Skip to content

Commit 4be5709

Browse files
committed
hack, please investigate
1 parent 5fc86a0 commit 4be5709

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

capabilities/src/execute_task_solution_capability.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,15 @@ 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+
//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+
}
177+
169178
exec_traj.effect_on_success_ =
170179
[this, &scene_diff = const_cast<::moveit_msgs::PlanningScene&>(sub_traj.scene_diff), description, i,
171180
no = solution.sub_trajectory.size()](const plan_execution::ExecutableMotionPlan* /*plan*/) {
@@ -174,7 +183,6 @@ bool ExecuteTaskSolutionCapability::constructMotionPlan(const moveit_task_constr
174183
feedback.sub_id = i;
175184
feedback.sub_no = no;
176185
as_->publishFeedback(feedback);
177-
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

Comments
 (0)