public class DeviceComplementaryFilterOrientation extends DeviceOrientation
DeviceOrientation, DeviceCompassOrientation
,
Serialized FormModifier and Type | Field and Description |
---|---|
static float |
FILTER_COEFICIENT_DEFAULT
filter coeficient default
|
static long |
TIME_SAMPLE_DEFAULT
Delay to update the orientation vector with current samples of sensor values
|
AZIMUTH_INDEX, PITCH_INDEX, ROLL_INDEX, YAW_INDEX
Constructor and Description |
---|
DeviceComplementaryFilterOrientation() |
DeviceComplementaryFilterOrientation(Device device,
float filter_coeficient) |
Modifier and Type | Method and Description |
---|---|
float |
getFilter_coeficient() |
void |
initCalculateTask(long timeSample)
Init the task to calculate the orientation vector
|
void |
sensorManager(ESensorType sensorType,
float[] sample,
long timestampSample,
OrientationSensorListener listener)
Called when sensor values have changed by the listener parameter
|
void |
setFilter_coeficient(float filter_coeficient) |
void |
startFilter(long timeSample)
Init the task to calculate the orientation vector
|
getAzimuth, getOrientation, getPitch, getRoll, getSensors, getYaw, setAzimuth, setOrientation, setPitch, setRoll, setSensors, setYaw
public static final long TIME_SAMPLE_DEFAULT
public static final float FILTER_COEFICIENT_DEFAULT
public DeviceComplementaryFilterOrientation()
public DeviceComplementaryFilterOrientation(Device device, float filter_coeficient)
device
- filter_coeficient
- %public float getFilter_coeficient()
public void setFilter_coeficient(float filter_coeficient)
public void startFilter(long timeSample)
timeSample
- amount of time in milliseconds between subsequent executions.public void initCalculateTask(long timeSample)
timeSample
- amount of time in milliseconds between subsequent executions.public void sensorManager(ESensorType sensorType, float[] sample, long timestampSample, OrientationSensorListener listener)
DeviceOrientation
sensorManager
in class DeviceOrientation
sensorType
- sensor type of SensorManager in Android API 2.2sample
- SensorEvent values in Android API 2.2timestampSample
- SensorEvent timestamp in Android API 2.2