|
@@ -5,7 +5,6 @@
|
|
|
URDF可视化的步骤如下:
|
|
|
|
|
|
1. 建立机器人描述功能包
|
|
|
-
|
|
|
2. 建立`urdf`文件夹编写urdf文件
|
|
|
3. 建立`launch`文件夹,编写launch文件
|
|
|
4. 修改`setup.py`配置,编译测试
|
|
@@ -24,13 +23,24 @@ ros2 pkg create fishbot_description --build-type ament_python
|
|
|
|
|
|
## 2.建立URDF文件
|
|
|
|
|
|
-建立文件夹,创建urdf文件
|
|
|
+建立URDF文件夹,创建urdf文件
|
|
|
|
|
|
```
|
|
|
cd fishbot_description && mkdir urdf
|
|
|
touch fishbot_base.urdf
|
|
|
```
|
|
|
|
|
|
+完成后的目录结构:
|
|
|
+```
|
|
|
+├── fishbot_description
|
|
|
+│ ├── __init__.py
|
|
|
+├── package.xml
|
|
|
+├── setup.cfg
|
|
|
+├── setup.py
|
|
|
+└── urdf
|
|
|
+ └── fishbot_base.urdf
|
|
|
+```
|
|
|
+
|
|
|
编辑`fishbot_base.urdf`
|
|
|
|
|
|
```xml
|
|
@@ -74,11 +84,27 @@ touch fishbot_base.urdf
|
|
|
|
|
|
## 3.建立launch文件
|
|
|
|
|
|
+在目录`src/fishbot_description`下创建launch文件夹下并新建`display_rviz2.launch.py`文件。
|
|
|
+
|
|
|
```
|
|
|
mkdir launch
|
|
|
touch display_rviz2.launch.py
|
|
|
```
|
|
|
|
|
|
+完成后的目录结构:
|
|
|
+```
|
|
|
+├── fishbot_description
|
|
|
+│ ├── __init__.py
|
|
|
+├── launch
|
|
|
+│ └── display_rviz2.launch.py
|
|
|
+├── package.xml
|
|
|
+├── setup.cfg
|
|
|
+├── setup.py
|
|
|
+└── urdf
|
|
|
+ └── fishbot_base.urdf
|
|
|
+```
|
|
|
+
|
|
|
+
|
|
|
```python
|
|
|
import os
|
|
|
from launch import LaunchDescription
|