@@ -57,6 +57,7 @@ def __str__(self):
57
57
def RetimeTrajectory (self , robot , path , options = None , ** kw_args ):
58
58
from ..util import (CreatePlannerParametersString , CopyTrajectory ,
59
59
SimplifyTrajectory , HasAffineDOFs )
60
+ from openravepy import CollisionOptions , CollisionOptionsStateSaver
60
61
from copy import deepcopy
61
62
from openravepy import Planner
62
63
@@ -94,10 +95,18 @@ def RetimeTrajectory(self, robot, path, options=None, **kw_args):
94
95
# not perform this check internally (e.g. ParabolicTrajectoryRetimer).
95
96
output_traj = SimplifyTrajectory (input_path , robot )
96
97
98
+ # Only collision check the active DOFs.
99
+ dof_indices , _ = cspec .ExtractUsedIndices (robot )
100
+ robot .SetActiveDOFs (dof_indices )
101
+
97
102
# Compute the timing. This happens in-place.
98
103
output_traj = SimplifyTrajectory (input_path , robot )
99
104
self .planner .InitPlan (None , params_str )
100
- status = self .planner .PlanPath (output_traj , releasegil = True )
105
+
106
+
107
+ with CollisionOptionsStateSaver (self .env .GetCollisionChecker (),
108
+ CollisionOptions .ActiveDOFs ):
109
+ status = self .planner .PlanPath (output_traj , releasegil = True )
101
110
102
111
if status not in [ PlannerStatus .HasSolution ,
103
112
PlannerStatus .InterruptedWithSolution ]:
0 commit comments