... | @@ -57,6 +57,8 @@ Running ***RobotFigure9_9***, the robot would stop and turn to both sides every |
... | @@ -57,6 +57,8 @@ Running ***RobotFigure9_9***, the robot would stop and turn to both sides every |
|
|
|
|
|
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.
|
|
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)
|
... | @@ -67,8 +69,9 @@ We speculate that this might lead to unintuitive behavior. For instance, if the |
... | @@ -67,8 +69,9 @@ We speculate that this might lead to unintuitive behavior. For instance, if the |
|
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, 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.
|
|
|
|
|
|
|
|
|
|
### Escape behavior
|
|
### Implementing the Escape behavior
|
|
We use a program from p. 305[2].
|
|
As suggested in the lesson plan, we used the implementation on page 305 in [2] as inspiration. The final result is included in [5].
|
|
|
|
|
|
We tried turning by just powering one motor, but that didnt work so now we power forward in one and backwards in one. This worked well, even though we had the other behaviors turned on, so they affected the run. We tried with them turned off aswell, and it worked even better this time.
|
|
We tried turning by just powering one motor, but that didnt work so now we power forward in one and backwards in one. This worked well, even though we had the other behaviors turned on, so they affected the run. We tried with them turned off aswell, and it worked even better this time.
|
|
### Motor for light sensor
|
|
### Motor for light sensor
|
|
We just changed the car movement to a new motor. We used too much power though! TODO Insert video of motorized choking of robot. Delay was 500 at first, but we changed that to 100. TODO Insert picture of motorized light sensor.
|
|
We just changed the car movement to a new motor. We used too much power though! TODO Insert video of motorized choking of robot. Delay was 500 at first, but we changed that to 100. TODO Insert picture of motorized light sensor.
|
... | @@ -90,7 +93,7 @@ Stopping the motors in the end helped. But it seemed that the sensor wasn't turn |
... | @@ -90,7 +93,7 @@ Stopping the motors in the end helped. But it seemed that the sensor wasn't turn |
|
|
|
|
|
We tested in the dark to obtain a bigger light difference. In here, the robot's response was easy to observe (TODO: video). Note, though, that the big difference in measured light values caused it to turn A LOT - a little too much.
|
|
We tested in the dark to obtain a bigger light difference. In here, the robot's response was easy to observe (TODO: video). Note, though, that the big difference in measured light values caused it to turn A LOT - a little too much.
|
|
|
|
|
|
Switching on everything else again: all behaviors were observable - we saw avoid overrule follow, and we saw the robot immediately respond to bumping into something (escaping overruling the rest). TODO: video. In general, we don't observe follow a lot, but as we reasoned about earlier, this is because the ambient light in the room induces too little a difference to the flashligt, whereby the motorpower for the turn is not very large.
|
|
Switching on everything else again: all behaviors were observable - we saw avoid overrule follow, and we saw the robot immediately respond to bumping into something (escaping overruling the rest). TODO: video. In general, we don't observe Follow a lot, but as we reasoned about earlier, this is because the ambient light in the room induces too little a difference to the flashligt, whereby the motorpower for the turn is not very large.
|
|
|
|
|
|
TODO: insert program code
|
|
TODO: insert program code
|
|
|
|
|
... | | ... | |