Running ROS node with a numeric parameter passed as string doesn't work.
I am trying to run the IAI Kinect2 Bridge node as follows, in order to use multiple sensors:
$ kinect2_bridge _sensor:=1234567890
But the node does not recognize the provided sensor ID and falls back to default. The issue here seems to be, that ROS parses this parameter as number (and stores it as an int?) without me being able to force it being a string.
This code: priv_nh.param("sensor", sensor, std::string(""));
Then tries to read this parameter, but in all subsequent code, sensor.empty()
is true. Seems that the parameter is an int, then fails the type check and gets ignored. (Source from here:
https://github.com/code-iai/iai_kinec... )
How can I force passing _sensor:=.... as a string, despite it being only numbers without using a launch file?
Thanks!