From fd005a087d15e038667b2e94dea9ac7d8906d35c Mon Sep 17 00:00:00 2001 From: Romain Reignier Date: Sun, 11 Mar 2018 00:02:28 +0100 Subject: [PATCH] action_client: register the feedback and result callbacks in separate methods --- src/ros_lib/ros/action_client.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/ros_lib/ros/action_client.h b/src/ros_lib/ros/action_client.h index c331776..820009c 100644 --- a/src/ros_lib/ros/action_client.h +++ b/src/ros_lib/ros/action_client.h @@ -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 @@ -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;