... | ... | @@ -34,13 +34,13 @@ In order to cope with this a small fix is implemented. Whenever the all the dist |
|
|
|
|
|
### Setup
|
|
|
|
|
|
####Triggerig conditions and behavioir implementation
|
|
|
###Triggerig conditions and behavioir implementation
|
|
|
|
|
|
######Cruise
|
|
|
**Cruise**
|
|
|
The cruise class does not have a trigger condition.
|
|
|
The cruise class drives the car forward by applying a power of 70 to both motors.
|
|
|
|
|
|
######Follow
|
|
|
**Follow**
|
|
|
The trigger condition of the Follow class is that the `frontLight` is greater than the `lightThreshold`.
|
|
|
The threshold value is set in the constructor, and is therefore the light value when the program is started.
|
|
|
If the light value never reaches a value higher than the first, the Follow class will never issue a command to the car.
|
... | ... | @@ -48,7 +48,7 @@ In order to cope with this a small fix is implemented. Whenever the all the dist |
|
|
If the condition is met, the light to the left and right sides of the car is measured, and the course adjusted by a delta expression which equals the difference in the two light values.
|
|
|
Thereby the car will make sharper turns towards the light with increasing light intensity.
|
|
|
|
|
|
#####Avoid
|
|
|
**Avoid**
|
|
|
The trigger condition for the avoid class is that the `frontDistance`, which is measured continuously, becomes less than the `stopThreshold` which is set to 30.
|
|
|
If the trigger condition is met, the car will stop, turn left and measure distance, turn right and measure distance and finally proceed in the direction with the largest distance.
|
|
|
Even though the implementation does not consider the scenario where both the `leftDistance` and `rightDistance` equal 255, like in the case of the single narrow obstacle,
|
... | ... | |