SF2 C++ FRC Class Library
Sensor Fusion Framework (SF2) for FRC
Public Member Functions | List of all members
ISensorDataSource Class Referenceabstract

The ITimestampedQuaternionSensor interface should be implemented by any sensor which generates timestamped Quaternions (e.g., the navX-MXP). More...

#include <ISensorDataSource.h>

Inheritance diagram for ISensorDataSource:
navXSensor

Public Member Functions

virtual bool subscribe (ISensorDataSubscriber *subscriber)=0
 Subscribes the provided subscriber object for callbacks whenever new TimestampedQuaternion data is received by the sensor. More...
 
virtual bool unsubscribe (ISensorDataSubscriber *subscriber)=0
 Unsubscribes the previously-registered subscriber object for callbacks whenever new Sensor Data is received by the sensor. More...
 
virtual bool getCurrent (vector< IQuantity * > &quantities, Timestamp &curr_ts)=0
 Retrieves the most recently-received Sensor Data value. More...
 
virtual bool reset (int quantity_index)=0
 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...
 
virtual void getSensorDataSourceInfos (vector< SensorDataSourceInfo * > &out)=0
 

Detailed Description

The ITimestampedQuaternionSensor interface should be implemented by any sensor which generates timestamped Quaternions (e.g., the navX-MXP).

Author
Scott

Member Function Documentation

virtual bool ISensorDataSource::getCurrent ( vector< IQuantity * > &  quantities,
Timestamp curr_ts 
)
pure virtual

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).

Implemented in navXSensor.

virtual bool ISensorDataSource::reset ( int  quantity_index)
pure virtual

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

Implemented in navXSensor.

virtual bool ISensorDataSource::subscribe ( ISensorDataSubscriber subscriber)
pure virtual

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.

Implemented in navXSensor.

virtual bool ISensorDataSource::unsubscribe ( ISensorDataSubscriber subscriber)
pure virtual

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.

Implemented in navXSensor.


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