... | ... | @@ -88,7 +88,7 @@ The program RobotFigure9_9.java[1] will be used in this exercise. It implements |
|
|
From watching the behaviour and the implemented code, we see that the threshold for the light value and sonar distance is what decides the car behaviour, whereas cruising does not seem to play a major role in how the car avoid obstacles but only stands for the forward command.
|
|
|
|
|
|
[![image alt text](http://img.youtube.com/vi/6-VHqw5FNXI/0.jpg)](http://www.youtube.com/watch?v=6-VHqw5FNXI)
|
|
|
#####Video 4: Running - RobotFigure9_9.java program[1].
|
|
|
##### Video 4: Running - RobotFigure9_9.java program[1].
|
|
|
|
|
|
According to figure 9.9, the method Avoid is the most “important”. It will take control of the car if it reaches a value below 30 and decide which way to go to avoid the obstacle. No matter if it measures a lightvalue above the light threshold. If there are no obstacles within reach, the Follow method will take control of the car if it registers a lightvalue above its threshold. At last, if both Avoid and Follow, do not measure any values that triggers their threshold the car will cruise.
|
|
|
|
... | ... | @@ -172,7 +172,7 @@ We are planning to do this by re-implementing the follow behavior using a motor |
|
|
We have expanded the Follower class to obtain a light sensor that rotates on a horizontal motor to receive left and right light values from the environment. It works similarly to the existing program (RobotFigure9_9.java[1]) where the Legocar should turn right and left to obtain the light values and hereafter drive towards the area with most light.
|
|
|
|
|
|
[![image alt text](http://img.youtube.com/vi/ISU8eYocQm4/0.jpg)](http://www.youtube.com/watch?v=ISU8eYocQm4)
|
|
|
#####Video 7: Motor Powered Light Sensor
|
|
|
##### Video 7: Motor Powered Light Sensor
|
|
|
|
|
|
In video 7, we see that, we place a hand above the light sensor to reach a low threshold, which means that the Legocar should stop and calculate the light levels to the right and left very often. What we also observe is that the Legocar make steeper turns if the difference between the two measured light values is high. This is done by calculating the delta and afterwards send it to the motors. What we also see, is that the source of light needs to be within 5-10 cm before we will see a notable reaction from the car. Otherwise, it just seem like cruise control, even though we see that the light sensor measures value it just keeps going straight ahead. The reason to this must be due to a limitation within the lightsensor. The light values must decrease drastically even though the light is only 40-50 centimeters away.
|
|
|
|
... | ... | |