Title image Spring 2017


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.

  1. Connect directly to the laser using the hokuyoaist and flexiport classes and then access the laser scan data.
  2. Run the provided URGserver and connect to it using a socket.
In either case, there is example code you can use in the hokuyo directory in the cs363-S17 folder. If you choose to do option 1, then look at the example called scanData.cpp. If you choose to do option 2, then look at the URGclient.cpp file.

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/ttyACM0

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

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



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.

  1. Title of the project and your name
  2. An abstract describing what you did in 200 words or less.
  3. A brief description of code you wrote and experiments you ran.
  4. Results.
  5. 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.