ethzasl-msf - Modular Sensor Fusion
Time delay compensated single and multi sensor fusion framework based on an EKF
|
The state vector containing all the state variables for this EKF configuration.
#include <msf_state.h>
Public Types | |
enum | { nStateVarsAtCompileTime, nErrorStatesAtCompileTime, nStatesAtCompileTime, nCoreStatesAtCompileTime, nPropagatedCoreStatesAtCompileTime, nPropagatedCoreErrorStatesAtCompileTime } |
typedef StateSeq_T | StateSequence_T |
The state vector defining the state variables of this EKF. | |
typedef StateDef_T | StateDefinition_T |
typedef Eigen::Matrix< double, nErrorStatesAtCompileTime, nErrorStatesAtCompileTime > | P_type |
Type of the error state. | |
typedef P_type | F_type |
typedef P_type | Q_type |
Public Member Functions | |
GenericState_T () | |
void | correct (const Eigen::Matrix< double, nErrorStatesAtCompileTime, 1 > &correction) |
Apply the correction vector to all state vars. | |
template<int INDEX> | |
msf_tmp::StripReference < typename boost::fusion::result_of::at_c < StateSequence_T, INDEX > ::type >::result_t::Q_T & | getQBlock () |
Returns the Q-block of the state at position INDEX in the state list, not allowed for core states. | |
template<int INDEX> | |
const msf_tmp::StripReference < typename boost::fusion::result_of::at_c < StateSequence_T, INDEX > ::type >::result_t::Q_T & | getQBlock () const |
Returns the Q-block of the state at position INDEX in the state list, also possible for core states, since const. | |
void | reset (msf_core::StateVisitor< GenericState_T< StateSequence_T, StateDefinition_T > > *usercalc=nullptr) |
Reset the state 3D vectors: 0; quaternion: unit quaternion; scale: 1; time:0; Error covariance: zeros. | |
void | getPoseCovariance (geometry_msgs::PoseWithCovariance::_covariance_type &cov) |
Write the covariance corresponding to position and attitude to cov. | |
void | toPoseMsg (geometry_msgs::PoseWithCovarianceStamped &pose) |
Assembles a PoseWithCovarianceStamped message from the state. | |
void | toExtStateMsg (sensor_fusion_comm::ExtState &state) |
Assemble an ExtState message from the state. | |
void | toFullStateMsg (sensor_fusion_comm::DoubleArrayStamped &state) |
Assembles a DoubleArrayStamped message from the state. | |
void | toCoreStateMsg (sensor_fusion_comm::DoubleArrayStamped &state) |
Assembles a DoubleArrayStamped message from the state. | |
Eigen::Matrix< double, nCoreStatesAtCompileTime, 1 > | toEigenVector () |
Returns all values as an eigen vector. | |
void | calculateIndicesInErrorState (std::vector< std::tuple< int, int, int > > &vec) |
std::string | print () |
Returns a string describing the state. | |
bool | checkStateForNumeric () |
Returns whether the state is sane. No NaN no inf. | |
template<int INDEX> | |
const msf_tmp::StripReference < typename boost::fusion::result_of::at_c < StateSequence_T, INDEX > ::type >::result_t::value_t & | get () const |
Returns the state at position INDEX in the state list, const version. | |
template<int INDEX> | |
msf_tmp::AddConstReference < typename boost::fusion::result_of::at_c < StateSequence_T, INDEX > ::type >::result_t | getStateVar () const |
Returns the stateVar at position INDEX in the state list, const version. | |
template<int INDEX> | |
void | set (const typename msf_tmp::StripConstReference< typename boost::fusion::result_of::at_c< StateSequence_T, INDEX >::type >::result_t::value_t &newvalue) |
Sets state at position INDEX in the state list, fails for core states at compile time. | |
template<int INDEX> | |
void | clearCrossCov () |
template<int INDEX> | |
void | set (const typename msf_tmp::StripConstReference< typename boost::fusion::result_of::at_c< stateVector_T, INDEX >::type >::result_t::value_t &newvalue) |
Public Attributes | |
StateSequence_T | statevars |
The actual state variables. | |
Eigen::Matrix< double, 3, 1 > | w_m |
Angular velocity from IMU. | |
Eigen::Matrix< double, 3, 1 > | a_m |
Linear acceleration from IMU. | |
double | time |
Time of this state estimate. | |
P_type | P |
Error state covariance. | |
F_type | Fd |
Discrete state propagation matrix. | |
Q_type | Qd |
Discrete propagation noise matrix. |
Private Member Functions | |
template<int INDEX> | |
boost::fusion::result_of::at_c < StateSequence_T, INDEX > ::type | getStateVar () |
Returns the stateVar at position INDEX in the state list. Non const version only for msf_core use. You must not make these functions public. Instead const_cast the state object to const to use the overload. | |
template<int INDEX> | |
msf_tmp::StripReference < typename boost::fusion::result_of::at_c < StateSequence_T, INDEX > ::type >::result_t::value_t & | get () |
Returns the state at position INDEX in the state list, non const version. You must not make these functions public. Instead const_cast the state object to const to use the overload. |
typedef P_type msf_core::GenericState_T< StateSeq_T, StateDef_T >::F_type |
typedef Eigen::Matrix<double, nErrorStatesAtCompileTime, nErrorStatesAtCompileTime> msf_core::GenericState_T< StateSeq_T, StateDef_T >::P_type |
typedef P_type msf_core::GenericState_T< StateSeq_T, StateDef_T >::Q_type |
typedef StateDef_T msf_core::GenericState_T< StateSeq_T, StateDef_T >::StateDefinition_T |
typedef StateSeq_T msf_core::GenericState_T< StateSeq_T, StateDef_T >::StateSequence_T |
The enums of the state variables.
anonymous enum |
|
inline |
void msf_core::GenericState_T< stateVector_T, StateDefinition_T >::calculateIndicesInErrorState | ( | std::vector< std::tuple< int, int, int > > & | vec | ) |
Returns a vector of int pairs with enum index in errorstate and numblocks.
bool msf_core::GenericState_T< stateVector_T, StateDefinition_T >::checkStateForNumeric | ( | ) |
|
inline |
|
inline |
|
inlineprivate |
|
inline |
void msf_core::GenericState_T< stateVector_T, StateDefinition_T >::getPoseCovariance | ( | geometry_msgs::PoseWithCovariance::_covariance_type & | cov | ) |
Writes the covariance corresponding to position and attitude to cov.
|
inline |
|
inline |
|
inlineprivate |
|
inline |
std::string msf_core::GenericState_T< stateVector_T, StateDefinition_T >::print | ( | ) |
void msf_core::GenericState_T< stateVector_T, StateDefinition_T >::reset | ( | msf_core::StateVisitor< GenericState_T< StateSequence_T, StateDefinition_T > > * | usercalc = nullptr | ) |
Resets the state.
3D vectors: 0; quaternion: unit quaternion; scale: 1; time:0; Error covariance: zeros
|
inline |
|
inline |
void msf_core::GenericState_T< stateVector_T, StateDefinition_T >::toCoreStateMsg | ( | sensor_fusion_comm::DoubleArrayStamped & | state | ) |
it does not set the header
Eigen::Matrix< double, GenericState_T< stateVector_T, StateDefinition_T >::nCoreStatesAtCompileTime, 1 > msf_core::GenericState_T< stateVector_T, StateDefinition_T >::toEigenVector | ( | ) |
void msf_core::GenericState_T< stateVector_T, StateDefinition_T >::toExtStateMsg | ( | sensor_fusion_comm::ExtState & | state | ) |
Assembles an ExtState message from the state.
it does not set the header
void msf_core::GenericState_T< stateVector_T, StateDefinition_T >::toFullStateMsg | ( | sensor_fusion_comm::DoubleArrayStamped & | state | ) |
it does not set the header
void msf_core::GenericState_T< stateVector_T, StateDefinition_T >::toPoseMsg | ( | geometry_msgs::PoseWithCovarianceStamped & | pose | ) |
it does not set the header
|
friend |
|
friend |
|
friend |
Eigen::Matrix<double, 3, 1> msf_core::GenericState_T< StateSeq_T, StateDef_T >::a_m |
F_type msf_core::GenericState_T< StateSeq_T, StateDef_T >::Fd |
P_type msf_core::GenericState_T< StateSeq_T, StateDef_T >::P |
Q_type msf_core::GenericState_T< StateSeq_T, StateDef_T >::Qd |
StateSequence_T msf_core::GenericState_T< StateSeq_T, StateDef_T >::statevars |
double msf_core::GenericState_T< StateSeq_T, StateDef_T >::time |
Eigen::Matrix<double, 3, 1> msf_core::GenericState_T< StateSeq_T, StateDef_T >::w_m |