Skip to content

Commit

Permalink
Merge pull request ros-industrial#86 from gavanderhoorn/issue85_withi…
Browse files Browse the repository at this point in the history
…n_constraints_segfault

Fix for issue ros-industrial#85: reject all goals until feedback has been received
  • Loading branch information
shaun-edwards committed Oct 28, 2014
2 parents e98aa80 + 49ff2d2 commit 1eca4f6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions industrial_robot_client/src/joint_trajectory_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,18 @@ void JointTrajectoryAction::goalCB(JointTractoryActionServer::GoalHandle & gh)
{
ROS_INFO("Received new goal");

// reject all goals as long as we haven't heard from the remote controller
if (!trajectory_state_recvd_)
{
ROS_ERROR("Joint trajectory action rejected: waiting for (initial) feedback from controller");
control_msgs::FollowJointTrajectoryResult rslt;
rslt.error_code = control_msgs::FollowJointTrajectoryResult::INVALID_GOAL;
gh.setRejected(rslt, "Waiting for (initial) feedback from controller");

// no point in continuing: already rejected
return;
}

if (!gh.getGoal()->trajectory.points.empty())
{
if (industrial_utils::isSimilar(joint_names_, gh.getGoal()->trajectory.joint_names))
Expand Down

0 comments on commit 1eca4f6

Please sign in to comment.