@@ -166,15 +166,23 @@ bool ExecuteTaskSolutionCapability::constructMotionPlan(const moveit_task_constr
166166 exec_traj.trajectory_ ->setRobotTrajectoryMsg (state, sub_traj.trajectory );
167167 exec_traj.controller_names_ = sub_traj.execution_info .controller_names ;
168168
169- exec_traj. effect_on_success_ =
170- [ this , &scene_diff = const_cast <::moveit_msgs::PlanningScene&>(sub_traj. scene_diff ), description, i,
171- no = solution. sub_trajectory . size ()]( const plan_execution::ExecutableMotionPlan* /* plan */ ) {
172- // publish feedback
173- moveit_task_constructor_msgs::ExecuteTaskSolutionFeedback feedback ;
174- feedback. sub_id = i ;
175- feedback. sub_no = no;
176- as_-> publishFeedback (feedback);
169+ // hack
170+ for ( int i = 1 ; i < exec_traj. trajectory_ -> getWayPointCount (); i++) {
171+ auto from_prev = exec_traj. trajectory_ -> getWayPointDurationFromPrevious (i);
172+ if (from_prev < 0.0001 ) {
173+ ROS_ERROR_NAMED ( " ExecuteTaskSolution " , " Found broken waypoint? fixing... " ) ;
174+ exec_traj. trajectory_ -> setWayPointDurationFromPrevious (i, 0.0001 ) ;
175+ }
176+ }
177177
178+ exec_traj.effect_on_success_ =
179+ [this , &scene_diff = const_cast <::moveit_msgs::PlanningScene&>(sub_traj.scene_diff ), description, i,
180+ no = solution.sub_trajectory .size ()](const plan_execution::ExecutableMotionPlan* /* plan*/ ) {
181+ // publish feedback
182+ moveit_task_constructor_msgs::ExecuteTaskSolutionFeedback feedback;
183+ feedback.sub_id = i;
184+ feedback.sub_no = no;
185+ as_->publishFeedback (feedback);
178186 // Never modify joint state directly (only via robot trajectories)
179187 scene_diff.robot_state .joint_state = sensor_msgs::JointState ();
180188 scene_diff.robot_state .multi_dof_joint_state = sensor_msgs::MultiDOFJointState ();
0 commit comments