Ask Your Question
0

How do I set the goalID in actionlib?

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

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 (http://www.ros.org/wiki/actionlib/DetailedDescription#The_Messages (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 http://ros.org/doc/groovy/api/actionlib/html/classactionlib_1_1SimpleActionClient.html#ae6a2e6904495e7c20c59e96af0d86801 (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 http://ros.org/doc/groovy/api/actionlib/html/simple__action__client_8h_source.html#l00313 (simple_action_client.h) to the sendGoal call in http://ros.org/doc/groovy/api/actionlib/html/action__client_8h_source.html#l00115 (action_client.h) to the initGoal call in http://ros.org/doc/groovy/api/actionlib/html/goal__manager__imp_8h_source.html#l00056 (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
0

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

toniOliver gravatar image

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

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

Comments

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

virgil93 gravatar imagevirgil93 ( 2013-03-27 09:59:10 -0600 )edit

No you cannot set it.

tfoote gravatar imagetfoote ( 2013-04-29 17:22:58 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

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

Seen: 1,076 times

Last updated: Mar 27 '13