ENGR 499 Engineering Science and Systems: From Humans to Robots

The goal of this lab is to make a robot travel through a maze. This exercise takes the goto behavior used in Lab 7, and adapts it to use a path planner for long-distance navigation.

Maze world

This lab makes use of a new stage world, maze.cfg, that has a nice, challenging maze to navigate through.

Planner

For this exercise, you will be using a path planner, called wavefront. Wavefront planning works by visualizing the world as a grid. The square where the goal is has a distance of zero. Radiating outward from the goal in a wave, squares have a distance of 1 plus the distance of the smallest-neighboring square. Once the wave reaches the robot, the path planned is found by traversing to the neighboring square with the lowest value until the goal is reached.

To help you visualize your work, there is a program called playernav. Start by running player:

> player stage-worlds/maze.cfg

Then, run the planner GUI:

> playernav

OK, so here's where player/stage gets cool. You don't have to write this wavefront planner, though, this would be a cool exercise. The planner driver is already implemented in player. All you have to do is know how to use it. The plan that is returned is a series of waypoints (x,y), which when connected by straight lines form a path from the robot's current pose to the goal pose.

First off, we have to declare a planner proxy:

PlannerProxy *planner =new PlannerProxy(pc);

Then, we need to set a goal pose to plan to:

planner->SetGoalPose( destX, destY, destTheta );

If we wanted to check to see if the robot is at the path...

if( planner->GetPathDone()

And to get the position of the next waypoint:

double destX = planner->GetWx(); double destY = planner->GetWy();

Objective (10 pts):

Modify the maze.cc file in the lab8 directory so that the robot moves to the goal. Really, what you're doing is taking your code for lab7 and making it work with the code you have been given. The planner will make the plan, and planner->GetWx() and planner->GetWy() gives you the pose of the current waypoint. Make to robot go to GetWx and GetWy.