Skip to content

Commit 95ebe05

Browse files
Levi-Armstrongbmagyar
authored andcommitted
Fix joint trajectory controller so results message is returned on tolerance failures
1 parent 9af3234 commit 95ebe05

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

joint_trajectory_controller/include/joint_trajectory_controller/joint_trajectory_controller_impl.h

+4
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,8 @@ update(const ros::Time& time, const ros::Duration& period)
407407
control_msgs::FollowJointTrajectoryResult::PATH_TOLERANCE_VIOLATED;
408408
rt_segment_goal->preallocated_result_->error_string = joint_names_[i] + " path error " + std::to_string( state_joint_error_.position[0] );
409409
rt_segment_goal->setAborted(rt_segment_goal->preallocated_result_);
410+
// Force this to run before destroying rt_active_goal_ so results message is returned
411+
rt_active_goal_->runNonRealtime(ros::TimerEvent());
410412
rt_active_goal_.reset();
411413
successful_joint_traj_.reset();
412414
}
@@ -443,6 +445,8 @@ update(const ros::Time& time, const ros::Duration& period)
443445
rt_segment_goal->preallocated_result_->error_code = control_msgs::FollowJointTrajectoryResult::GOAL_TOLERANCE_VIOLATED;
444446
rt_segment_goal->preallocated_result_->error_string = joint_names_[i] + " goal error " + std::to_string( state_joint_error_.position[0] );
445447
rt_segment_goal->setAborted(rt_segment_goal->preallocated_result_);
448+
// Force this to run before destroying rt_active_goal_ so results message is returned
449+
rt_active_goal_->runNonRealtime(ros::TimerEvent());
446450
rt_active_goal_.reset();
447451
successful_joint_traj_.reset();
448452
}

0 commit comments

Comments
 (0)