SF2 C++ FRC Class Library
Sensor Fusion Framework (SF2) for FRC
Public Member Functions | Static Public Attributes | List of all members
navXSensor Class Reference
Inheritance diagram for navXSensor:
ISensorDataSource ISensorInfo

Public Member Functions

 navXSensor (AHRS *navx_sensor, string sensor_name)
 
bool subscribe (ISensorDataSubscriber *subscriber)
 Subscribes the provided subscriber object for callbacks whenever new TimestampedQuaternion data is received by the sensor. More...
 
bool unsubscribe (ISensorDataSubscriber *subscriber)
 Unsubscribes the previously-registered subscriber object for callbacks whenever new Sensor Data is received by the sensor. More...
 
void timestampedDataReceived (long system_timestamp, long sensor_timestamp, AHRSProtocol::AHRSUpdateBase &data, void *context)
 
IProcessorInfogetHostProcessorInfo ()
 
string getMake ()
 
string getModel ()
 
string getName ()
 
void getSensorDataSourceInfos (vector< SensorDataSourceInfo * > &infos)
 
bool getCurrent (vector< IQuantity * > &quantities, Timestamp &curr_ts)
 Retrieves the most recently-received Sensor Data value. More...
 
ISensorDataSourcegetSensorDataSource ()
 
TimestampInfogetSensorTimestampInfo ()
 
bool reset (int index)
 For those quantities which can be reset to their default (e.g., an IMU Yaw, or an encoder counter), this method will cause the reset to occur. More...
 

Static Public Attributes

static const int QUANTITY_INDEX_QUATERNION = 0
 
static const int QUANTITY_INDEX_YAW = 1
 
static const int QUANTITY_INDEX_PITCH = 2
 
static const int QUANTITY_INDEX_ROLL = 3
 

Member Function Documentation

bool navXSensor::getCurrent ( vector< IQuantity * > &  quantities,
Timestamp curr_ts 
)
inlinevirtual

Retrieves the most recently-received Sensor Data value.

Parameters
tq
Returns
true if valid Sensor was received. false if data is invalid (e.g., the sensor is no longer connected).

Implements ISensorDataSource.

bool navXSensor::reset ( int  quantity_index)
inlinevirtual

For those quantities which can be reset to their default (e.g., an IMU Yaw, or an encoder counter), this method will cause the reset to occur.

If the quantity is reset successful, true is returned. If the quantity could not be reset, or if the quantity does not support resetting, false is returned.

Parameters
quantity_index
Returns

Implements ISensorDataSource.

bool navXSensor::subscribe ( ISensorDataSubscriber subscriber)
inlinevirtual

Subscribes the provided subscriber object for callbacks whenever new TimestampedQuaternion data is received by the sensor.

Parameters
subscriber- object implementing the ISensorDataSubscriber<T> interface which will be called back whenever new data arrives.
Returns
true if registration was successful; false otherwise.

Implements ISensorDataSource.

bool navXSensor::unsubscribe ( ISensorDataSubscriber subscriber)
inlinevirtual

Unsubscribes the previously-registered subscriber object for callbacks whenever new Sensor Data is received by the sensor.

The subscriber should have been previously registered for callbacks via the subscribe() method.

Parameters
subscriber- object implementing the ISensorDataSubscriber<T> interface, which up success will no longer be called back whenever new data arrives.
Returns
true if unsubscription was successful; false otherwise.

Implements ISensorDataSource.


The documentation for this class was generated from the following file: