UP | HOME

Homework 4

Logistics

  1. Create a git repository using the link provided in Canvas.
  2. Your homework will be submitted via this git repository.
  3. I will grade whatever is on the main branch when I clone the repository.
  4. Guidelines provides important information about what you should turn-in, including information about your README.md file.

Custom Workspace

  1. Due to a bug either in slam_toolbox or turtlebot3 (not sure which yet), slam_toolbox won't work with gazebo.
    • The workaround is to git clone https://github.com/m-elwin/turtlebot3 -b slam_toolbox into your custom_ws

Navigation

  • The goal is to use the turtlebot to map an environment and then navigate within the map using the slam_toolbox
    • SLAM toolbox is (as far as I know) the most advanced 2D SLAM method for ROS and the only one that is actively maintained.
  • The turtlebot3 tutorials and source code will be a useful reference for you.
  • The Slam Toolbox documentation and source code (for finding launch files) will also be useful. This package is released for noetic so you may install it from a binary package.

Grading

  1. You may choose to do this assignment in gazebo exclusively or with gazebo and the actual robot
    • It will likely be easier to do first use simulation and then transfer to the real robot at the end
    • When using the real robot, your launchfiles may assume that the user has separately ssh'd into the turtlebot and run roslaunch turtlebot3_bringup turtlebot3_robot.launch
  2. You may choose to implement a Frontier Exploration algorithm, or a significantly simpler algorithm of your own design
  3. If you choose gazebo only and a simple algorithm (not Frontier Exploration) you can earn up to a 16.5/18 on the assignment
  4. You earn up to one additional point for also implementing on the real robot
  5. You earn up to one additional point for implementing frontier exploration
  6. Therefore, you can earn up to an 18.5/18 on the assignment

Tasks

  1. Write a launchfile called start_slam.launch that starts the turtlebot3 (either using remote_bringup or gazebo in the house environment), loads rviz and visualizes it's laser scan, starts a turtlebot3_teleop node, and the slam_toolbox.
    • You will need to set the TURTLEBOT3_MODEL environment variable to burger to use the launchfile
    • You should make sure that rviz shows the Map, the laser scan, and the robot and the fixed frame in rviz should be the map frame.
      • The turtlebot3 launchfiles that start rviz for doing SLAM already use the appropriate rviz configuration
    • You can try either synchronous mode (for most accurate results) or asynchronous mode (guaranteed real-time mapping)
    • You can use launchfiles for turtlebot3 (including turtlebot3_bringup, turtlebot3_navigation and turtlebot3_gazebo) and slam_toolbox
    • Most of this task in particular can be done in a only a few lines if you include the appropriate turtlebot3 launchfiles.
      • roscd slam_toolbox and ls to see the slam_toolbox launchfiles
  2. Drive the turtlebot3 throughout its workspace while running slam_toolbox.
    • End with the robot near it's starting position.
    • Use the mapserver to save the map file.
    • For the gazebo run, include map_gazebo.yaml and map_gazebo.pgm in the base directory of your repository
    • For the real run, include map_real.yaml and and map_real.pgm in the base directory of your repository
  3. Create a launchfile called nav_stack.launch that uses amcl to localize your robot and the ROS navigation stack to allow the robot to move using the map created in the previous step.
    • Move the robot by setting 2D navigation goals in Rviz
    • Include a screencast showing the plan being executed in RViz along with a video of the robot moving (in the real world or in gazebo)
      • The robot, the motion plan, the map from SLAM, the global and local costmaps should be visible.
      • You should show the Path that is planned
      • rviz as launched by the turtlebot3 navigation launchfiles shows the appropriate items already in the rviz window
    • This step is essentially the same as the turtlebot3 navigation tutorial except you are writing a single launchfile to do it.
    • The launchfile does not need to be very long if you <include> other existing launchfiles.
  1. Create a launchfile called slam_stack.launch that runs all of the nav-stack components as in the previous step except instead of starting amcl and a pre-built map uses slam_toolbox to create the map while navigating
    • Explore the space by setting 2D navigation goals manually in rviz
    • Capture a screencast of RViz and the robot (in the real world or in gazebo) and link to it in README.md of the following scenario
      1. You set a 2D navigation goal in an uncertain part of the map
      2. The path is planned, but there is actually a (previously unseen) wall blocking the path
      3. The robot needs to replan to get to the goal using a different route
    • Rviz should show everything requested in the previous step
  2. Write a node that causes the robot to explore the environment autonomously while mapping the world
    • Provide a launchfile that lets the robot use this node and slam_toolbox to autonomously map the environment
    • Create a screencast of the robot exploring in rviz and a video of the robot exploring (in the real world) and include that in your README.md
    • Include a map called expl.pgm and expl.yaml that you created after running the exploration algorithm in your repository
    • Your algorithm should work in conjunction with the move_base node to plan via waypoints and to ensure that you do not collide
    • You can use any algorithm you want, but it should be described or cited in your README.md
      • The exploration does not need to be complete, perfect, or optimal in any way. For example, you could move randomly.
    • A well-known strategy is called Frontier Exploration.
      • See Robot Frontier for a friendly description, in particular Detecting Frontiers
      • Once you have detected a frontier, you can use move_base to move to the frontier centroid. The map should be updated along the way
    • You can subscribe to the /map topic to get information about the robot's current knowledge of the environment
      • This topic is output by your SLAM method: in our case slam_toolbox and creates an occupancy map where -1 represents unexplored areas.

Author: Matthew Elwin