Expose node command line arguments in ros 2

asked 2018-09-13 06:21:16 -0500

Skyking gravatar image

Is there any way in ros 2 to know about the command line arguments in the application level ?

For example if I do ros2 run demo_node_cpp talker __params:=test.yaml , I want to check inside the code whether I have given the correct yaml file or not.

Any help would be appreciated.

edit retag flag offensive close merge delete

Comments

I am not sure what exactly you are asking for. The talker executable has a main function which receives the command line arguments as argc / argv. So whatever check you would like to perform can happen right at the beginning of the main function.

Dirk Thomas gravatar image Dirk Thomas  ( 2018-09-13 10:48:19 -0500 )edit