Robot Model Visualization
1 2 3 4 5 6
The indy7_description package includes the model files (URDF) for use with RViz and Gazebo simulator.
URDF (The Universal Robotic Description Format)is an XML-format file describing the kinematic and dynamic elements of the robot. Xacro is 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 indy7_description package, There's a xacro file(indy7.xacro) describing Indy7 robot.
The code below is link0, joint0 element of indy7.xacro.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
visual : This element specifies the shape of the object for visualization purposes. example above loads a stl model saved in meshes folder as visual element.
collision : Collision model is required to check collision, for example with MoveIt. It is posseble to use the same model as visual element, but simpler collision models are often used to reduce computation time. the example above uses a cylinder with 0.102[m]diameter, 0.06[m]height. the unit of geometry is [m](meter).
inertia : this element describes the dynamic property of robot.
joint : this element connects a link to another link.
For more information about xacro, please visit ROS tutorial xacro.
Indy7 model can be visualized with RViz. launch file is a file for launching a number of ROS nodes at the same time. The launch file that visualizes Indy7 model in RViz is located in launch folder of indy7_description package. and can be launched with this command.
Now you should see 2 windows launched.
by tweaking the joint position value of joint_states_publisher, the position of the robot in RViz can be changed.
The code below is display_indy7.launch, from the command above.
1 2 3 4 5 6 7 8
robot_description : Reads indy7.xacro. also, It is a parameter for joint_state_publisher node.
rviz : launches RViz node, loading rviz configuration file (indy7_description/rviz_config/indy7.rviz). subscribes tf published by robot_state_publisher node, and visualizes them.
To launch a ROS node, roscore should be launched before. However, If you use roslaunch, it will automatically start roscore if it detects that it is not already running.