|
@@ -42,8 +42,8 @@ ROS2的launch文件有三种格式,python、xml、yaml。其中ROS2官方推
|
|
|
创建文件夹和功能包,接着touch一个launch文件,后缀为`.py`。
|
|
|
|
|
|
```
|
|
|
-mkdir -p chapt4/chapt4_ws/src
|
|
|
-cd chapt4/chapt4_ws/src
|
|
|
+mkdir -p chapt5/chapt5_ws/src
|
|
|
+cd chapt5/chapt5_ws/src
|
|
|
ros2 pkg create robot_startup --build-type ament_cmake --destination-directory src
|
|
|
mkdir -p src/robot_startup/launch
|
|
|
touch src/robot_startup/launch/example_action.launch.py
|
|
@@ -124,8 +124,8 @@ colcon build
|
|
|
接着运行`
|
|
|
|
|
|
```sheel
|
|
|
-# source 第四章的工作目录,这样才能找到对应的节点,不信你可以不source试试
|
|
|
-source ../../chapt4/chapt4_ws/install/setup.bash
|
|
|
+# source 第五章的工作目录,这样才能找到对应的节点,不信你可以不source试试
|
|
|
+source ../../chapt5/chapt5_ws/install/setup.bash
|
|
|
source install/setup.bash
|
|
|
ros2 launch robot_startup example_action.launch.py
|
|
|
# 新终端
|
|
@@ -171,8 +171,8 @@ def generate_launch_description():
|
|
|
编译运行测试
|
|
|
|
|
|
```shell
|
|
|
-# source 第四章的工作目录,这样才能找到对应的节点,不信你可以不source试试
|
|
|
-source ../../chapt4/chapt4_ws/install/setup.bash
|
|
|
+# source 第五章的工作目录,这样才能找到对应的节点,不信你可以不source试试
|
|
|
+source ../../chapt5/chapt5_ws/install/setup.bash
|
|
|
source install/setup.bash
|
|
|
ros2 launch robot_startup example_param_rclcpp.launch.py
|
|
|
# 新终端
|
|
@@ -199,4 +199,4 @@ launch还有很多更深入的用法,范子琦同学总结的很不错,这
|
|
|
- **小鱼微信:AiIotRobot**
|
|
|
- **QQ交流群:139707339**
|
|
|
|
|
|
-- 版权保护:已加入“维权骑士”(rightknights.com)的版权保护计划
|
|
|
+- 版权保护:已加入“维权骑士”(rightknights.com)的版权保护计划
|