... | ... | @@ -71,11 +71,11 @@ We will test three different positions of the light sensors and test how it affe |
|
|
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, where the sensors pointed in the direction of the robot and for the third we placed the sensors at ~10 degrees. (see Fig. 4)
|
|
|
|
|
|
![opstilling2](http://gitlab.au.dk/uploads/group-22/lego/3831a07e03/opstilling2.jpg)
|
|
|
##### Fig. 4 -
|
|
|
##### Fig. 5 -
|
|
|
|
|
|
To conduct our experiments we configured a LightVehicle.java class which mapped the light readings from each of the two sensors to the motors (see snippet).
|
|
|
To conduct our experiments we configured a LightVehicle.java class which mapped the light readings from each of the two sensors to the motors (see Fig. 6).
|
|
|
|
|
|
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:
|
|
|
For each experiment we implemented both the inhibitory and the exitatory behavior [1]. 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:
|
|
|
```
|
... | ... | @@ -87,16 +87,18 @@ Inhibatory behavior: |
|
|
int lightValLeft = (int) (100-(lightLeft.readValue()*scale));
|
|
|
int lightValRight = (int) (100-(lightRight.readValue()*scale));
|
|
|
```
|
|
|
#### Fig. 6 - Shows the exitatory and the inhibatory behavior in the code.
|
|
|
|
|
|
|
|
|
#### Results
|
|
|
First experiment with 45 degree angle:
|
|
|
The two sensors were mounted at an angle of ~45 degrees and a space of 12 cm. Both sensors were “lying down” on the side (see Fig. 4). The results showed that the robot was able to move towards the light. However it also resulted in a large blind spot. The large blind spot resulted in the robot sometimes not being able to see the light source despite the source being right in front of it.
|
|
|
The two sensors were mounted at an angle of ~45 degrees and a space of 12 cm. Both sensors were “lying down” on the side (see Fig. 5). The results showed that the robot was able to move towards the light. However it also resulted in a large blind spot. The large blind spot resulted in the robot sometimes not being able to see the light source despite the source being right in front of it.
|
|
|
|
|
|
Second experiment with 0 degree angle:
|
|
|
Two light sensors mounted at the same angle, both pointing straight ahead while remaining upright with a space of 8 centimeters between them. The experiment showed that the robot was able to navigate towards a light source placed directly in front of it. The placement of the sensors with no angle also meant that once the light source was placed too far to the side of the robot, it would not be able to see it due to the blind spot.
|
|
|
|
|
|
Third experiment with a 15 degree angle:
|
|
|
For the third experiment we placed the sensors at a 15 degree angle. This experiment turned out to be the best of the three experiments as the blind spot to the sides and the front (see Fig. 4) were minimised, and the robot was able to navigate towards light placed directly in front of it and towards light placed by its side. Though the blind spots were minimised they were still present meaning that once the robot comes too close to the light source, the light will go between the sensors (See Fig. 4). This problem could be solved using a ultrasonic distance to measure the distance to objects placed in front of the robot.
|
|
|
For the third experiment we placed the sensors at a 15 degree angle. This experiment turned out to be the best of the three experiments as the blind spot to the sides and the front (see Fig. 5) were minimised, and the robot was able to navigate towards light placed directly in front of it and towards light placed by its side. Though the blind spots were minimised they were still present meaning that once the robot comes too close to the light source, the light will go between the sensors (See Fig. 5). This problem could be solved using a ultrasonic distance to measure the distance to objects placed in front of the robot.
|
|
|
|
|
|
---
|
|
|
|
... | ... | |