Mastering ROS for Robotics Programming
上QQ阅读APP看书,第一时间看更新

ROS packages for robot modeling

ROS provides some good packages that can be used to build 3D robot models. In this section, we will discuss some of the important ROS packages that are commonly used to build robot models:

  • robot_model: ROS has a meta package called robot_model, which contains important packages that help build the 3D robot models. We can see all the important packages inside this meta-package:
    • urdf: One of the important packages inside the robot_model meta package is urdf. The URDF package contains a C++ parser for the Unified Robot Description Format (URDF), which is an XML file to represent a robot model.
  • We can define a robot model, sensors, and a working environment using URDF and can parse it using URDF parsers. We can only describe a robot in URDF that has a tree-like structure in its links, that is, the robot will have rigid links and will be connected using joints. Flexible links can't be represented using URDF. The URDF is composed using special XML tags and we can parse these XML tags using parser programs for further processing. We can work on URDF modeling in the upcoming sections.
    • joint_state_publisher: This tool is very useful while designing robot models using URDF. This package contains a node called joint_state_publisher, which reads the robot model description, finds all joints, and publishes joint values to all nonfixed joints using GUI sliders. The user can interact with each robot joint using this tool and can visualize using RViz. While designing URDF, the user can verify the rotation and translation of each joint using this tool. We can discuss more about the joint_state_publisher node and its usage in the upcoming chapter.
    • kdl_parser: Kinematic and Dynamics Library (KDL) is an ROS package that contains parser tools to build a KDL tree from the URDF representation. The kinematic tree can be used to publish the joint states and also to forward and inverse kinematics of the robot.
  • robot_state_publisher: This package reads the current robot joint states and publishes the 3D poses of each robot link using the kinematics tree build from the URDF. The 3D pose of the robot is published as ROS tf (transform). ROS tf publishes the relationship between coordinates frames of a robot.
  • xacro: Xacro stands for (XML Macros) and we can define how xacro is equal to URDF plus add-ons. It contains some add-ons to make URDF shorter, readable, and can be used for building complex robot descriptions. We can convert xacro to URDF at any time using some ROS tools. We will see more about xacro and its usage in the upcoming sections.