public class EV3GyroSensor extends UARTSensor
Supported modes | |||
---|---|---|---|
Mode name | Description | unit(s) | Getter |
Angle | Measures the orientation of the sensor | Degrees | getAngleMode() |
Rate | Measures the angular velocity of the sensor | Degrees / second | getRateMode() |
Rate and Angle | Measures both angle and angular velocity | Degrees, Degrees / second | getAngleAndRateMode() |
Sensor configuration
Use reset()
to recalibrate the sensor and to reset accumulated angle to zero. Keep the sensor motionless during a reset.
The sensor shuld also be motionless during initialization.
See Sensor Product page
See The
leJOS sensor framework
See leJOS conventions for
SampleProviders
currentMode, port
modes
Constructor and Description |
---|
EV3GyroSensor(Port port) |
EV3GyroSensor(UARTPort port) |
Modifier and Type | Method and Description |
---|---|
SampleProvider |
getAngleAndRateMode()
EV3 Gyro sensor, Rate mode
Measures both angle and angular velocity of the sensor. |
SampleProvider |
getAngleMode()
EV3 Gyro sensor, Angle mode
Measures the orientation of the sensor in respect to its start orientation. |
SampleProvider |
getRateMode()
EV3 Gyro sensor, Rate mode
Measures angular velocity of the sensor. |
void |
reset()
Hardware calibration of the Gyro sensor and reset off accumulated angle to zero.
|
switchMode
fetchSample, getAvailableModes, getCurrentMode, getMode, getMode, getModeCount, getName, sampleSize, setCurrentMode, setCurrentMode, setModes
close, releaseOnClose
public EV3GyroSensor(Port port)
public EV3GyroSensor(UARTPort port)
public SampleProvider getAngleMode()
Size and content of the sample
The sample contains one elements representing the orientation (in Degrees) of the sensor in respect to its start position.
Configuration
The start position can be set to the current position using the reset method of the sensor.
leJOS conventions for
SampleProviders
public SampleProvider getRateMode()
Size and content of the sample
The sample contains one elements representing the angular velocity (in Degrees / second) of the sensor.
Configuration
The sensor can be recalibrated using the reset method of the sensor.
leJOS conventions for
SampleProviders
public SampleProvider getAngleAndRateMode()
Size and content of the sample
The sample contains two elements. The first element contains angular velocity (in degrees / second). The second element contain angle (in degrees).
Configuration
The sensor can be recalibrated using the reset method of the sensor.
leJOS conventions for
SampleProviders
public void reset()