启动文件:
之前需要多个命令行,来操作,很不方便。
学习lauch file ,用命令脚本来控制。
# turtlesim/launch/multisim.launch.py ,
from launch import LaunchDescription
import launch_ros.actionsdef generate_launch_description():
return LaunchDescription([
launch_ros.actions.Node(
namespace= "turtlesim1", package='turtlesim', executable='turtlesim_node', output='screen'),
launch_ros.actions.Node(
namespace= "turtlesim2", package='turtlesim', executable='turtlesim_node', output='screen'),
])
ros2 launch turtlesim multisim.launch.py
创建2个node节点。

启动文件:
ros2 launch 《package name》 <youname>.launch.py
具体原理??
Launching/monitoring multiple nodes with Launch — ROS 2 Documentation: Foxy documentation
launch 文件,工程构建:
Create a ROS2 Python package - The Robotics Back-End
修改setup.py (python 构建下,相当于make

最低0.47元/天 解锁文章
8172

被折叠的 条评论
为什么被折叠?



