Ask Your Question

Can I handle multiple client requests of different action types with one action server?

asked 2017-01-12 04:47:16 -0500

ghkraju gravatar image

updated 2017-01-17 07:46:30 -0500

I have a requirement as follows:

One GUI window has an Action Server. This should serve multiple client requests (may be one at a time) but each request type is different (ex:- 1.MoveAction 2.RunAction 3.WalkAction) Based on the request, the message type will be different. The Action server should be able to recognize it in executeCB and serve the request back. (just like a web server) Is that possible with action lib?

I could write all the messages in one combined custom message and set an indicator for request type but that takes so much memory for each request that i make. I think there should a better way to do it.

Please let me know if you need any further information. Thanks in advance.......

Edit 1: Method overloading is not an option... Cuz action server definition is as follows with the message type:

actionlib::SimpleActionServer<aps_msgs::FileSelectAction> as_;

Can we make the initialization of the action server more generic?

edit retag flag offensive close merge delete


Can method overloading to executeCB be helpful? I can think of this as best known sol as of now.

ghkraju gravatar image ghkraju  ( 2017-01-12 04:59:22 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2017-01-17 08:05:40 -0500

gvdhoorn gravatar image

No, afaik this is not possible. ROS is a type based pub/sub middleware, and in those middlewares only messages of the same type can be published on a single 'channel'. Actions are basically pub/sub over a few different topics, so the same restrictions apply.

edit flag offensive delete link more


Yes, you are correct. As of now, I have to create multiple action servers for different message types. May be it can be a future scope of improvement to generic type of action servers in ROS too like web APIs.

ghkraju gravatar image ghkraju  ( 2017-01-19 15:59:12 -0500 )edit

I don't know whether I'd be a fan of that: strongly typed systems have their advantages, and especially in component based systems I don't think it's so bad that already at the type level things are guarded against incompatibilities. Especially since semantics are strongly coupled with syntax here.

gvdhoorn gravatar image gvdhoorn  ( 2017-01-20 05:46:59 -0500 )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

1 follower


Asked: 2017-01-12 04:47:16 -0500

Seen: 785 times

Last updated: Jan 17 '17