Reading vector from launch file does not work in Indigo
Hi to all,
I'm facing an issue while reading a vector parameter from launch file in ROS Indigo. I set the parameter in my launch file in the private namespace of my node as;
<param name="x0" value="[0.0, 0.0]"/>
And I'm trying to read it as described here or in this previous answer:
ros::NodeHandle nh("~");
std::vector<double> x0;
nh.getParam("x0", x0);
but if I try to print the size of the vector it tells me 0. From the roslaunch param documentation it seems that parameters which are not scalar numbers or literal booleans are interpreted as strings.
Why is there such inconsistency between the types that I can read from the parameter server and the parameters that I can set from a launch file? How can I solve this problem?
Thanks to all in advance.
So just to clarify: does this work if you use:
Yes, in this way it works. Thanks, I didn't notice the comment in the previous answer. Still, is there any reason for this inconsistency?