ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

How do I set the goalID in actionlib?

asked 2013-03-27 04:23:16 -0500

virgil93 gravatar image

I have been using a simple_action_client to send goals to move_base.

According to the Detailed description of the actionlib ( (Actionlib Messages)):

When sending a goal, the action client generally generates both a unique Goal ID and a timestamp. However, it is possible that naive (aka dumb) clients might leave either of these empty. If so, the action server will populate them.

Empty stamp: Upon receipt by action server, stamp is set to now()

Empty id: Upon receipt by action server, id is auto-generated. Note that this ID is not very useful since, the action client doesn't have any way to know the ID that the server generated for its goal.

This implies to me that there is a way to create your own goal ID and send it with the goal. The only method call to send a goal to the actionlib server is (actionlib::SimpleActionClient< ActionSpec >::sendGoal):

void sendGoal (const Goal &goal, SimpleDoneCallback done_cb=SimpleDoneCallback(), SimpleActiveCallback active_cb=SimpleActiveCallback(), SimpleFeedbackCallback feedback_cb=SimpleFeedbackCallback())

The only Goal type I can find associated with move_base is MoveBaseGoal.msg which only includes a geometery_msgs/PoseStamped.msg.

I traced the sendGoal call from the (simple_action_client.h) to the sendGoal call in (action_client.h) to the initGoal call in (goal_manager_imp.h) which is the first place I can find that the goal id is set.

So, my question is If I can, how do I set the goal id of the goal message to move_base?

My goal is to be able to send a goal to move_base and then verify that it received the correct goal by checking the goal_id from the /move_base/status topic. I know that I could edit the actionlib code but that isn't a workable solution for me right now.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-03-27 08:32:07 -0500

toniOliver gravatar image

updated 2013-03-27 08:36:17 -0500

When you invoke SendGoal in the simple action client, the GoalID and timestamp are autogenerated, and a GoalHandle object for that goal is stored.

This GoalHandle allows the action client to obtain information about the state of this goal, cancel it, etc (internally it is using the GoalID and timestamp, but you don't need to care about it).

The GoalID is defined in the autogenerated ActionGoal message that wraps the goal message.

edit flag offensive delete link more


Does that mean no, I can't set it?

virgil93 gravatar image virgil93  ( 2013-03-27 09:59:10 -0500 )edit

No you cannot set it.

tfoote gravatar image tfoote  ( 2013-04-29 17:22:58 -0500 )edit

Question Tools


Asked: 2013-03-27 04:23:16 -0500

Seen: 2,212 times

Last updated: Mar 27 '13