... | @@ -29,7 +29,7 @@ We were provided with the program ***AvoidFigure9_3.java*** [4] which implements |
... | @@ -29,7 +29,7 @@ We were provided with the program ***AvoidFigure9_3.java*** [4] which implements |
|
![the avoid behavior](https://gitlab.au.dk/LEGO/lego-kode/raw/master/week9/img/fig93.PNG)
|
|
![the avoid behavior](https://gitlab.au.dk/LEGO/lego-kode/raw/master/week9/img/fig93.PNG)
|
|
*Figure 2: Diagram of the avoid behavior. The image is originally Figure 9.3 in [2].*
|
|
*Figure 2: Diagram of the avoid behavior. The image is originally Figure 9.3 in [2].*
|
|
|
|
|
|
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]
|
|
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](TODO)
|
|
![robot running avoid behavior](TODO)
|
|
*Video 1: The robot running AvoidFigure9_3.java, implementing the avoid behavior*
|
|
*Video 1: The robot running AvoidFigure9_3.java, implementing the avoid behavior*
|
... | @@ -38,7 +38,7 @@ The program worked quite well. The robot succesfully avoided obstacles registere |
... | @@ -38,7 +38,7 @@ The program worked quite well. The robot succesfully avoided obstacles registere |
|
#### Incorpoating a 180 degree escape turn
|
|
#### Incorpoating a 180 degree escape turn
|
|
As prescribed in the lesson plan, we modified ***AvoidFigure9_3.java*** to make the robot perform a 180 degree turn when encountering a corner (i.e. when both the front distance and the side distance are below the threshold value).
|
|
As prescribed in the lesson plan, we modified ***AvoidFigure9_3.java*** to make the robot perform a 180 degree turn when encountering a corner (i.e. when both the front distance and the side distance are below the threshold value).
|
|
|
|
|
|
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
|
|
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](TODO)
|
|
![improved avoid behavior](TODO)
|
|
*Video 2: The robot performing a 180 degree turn when encountering a corner (approximately TODO seconds in)*
|
|
*Video 2: The robot performing a 180 degree turn when encountering a corner (approximately TODO seconds in)*
|
... | @@ -50,7 +50,7 @@ We were provided with the program ***RobotFigure9_9.java*** [5] which implements |
... | @@ -50,7 +50,7 @@ We were provided with the program ***RobotFigure9_9.java*** [5] which implements |
|
![behavior control network](https://gitlab.au.dk/LEGO/lego-kode/raw/master/week9/img/fig99.PNG)
|
|
![behavior control network](https://gitlab.au.dk/LEGO/lego-kode/raw/master/week9/img/fig99.PNG)
|
|
*Figure 3: Diagram of the behavior control network of section 9.5 in [2], exluding the Escape behavior. The original diagram, including the Escape behavior, is Figure 9.9 in [2].*
|
|
*Figure 3: Diagram of the behavior control network of section 9.5 in [2], exluding the Escape behavior. The original diagram, including the Escape behavior, is Figure 9.9 in [2].*
|
|
|
|
|
|
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.
|
|
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](TODO)
|
|
![avoid follow cruise](TODO)
|
|
*Video 3: The robot running with three behaviors: Cruise, Follow, and Avoid*
|
|
*Video 3: The robot running with three behaviors: Cruise, Follow, and Avoid*
|
... | | ... | |