File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -730,6 +730,27 @@ def IsTimedTrajectory(trajectory):
730
730
return cspec .ExtractDeltaTime (trajectory .GetWaypoint (0 )) is not None
731
731
732
732
733
+ def UntimeTrajectory (trajectory , env = None ):
734
+ """
735
+ Returns an untimed copy of the provided trajectory.
736
+
737
+ This function strips the DeltaTime group from a timed trajectory to create
738
+ an untimed trajectory.
739
+
740
+ @param trajectory: an OpenRAVE trajectory
741
+ @returns: an untimed copy of the provided trajectory.
742
+ """
743
+ cspec = trajectory .GetConfigurationSpecification ()
744
+ cspec .RemoveGroups ('deltatime' , True )
745
+ waypoints = trajectory .GetWaypoints (0 , trajectory .GetNumWaypoints (), cspec )
746
+
747
+ path = openravepy .RaveCreateTrajectory (env or trajectory .GetEnv (),
748
+ trajectory .GetXMLId ())
749
+ path .Init (cspec )
750
+ path .Insert (0 , waypoints )
751
+ return path
752
+
753
+
733
754
def ComputeUnitTiming (robot , traj , env = None ):
734
755
"""
735
756
Compute the unit velocity timing of a path or trajectory.
You can’t perform that action at this time.
0 commit comments