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

Advanced actionserver usage

asked 2014-02-18 08:36:23 -0600

MatthiasMayr gravatar image

updated 2016-10-24 09:03:58 -0600

ngrennan gravatar image

Hey there,

I try to use an Actionserver in a 'advanced' way. Advanced means, that

  1. I want to be able to send several goals to an Actionserver by multiple clients,
  2. Keep track of all the goals (partly solved)
  3. Be able to cancel a single specific goal
  4. Take a look at the goal on the server site during the execution (solved)

Therefore I first tried the SimpleActionServer, which doesn't seem to fulfill these requirements. So I switched to the more advanced implementation using an "ActionServer" instead of the "SimpleActionServer". It seems, that there aren't any tutorials our there, but I found one implementation.

My answers up to now:

  1. Although I like the style and the usage of this native ActionServer a lot more it seems that even this implementation is not able to manage multiple goals and I'm starting to believe, that it may not be possible to have multiple goals. (It's mentioned here that you can have multiple goals, but I'm still wondering how.)
    So in the implementation mentioned above, they assign the goal to a single "goalhandle". So of course, if I would use an std::vector for that - I could accept store multiple goals. But I'm not sure, if this is the good way to deal with it. (E.g. How do I get the next goal chosen by the actionserver)

  2. This is possible by subscribing to <actionserver_name>/status, but I would like it a lot more, if there would be a way to do this directly with the ActionClient, because I can never be sure, that e.g. the latest or newest goal appearing in the status array is really my goal.

  3. As far as I've figure it out from the API, there's no way of cancelling a specific goal, nor a way to delete the last goal sent by that client. Is that right? Because the detailed description says it should be possible.

  4. This can be done with the native ActionServer, but not the with the SimpleActionServer (except one value when accepting the goal(line 34), which seems pretty strange)

Please tell me, if I missed something. I know that the detailed description mentions some of the things, but I would like to have either an API reference or some running code.

Thanks a lot.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-03-17 05:32:05 -0600

MatthiasMayr gravatar image
  1. Works out of the box. But the goalhandles received in the GoalCallback on the server side have to be stored somewhere to get access to older goals. In my implementation I just store them in a vector.

  2. Store the callback goalhandles on the server side and store the client goalhandles on the client side. Client goalhandles are the returned object of actionclient.sendGoal(goal).

  3. Use the client goalhandle received from the sendGoal-Function.

  4. The server goalhandle has a function allowing to access the goal. It can be accessed with (*server_goalhandle.getGoal()).[goal-attribute1]

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-02-18 08:36:23 -0600

Seen: 770 times

Last updated: Mar 17 '14