目前已经按照Ros2的教程,已经跑到了nav2导航。接下来想自己做多机器人控制。目前写了3个urdf模型,在gazebo中加载了3个机器人,分别为fishbot1,fishbot2,fishbot3。启动gazebo后话题列表如下:
willing@Y7000: ~/fishbot_ws$ ros2 topic list
/clock
/fishbot1/cmd_vel
/fishbot1/imu
/fishbot1/joint_states
/fishbot1/odom
/fishbot1/robot_description
/fishbot1/scan
/fishbot2/cmd_vel
/fishbot2/imu
/fishbot2/joint_states
/fishbot2/odom
/fishbot2/robot_description
/fishbot2/scan
/fishbot3/cmd_vel
/fishbot3/imu
/fishbot3/joint_states
/fishbot3/odom
/fishbot3/robot_description
/fishbot3/scan
/joint_states
/parameter_events
/performance_metrics
/rosout
/tf
/tf_static
我想先控制一个机器人,然后在fishbot_nav2.yaml中,修改amcl中的scan_topic为/fishbot1/scan;bt_navigator中的odom_topic为/fishbot1/odom;local_costmap中的scan:topic为 /fishbot1/scan;global_costmap中的scan:topic为 /fishbot1/scan。然后再启动navigation2.launch.py,设置fishbot1的初始点,能正常定位,但设置目标点,fishbot1无法运行,应该是由于速度话题从原来的/cmd_vel变成了/fishbot1/cmd_vel,所以机器人没正常运行。但我不太清楚在哪里修改。
此外,似乎有更简单的方法,比如直接修改namespace?但是我并不太清楚具体要如何操作。所以想咨询一下 ,如何使用nav2进行多机器人导航。