User Tools

Site Tools


marvin:lab8

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Last revisionBoth sides next revision
marvin:lab8 [2008/11/09 10:29] devamarvin:lab8 [2008/11/09 10:34] deva
Line 11: Line 11:
     * Test individual behaviors seperately and re-calibrate constants.     * Test individual behaviors seperately and re-calibrate constants.
   * Make modular priority system.   * 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 (([[marvin:lab7]]))+  * Investigate the functionality of java threads in order to implement a "Drive towards light" behavior as seen in lab session 7 (([[marvin:lab7]]))
  
 ====Execution==== ====Execution====
Line 17: Line 17:
  
 {{marvin:lab8-2.jpg?300}} {{marvin:lab8-2.jpg?300}}
-  * 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 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 separating the two light sensors. 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."+  * The constants in the thread ''RandonDrive.java'' has been change to accommodate more action, less waiting. We wanted Marvin to move longer before there were the tread ended. This caused Marvin to be more "exploring."
 **Video of Marvin running with default code**\\ **Video of Marvin running with default code**\\
 [[http://www.youtube.com/v/OuSbJ5-chXI|{{marvin:lab8-1.jpg}}]]\\ [[http://www.youtube.com/v/OuSbJ5-chXI|{{marvin:lab8-1.jpg}}]]\\
  
 ===RandomDrive=== ===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.+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 necessarily (in fact not likely) 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=== ===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.+Implemented using a sonic sensor. Prints a b on the screen to indicate a backwards motion, and set full power to both motors and do this for 1 second to get a away from the obstacle. Afterward 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=== ===PlaySound===
Line 38: Line 39:
 </code> </code>
 This however makes shuffling of the priorities, as well as making the introduction of new Behaviors, a very tedious task. We therefore rewrote the priority system to make it more modular and flexible.\\ This however makes shuffling of the priorities, as well as making the introduction of new Behaviors, a very tedious task. We therefore rewrote the priority system to make it more modular and flexible.\\
-Below is the new stucture:+Below is the new structure:
 <code java> <code java>
 ArrayList behaviors = new ArrayList(); ArrayList behaviors = new ArrayList();
Line 79: Line 80:
 } }
 </code> </code>
 +The code in its entirety can be found in the ''Behavior.java'' file in the source tarball(({{:marvin:07112008.tar.gz}})).
  
 ====Java Thread==== ====Java Thread====
Line 139: Line 141:
 } }
 </code> </code>
 +The code in its entirety can be found in the ''DriveTowardsLight.java'' file in the source tarball(({{:marvin:07112008.tar.gz}})).
  
 **Video for "Drive towards light test"**\\ **Video for "Drive towards light test"**\\
Line 144: Line 147:
  
 ====Conclusion==== ====Conclusion====
-The layered behavior model seems to work very well for the implementation of an autonomous roboot. We believe that with an added push sensor Marvin would be able to navigate in any room avoiding any obstacles and find the exit with lights. +The layered behavior model seems to work very well for the implementation of an autonomous robot. We believe that with an added push sensor Marvin would be able to navigate in any room avoiding any obstacles and find the exit with lights. 
marvin/lab8.txt · Last modified: 2008/11/14 08:50 by rieper