Homework 4
Logistics
- Create a git repository using the link provided in Canvas.
- Your homework will be submitted via this git repository.
- I will grade whatever is on the
main
branch when I clone the repository. - Guidelines provides important information about what
you should turn-in, including information about your
README.md
file.
Navigation
- The goal is to use the simulated robot to map an environment and then navigate within the map using the slam_toolbox
The Environment
- Clone the package nubot, which is a package that simulates a mobile robot with a lidar in Gazebo.
- Your repository will be next to
nubot
in the source space as well: e.g.(ws/src/nubot
andws/src/homework4
). - I purposely did not put a README.md in this package, so you will need to explore it to find out how it works.
- HINT: There is one launchfile that runs the simulation and visualizes it in rviz.
- HINT: There are two worlds to use, either will be accepted for the assignment but one is significantly smaller (and hence easier to explore).
Navigation Stack Setup
- Going through the First Time Setup Guide (through setting up the robot's footpring) will help you understand how the Nav2 stack works, and be helpful for this homework.
- Much of the setup, however, is already done for you in
nubot
. - By running the launch file in the
nubot
package you will be able to see what features required by thenav_stack
are already implemented.
A Launch File
- Your package will be called
nubot_nav
- In
nubot_nav
, write a launch file calledmanual_explore.launch.xml
(or you can use apython
launch file).- Starts the
nubot
simulation. - Starts
slam_toolbox
inasync
mode. - Starts the
nav2
stack (to create cost-maps and also enable navigation).- Make sure to set a parameter to increase the footprint of the robot so that it encompasses the whole robot
- You may use a circular approximation of the robot
- Starts
rviz
and displays- The robot relative to the
/map
frame - The global costmap
- The local costmap (with the
costmap
color scheme) - The planned path
- The robot relative to the
- Starts the
- Record a video of the robot mapping the environment until at least 1 corridor is mapped.
- You can manually set waypoints using
rviz2
- You can manually set waypoints using
- HINT: You must enable simulation time when using the launchfiles to start navigation and SLAM
Autonomous Exploration
- Write a node called
explore
that causes the robot to explore the environment autonomously while mapping the world. - The launchfile called
explore.launch.py
(or.xml
) should start all the nodes necessary to allow the robot to explore and map its environment- This launchfile should include
manual_explore.launch.xml
and then start theexplore
node.
- This launchfile should include
- Use the
map_saver_cli
in thenav2_map_server
package to save the resulting map and place it within themaps
directory of the git repository - Record a video of the robot exploring the environment in
rviz
(you need not capture what the robot is doing in gazebo)
Exploration Algorithm
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, but it should be generic (so no hardcoding locations that work for this particular room).
The algorithm will ideally enable the robot to explore at least two "rooms" in the environment
- A well-known strategy is called Frontier Exploration.
- See Robot Frontier for a friendly description, in particular Detecting Frontiers
- You can subscribe to the
/map
topic output by slam_toolbox to get information about the map
README
- The
README.md
should contain your name, and a description or reference to the exploration algorithm used (the reference should be properly cited incitations.txt
. - It should also have the
ros2 launch
commands needed to run the manual and autonomous exploration - It should embed both of the required videos directly in the README so that they can viewed on
github