public class SensorData
extends java.lang.Object
Position | Description |
---|---|
0 | time [ms] |
1-3 | accelerometer; x, y, z [m/s^2] |
4-6 | gyroscope; x, y, z [rad/s] |
7-9 | magnetometer; x, y, z [uT] |
10-12 | GPS [deg North, deg East, alt m] |
13 | Pressure [hPa] |
14 | Light [lux] |
15 | Proximity [cm] |
16 | Temperature [deg C] |
17-20 | Orientation [normalized quaternion] |
21-26 | Uncalibrated gyroscope; x, y, z, bx, by, bz [rad/s] |
27-32 | Uncalibrated magnetometer; x, y, z, bx, by, bz [uT] |
Modifier and Type | Field and Description |
---|---|
static byte |
DATA_FIELDS_USED |
SensorInfo |
sensorInfo
Type of the measurement in terms of a SensorInfo object.
|
long |
time
Time when the measurement was made [ms]
|
Constructor and Description |
---|
SensorData(SensorInfo sensorInfo,
long time,
float[] values)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static SensorData |
deserialize(byte[] data)
Deserialize a byte[] to a measurement in a SensorData object.
|
long |
getTime()
Timestamp getter.
|
float[] |
getValues()
Measurement values getter.
|
byte[] |
serialize()
Serialize the measurement for streaming or saving to file.
|
public long time
public final SensorInfo sensorInfo
public static final byte DATA_FIELDS_USED
public SensorData(SensorInfo sensorInfo, long time, float[] values)
sensorInfo
- Type of measurement.time
- Timestamp of the measurement [ms].values
- The measurements.public long getTime()
public float[] getValues()
public byte[] serialize()
public static SensorData deserialize(byte[] data)
serialize
.data
- Data to be deserialized.