Skip to content

Instantly share code, notes, and snippets.

@TheProjectsGuy
Last active December 17, 2018 06:28
Show Gist options
  • Select an option

  • Save TheProjectsGuy/a203a8d27d52f7aa3cd7cc8362099c6b to your computer and use it in GitHub Desktop.

Select an option

Save TheProjectsGuy/a203a8d27d52f7aa3cd7cc8362099c6b to your computer and use it in GitHub Desktop.
XACRO Launch file code
<launch>
<!-- Arguments -->
<arg name="model" default="first_xacro" doc="Model name (name of the XACRO file without extension)" />
<arg name="rviz_config" default="RobotViewer" doc="Name (withoug extension) of RViZ configuration file in 'rviz' folder" />
<arg name="use_gui" default="true" doc="true or false, if you want GUI" />
<!-- Parameters on the ROS parameter server -->
<param name="robot_description" command="xacro $(find intro_robot_description)/urdf/$(arg model).xacro" />
<param name="use_gui" value="$(arg use_gui)" />
<!-- Nodes to be launched -->
<!-- RViZ node -->
<node name="rviz" type="rviz" pkg="rviz" args="-d $(find intro_robot_description)/rviz/$(arg rviz_config).rviz" required="true" />
<!-- Joint state and robot state publishers -->
<node name="joint_state_publisher" type="joint_state_publisher" pkg="joint_state_publisher" />
<node name="robot_state_publisher" type="robot_state_publisher" pkg="robot_state_publisher" />
</launch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment