|
@@ -108,7 +108,7 @@ class ActionControl02(Node):
|
|
|
def main(args=None):
|
|
|
"""主函数"""
|
|
|
rclpy.init(args=args)
|
|
|
- action_robot_02 = ActionRobot02("action_control_02")
|
|
|
+ action_robot_02 = ActionControl02("action_control_02")
|
|
|
rclpy.spin(action_robot_02)
|
|
|
rclpy.shutdown()
|
|
|
```
|
|
@@ -353,17 +353,17 @@ class ActionControl02(Node):
|
|
|
|
|
|
```
|
|
|
cd chapt4_ws/
|
|
|
-colcon build --packages-up-to example_action_rclcpp
|
|
|
+colcon build --packages-up-to example_action_rclpy
|
|
|
# 运行机器人节点
|
|
|
source install/setup.bash
|
|
|
-ros2 run example_action_rclcpp action_robot_01
|
|
|
+ros2 run example_action_rclpy action_robot_02
|
|
|
# 新终端
|
|
|
source install/setup.bash
|
|
|
-ros2 run example_action_rclcpp action_control_02
|
|
|
+ros2 run example_action_rclpy action_control_02
|
|
|
```
|
|
|
|
|
|

|
|
|
|
|
|
## 6.总结
|
|
|
|
|
|
-本节我们学习了使用Python编写Action,在设计上Python显得比C++更好用些,但背后的逻辑都是一样的,下一节我们将对ROS2节点通信进行总结。
|
|
|
+本节我们学习了使用Python编写Action,在设计上Python显得比C++更好用些,但背后的逻辑都是一样的,下一节我们将对ROS2节点通信进行总结。
|