Project 1


Project 1 Description
Project 1: FAQ
Late Policy
Footprint of the Erratic Robot
Example Environments
Creating Environments
Phase 2: Deliverables
Phase 3: Deliverables
Phase 3: Trajectory
Phase 4: It's Showtime Baby!
Phase 4: How to Submit
Phase 4: Environment
Generate your own Environments & Worlds
Project 1: Student Feedback

Late Policy


penalty = # days late (cumulative over all phases) * c
c = (total score)/100 days

At the end of the day, it is most important to hand in a successful and fully functional project. If Phase IV is turned in on time and complete, then the penalty may be forgotten.

Footprint of Erratic Robot


Get erratic_footprint.png


fp= [0.163,  0.220;
     0.233,  0.145;
     0.233, -0.145;
     0.163, -0.220;
    -0.153, -0.220;
    -0.233, -0.133;
    -0.233,  0.133;
    -0.153,  0.220;
    0.163,  0.220];

line(fp(:,1),fp(:,2), 'LineWidth', 3)

Example Environments


Here is the moment you've all been waiting for....


Download some sample maps here: project1-example_maps-1.28.2011-v2.zip

Below, is a sample map showing you the axis that I used in creating the environments. You don't have to use this one internally in your planner. You can use whatever axis you'd like but the path returned has to be on the same axis defined by the boundary line in the environment file.
(I'm sorry that this axis is more conducive to matlab users...When it comes time to integration - I might have to flip it to make it integrate nicely with ROS's odometry messages.)



Script for Creating your own Environments


I wrote a script that you can use to make your own environment files. There are somethings that the script left to be desired. Email me with improvements if you decide to add any functionality. -ben

  1. Download the script Attach:create_environment_v1.m .
  2. Edit the script so that it calls your own function to compute the cells in a circle. I can't give you mine at this time. I'll give it to you after you hand in Phase 2.
    cells = getCellsInCircle(x_center, y_center, radius, dim)
    (all dimensions are in pixels (cells))
  3. Change the name of the environment file at the top of the script to your desired filename.
  4. Run the script.
  5. Click with either the left, middle, right mouse buttons. The button you use determines the radius of the circle (see code).
  6. Click anywhere on the gray area around the image when you are done adding obstacles.
  7. Click on the desired start coordinates.
  8. Click on the desired goal.
  9. Check local directory for output files (environment file & image).

Phase II Deliverables


What you will submit:

  1. A zipped directory of your code that should contain:
    • a README file that states
      • your name
      • a very short paragraph describing your approach
      • how to run your code
    • The zip file should be called:
      FirstnameLastname-Project1-Phase2.zip
  2. A run_planner executable or executive function:
    • Matlab: an executive function called 'run_planner' that takes in one argument - the environment filename.
    • C++ & Python: an executable called 'run_planner' that takes in one argument - the environment filename.

How I will test it:

I will enter your directory, read your README, follow any special directions about compiling or how to call your planner.

  • Matlab: From within matlab I will call:
    run_planner("/path/to/new_environment.txt")
  • C++ or Python: At a terminal, I will call your executable in the same way:
    run_planner /path/to/new_environment.txt

Expected Behavior:

  1. The following output will get printed to the terminal:
    name:
    length of path:
    planning time:
    # of states expanded:
    (Please comment out all of your debug output before you hand it in)
  2. An jpeg image file is created in the same directory that displays the map overlayed with the states that were expanded, and the path overlayed on top of it.
    • obstacles: black
    • region that was searched: yellow
    • unsearched region: white
    • path: green

How you should compute your planning time:

Since you are parsing the text file and creating the environment, it's important that for the "planning time" statistic that you have to output, you only time the actual execution time of your planner. We may go through your code to confirm that you are only timing the planner so to make it easier for us, we request that:

  1. You put a comment above the line that starts the clock, like so:
    %TIME_START or //TIME_START or #TIME_START
  2. You put a comment below the line that stops the clock, like so:
    %TIME_END or //TIME_END or #TIME_END

Some notes on timing a block of code

Phase 3: Deliverables



Phase 3 Deadline: Monday, 2/14/2011 @ 12pm

Prerequisite: You have followed the tutorial on how to get started with the erratic robot in Gazebo, Erratic Robot.

Brief Summary

You'll be given a simulation of a robot that takes, as inputs, two commanded wheel velocities and returns, as outputs, the two odometry readings. You'll be asked to command the robot through three sample trajectories:

  1. 5m x 5m square.
  2. A circle of radius 5m.
  3. A smooth trajectory (that you will generate) that passes through a given list of points.

You will need to design a controller that takes the current position of the robot as feedback and drive the robot through the trajectory. The current position can be estimated from the odometry. (You will have to determine how to do this.)

Note:

  • You can start executing the trajectory from the robot's starting point when bringing up gazebo.
  • We won't be running your code - we'll just be grading your report and figures. Feel free to hard code waypoints of the trajectories.

What you will submit:

A zipped directory of your code that should contain:

  • a one page report in pdf format (described below)
  • a directory called 'figures' containing originals of your plots (they should be added in the report - you can add higher-res originals. The images shouldn't be larger than 1mb each)
  • a directory called 'code' containing the code that you wrote for phase 3. (We won't be running it but it should contain everything just in case - we are 'inspired' to)

The zip file should be called:

FirstnameLastname-Project1-Phase3.zip

You should email your submission to Ben at his email address that's posted on the info page.

Report:

  1. Three figures showing the actual trajectories overlayed on the planned trajectories.
    • You can use matlab to plot the desired trajectory in matlab, and then plot your odometry overlayed on top of it. The plotting can be a post-processing step.
    • Please label all of your plots and figures
      we'll be annoyed if there is no title, legend, etc...
  2. For each trajectory:
    • State the time to completion.
    • Display the errors between the planned and actual trajectory as a function of the planned trajectory.
    • Display the error in the robot's velocity by plotting the desired vs actual.

Note: The last two items of (2) are somewhat open ended. Feel free to let your inner creative spirit blossom while visualizing for us the errors you observe in velocity, etc.

Phase 3: Trajectory



Above is a plot showing a trajectory that starts at (0,0) and passes through 12 waypoints, the final waypoint, being the initial position of the robot.

points =  [0.0  0.0; % (Initial Position)
          -2.0  4.0; % 1
           0.0  8.0; 
           2.0  4.0;
           4.0  8.0;
           6.0  4.0;
           8.0  8.0;
           10.0 4.0;
           6.0 -4.0;
           0.0 -4.0;
          -2.0 -2.0;
          -4.0  0.0; 
           0.0  0.0]; % Start/End

Phase 4: It's Showtime Baby!



Phase 4 Deadline: Friday night, 2/25/2011 @ 11:59pm

Brief Summary

It all comes down to this. This is where we separate the men/women from the boys/girls....
It's time to glue it all together.

In the final phase, you'll be given an environment file as input to your planner and the corresponding world file to be used by Gazebo. See an example world below.

You will have to generate a motion plan and then navigate through the environment to the goal position.


What you will submit:

  1. A video of your simulation. We will be posting your video on the new meam620 youtube channel. For the sake of your personal robotics portfolio you may want to polish the video up with a title and what not. Details will follow.
  2. A zipped directory of your code that should contain:
    • a 2-3 page report in pdf format (described below)
    • a directory called 'figures' containing originals of your plot(s) (they can be added in the report - you can add higher-res originals. The images shouldn't be larger than 1mb each)
    • a directory called 'code' containing all of the code required to run your phase 4.
    • a text file called 'README' in the code directory stating how to run your code
    • a text file called 'LESSONS' in the root directory that lists the following things:
      • all of the secrets that you wish you knew at the beginning of the project about matlab/ros/gazebo/planning
      • all of the project details that you felt should have been posted on the wiki at the start of the project but weren't
      The zip file should be called:
      FirstnameLastname-Project1-Phase4.zip

You should email your submission to Ben at his email address that's posted on the info page.

Report:

  • Include a description of your planner from Phase2 (you might want to add to it if it was lacking in goodness).
  • Include a description of your controller from Phase3 - you should just include a description - do not include the plots from Phase3.
  • Please include a plot of your motion plan overlayed with the actual trajectory followed to the goal.
  • Please label all of your plots and figures
    we'll be annoyed if there is no title, legend, etc...


How to submit:

To submit your video and your zip file, we would like it if you can copy your 2 files to a folder on the local network by running the following two commands:

scp FILE.zip meam620@mediabox.grasp.upenn.edu:~/project1/
scp VIDEO.mp4 meam620@mediabox.grasp.upenn.edu:~/project1/
The required password will be provided in the email that you received from ben.

The zip file should be called:
FirstnameLastname-Project1-Phase4.zip
The video should be called:
FirstnameLastname-Project1-Phase4.EXT
(EXT can be any standard video format extension - not ogv or glc)


Gazebo World for Phase 4:

The world files needed can be downloaded here phase4_world-2.24.11.zip. Unzip the package into your ROS_PACKAGE_PATH.

Note: While the plane that's rendered in Gazebo is larger than the boundary stated in the environment file, it would be frowned upon if you chose to drive outside of the boundary to drive to the goal. (Don't just circumvent the world - you must drive through it)

This is what the world looks like:


Generate your own Environments & Worlds



In the Creating Environments section, you learn how to easily create text files that you can use to test your planner. Now, we need to generate world files so that Gazebo can simulate the environment for us. A world file is an XML document that describes how the simulated world should appear and the items that it contains.

Below are instructions that describe how to generate a world file using the environment file that you have downloaded or created.

  1. Download environment_to_world-2.17.11.zip.
  2. Unzip it in your ROS_PACKAGE_PATH.
    unzip environment_to_world-2.17.11.zip
  3. In the environment_to_world directory you will find two matlab scripts.
    • create_environment.m - use this to create environments of your own (it's the same script as the one provided above but this version includes the missing function).
    • environment_to_world.m - convert your environment file into a world file that is usable by Gazebo.
      • At the top of the script, set map_file to the environment file that you want to convert to a Gazebo world.
  4. Launch Gazebo.
    roslaunch environment_to_world simulate_environment.launch
  5. Get to work... :)

You should see:

  • obstacles in yellow
  • robot at the start position
  • a green marker hovering over the start position
  • a red marker hovering over the goal position