Page tree
Skip to end of metadata
Go to start of metadata


References and Prerequisites

Git Repository / ROS Package

Your submission for this assignment will be a Git repository that contains a ROS package.  The name of the repository on the server should be mrc_hw7 and it should be a ROS package (catkin_create_pkg).

Update ROS Software

  1. Use git to update to the most recent code for out custom NPS turtlebot ROS package.  (The turtlebot3_nps repository is on github.)

    cd ~/catkin_ws/src/turtlebot3_nps
    git pull origin master

Exercise 1: Leader-Follower via Simulink, Teleoperated.

After completing the previous assignment, you should be able to bring up a two Turtlebot system where AMCL is used to localize each robot relative to the same given map.  In the exercise you add a Simulink-based leader-follower controller based.  The basic scenario is as follows:

  • The "leader" robot is teleoperated via the gamepad.  The robot uses the tb3_1 namespace (and tf_prefix) and starts at a 2D position (1, 0) m with 0 radian yaw.
  • The "follower" robot is controlled via simulink.  The robot uses the tb3_0 namespace (and tf_prefix) and starts at a 2D position (0, 0) m with 0 radian yaw.

Two Robot Bringup

Based on the previous assignment, here is how you would bring up two turtlebots:

  1. LAPTOP:

  2. TB3_0

    ROS_NAMESPACE=tb3_0 roslaunch turtlebot3_bringup turtlebot3_robot.launch multi_robot_name:="tb3_0" set_lidar_frame_id:="tb3_0/base_scan"
  3. TB_1

    ROS_NAMESPACE=tb3_1 roslaunch turtlebot3_bringup turtlebot3_robot.launch multi_robot_name:="tb3_1" set_lidar_frame_id:="tb3_1/base_scan"

    roslaunch turtlebot3_nps navigation_two.launch map_file:=${HOME}/map.yaml tb3_1_init_x:=1.0

    This launch file consolidates a number of tasks involved with setting up the system.

    1. Takes optional command line arguments for the initial pose of each robot and the map config file location.
      See the launch file for the use of the various arguments.
    2. Starts a single map_server node to provide the map for localization
    3. For each turtlebot (tb3_0 and tb3_1), starts nodes with the appropriate namespace and tf_prefix...
      1. robot_state_publisher node
      2. amcl node
      3. joy and teleop_twist_joy nodes configured for ports /dev/js0 and /dev/js1
    4. RVIZ with configuration file consistent with the setup.

If all goes well you should see the following ROS graph, tf_tree and RVIZ views...


One way to implement leader-follower behavior for tb3_0  is to use the waypoint guidance Simulink model from Assignment 4: Networking, Turtlebot Setup, Waypoint Navigation (19-3).  The Simulink program would subscribe to the AMCL pose estimates for both robots.  The position of the leader (tb3_1) is decoded and the x, y position is used as the waypoint inputs (wp_x  and wp_y) to the waypoint guidance function.  The program would then use the pose from the follower tb3_0  to determine commands that should be published from Simulink to the cmd_vel  topic for the tb3_0  robot.

You may notice that if the position goal for the follower is the position of the leader it will continually collide with the leader.  You may address that by adding a small offset between the position of the leader and the goal position provided to the guidance algorithm.  Ideally, the goal position for the waypoint guidance would take into account the attitude (yaw) of the leader and drive towards a position some small offset behind the leader.


  • With the entire system running, including Simulink, save an image of the ROS graph as images/rosgraph_lf.png as
  • While logging a bag file, use a gamepad to control the leader, drive the leader to through the spaces in the lab while Simulink is implementing the follower behavior.   A good test is to visit (approximately) our A, B, C waypoints from previous assignments.
  • Create a MATLAB figure that shows the following and save it as images/lf_teleop.png 
    • The map image as a background
    • The AMCL position estimates for both the leader and follower

Exercise 2: RFID Integration

In this exercise you will integrate a new sensor - the RFID reader - into the Turtlebot3 platform.  Start with a single, standalone Turtlebot.

Follow these directions to integrate the RFID reader with your Turtlebot3 platform: ThingMagic USB Pro RFID Reader, Turtlebot3 Integration

To verify that you can move around and detect RFID tags:

  1. Distribute a few tags in known locations.
  2. Bringup the single turtlebot system using the AMCL map-based localization and teleoperation (via gamepad).
  3. Start a log/bag file.
  4. Drive the turtle around within the map.
  5. Generate a figure images/rfid_map.png  that includes
    1. The occupancy grid map as background
    2. The path of the robot as estimated by AMCL
    3. The estimated location of the RFID tags

Here is a description and example of post-processing RFID locations: RFID Detection Post-Processing


When you have completed the exercises, your mrc_hw7 repository should look something like...

  • No labels