Skip to content

Robot Model Visualization

Indy Description Package

The indy_description package includes the model files (URDF) for use with RViz and Gazebo simulator.

├── indy_description
    ├── urdf
    ├── launch
    ├── rviz_config
    ├── meshes
    └──  ...

Robot Model

  • URDF (The Universal Robotic Description Format): an XML-format file describing the kinematic and dynamic elements of the robot.
  • Xacro: an XML macro language that constructs shorter and more readable XML files by using macros that expand to larger XML expressions.

In the urdf folder of the indy_description package, There's a config folder which contains all config for Indy models (Indy7, Indy7v2, Indy12, Indy12v2, IndyRP, IndyRPv2) The other xacro files read the config files and build the description of the robot.

The diagram below show the relationship of the files

joint_limits ────────┐
kinematics ──────────┤
physical_parameters ─┤
visual_parameters ───┴─ indy_common ─┐
                  indy_transmission ─┤
                          materials ─┴─ indy_macro─indy.urdf

For more information about urdf and xacro, please visit ROS1 build model tutorial

Launching RViz

Indy models can be visualized with RViz. launch file is a file for launching a number of ROS nodes at the same time. The following command is used to launch the robot description and visualization for the Indy7 robot model in ROS.

$ roslaunch indy_description indy_description.launch indy_type:=indy7
By specifying the indy_type as "indy7", the launch file will load the appropriate configuration files and launch the necessary nodes to display the robot in a visualization tool like RViz.

Now you should see windows launched.


Launch with indy_eye option.

$ roslaunch indy_description indy_description.launch indy_type:=indy7 indy_eye:=true


by tweaking the joint position value of joint_states_publisher, the position of the robot in RViz can be changed.

Launch File

The code below is indy_description.launch, from the command above.

<?xml version="1.0"?>
<launch>
  <arg name="prefix"        default=""/>
  <arg name="name"      default="indy"/>
  <arg name="indy_type"     default="indy7"/>
  <arg name="indy_eye"  default="false"/>
  <arg name="rviz"      default="true"/>
  <arg name="sim_gazebo"  default="false"/> <!--is sim gazebo?-->
  <arg name="joint_state" default="true"/> <!--need joint state? -->

  <param name="robot_description" command="$(find xacro)/xacro --inorder '$(find  indy_description)/urdf/indy.urdf.xacro'
    prefix:=$(arg prefix)
    name:=$(arg name)
    indy_type:=$(arg indy_type)
    indy_eye:=$(arg indy_eye)
    sim_gazebo:=$(arg sim_gazebo)"/>

  <!--joint state-->
  <group if="$(eval arg('rviz') == true and arg('sim_gazebo') == false and arg('joint_state') == true)">
    <node name="joint_state_publisher_gui" pkg="joint_state_publisher_gui" type="joint_state_publisher_gui"/>
  </group>

  <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"/>

  <!--rviz-->
  <node if="$(arg rviz)" pkg="rviz" type="rviz" name="rviz" args="-d $(find indy_description)/rviz_config/indy.rviz"/>

</launch>
  • robot_description: Reads indy.urdf.xacro also, it is parameters for joint_state_publisher node.

  • joint_state_publisher: publishes the joint positions of robot_description, with /joint_states topic.

  • robot_state_publisher: subscribes /joint_states topic, and publishes transform of each link.

  • rviz : launches RViz node, loading rviz configuration file (indy_description/rviz_config/indy.rviz). Subscribes tf published by robot_state_publisher node, and visualizes them.