[ros-users] Param from launch file: node vs nodelet

Ivan Dryanovski ivan.dryanovski at gmail.com
Tue Jan 25 21:56:15 UTC 2011


Hi all,

I am having some trouble with getting parameters from a launch file.
The same bit of code worked well with a node driver, but when i
switched to a nodelet driver, it fails. I am running on Ubuntu 10.10,
ros unstable.

Here are some more details:

I have the following bit of code running to get a parameter:

    ros::NodeHandle nh_private ("~");
    if (!nh_private.getParam ("enable_IMU_CALCDATA", enable_IMU_CALCDATA_))
      enable_IMU_CALCDATA_ = false;

When I run that code with a node driver, everything works fine. I use
the following launch file:

  <node name="autopilot" pkg="asctec_autopilot" type="autopilot_node"
respawn="false" required="true" output="screen">
    <param name="enable_IMU_CALCDATA" type="bool" value="true"/>
  </node>

However, when I run the code with a nodelet driver, it fails to check
the param, and assumes the default (false) value. This is the launch
file for the nodelet:

  <node pkg="nodelet" type="nodelet" name="pelican_manager"
args="manager" output="screen" />
  <node pkg="nodelet" type="nodelet" name="AutoPilotNodelet"
args="load asctec_autopilot/AutoPilotNodelet pelican_manager"
output="screen">
    <param name="enable_IMU_CALCDATA" type="bool" value="true"/>
  </node>

Any help would be appreciated!

Thanks,
Ivan Dryanovski



More information about the ros-users mailing list