public class OrientationHistory extends java.lang.Object implements ISensorDataSubscriber
Modifier and Type | Field and Description |
---|---|
int |
MAX_ORIENTATION_HISTORY_LENGTH_NUM_SAMPLES |
Constructor and Description |
---|
OrientationHistory(ISensorInfo quat_sensor,
int history_length_num_samples)
Constructs an OrientationHistory object with a specified size.
|
Modifier and Type | Method and Description |
---|---|
boolean |
calculate_covariance(Matrix orientation_matrix,
Matrix angular_velocity_matrix)
Calculates the orientation and angular velocity covariances, based upon
the contents of the orientation history..
|
boolean |
getCurrentQuaternion(TimestampedValue<Quaternion> out)
Retrieves the most recently added Quaternion.
|
float |
getPitchDegreesAtTime(long requested_timestamp)
Retrieves the pitch angle in degrees at the specified sensor timestamp.
|
boolean |
getQuaternionAtTime(long requested_timestamp,
TimestampedValue<Quaternion> out)
Retrieves the TimestampedQuaterion at the specified sensor timestamp.
|
float |
getRollDegreesAtTime(long requested_timestamp)
Retrieves the roll angle in degrees at the specified sensor timestamp.
|
float |
getYawDegreesAtTime(long requested_timestamp)
Retrieves the yaw angle in degrees at the specified sensor timestamp.
|
void |
publish(IQuantity[] curr_values,
Timestamp sys_timestamp) |
void |
reset(TimestampedValue<Quaternion> quat_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_ORIENTATION_HISTORY_LENGTH_NUM_SAMPLES
public OrientationHistory(ISensorInfo quat_sensor, int history_length_num_samples)
quat_sensor
- - the sensor to acquire TimestampedQuaternion objects from.history_length_seconds
- - the length of the OrientationHistory, in seconds. The actual
length of the OrientationHistory 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.quat_sensor
- - the sensor to use as the source of TimestampedQuaternions
contained in the Orientation Historyhistory_length_seconds
- - the number of seconds the history will represent. This value
may not be larger than @value
#MAX_ORIENTATION_HISTORY_IN_SECONDS seconds.public void reset(TimestampedValue<Quaternion> quat_curr)
quat_curr
- public boolean getCurrentQuaternion(TimestampedValue<Quaternion> out)
public boolean getQuaternionAtTime(long requested_timestamp, TimestampedValue<Quaternion> out)
requested_timestamp
- - sensor timestamp to retrievepublic float getYawDegreesAtTime(long requested_timestamp)
Note that this value may be interpolated if a sample at the requested time is not available.
requested_timestamp
- public float getPitchDegreesAtTime(long requested_timestamp)
Note that this value may be interpolated if a sample at the requested time is not available.
requested_timestamp
- public float getRollDegreesAtTime(long requested_timestamp)
Note that this value may be interpolated if a sample at the requested time is not available.
requested_timestamp
- public 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 orientation_matrix, Matrix angular_velocity_matrix)
Note that this value may be interpolated if a sample at the requested time is not available.
orientation_matrix:
- Must have a dimensionality of 3. Output units: radians.angular_velocity_matrix:
- Must have a dimensionality of 3. Output units: radians/sec.