... | @@ -63,7 +63,7 @@ Note that the left sensor reading is calibrated, by subtracting 30 from the raw |
... | @@ -63,7 +63,7 @@ Note that the left sensor reading is calibrated, by subtracting 30 from the raw |
|
This is done, in order for the sound sensors to have equal calibration.
|
|
This is done, in order for the sound sensors to have equal calibration.
|
|
Otherwise the vehicle will always turn.
|
|
Otherwise the vehicle will always turn.
|
|
|
|
|
|
```
|
|
```java
|
|
SensorPort leftSound = SensorPort.S1;
|
|
SensorPort leftSound = SensorPort.S1;
|
|
SensorPort rightSound = SensorPort.S4;
|
|
SensorPort rightSound = SensorPort.S4;
|
|
leftSound.setTypeAndMode(SensorPort.TYPE_SOUND_DB, SensorPort.MODE_RAW);
|
|
leftSound.setTypeAndMode(SensorPort.TYPE_SOUND_DB, SensorPort.MODE_RAW);
|
... | @@ -96,7 +96,7 @@ while(!Button.ESCAPE.isDown()) |
... | @@ -96,7 +96,7 @@ while(!Button.ESCAPE.isDown()) |
|
```
|
|
```
|
|
|
|
|
|
The gains for the vehicle is chosen empirically to:
|
|
The gains for the vehicle is chosen empirically to:
|
|
```
|
|
```java
|
|
static float Kp = 5.0f,
|
|
static float Kp = 5.0f,
|
|
Ki = 0f,
|
|
Ki = 0f,
|
|
Kd = 0.5f;
|
|
Kd = 0.5f;
|
... | | ... | |