0
$\begingroup$

What is the general structure of .launch file for using a sensor?

For example:

1.Following code is example for using a JoyStick to control TurtleSim

<launch>
  <node pkg="turtlesim" type="turtlesim_node" name="sim"/>
  <node pkg="chapter4_tutorials" type="example1" name="example1" />
  <param name="axis_linear" value="1" type="int" />
  <param name="axis_angular" value="0" type="int" />
  <node respawn="true" pkg="joy"type="joy" name="teleopJoy">
    <param name="dev" type="string" value="/dev/input/js0" />
    <param name="deadzone" value="0.12" />
  </node>
</launch>

2.Using a Laser Range finder

<launch>
  <node pkg="hokuyo_node" type="hokuyo_node" name="hokuyo_node"/>
  <node pkg="rviz" type="rviz" name="rviz"
        args="-d $(find chapter4_tutorials)/example2.vcg"/>
  <node pkg="chapter4_tutorials" type="example2" name="example2" />
</launch>

What exactly is the syntax?

Why do we have two <node pkg>?

$\endgroup$
1
$\begingroup$

The first node, hokuyo_node, is the driver for the sensor. The second node, rviz, is for visualizing the data coming from the hokuyo_node. The third node is the tutorial program.

The launch file format is well documented. However it assumes that you understand the basic organization of ROS, what nodes are, and how they interact.

$\endgroup$
  • $\begingroup$ Where can I find documentation for launch file format? $\endgroup$ – Akhil Kathi Jun 6 '17 at 18:40
  • $\begingroup$ Both Google search, and the search tool of wiki.ros.org give good results. $\endgroup$ – hauptmech Jun 6 '17 at 20:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.