public class LinearAccelerationHistory extends java.lang.Object implements ISensorDataSubscriber
Modifier and Type | Field and Description |
---|---|
int |
MAX_HISTORY_LENGTH_NUM_SAMPLES |
Constructor and Description |
---|
LinearAccelerationHistory(ISensorInfo linear_accel_sensor,
int history_length_num_samples)
Constructs a LinearAccelerationHistory object with a specified size.
|
Modifier and Type | Method and Description |
---|---|
boolean |
calculate_covariance(Matrix linear_acceleration_matrix)
Calculates the linear acceleration covariances (in units of m/s^2), based
the contents of the LinearAccelerationHistory.
|
boolean |
getCurrentQuaternion(TimestampedValue<LinearAcceleration> out)
Retrieves the most recently added Quaternion.
|
boolean |
getLinearAccelerationAtTime(long requested_timestamp,
TimestampedValue<LinearAcceleration> out)
Retrieves the TimestampedLinearAcceleration at the specified sensor timestamp.
|
void |
publish(IQuantity[] curr_values,
Timestamp sys_timestamp) |
void |
reset(TimestampedValue<LinearAcceleration> linear_accel_curr)
Reset the OrientationHistory, clearing all existing entries.
|
boolean |
writeToDirectory(java.lang.String directory_path) |
boolean |
writeToFile(java.lang.String file_path) |
public final int MAX_HISTORY_LENGTH_NUM_SAMPLES
public LinearAccelerationHistory(ISensorInfo linear_accel_sensor, int history_length_num_samples)
quat_sensor
- - the sensor to acquire TimestampedLinearAcceleration objects from.history_length_seconds
- - the length of the history, in seconds. The actual length of
the history in number of objects is calculated internally by
accessing the sensor's current update rate. Note: if the
sensor update rate is changed, after this constructor is invoked,
the length of the history may no longer accurately reflect the
originally-configured length.linear_accel_sensor
- - the sensor to use as the source of TimestampedLinearAccelerations
contained in the Historyhistory_length_seconds
- - the number of seconds the history will represent. This value
may not be larger than @value
#MAX_HISTORY_LENGTH_NUM_SAMPLES seconds.public void reset(TimestampedValue<LinearAcceleration> linear_accel_curr)
quat_curr
- public boolean getCurrentQuaternion(TimestampedValue<LinearAcceleration> out)
public boolean getLinearAccelerationAtTime(long requested_timestamp, TimestampedValue<LinearAcceleration> out)
requested_timestamp
- - sensor timestamp to retrievepublic void publish(IQuantity[] curr_values, Timestamp sys_timestamp)
publish
in interface ISensorDataSubscriber
public boolean writeToDirectory(java.lang.String directory_path)
public boolean writeToFile(java.lang.String file_path)
public boolean calculate_covariance(Matrix linear_acceleration_matrix)
linear_acceleration_matrix:
- Must have a dimensionality of 3.