15-494/694 Cognitive Robotics: Lab 6
Learning Goal: This lab will introduce you to path planning
with RRTs, using the Pilot.
Part 1: Setting Gaze Points to Build a World Map
- This part should be done alone or in teams of two.
- We want to build a world map with obstacles so we can use it for
path planning. We'll use red cylinders and blue tape lines as
obstacles, and a green cylinder as the goal. To speed things up,
we'll tell the MapBuilder where to point the camera to efficiently
scan the space we're using, by defining a set of "gaze points" in
local space. These points are used to form a polygon that can be used
in the MapBuilderRequest. Here is an example, but you won't need to
use this many points for today's task:
vector<Point> gazePoints;
// look front
gazePoints.push_back(Point( 500, 0, 0, egocentric));
gazePoints.push_back(Point( 1000, 0, 0, egocentric));
gazePoints.push_back(Point( 2000, 0, 0, egocentric));
// look left
gazePoints.push_back(Point( 500, -500, 0, egocentric));
gazePoints.push_back(Point( 750, -250, 0, egocentric));
gazePoints.push_back(Point( 1000, -1000, 0, egocentric));
// look right
gazePoints.push_back(Point( 1000, 1000, 0, egocentric));
gazePoints.push_back(Point( 500, 500, 0, egocentric));
gazePoints.push_back(Point( 750, 250, 0, egocentric));
NEW_SHAPE(gazePoly, PolygonData, new PolygonData(localShS, gazePoints, false));
mapreq.searchArea = gazePoly;
- Write code to look for lines and cylinders and build a world map.
Call your behavior Lab6a. It should be a child of PilotDemo because
we're going to use that functionality later.
- Test out your behavior and make sure it is constructing a usable world map.
Part 2: Path Planning
- Extend your Lab6a behavior to locate the green cylinder on the world map and set
that as the target location for a PilotNode to navigate to. Can the robot navigate
around the obstacles and reach the cylinder?
- Set the flag in your PilotRequest to display the RRT generated by
the path planner.
- Consider modifications to your world so that there is no safe
path to the goal. For example, if the goal is too close to an
obstacle, there will be no safe target pose the robot could try to
reach. As another example, if the target is completely surrounded by
obstacles, with gaps too small for the robot to pass through, there
may be no way to reach the target pose. In each case, what does the
path planner do?
- Take screen shots of the world map showing each case: successful
planning to the goal, no valid goal state, and no path to the goal.
Part 3: Navigation in a Virtual Maze
- Do this part of the assignment by yourself.
- View the Emaze.mirage world in Mirage.
- Make a new behavior Lab6b that inherits from Behaviors/Demos/Navigation/Emaze.h
- Your behavior should park the robot's arm on startup so that it
doesn't interfere with navigation. There is a built-in ParkArm node
for this purpose.
- This maze has three alcoves, which we'll number 1, 2, and 3. By
looking at the Emaze.h.fsm source file or the maze polygon in the
world map you can figure out the coordinates of a point near the end
of each alcove. These will be our goal points.
- Write a behavior that allows the user to send a text message "1",
"2", or "3" indicating a goal point the robot should navigate to.
Your behavior should invoke the Pilot to plan and execute a path to
the goal. Have it display the RRT search tree in the world map as it
does this.
- Add locations "4" and "5" that are unreachable for various
reasons. One might be outside the maze; another might be too close to
a wall. How does the Pilot treat each case?
- Take screen shots of the world map showing what happens as you
test your program in each of these cases.
What to Hand In
Finish the lab for homework.
- For Part 1, hand in a photo of the robot and the world you set up for it, and a screen shot
showing the world map it built.
- For Parts 2 and 3, hand in your source code, screen shots, and a description of what you observed.
Due Friday, March 11, 2016.
|