@@ -88,7 +88,15 @@ def RetimeTrajectory(self, traj, max_jerk=30.0, synchronize=False,
88
88
# Fall back on the standard OpenRAVE retimer if MacTrajectory is not
89
89
# available.
90
90
if self .mac_retimer is None :
91
- return Robot .RetimeTrajectory (self , traj , ** kw_args )
91
+ active_manipulators = self .GetTrajectoryManipulators (traj )
92
+ sim_flags = [ manip .simulated for manip in active_manipulators ]
93
+
94
+ if all (sim_flags ):
95
+ return Robot .RetimeTrajectory (self , traj , ** kw_args )
96
+ elif not any (sim_flags ):
97
+ return prpy .util .CopyTrajectory (traj )
98
+ else :
99
+ raise ValueError ('Mixed simulated and real manipulators is not supported.' )
92
100
93
101
# check the number of
94
102
num_waypoints = traj .GetNumWaypoints ()
@@ -172,6 +180,7 @@ def ExecuteTrajectory(self, traj, timeout=None, blend=True, retime=True, limit_t
172
180
@param retime flag for retiming the trajectory before execution
173
181
@return executed_traj including blending and retiming
174
182
"""
183
+
175
184
# Query the active manipulators based on which DOF indices are
176
185
# included in the trajectory.
177
186
active_manipulators = self .GetTrajectoryManipulators (traj )
@@ -219,6 +228,7 @@ def has_group(cspec, group_name):
219
228
220
229
first_waypoint = traj .GetWaypoint (0 )
221
230
cspec = traj .GetConfigurationSpecification ()
231
+
222
232
first_dof_values = cspec .ExtractJointValues (first_waypoint , self , active_indices , 0 )
223
233
lower_limits , upper_limits = self .GetActiveDOFLimits ()
224
234
@@ -236,7 +246,7 @@ def has_group(cspec, group_name):
236
246
237
247
# This must be last because MacTrajectories are immutable.
238
248
# TODO: This may break if the retimer clamps DOF values to the joint limits.
239
- if retime :
249
+ if retime :
240
250
traj = self .RetimeTrajectory (traj , synchronize = needs_synchronization , ** kw_args )
241
251
242
252
if needs_base :
0 commit comments