Lab 05. Bug Algorithms

From Introduction to Robotics (CS460)
Jump to: navigation, search

Lab 04. PID Controller for Drone

Lab Objectives

The objective of this lab is to develop a PID controllers for the Turtlebot robot to solve a maze and find the exit.

Pre-Lab Settings

First, you need to download the files in
Put the following into the appropriate directories as follow:

  • bug.png and bug.yaml into ~/catkin_ws/src/gaitech_edu/src/maps
  • into ~/catkin_ws/src/gaitech_edu/src/maps/stage
  • turtlebot_stage_bug.launch into ~/catkin_ws/src/gaitech_edu/src/turtlebot/navigation/map_navigation/launch
  • into ~/catkin_ws/src/gaitech_edu/src/turtlebot/navigation/reactive_navigation/scripts

Make sure that all works fine by writing the following command:

roslaunch gaitech_edu turtlebot_stage_bug.launch

You should see the following display in stage simulator


If you do not get a similar display, contact me and send me the error to solve it.

Your Task

In this assignment, you will start from the file, that contains several functions including Go To Goal and Follow Wall function.
You will use these two functions to implement the bug algorithms, BUG0 and BUG1. BUG2 will be considered an option with 1.5 points bonus.(SALES FOR END OF YEAR)
So, write two functions bug0 and bug1 inside to implement the behavior of the bug algorithm.
Note that when the simulator starts, the robot is at position (1,1). The exit is at position (10,10). If you are within 0.5 meter from (10,10), it means you reached the exit.
You program must calculate the following things:

  • The total traveled distance by the turtlebot. This can be by integrating (making the sum) of distance between (xi,yi) and (xi+1,yi+1) when the robot moves.
  • Total time until the robot reached the exit.

The best student with the shortest path and lowest execution time will have 1 point bonus (SALES FOR END OF YEAR).

There are three topics for the pose:

  • /odom: is the relative pose
  • /base_pose_ground_truth: consistent with coordinate system
  • /amcl_pose: is the absolute pose

Use the /base_pose_ground_truth.

When all works fine, try with /odom and /amcl_pose. Is there any difference?

What to Submit

You need to submit your code and a video with successful execution of the bug algorithms.
You can use Camtasia studio for making the video.
You will make a presentation where you show me the code and explain me the execution.

Work strategy

This lab assignment should be individual.


This task must be submitted on next Monday at 4:00 pm, by email.


Will be considered as a Assignment (20%). See Grading