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

Hello again,

This time I would like to ask you about variables/parameters that I want to deliver to a my program (node) via launch file. My purpose is to configure the number of the cameras, that will appear in a GUI that I create, and I want this number to be configurable in a launch file. I have found this example in the web: http://www.ros.org/wiki/roslaunch/XML, but I donĀ“t exactly understand the connection between the launch file and the C code...

For example, in the next code:

<node pkg="rospy_tutorials" type="talker" name="talker">
  <!-- set a private parameter for the node -->
  <param name="talker_1_param" value="a value" />
  <!-- you can set environment variables for a node -->
  <env name="ENV_EXAMPLE" value="some value" />
</node>
  1. Do I need "to have" a variable named "talker_1_param" in my code?

  2. How actually I CONNECT between the launch file and the C code?

  3. Actually what is the difference between variable and parameter in the context of launch files?

  4. What is the difference between "parameter" and "environment variables" in the above code?

  5. In my node there are several functions, when the writer of the above code says in the comment that this is a "private parameter", what does he mean?

  6. Is there a way to distinguish between global and local variables?

Thank you all in advance,

Have a nice day,

Felix.