public class EV3GyroSensor extends BaseSensor
Sensor configuration
Use reset()
to recalibrate the sensors and to reset accumulated angle to zero. Keep the sensors motionless during a reset.
The sensors shuld also be motionless during initialization.
See Sensor Product page
See The
leJOS sensors framework
See leJOS conventions for
SampleProviders
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
LEGO_EV3_GYRO |
private static java.lang.String |
MODE_ANGLE |
private static java.lang.String |
MODE_RATE |
private static java.lang.String |
MODE_RATE_ANGLE |
currentMode, modes, SWITCH_DELAY
LEGO_ANALOG_SENSOR, LEGO_I2C, LEGO_UART_SENSOR, SENSOR_MODE, SENSOR_MODES
ADDRESS, CURRENT_PLATFORM, DEVICE, ev3DevProperties, LEGO_PORT, LEGO_SENSOR, MODE, PATH_DEVICE
Constructor and Description |
---|
EV3GyroSensor(Port portName) |
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 sensors, Angle mode
Measures the orientation of the sensors 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 sensors and reset off accumulated angle to zero.
|
fetchSample, getAvailableModes, getCurrentMode, getMode, getMode, getModeCount, getName, getSystemMode, sampleSize, setCurrentMode, setCurrentMode, setModes, switchMode
detect, getIntegerAttribute, getStringAttribute, setIntegerAttribute, setStringAttribute
private static final java.lang.String LEGO_EV3_GYRO
private static final java.lang.String MODE_RATE
private static final java.lang.String MODE_ANGLE
private static final java.lang.String MODE_RATE_ANGLE
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 getAngleMode()
Size and content of the sample
The sample contains one elements representing the orientation (in Degrees) of the sensors in respect to its start position.
Configuration
The start position can be set to the current position using the reset method of the sensors.
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()