The move_base package is a fairly complex application with a variety of options that can be specified by the user. Building our example of using amcl navigation to simultaneously localize two robots (see Assignment 7: Leader Follower and RFID (19-3)), we'd like to be able to add two move_base nodes to the system and be able to command each robot to go to a different pose (position and attitude) relative to the map.
As you might expect, this requires that we launch two move_base nodes, one within the namespace and tf_prefix that corresponds to each of our turtlebots. For our example we use the same string for both the namespace and tf_prefix:
We have an example in the turtlebot3_nps ROS package.
- Start by following the instructions at Assignment 7: Leader Follower and RFID (19-3) to bring up the robots and all the nodes on the laptop (two robot_state_publishers, two amcl nodes, etc.)
Then we can start two move_base nodes
If you look at this launch file (move_base_two.launch) you will see that it calls the same launch file twice (move_base_namepsace.launch), setting the appropriate configuration values for the namespace and tf_prefix of
- You may also notice that RVIX has two menu buttons for setting the 2D Nav Goal
The one on the left sends a message on the
tb3_0/move_base_simple/goaltopic, while the one on the left sends a message on the
- Note that the move_base status and result messages (e.g.,
rostopic echo /tb3_0/move_base/status) are published by each node.