... | ... | @@ -65,7 +65,7 @@ To conduct experiments with two light sensors mounted in front of the robot and |
|
|
#### Plan
|
|
|
We will test three different positions of the light sensors and test how it affects the behaviour of the robot. Furthermore we will implement and test both exibatory and inhibitory behavior. The tests will be conducted under the same circumstances in a darkened room. As a light source we use the camera flash of a smartphone.
|
|
|
|
|
|
For the first experiment we mounted the two sensors at the front of the robot at an angle of ~45 degrees and a space of 12 cm. For the second experiment we used an angle of ~10 degrees, and for the third we placed the sensors at 0 degrees, where the sensors pointed in the direction of the robot. (see picture)
|
|
|
For the first experiment we mounted the two sensors at the front of the robot at an angle of ~45 degrees and a space of 12 cm. For the second experiment we used an angle of 0 degrees, and for the third we placed the sensors at ~10 degrees, where the sensors pointed in the direction of the robot. (see picture)
|
|
|
|
|
|
![opstillinger](http://gitlab.au.dk/uploads/group-22/lego/985a2cafa8/opstillinger.jpg)
|
|
|
##### Fig. 4 -
|
... | ... | @@ -75,6 +75,15 @@ To conduct our experiments we configured a LightVehicle.java class which mapped |
|
|
For each experiment we implemented both the inhibitory and the exitatory behavior (ref). The exitatory behavior causes the robot to accelerate as it nears the light source, and the inhibatory behavior caused the robot to decelerate as it detects more light. The different behaviors were implemented using this mapping of the motors and sensors:
|
|
|
|
|
|
Exitatory behavior:
|
|
|
```
|
|
|
int lightValLeft = lightLeft.readValue();
|
|
|
int lightValRight = lightRight.readValue();
|
|
|
```
|
|
|
Inhibatory behavior:
|
|
|
```
|
|
|
int lightValLeft = (int) (100-(lightLeft.readValue()*scale));
|
|
|
int lightValRight = (int) (100-(lightRight.readValue()*scale));
|
|
|
```
|
|
|
|
|
|
## References
|
|
|
|
... | ... | |