... | ... | @@ -18,7 +18,7 @@ As an example of a behavior-based control program the leJOS NXJ distribution con |
|
|
First, make BumperCar run the base sumo wrestler driving base mounted with a bumper and an ultrasonic sensor.
|
|
|
|
|
|
### Plan
|
|
|
To execute and test the provided BumperCar.java program on the sumo wrestler driving base we used an express bot [2], built for sumo wrestling, as seen in Fig. ??
|
|
|
To execute and test the provided BumperCar.java program on the sumo wrestler driving base we used an express bot [2], built for sumo wrestling, as seen in Fig. 1.
|
|
|
|
|
|
We then equipped the robot with a front bumper with two touch sensors, and a forward facing ultrasonic sensor.
|
|
|
|
... | ... | @@ -26,4 +26,31 @@ We then equipped the robot with a front bumper with two touch sensors, and a for |
|
|
##### Fig. 1: The base robot equipped with an ultrasonic sensor and two touch sensors.
|
|
|
|
|
|
### Result
|
|
|
When deployed on the sumo wrestler driving base, the robot drives across the platform and over the edge. This is due to the ultrasonic sensor which is not able to detect when the robot comes close to the edge, but instead looks for walls. Due to this fact it makes little sense to deploy the robot on the sumo track. (Insert Video). To overcome the problem with driving over the edge, the sensor could be mounted with an angle towards the floor in order to measure the distance to the ground. If the robot goes near the edge of the platform, the sensor will detect an increase in its readings meaning that the robot has encountered the edge. Additionally a light sensor be implemented to detect the white border along the edge of the track. |
|
|
When deployed on the sumo wrestler driving base, the robot drives across the platform and over the edge. This is due to the ultrasonic sensor which is not able to detect when the robot comes close to the edge, but instead looks for walls. Due to this fact it makes little sense to deploy the robot on the sumo track. To overcome the problem with driving over the edge, the sensor could be mounted with an angle towards the floor in order to measure the distance to the ground. If the robot goes near the edge of the platform, the sensor will detect an increase in its readings meaning that the robot has encountered the edge. Additionally a light sensor be implemented to detect the white border along the edge of the track.
|
|
|
|
|
|
### Task 2
|
|
|
|
|
|
Conduct a series of defined experiments with the BumperCar to investigate the functions of the Arbitrator:
|
|
|
|
|
|
Press the touch sensor and keep it pressed. What happens ? Explain.
|
|
|
|
|
|
After activating the touch sensor the robot starts reversing. It stays in reverse until the touch sensor is no longer activated. If the touch sensor is repeatedly pressed, the robot cancels the current action() method and starts over on the same method. This behavior can be seen in the video in fig 2:
|
|
|
|
|
|
[![image alt text](http://img.youtube.com/vi/ZHFlJe0Ao6c/0.jpg)](http://www.youtube.com/watch?v=ZHFlJe0Ao6c)
|
|
|
|
|
|
##### Fig. 2: The robot drives along a table. Once the touch sensors are activated the robot goes in reverse.
|
|
|
|
|
|
If the touch sensor is pressed, the takeControl() method returns a value of 100 (see fig 3) which initiates the prioritised action() behavior. Once initiated, the boolean value ‘active’ is set to true and the priority value is set to 50. This means that if the touch sensor is pressed while the action() is still running the method will start over due to the higher priority.
|
|
|
|
|
|
´´´
|
|
|
public int takeControl()
|
|
|
{
|
|
|
if (touch.isPressed() || distance < 25)
|
|
|
return 100;
|
|
|
if ( active )
|
|
|
return 50;
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
´´´
|
|
|
##### Fig. 3: takeControl() method. Shows how different values are returned according to sensor values and if the methods is ‘active’. |
|
|
\ No newline at end of file |