how to use a rosnode as action client as well as simple action client both

asked 2020-10-26 16:11:05 -0500

DB gravatar image

updated 2020-10-26 17:52:24 -0500

I want to use a single node as both action client sending goals to action server as well as simple action client sending to a second simple action server.

edit retag flag offensive close merge delete

Comments

in which language? C++, python, node.js?

chfritz gravatar image chfritz  ( 2020-10-26 17:08:33 -0500 )edit

in python language

DB gravatar image DB  ( 2020-10-26 17:14:24 -0500 )edit
1

@DB yes you can do that. What exactly do you have problems with? Please elaborate...

mgruhler gravatar image mgruhler  ( 2020-10-27 01:56:44 -0500 )edit

I have problem in code , to initialize the action client and simple action client in one node , do I have to create two separate classes and write like:

  1. # Initialize Action Client self._ac = actionlib.ActionClient('/action_iot_ros', msgIotRosAction)

  2. #initialize simple action client self._ac = actionlib.ActionClient('/action_turtle', myActionMsgAction)

Is this correct?

DB gravatar image DB  ( 2020-10-27 02:37:47 -0500 )edit

I don't understand what you mean with "create two classes". Create two classes that each contain an action client as a member? or instantiate two members in one class? or do you have a class at all?

Maybe you should edit your question and paste in the code that you think should do the trick. This would help in understanding your issues.

mgruhler gravatar image mgruhler  ( 2020-10-27 04:00:32 -0500 )edit

Yes, I meant create two classes that each contain an action client as a member

DB gravatar image DB  ( 2020-10-27 08:48:54 -0500 )edit

You can actually do all of those. Create two classes each containing an action client, create one class containing both, not have a class and have everything just live in main... This all depends on your use case, if you need to share data from one action client with the other, etc...

Again: Please elaborate and provide clear description of what you issue is, what you've tried, what you don't understand and what you try to achieve in the first place.

Otherwise we cannot help!

mgruhler gravatar image mgruhler  ( 2020-10-28 02:48:29 -0500 )edit