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

  1. This part should be done alone or in teams of two.

  2. 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;
    
  3. 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.

  4. Test out your behavior and make sure it is constructing a usable world map.

Part 2: Path Planning

  1. 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?

  2. Set the flag in your PilotRequest to display the RRT generated by the path planner.

  3. 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?

  4. 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

  1. Do this part of the assignment by yourself.

  2. View the Emaze.mirage world in Mirage.

  3. Make a new behavior Lab6b that inherits from Behaviors/Demos/Navigation/Emaze.h

  4. 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.

  5. 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.

  6. 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.
  7. 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?

  8. 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.