今天在实体机器人中同时执行多个ROS节点:
roslaunch rei_robot_base oryxbot_base.launch
roslaunch robot_joy robot_joy.launch
roslaunch oryxbot_slam oryxbot_slam_local.launch
结果全部报错退出了
现在换一种执行方式:
roscore
roslaunch rei_robot_base oryxbot_base.launch
roslaunch oryxbot_slam oryxbot_slam_local.launch
结果除了第一个命令,后面两条指令全部报错退出了
分析原因:
在执行指令:
roslaunch rei_robot_base oryxbot_base.launch
时,启动的节点包括:
oryxbot_base_node (rei_robot_base/robot_base_node)
而在执行指令:
roslaunch oryxbot_slam oryxbot_slam_local.launch
时,启动的节点包括:
front_lidar (nodelet/nodelet)
joint_state_publisher (joint_state_publisher/joint_state_publisher)
joy_node (joy/joy_node)
lidar_fuse (nodelet/nodelet)
oryxbot_base_node (rei_robot_base/robot_base_node)
oryxbot_slam_gmapping (gmapping/slam_gmapping)
rear_lidar (nodelet/nodelet)
robot_joy (robot_joy/robot_joy_node)
robot_state_publisher (robot_state_publisher/robot_state_publisher)
ydlidar_manager (nodelet/nodelet)
这个可能与节点冲突有关,
于是只启动:
roslaunch oryxbot_slam oryxbot_slam_local.launch
成功.