[ros-users] Unable to get double parameters

Christian Verbeek verbeek at servicerobotics.eu
Thu Oct 28 12:09:42 UTC 2010


getParam(const std::string &key, double &d)

returns only the integer part of the parameter.

ros::NodeHandle nh( "~" );
double dvalue;
nh.getParam( "key", dvalue );

dvalue=0 // in the launch file 0.2
dvalue=1 // in the launch file 1.5
...

in /opt/ros/cturtle/ros/core/roscpp/src/libros/param.cpp
I printed the XmlRpcValue and this gives me

<value><double>0</double></value>
<value><double>1</double></value>

Whats going wrong? Any ideas?

rosparam get key
returns 0.200000000000000001 or 1.5

so the values in the parameter server are correct.




More information about the ros-users mailing list