ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

In your 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>

In your source file, use:

 ros::NodeHandle nodehandle("~");
 double INC = 0.0;
 nodehandle.param<double>("parameter_analyzer/increment", INC, INC);

make sure to pass default value as 3rd argument to param() (I'm not sure for what reason If I don't pass this a double/float value here, it gives me 0)

In your launch file:

<launch>
<arg name="inc" default="-0.02"/>
<node pkg="parameter_analyzer" type="kld_err" name="parameter_analyzer" output="screen">
    <param name="increment" type="double" value="$(arg inc)"/>
</node>

</launch>

In your source file, use:

 ros::NodeHandle nodehandle("~");
 double INC = 0.0;
 nodehandle.param<double>("parameter_analyzer/increment", INC, INC);

make sure to pass default value as 3rd argument to param() (I'm not sure for what reason If I don't pass this a double/float value here, it gives me 0)