ROS(URDF机器人建模)

新建功能包mbot_description

ROS(URDF机器人建模)_第1张图片

在功能包下新建文件config,launch,meshes,urdf。

在launch文件夹下新建文件display_mbot_base_urdf.launch

 1 
 2     "robot_description" textfile = "$(find mbot_description)/urdf/mbot_base.urdf"/>
 3 
 4     
 5     "use_gui" value="true"/>
 6 
 7     
 8     "joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />
 9 
10     
11     "robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />
12 
13     
14     "rviz" pkg="rviz" type="rviz" args="-d $(find mbot_description)/config/mbot_urdf.rviz" required="true" />
15 

ROS(URDF机器人建模)_第2张图片

在urdf文件夹中新建文件mbot_base.urdf

  1 "1.0" ?>
  2 "mbot">
  3 
  4     "base_link">
  5         
  6             " 0 0 0" rpy="0 0 0" />
  7             
  8                 "0.16" radius="0.20"/>
  9             
 10             "yellow">
 11                 "1 0.4 0 1"/>
 12             
 13         
 14     
 15 
 16     "left_wheel_joint" type="continuous">
 17         "0 0.19 -0.05" rpy="0 0 0"/>
 18         "base_link"/>
 19         "left_wheel_link"/>
 20         "0 1 0"/>
 21     
 22 
 23     "left_wheel_link">
 24         
 25             "0 0 0" rpy="1.5707 0 0" />
 26             
 27                 "0.06" length = "0.025"/>
 28             
 29             "white">
 30                 "1 1 1 0.9"/>
 31             
 32         
 33     
 34 
 35     "right_wheel_joint" type="continuous">
 36         "0 -0.19 -0.05" rpy="0 0 0"/>
 37         "base_link"/>
 38         "right_wheel_link"/>
 39         "0 1 0"/>
 40     
 41 
 42     "right_wheel_link">
 43         
 44             "0 0 0" rpy="1.5707 0 0" />
 45             
 46                 "0.06" length = "0.025"/>
 47             
 48             "white">
 49                 "1 1 1 0.9"/>
 50             
 51         
 52     
 53 
 54     "front_caster_joint" type="continuous">
 55         "0.18 0 -0.095" rpy="0 0 0"/>
 56         "base_link"/>
 57         "front_caster_link"/>
 58         "0 1 0"/>
 59     
 60 
 61     "front_caster_link">
 62         
 63             "0 0 0" rpy="0 0 0"/>
 64             
 65                 "0.015" />
 66             
 67             "black">
 68                 "0 0 0 0.95"/>
 69             
 70         
 71     
 72 
 73     "back_caster_joint" type="continuous">
 74         "-0.18 0 -0.095" rpy="0 0 0"/>
 75         "base_link"/>
 76         "back_caster_link"/>
 77         "0 1 0"/>
 78     
 79 
 80     "back_caster_link">
 81         
 82             "0 0 0" rpy="0 0 0"/>
 83             
 84                 "0.015" />
 85             
 86             "black">
 87                 "0 0 0 0.95"/>
 88             
 89         
 90     
 91 
 92     "kinect_link">
 93         
 94             "0 0 0" rpy="0 0 1.5708"/>
 95             
 96                 "package://mbot_description/meshes/kinect.dae" />
 97             
 98         
 99     
100 
101     "laser_joint" type="fixed">
102         "0.15 0 0.11" rpy="0 0 0"/>
103         "base_link"/>
104         "kinect_link"/>
105     
106 
107 

 

在meshes文件夹下有文件

ROS(URDF机器人建模)_第3张图片

 

ROS(URDF机器人建模)_第4张图片

 

ROS(URDF机器人建模)_第5张图片

 

通过urdf_to_graphiz命令查看URDF模型结构:

ROS(URDF机器人建模)_第6张图片

 

生成PDF

ROS(URDF机器人建模)_第7张图片

转载于:https://www.cnblogs.com/112358nizhipeng/p/9469196.html

你可能感兴趣的:(ROS(URDF机器人建模))