public class Gyroscope extends Sensor implements GyroscopeSensor
simulatedOnly, validLoad| Constructor and Description |
|---|
Gyroscope()
Loads the default connected sensor
|
| Modifier and Type | Method and Description |
|---|---|
double[] |
getGyroscopeData() |
float |
getGyroscopeX() |
float |
getGyroscopeY() |
float |
getGyroscopeZ() |
float |
getPitch() |
float |
getRoll() |
java.lang.String |
getSensorName()
Returns the sensor name, typically the make/model of the hardware sensor that this class refers to.
|
float |
getYaw() |
void |
reloadSimulation()
Override this on any classes you need to do something as a simulated sensor
|
void |
resetToDefault()
Remove all rounding
|
Gyroscope |
setRounding(int resolution)
Set the resolution for all three axis to the number of decimal places
set by resolution.
|
void |
setXRounding(int resolution)
Set the resolution for X axis to the number of decimal places
set by resolution.
|
void |
setYRounding(int resolution)
Set the resolution for Y axis to the number of decimal places
set by resolution.
|
void |
setZRounding(int resolution)
Set the resolution for Z axis to the number of decimal places
set by resolution.
|
addListener, addNonResettableListener, addNonResettableValueChangedListener, addValueChangedListener, clearListeners, getSensor, isSimulatedOnly, isValidLoadedSensor, notifyListeners, removeListener, removeListener, roundValue, scaleValue, setSimulatedOnly, setValidLoad, storeSensorpublic void resetToDefault()
resetToDefault in class Sensorpublic void reloadSimulation()
SensorreloadSimulation in class Sensorpublic Gyroscope setRounding(int resolution)
resolution - the number of decimal places to round to. -1 will be no roundingpublic void setXRounding(int resolution)
resolution - the number of decimal places to round to. -1 will be no roundingpublic void setYRounding(int resolution)
resolution - the number of decimal places to round to. -1 will be no roundingpublic void setZRounding(int resolution)
resolution - the number of decimal places to round to. -1 will be no roundingpublic java.lang.String getSensorName()
SensorgetSensorName in class SensorString representing the sensor's name.public double[] getGyroscopeData()
getGyroscopeData in interface GyroscopeSensorpublic float getGyroscopeX()
getGyroscopeX in interface GyroscopeSensorpublic float getGyroscopeY()
getGyroscopeY in interface GyroscopeSensorpublic float getGyroscopeZ()
getGyroscopeZ in interface GyroscopeSensorpublic float getPitch()
getPitch in interface GyroscopeSensorpublic float getRoll()
getRoll in interface GyroscopeSensorpublic float getYaw()
getYaw in interface GyroscopeSensor