Using realtime_tools Action Server

asked 2021-03-18 06:47:03 -0500

smihael gravatar image

updated 2021-03-18 07:18:57 -0500

I have troubles sending action feedback and result from ros_control plugin using realtime_tools' realtime_server_goal_handle.

I followed

In the header I define the following types and rt_active_goal_ property:

typedef realtime_tools::RealtimeServerGoalHandle<MyAction> RealtimeGoalHandle;
typedef boost::shared_ptr<RealtimeGoalHandle> RealtimeGoalHandlePtr;
RealtimeGoalHandlePtr rt_active_goal_;

My goal callback function includes (with GoalHandle gh):

 if (goal_ok) {   
     RealtimeGoalHandlePtr rt_goal(new RealtimeGoalHandle(gh));
     gh.setAccepted("Goal accepted");
     rt_active_goal_ = rt_goal;
 } else {
      ActionResult result;
      result.fully_succeeded = false;

 goal_handle_timer = controller_nh_.createTimer(period, &RealtimeGoalHandle::runNonRealtime, rt_goal);       

In update callback I have:

if (rt_active_goal_) {
  rt_active_goal_->preallocated_feedback_->... = ...

if ( arrived_to_goal ) {
   RealtimeGoalHandlePtr current_active_goal(rt_active_goal_);
   if (rt_active_goal_) {
        rt_active_goal_->preallocated_result_->fully_succeeded = true;

However, I cannot get any messages when subscribed to result and feedback. If I send feedback/result though normal goal handle, e.g.:


I can receive the message. I don't believe this is the intended way. Is there some other trick to use rt_active_goal_->setSucceeded() and rt_active_goal_->setFeedback() directly?

edit retag flag offensive close merge delete