Skip to content

Commit

Permalink
Only accept goals after reception of controller feedback. Fix ros-ind…
Browse files Browse the repository at this point in the history
  • Loading branch information
gavanderhoorn committed Oct 23, 2014
1 parent b0d1cb5 commit 49ff2d2
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 49ff2d2

Please sign in to comment.