For this assignment you will implement three algorithms, adding in the Laser as one of your sensors. The laser enables you to be more precise than sonars or IRs.
The laser is situated on the front of the robot's base, pointing forward. It senses surfaces that are approximately as high as the robot base with 681 separate measurements spread over 240 degrees.
To use the laser, you will need to do one of two things.
- Connect directly to the laser using the hokuyoaist and flexiport classes and then access the laser scan data.
- Run the provided URGserver and connect to it using a socket.
To test the laser, first make sure the laser power cable is plugged in, the laser USB cable is plugged into the netbook, and that the port /dev/ttyACM0 appears. (Just type ls /dev/ttyACM* and see what pops up.)
Then you can run the program scanData using the following from inside the hokuyo directory.
./scanData /dev/ttyACM0It should return some values. You can move things in front of the laser and test it again to see if things change.
Do each of these tasks with a partner. Incorporate the laser into your code, but do not rely on it alone for obstacle avoidance. It's good, but it doesn't see behind the robot.
- Have the robot orient itself towards the nearest flat surface of some minimum extent. The kind of behavior it should exhibit is to turn towards a flat panel held up near the robot.
- Have the robot track a flat surface and maintain a specific distance from it. The robot should follow you around the lobby if you are holding a flat piece of whiteboard, or even a large book. Once the robot has tracked on to an object in front of it, try to keep it from being distracted by other objects that may come close on the side or back. Make sure the robot stops if it is about to run into anything.
- Write a program that enables the robot to follow a wall (pick right or left wall following). You can assume it is just a straight wall with no corners. If the wall disappears, or an obstacle appears in front of it, the robot should stop and the program terminate.
- Use something like RANSAC or a line-fitting algorithm to determine the orientation of the wall.
- Add more complex wall following capabilities so the robot can traverse a simple maze.
- Have the robot find a wall when placed in an arbitrary location, perhaps through wandering, then track along the wall.
- Find a paper on robot navigation/goal achievement/path following and develop some code for the robot.
The writeup for each project should be a brief summary of what you did along with some code examples, terminal output, or screen shots, depending upon the assignment. Please organize the writeup as follows.
- Title of the project and your name
- An abstract describing what you did in 200 words or less.
- A brief description of code you wrote and experiments you ran.
- A brief description of what you learned.
Make your writeup for the project a wiki page in your personal space. If you have questions about making a wiki page, stop by my office or ask in class.
Once you have written up your assignment, give the page the label:
You can give any page a label when you're editing it using the label field at the bottom of the page.
To hand in code, put it in the private subdirectory in your Courses folder.