User Tools

Site Tools


marvin:lab8

This is an old revision of the document!


Lab report 8

Date: November 7th 2008
Duration of activity: 8-13
Participants: Kasper, Bent and Johnny

Project Goal

Implement a working Rodney Brooks layered control system on the NXT 1)

Plan

  • Modify code by Ole Caprani2) to work with the our own physical implementation of Marvin.
    • Test individual behaviors seperately and re-calibrate constants.
  • Make modular priority system.
  • Investegate the functionality of java threads in order to implement a “Drive towards light” behavior as seen in lab session 7 3)

Execution

We modified the code to be more modular. This was not part of the exercise, but it made it a lot easier to test individual modules. Below follows the modifications made.

  • The constant tooCloseThreshold was initially set to be 20 cm, but this was not enough to take into account our modified Marvin which has a plate seperating the two lightsensors. There this constant was changed to 35 instead.
  • The constants in the thread RandonDrive.java has been change to accomdate more action, less waiting. We wanted Marvin to move longere before there were the tread ended. This caused Marvin to be more “exploring.”

RandomDrive

Prints an f on the screen to show the direction of movement. The thread drives forward with different random numbers between 50 and 100 on each motor. This means that Marvin not nessesarily (infact not likkely) will drive straight ahead. It will do this between 1 and 3 seconds. Then print s on the screen to indicate a stop and wait between 0.5 and 1 second. All these intervals are computed using a random function from Math library.

AvoidFront

Implemented using a sonic sensor. Prints a b on the screen to indecate a backwards motion, and set full power to both motors and do this for 1 second to get a away from the obstacle. Afterwards Marvin stops both motors, and sets right motor to full power to make a left turn. Marvin does this for 0.8 seconds, and it seems this corresponds to a 90 degree turn to the left. This thread shows a f while this happens. Lastly i shows a s en stops for 0.5 seconds.

PlaySound

This thread waits for 10 seconds, then stops and plays a sound while printing an s on the screen.

http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#setDaemon(boolean)

Video and pictures lab8-1.jpg lab8-2.jpg

Video for “Drive towards light test” lab8-3.jpg

1)
Rodney Brooks, A robust layered control system for a mobile robot, IEEE Journal of Robotics and Automation, RA-2(1):14-23, 1986, also MIT AI Memo 864, September 1985.
marvin/lab8.1226059049.txt.gz · Last modified: 2008/11/07 12:57 by sohn