... | @@ -55,18 +55,22 @@ Running ***RobotFigure9_9***, the robot would stop and turn to both sides every |
... | @@ -55,18 +55,22 @@ Running ***RobotFigure9_9***, the robot would stop and turn to both sides every |
|
[![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*
|
|
*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.
|
|
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.
|
|
|
|
|
|
TODO: Har vi en video med ovenstående?
|
|
|
|
|
|
|
|
Observing the robot running with the Follow behavior, we became aware that the light readings were performed using reflective light. We realized this when we tried to block out the light by holding a hand in front of the sensor, which didn't work. Trying to recreate the incident, we held the robot in place and shone a light in front if it, interchangeably blocking the light with a hand or some dark fabric. The hand had to be very close to the sensor in order to for the robot not to respond, while the dark fabric caused it to stop immediately.
|
|
Furthermore, observing the robot running with the Follow behavior, we became aware that the light readings were performed using reflective light. We realized this when we tried to block out the light by holding a hand in front of the sensor, which didn't work. Trying to recreate the incident, we held the robot in place and shone a light in front if it, interchangeably blocking the light with a hand or some dark fabric. The hand had to be very close to the sensor in order to for the robot not to respond, while the dark fabric caused it to stop immediately.
|
|
|
|
|
|
![pale hand and dark shirt](https://gitlab.au.dk/LEGO/lego-kode/raw/master/week9/img/handshirt.PNG)
|
|
![Pale hand and dark shirt](https://gitlab.au.dk/LEGO/lego-kode/raw/master/week9/img/handshirt.PNG)
|
|
*Figure 4: Pale hand and t-shirt made of dark fabric. The hand reflected too much light back to the sensor causing it not to register that the torch light was blocked, while the dark fabric succesfully blocked the torch light.*
|
|
*Figure 4: Pale hand and t-shirt made of dark fabric. The hand reflected too much light back to the sensor causing it not to register that the torch light was blocked, while the dark fabric succesfully blocked the torch light.*
|
|
|
|
|
|
We speculate that this might lead to unintuitive behavior. For instance, if the robot gets close to a white wall, the Follow behavior might cause it to be drawn to the wall before the Avoid behavior kicks in and drives it away from the surface. [TODO reflective might only measure specific light values LOOK INTO IT CAMILLA - EMIL]
|
|
We speculate that this might lead to unintuitive behavior. For instance, if the robot gets close to a white wall, the Follow behavior might cause it to be drawn to the wall before the Avoid behavior kicks in and drives it away from the surface. [TODO reflective might only measure specific light values LOOK INTO IT CAMILLA - EMIL]
|
|
|
|
|
|
Additionally, as the threshold between seeing light and not seeing light is based on an initial calibration of the ambient light, we sometimes had issues with the calibrated threshold being too low, causing the robot to constantly respond to light even when the smartphone torch was off - that is, it was simply responding to (changes in) the ambient light in the room. We "solved" this by performing the calibration while holding the robot up high, closer to the skylights, and pointing it towards them (*cue Circle of Life*). Thereby, when driving closer to the ground, with its light sensor being horisontal, the ambient light registered by the robot would be below the threshold. This simple solution worked fine and was fast, for which reason we did not look into it further as we wanted to move on with the actual focus of the lesson.
|
|
Additionally, we discovered a slight nuisance during closer observations of the Follow behavior. The robot would, when left alone, constantly stop up and check its sides for light sources, even when not given any significant light source from a torch, as shown in video 4.
|
|
|
|
|
|
|
|
[![Follow keeps checking](http://img.youtube.com/vi/--ZTLgyoltc/0.jpg)](https://www.youtube.com/watch?v=--ZTLgyoltc)
|
|
|
|
*Video 4: The Follow behavior constantly checks for light, without being given stimuli*
|
|
|
|
|
|
|
|
This was caused by the Follow behavior being programmed to trigger a 'search' for light, as soon as the light sensor measures a light level higher than its initial reading when starting the program. This means that because of the potential for slight instability in the ambient lighting in the area of the light sensor (especially when the robot is driving around), any time the light value fluctuated above the initial reading, it would result in a Follow 'check'. For the remainder of the lab exercise, we would launch the programs while holding the robot up in the air (*cue Circle of Life*), with the light sensor facing the skylights. Thereby, the initial ambient light reading would be slightly higher than what the sensor measured when driving around horizontally on the tables in the building, and as such caused it to only execute the Follow behavior when given noticeably interesting light sources, such as our torch. Alternatively we could have simply modified the program to only trigger when measuring a light reading of 'X' higher than the initial reading, but we opted for the quick hack instead, which worked very well.
|
|
|
|
|
|
|
|
|
|
### Implementing the Escape behavior
|
|
### Implementing the Escape behavior
|
... | | ... | |