I have made services, actions, etc... for performing functions of my robot, now what is the best way to bring them together?

asked 2021-04-01 22:45:25 -0600

masynthetic gravatar image

I am fairly new to ros2 and it has been a big learning curve but I have developed a handful of mainly services and actions for performing various functions like reading sensors or moving something but I don't really have a clear picture of how I should use them all simultaneously at like the top level of abstraction.

Is this something that is meant to be covered by a ros2 pattern or concept? The only idea I really have is to make one top level node which contains many clients but it just does not feel like a great solution because the clients are kind of code heavy so the file will just get very lengthy fast. Is there a better way?

edit retag flag offensive close merge delete

Comments

Instead of one "top level" node, why not have a top level package whose CMakeLists.txt and package.xml include the package(s) containing your services and actions? And that top level package can have as many nodes you want

abhishek47 gravatar image abhishek47  ( 2021-04-01 23:16:03 -0600 )edit
1

Iam not sure if this is what you are looking for but have a look here smach. Its a high level state machine approach. There is also a c++ "version" of this. I only know it for ros1, but as it is as useful a high level concept I would assume there is ros2 development going on as well.

Dragonslayer gravatar image Dragonslayer  ( 2021-04-02 01:49:13 -0600 )edit