... | ... | @@ -31,7 +31,7 @@ We were provided with the program ***AvoidFigure9_3.java*** [4] which implements |
|
|
|
|
|
The program worked quite well. The robot succesfully avoided obstacles registered by the ultrasonic sensor, and when approaching a corner it seemed like the robot was attempting to find a way around the obstacle by scanning from side to side by turning its body, increasing the angle for left-turns with each try. When we looked into the program code, we saw that this observation is correct albeit a little too specific: the robot increases its turn angle in the direction where it measures the largest distance to any obstacles - i.e. it will not necessarily be the angle for left-turns that is increased. Video 1 shows the robot avoiding different obstacles [TODO: grundigere beskrivelse af video]
|
|
|
|
|
|
[![Robot running avoid behavior](http://img.youtube.com/vi/4Xa1ZYIT-Rs/0.jpg)](https://www.youtube.com/watch?v=4Xa1ZYIT-Rs)
|
|
|
[![Robot running avoid behavior](http://img.youtube.com/vi/4Xa1ZYIT-Rs/0.jpg)](https://www.youtube.com/watch?v=4Xa1ZYIT-Rs)
|
|
|
*Video 1: The robot running AvoidFigure9_3.java, implementing the avoid behavior*
|
|
|
|
|
|
|
... | ... | @@ -40,7 +40,7 @@ As prescribed in the lesson plan, we modified ***AvoidFigure9_3.java*** to make |
|
|
|
|
|
We tried changing the program by making the robot drive backwards a little when encountering an obstacle and then spin around 180 degrees (by making one motor drive forward and the other drive backwards). Initially we made the robot perform the 180 turn for 1 second (1000ms), which wasn't enough, but when we changed it to 2 seconds (2000ms) it spun approximately 180 degrees. [TODO: video description]
|
|
|
|
|
|
[![Improved avoid behavior](http://img.youtube.com/vi/Um4zjVYArJ0/0.jpg)](https://www.youtube.com/watch?v=Um4zjVYArJ0)
|
|
|
[![Improved avoid behavior](http://img.youtube.com/vi/Um4zjVYArJ0/0.jpg)](https://www.youtube.com/watch?v=Um4zjVYArJ0)
|
|
|
*Video 2: The robot performing a 180 degree turn when encountering a corner (approximately TODO seconds in)*
|
|
|
|
|
|
|
... | ... | @@ -52,7 +52,7 @@ We were provided with the program ***RobotFigure9_9.java*** [5] which implements |
|
|
|
|
|
Running ***RobotFigure9_9***, the robot would stop and turn to both sides every time it was bothered by either an obstacle or light, in the same manner as with ***AvoidFigure9_3***. It was hard to distinguish whether it was reacting to light or an obstacle, as the resoponses looked the same. Later, a closer look at the code confirmed that the behavor implementations were similar, in that they both sought in the direction of the higher value (of either light reading or distance). [TODO: beskrivelse af video]
|
|
|
|
|
|
[![Avoid follow cruise](http://img.youtube.com/vi/2qxAJpQgZMM/0.jpg)](https://www.youtube.com/watch?v=2qxAJpQgZMM)
|
|
|
[![Avoid follow cruise](http://img.youtube.com/vi/2qxAJpQgZMM/0.jpg)](https://www.youtube.com/watch?v=2qxAJpQgZMM)
|
|
|
*Video 3: The robot running with three behaviors: Cruise, Follow, and Avoid*
|
|
|
|
|
|
After the initial observations, we ran the robot with modified versions of the program. First, with only the Cruise behavior included - in this case, the robot simply drove forward without responding to any stimuli. When including the Follow behavior, unsurprisingly the robot responded to a lit smartphone torch being near it but remained unaffected by other stimuli such as a box standing in its way.
|
... | ... | |