
Hello everyone,
roslaunch can't read negative argument.
I'm launching my node via this launch file:
<launch>
<arg name="inc" default="-0.02"/>
<node pkg="parameter_analyzer" type="kld_err" name="parameter_analyzer" output="screen">
<param name="increment" value="$(arg inc)"/>
</node>
</launch>
Output:
[ INFO] [1461752716.797017994, 13371.605000000]: INCREMENT VALUE: 0
If parameter is set to positive, output:
[ INFO] [1461752338.872513841, 13012.430000000]: INCREMENT VALUE: 0.02
Any suggestions? Thanks.
Originally posted by Orhan on ROS Answers with karma: 856 on 2016-04-27
Post score: 0
Original comments
Comment by mgruhler on 2016-04-27:
It works for me in both hydro and indigo. Could you check your code that you are not doing something wrong while retrieving the parameter?
Comment by naveedhd on 2016-04-27:
kindly also post the line from your source file where you are loading this param.
Comment by Orhan on 2016-04-27:
My roslaunch's version is 1.11.19 in indigo. And there is only 3 lines: double INC; and ros::param::get("parameter_analyzer/increment", INC); and ROS_INFO("INCREMENT VALUE: %lf", INC);
Comment by naveedhd on 2016-04-27:
By using ros::param::get() I am also recieving 0 (very small value in exponent). Using:
ros::NodeHandle n("~"); double increment; n.param<double>("increment", increment, 5.0);
you can receive negative values.
Comment by Orhan on 2016-04-27:
Thanks! I'm trying, Please write as answer to let me marking correct answer.