... | ... | @@ -140,15 +140,17 @@ The following image shows the setup used, with a sonar sensor, two light sensors |
|
|
![Setup for tracking whilst avoiding obstacles](https://gitlab.au.dk/rene2014/lego/raw/master/Lesson10/Images/Sonar.JPG)
|
|
|
|
|
|
We used the bumper and touch sensor to detect obstacles as this was easier to test.
|
|
|
Odometry was used to track the movements performed in the two behaviors *Wander* and *Avoid edge*.
|
|
|
Odometry was used to track the movements performed in the two behaviors *Avoid obstacle* and *Travel route*.
|
|
|
|
|
|
Wander was modified to drive in a straight line to obtain a simple fixed route.
|
|
|
The Avoid egde behavoir, which backs the car up and turns 90 degrees to the left, was re-used as an avoid obstacle behavior.
|
|
|
![Behavioral control](https://gitlab.au.dk/rene2014/lego/raw/master/Lesson10/Images/BehavioralControl.jpg)
|
|
|
|
|
|
Travel route was implemented to drive in a straight line to obtain a simple fixed route.
|
|
|
The Avoid Obstacle behavoir, which backs the car up 10 cms and turns 90 degrees to the left, is activated by the touch sensor.
|
|
|
|
|
|
In order to avoid objects whilst following
|
|
|
We tested the tracking by placing the vehicle approximately 30 cm in front of an obstacle.
|
|
|
When the car reached the obstacle, it backed up, turned to the left and continued forward.
|
|
|
As can be seen in the video in [3], the odometry was able to keep track of the car.
|
|
|
|
|
|
![Behavioral control](https://gitlab.au.dk/rene2014/lego/raw/master/Lesson10/Images/BehavioralControl.jpg)
|
|
|
|
|
|
## Conclusion
|
|
|
Notes:
|
... | ... | @@ -166,6 +168,8 @@ Use travel and rotate with immediateReturn = true. Then the commands can be over |
|
|
|
|
|
[2] http://lejos.sourceforge.net/nxt/nxj/tutorial/WheeledVehicles/WheeledVehicles.htm
|
|
|
|
|
|
[3] http://youtu.be/JOdNyQy-lQ4
|
|
|
|
|
|
|
|
|
### Code
|
|
|
|
... | ... | |