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

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: User discussions
Date:  
To: User discussions
Subject: [ros-users] Param from launch file: node vs nodelet
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