Laboratory 1, part a - Getting started (assigned on Sep 4)

See the course homepage (http://aass.oru.se/~asaffio/Teaching/AIMR) for information about how to write and submit lab reports, due dates, linux help, etc.

Objective

Learn how to run your programs on the robot, run some test programs, and write and use a few simple programs of your own.

Tasks

  1. Familiarize yourself with the Linux installation on your computer. Open an editor and write a simple C program -- e.g., the usual "hello world" that you find in all C books or online. Try to compile it and run it. Make sure you are confortable with the file system, the editor, and the compiler. Be sure to thoroughly read the linux tips document (http://aass.oru.se/~aakq/AIMR/linuxtips.txt).
  2. Go to the course homepage and read all the documentation you find. Answers to many of your questions can be found here. In addition to the linux tips document above, be sure to thoroughly read the lab report specifications document (http://aass.oru.se/~asaffio/Teaching/AIMR/labinfo.txt). Download the latest source code (http://aass.oru.se/~aakq/AIMR/AIMR_2016.tar.gz) and extract it. Take a close look at the include file epuck.hpp. Also, take a look at lists.h and maps.h: they will be needed in later labs.
  3. View the readme file, and follow the instructions to compile the code for the robot. Ask for help connecting the robot, and then run the sample program on the robot. Describe what each part of the sample program does.
  4. View the readme file, and follow the instructions to compile the code for the simulator. Start the simulator, and then run the sample program on the simulator. Describe what each part of the sample program does, and compare this to the results obtained on the real robot.
  5. Make the robot move using the SetTargetSteps() function. Try various values, including values which are very different for each wheel. How does this function work? What happens when you try SetTargetSteps(2000,3000)? Why?
  6. Make the robot move using the SetSpeed(), Stop(), and Sleep() functions. Try various values, including values which are very different for each wheel. How does this function work? Why do you need to use the Sleep() function? What is the maximum speed allowed by the software (see the epuck.hpp header file)? Try sending SetSpeed(300,400) to the robot for a very short time. Why doesn't the robot turn?
  7. Make the robot go back and forth 5 times between two points using the SetTargetSteps() and Sleep() functions.
  8. Make the robot go back and forth 5 times between two points using the SetSpeed(), Stop(), and Sleep() functions.
  9. Write a function called Move(double mm), that moves the robot a specific number of mm (positive = forward, negative = backward), using SetTargetSteps(). Try printing out the values of the steps after the robot reaches the target.
  10. Write a function called Turn(double degrees), that turns the robot the given number of degrees (positive = counterclockwise), using SetTargetSteps().
  11. (Optional) Write another version of the Move() function, this time using SetSpeed() and then calling GetSteps() until the robot has traveled the desired amount of space, and finally calling Stop(). Try printing out the values of the steps during the motion of the robot. Also, note how long it takes for the steps values to stop changing. Is the resulting motion more precise or less precise than the previus version of Move()?
  12. (Optional) Write yet another version of the Move() function, using SetSpeed() and then Sleep() for the amount of time needed to reach your position. Is this third version more precise or less precise than the previus two? Explain why.
  13. (Optional) Write your own program which makes the robot react to the infra-red sensors in some way: e.g., you can blink the leds, retract from an obstacle, go toward an obstacle, or other. Use the GetIR() function. Describe what your program does, and how.