ME132 Lab 2

From Robotics Wiki

Jump to: navigation, search

Contents

Lab 2 - Grabbing Data from the Robot

Objectives

  1. Learn how to gather and plot the laser data
  2. Develop a simple "go-to-goal" algorithm
  3. (optional) Demonstrate a combined path-planning algorithm with obstacle avoidance

Assignments

1. Gathering Robot Data

  1. Write a simple client-code that logs laser-data and robot-state data to a file (the example here will help you get started).
  2. Write a simple plotting program (i.e. MATLAB) to replay the logged laser data in:
    • the robot reference frame
    • the global reference frame
    • NOTE: use the following naming convention for your data file lab2_logdataJ5.dat where J5 would be your initials if you were Johnny #5.
      • You'll be submitting both the data file and your MATLAB script as part of this lab.

2. Simple Path-Planning

  1. Write a simple algorithm/function in C++ that takes in a goal point (x,y) and generates the necessary speed commands that will bring the robot to the goal in any orientation (no obstacle avoidance yet).
  2. Implement this function call in a client code and demonstrate (in Stage) that the robot achieves the said goal during your lab time
    • have the desired goal location be user specified (i.e. some cout prompt); you will be graded according to how robust your algorithm is to various commanded points (HINT: from quadrant 2 to a point in quadrant 3 may prove difficult because of the Pi/-Pi discontinuity)
    • the configuration file lab2_freespace.cfg will be helpful for this part of the lab in Stage
    • NOTE: YOU CANNOT USE THE goto FUNCTION IN PLAYER/STAGE. Even if you try and use it, you'll find it won't work on the robots in the lab. The purpose of this lab is to have students think about different ways of commanding the robot to go from one point to the next. Be creative!

3. Simple Path-Planning with Obstacle Avoidance (for extra credit)

  1. Make use of the function written in part 2 to bring the robot from an initial position at (-2,0) to a goal position at (2.5,2.0) with some rudimentary obstacle avoidance implemented in Stage
    • use the configuration file lab0014_obstacle.cfg to help with this part of the lab in Stage
      • This configuration file will position your robot at (-2,0) with 0 degree heading; in order to get your odometry readings consistent with the global reference frame, use the SetOdometry command before the beginning of your infinite for-loop:
    pp.SetOdometry(-2, 0, 0)
  • Demonstrate your simple path-planning algorithm with obstacle avoidance during your lab time
  • NOTE: your client-code must be flexible enough for the TAs to place an obstacle anywhere in the lab

Scheduling

You need to schedule a slot to conduct your robot experiments on the testbed.

Before you can test your algorithms on the robots, you have to demonstrate its functionality to the TA in Stage! You should NOT use your robot time to do code development or major debugging; otherwise be prepared to reschedule for another time slot or for a special appointment with the TA.


LAB 2 Time (Wed)

DATE/TIME NAME
4-Mar, 3:00 Tony Roy & Jeff Edlund
4-Mar, 3:30 Chun-Che, Lea, & Mason
4-Mar, 4:00 K. Noertker & R. Paolini
4-Mar, 4:30
4-Mar, 5:00 Karthik & Han Bin

Lab 2 Time (Thur)

DATE/TIME NAMES
5-Mar, 3:00 Ruslan & Dane
5-Mar, 3:30 Jeff F. & Ben F.
5-Mar, 4:00 Jimmy P. & Albert W.
5-Mar, 4:30 Mark McDuff & Jason Burt
5-Mar, 5:00 Tom D. & Paul H.