Expose node command line arguments in ros 2
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.
Asked by Skyking on 2018-09-13 06:21:16 UTC
Comments
I am not sure what exactly you are asking for. The
talker
executable has amain
function which receives the command line arguments asargc
/argv
. So whatever check you would like to perform can happen right at the beginning of the main function.Asked by Dirk Thomas on 2018-09-13 10:48:19 UTC