Negative values in launch file arguments
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.
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?
kindly also post the line from your source file where you are loading this param.
My roslaunch's version is
1.11.19
in indigo. And there is only 3 lines:double INC;
andros::param::get("parameter_analyzer/increment", INC);
andROS_INFO("INCREMENT VALUE: %lf", INC);
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.
Thanks! I'm trying, Please write as answer to let me marking correct answer.