|
ethzasl-msf - Modular Sensor Fusion
Time delay compensated single and multi sensor fusion framework based on an EKF
|
The core class of the EKF Does propagation of state and covariance but also applying measurements and managing states and measurements in lists sorted by time stamp.
#include <msf_core.h>
Public Types | |
| enum | { nErrorStatesAtCompileTime = EKFState_T::nErrorStatesAtCompileTime, nStatesAtCompileTime = EKFState_T::nStatesAtCompileTime } |
| typedef EKFState_T::StateDefinition_T | StateDefinition_T |
| typedef EKFState_T::StateSequence_T | StateSequence_T |
| typedef Eigen::Matrix< double, nErrorStatesAtCompileTime, 1 > | ErrorState |
| The error state type. | |
| typedef Eigen::Matrix< double, nErrorStatesAtCompileTime, nErrorStatesAtCompileTime > | ErrorStateCov |
| The error state covariance type. | |
| typedef msf_core::SortedContainer < EKFState_T > | StateBuffer_T |
| The type of the state buffer containing all the states. | |
| typedef msf_core::SortedContainer < typename msf_core::MSF_MeasurementBase < EKFState_T >, typename msf_core::MSF_InvalidMeasurement < EKFState_T > > | measurementBufferT |
| The type of the measurement buffer containing all the measurements. | |
Public Member Functions | |
| void | addMeasurement (shared_ptr< MSF_MeasurementBase< EKFState_T > > measurement) |
| Add a sensor measurement or an init measurement to the internal queue and apply it to the state. | |
| void | init (shared_ptr< MSF_MeasurementBase< EKFState_T > > measurement) |
| Initializes the filter with the values of the given measurement, other init values from other sensors can be passed in as "measurement" using the initMeasurement structs. | |
| shared_ptr< EKFState_T > | getClosestState (double tstamp) |
| Finds the closest state to the requested time in the internal state. | |
| void | getAccumF_SC (const shared_ptr< EKFState_T > &state_old, const shared_ptr< EKFState_T > &state_new, Eigen::Matrix< double, nErrorStatesAtCompileTime, nErrorStatesAtCompileTime > &F) |
| Returns the accumulated dynamic matrix between two states. | |
| shared_ptr < msf_core::MSF_MeasurementBase < EKFState_T > > | getPreviousMeasurement (double time, int sensorID) |
| Returns previous measurement of the same type. | |
| shared_ptr< EKFState_T > | getStateAtTime (double tstamp) |
| Finds the state at the requested time in the internal state. | |
| void | predictProcessCovariance (shared_ptr< EKFState_T > &state_old, shared_ptr< EKFState_T > &state_new) |
| Propagates the error state covariance. | |
| void | propagateState (shared_ptr< EKFState_T > &state_old, shared_ptr< EKFState_T > &state_new) |
| Propagates the state with given dt. | |
| void | CleanUpBuffers () |
| Delete very old states and measurements from the buffers to free memory. | |
| void | setPCore (Eigen::Matrix< double, EKFState_T::nErrorStatesAtCompileTime, EKFState_T::nErrorStatesAtCompileTime > &P) |
| sets the covariance matrix of the core states to simulated values. | |
| MSF_Core (const MSF_SensorManager< EKFState_T > &usercalc) | |
| Ctor takes a pointer to an object which does the user defined calculations and provides interfaces for initialization etc. | |
| ~MSF_Core () | |
| const MSF_SensorManager < EKFState_T > & | usercalc () const |
Public Attributes | |
| EIGEN_MAKE_ALIGNED_OPERATOR_NEW | |
Private Types | |
| enum | { indexOfStateWithoutTemporalDrift } |
| Get the index of the best state having no temporal drift at compile time. More... | |
| typedef msf_tmp::getEnumStateType < StateSequence_T, indexOfStateWithoutTemporalDrift > ::value | nonDriftingStateType |
| Returns void type for invalid types. | |
Private Member Functions | |
| bool | applyCorrection (shared_ptr< EKFState_T > &delaystate, ErrorState &correction, double fuzzythres=0.1) |
| Applies the correction. | |
| void | propPToState (shared_ptr< EKFState_T > &state) |
| Propagate covariance to a given state in time. | |
| void | process_imu (const msf_core::Vector3 &linear_acceleration, const msf_core::Vector3 &angular_velocity, const double &msg_stamp, size_t msg_seq) |
| This function gets called on incoming imu messages and then performs the state prediction internally. Only use this OR stateCallback by remapping the topics accordingly. | |
| void | process_extstate (const msf_core::Vector3 &linear_acceleration, const msf_core::Vector3 &angular_velocity, const msf_core::Vector3 &p, const msf_core::Vector3 &v, const msf_core::Quaternion &q, bool is_already_propagated, const double &msg_stamp, size_t msg_seq) |
| External state propagation: | |
| void | propagatePOneStep () |
| Propagates P by one step to distribute processing load. | |
| void | handlePendingMeasurements () |
| Checks the queue of measurements to be applied in the future. | |
Private Attributes | |
| StateBuffer_T | stateBuffer_ |
| EKF buffer containing pretty much all info needed at time t. Sorted by t. | |
| measurementBufferT | MeasurementBuffer_ |
| EKF Measurements and init values sorted by t asc. | |
| std::queue< shared_ptr < MSF_MeasurementBase < EKFState_T > > > | queueFutureMeasurements_ |
| Buffer for measurements to apply in future. | |
| double | time_P_propagated |
| Last time stamp where we have a valid propagation. | |
| StateBuffer_T::iterator_T | it_last_IMU |
| Last time stamp where we have a valid state. | |
| Eigen::Matrix< double, 3, 1 > | g_ |
| Gravity vector. | |
| bool | initialized_ |
| Is the filter initialized, so that we can propagate the state? | |
| bool | predictionMade_ |
| Is there a state prediction, so we can apply measurements? | |
| bool | isfuzzyState_ |
| Was the filter pushed to fuzzy state by a measurement? | |
| CheckFuzzyTracking< EKFState_T, nonDriftingStateType > | fuzzyTracker_ |
| Watch dog to determine fuzzy tracking by observing non temporal drifting. | |
| const MSF_SensorManager < EKFState_T > & | usercalc_ |
| A class which provides methods for customization of several calculations. | |
Friends | |
| class | MSF_MeasurementBase< EKFState_T > |
| class | IMUHandler< EKFState_T > |
| typedef Eigen::Matrix<double, nErrorStatesAtCompileTime, 1> msf_core::MSF_Core< EKFState_T >::ErrorState |
| typedef Eigen::Matrix<double, nErrorStatesAtCompileTime, nErrorStatesAtCompileTime> msf_core::MSF_Core< EKFState_T >::ErrorStateCov |
| typedef msf_core::SortedContainer< typename msf_core::MSF_MeasurementBase<EKFState_T>, typename msf_core::MSF_InvalidMeasurement<EKFState_T> > msf_core::MSF_Core< EKFState_T >::measurementBufferT |
|
private |
| typedef msf_core::SortedContainer<EKFState_T> msf_core::MSF_Core< EKFState_T >::StateBuffer_T |
| typedef EKFState_T::StateDefinition_T msf_core::MSF_Core< EKFState_T >::StateDefinition_T |
| typedef EKFState_T::StateSequence_T msf_core::MSF_Core< EKFState_T >::StateSequence_T |
| anonymous enum |
| msf_core::MSF_Core< EKFState_T >::MSF_Core | ( | const MSF_SensorManager< EKFState_T > & | usercalc | ) |
| usercalc | The class providing the user defined calculations DO ABSOLUTELY NOT USE THIS REFERENCE INSIDE THIS CTOR!! |
| msf_core::MSF_Core< EKFState_T >::~MSF_Core | ( | ) |
| void msf_core::MSF_Core< EKFState_T >::addMeasurement | ( | shared_ptr< MSF_MeasurementBase< EKFState_T > > | measurement | ) |
| Measurement | the measurement to add to the internal measurement queue. |
|
private |
| delaystate | The state to apply the correction on. |
| correction | The correction vector. |
| fuzzythres | The error of the non temporal drifting state allowed before fuzzy tracking will be triggered. |
| void msf_core::MSF_Core< EKFState_T >::CleanUpBuffers | ( | ) |
| void msf_core::MSF_Core< EKFState_T >::getAccumF_SC | ( | const shared_ptr< EKFState_T > & | state_old, |
| const shared_ptr< EKFState_T > & | state_new, | ||
| Eigen::Matrix< double, nErrorStatesAtCompileTime, nErrorStatesAtCompileTime > & | F | ||
| ) |
| shared_ptr< EKFState_T > msf_core::MSF_Core< EKFState_T >::getClosestState | ( | double | tstamp | ) |
| tstamp | The time stamp to find the closest state to. |
| shared_ptr< msf_core::MSF_MeasurementBase< EKFState_T > > msf_core::MSF_Core< EKFState_T >::getPreviousMeasurement | ( | double | time, |
| int | sensorID | ||
| ) |
| shared_ptr< EKFState_T > msf_core::MSF_Core< EKFState_T >::getStateAtTime | ( | double | tstamp | ) |
| tstamp | The time stamp to find the state to. |
|
private |
| void msf_core::MSF_Core< EKFState_T >::init | ( | shared_ptr< MSF_MeasurementBase< EKFState_T > > | measurement | ) |
| Measurement | a measurement containing initial values for the state |
| void msf_core::MSF_Core< EKFState_T >::predictProcessCovariance | ( | shared_ptr< EKFState_T > & | state_old, |
| shared_ptr< EKFState_T > & | state_new | ||
| ) |
| state_old | The state to propagate the covariance from. |
| state_new | The state to propagate the covariance to. |
|
private |
This function gets called when state prediction is performed externally, e.g. by asctec_mav_framework. Msg has to be the latest predicted state. Only use this OR imuCallback by remapping the topics accordingly.
| msg | The state message from the external propagation. |
|
private |
| msg | The imu ros message. |
|
private |
| void msf_core::MSF_Core< EKFState_T >::propagateState | ( | shared_ptr< EKFState_T > & | state_old, |
| shared_ptr< EKFState_T > & | state_new | ||
| ) |
| state_old | The state to propagate from. |
| state_new | The state to propagate to. |
|
private |
| State | the state to propagate to from the last propagated time. |
| void msf_core::MSF_Core< EKFState_T >::setPCore | ( | Eigen::Matrix< double, EKFState_T::nErrorStatesAtCompileTime, EKFState_T::nErrorStatesAtCompileTime > & | P | ) |
| P | the error state covariance Matrix to fill. |
| const MSF_SensorManager< EKFState_T > & msf_core::MSF_Core< EKFState_T >::usercalc | ( | ) | const |
|
friend |
|
friend |
| msf_core::MSF_Core< EKFState_T >::EIGEN_MAKE_ALIGNED_OPERATOR_NEW |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
1.8.1.2