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, storeSensor
public void resetToDefault()
resetToDefault
in class Sensor
public void reloadSimulation()
Sensor
reloadSimulation
in class Sensor
public 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()
Sensor
getSensorName
in class Sensor
String
representing the sensor's name.public double[] getGyroscopeData()
getGyroscopeData
in interface GyroscopeSensor
public float getGyroscopeX()
getGyroscopeX
in interface GyroscopeSensor
public float getGyroscopeY()
getGyroscopeY
in interface GyroscopeSensor
public float getGyroscopeZ()
getGyroscopeZ
in interface GyroscopeSensor
public float getPitch()
getPitch
in interface GyroscopeSensor
public float getRoll()
getRoll
in interface GyroscopeSensor
public float getYaw()
getYaw
in interface GyroscopeSensor