Skip to content

Commit

Permalink
action_client: register the feedback and result callbacks in separate…
Browse files Browse the repository at this point in the history
… methods
  • Loading branch information
romainreignier committed Mar 10, 2018
1 parent 74e5ecc commit fd005a0
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/ros_lib/ros/action_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,10 @@ namespace ros {
resetState();
}

void sendGoal(const Goal& goal, FeedbackCallbackT feedback_cb = FeedbackCallbackT(), ResultCallbackT result_cb = ResultCallbackT())
void sendGoal(const Goal& goal)
{
if(!goal_pub.nh_->connected()) return;

feedback_cb_ = feedback_cb;
result_cb_ = result_cb;

ActionGoal action_goal_msg;
// no goal id and stamp -> will be generated by the action server
// see: http://wiki.ros.org/actionlib/DetailedDescription
Expand All @@ -109,6 +106,16 @@ namespace ros {
cancel_pub.publish(msg);
}

void registerFeedbackCallback(FeedbackCallbackT feedback_cb)
{
feedback_cb_ = feedback_cb;
}

void registerResultCallback(ResultCallbackT result_cb)
{
result_cb_ = result_cb;
}

void registerStateCallback(StateChangedCallbackT state_cb)
{
state_cb_ = state_cb;
Expand Down

0 comments on commit fd005a0

Please sign in to comment.