roscpp roslaunch get arguments
I have a launcher with some arguments, so I expect to launch it like this
roslaunch my_package my_launcher.launch my_argument:=some_value
Is there a way to get the value of "my_argument" ("some_value" as a string or number if it's a number) from the node code?
I want to do something like this:
std::string my_value = ros::launch::?????::get_arg("my_argument");
Thanks in advance
You can get this argument in the launch file and send it over to the node you are starting. From the node you will get it as the args[] from (int argn, char *args[]). Doing it directly isn't possible I guess.