ROS (7) URDF build their own robot model _ros

Source: Internet
Author: User

ROS (7) URDF build their own robot model


1. Build your own model and display it in the Rviz, which requires three files.

(1) URDF file: This file is a robot shape description file, mainly including link and joint, need to be written in strict format. Specific reference http://wiki.ros.org/urdf/Tutorials/

(2) Rviz file: Used to configure Rviz related parameters

(3) Launch files: Starting Rviz and URDF


2. Specific implementation:

. Rviz: Direct replication Urdf_tutorials Urdf.rviz

. Launch: Copy display.launch in Urdf_tutorials

Code Modifications:

<param name= "Robot_description" textfile= "$ (find pkg_name)/urdf/xxx.urdf"/>

<node name= "Rviz" type = "Rviz" args= "-D $ (Find okg_name)"/xxx.rviz "required=" true "/>

. URDF check URDF file for grammatical problems: URDF directory CHECK_URDF XXX.URDF

3.Xacro:

In the Urdf file, the size parameters and location of each part are embedded, and the Xacro can be written for different sizes of the same model. Xacro can be interpreted as a macro language (macro language) designed for URDF extensibility and configuration. With a xacro, you can
Write URDF files like programming.
First we look at the variable definition of the Xacro file:

<xacro:macro name= "pr2_arm" params= "suffix parent reflect" >
  <pr2_upperarm suffix= "${suffix}" reflect= "$ {reflect} "parent=" ${parent} "/>
  <pr2_forearm suffix=" ${suffix} "reflect=" ${reflect} "parent=" Elbow_flex_ ${suffix} "/>
</xacro:macro>

<xacro:pr2_arm suffix=" left "reflect=" 1 "parent=" Torso "/>
<xacro:pr2_arm suffix= "Right" reflect= "-1" parent= "torso"/>
<xacro:property name= "The_radius" value= "2.1"/> <xacro:property name= "
the_length" value= "4.5"/>

<geometry type= "cylinder" radius= "${the_radius}" length= "${the_length}"/>
Copy the Xacrodisplay.launch in the urdf_tutorials to modify the model address in launch after the edit is complete


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.