25 #ifndef INCLUDED_AugmentedState_h_GUID_7A7BD6AE_F672_4096_679B_D5BB21D42445
26 #define INCLUDED_AugmentedState_h_GUID_7A7BD6AE_F672_4096_679B_D5BB21D42445
35 #include <type_traits>
43 using StateTypeA = StateA;
44 using StateTypeB = StateB;
69 template <
typename Derived>
72 EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Derived, DIMENSION);
73 a().setStateVector(state.derived().template head<DIM_A>());
74 b().setStateVector(state.derived().template tail<DIM_B>());
77 StateVector stateVector()
const {
79 ret << a().stateVector(),
b().stateVector();
83 SquareMatrix errorCovariance()
const {
84 SquareMatrix ret = SquareMatrix::Zero();
85 ret.template topLeftCorner<DIM_A, DIM_A>() = a().errorCovariance();
86 ret.template bottomRightCorner<DIM_B, DIM_B>() =
87 b().errorCovariance();
91 template <
typename Derived>
95 EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(Derived, DIMENSION,
97 a().setErrorCovariance(P.template topLeftCorner<DIM_A, DIM_A>());
98 b().setErrorCovariance(
99 P.template bottomRightCorner<DIM_B, DIM_B>());
111 StateTypeA &a() {
return a_; }
113 StateTypeA
const &
a()
const {
return a_; }
116 StateTypeB &
b() {
return b_; }
118 StateTypeB
const &
b()
const {
return b_; }
127 template <
typename StateA,
typename StateB>
129 AugmentedState<typename std::remove_const<StateA>::type,
130 typename std::remove_const<StateB>::type>;
133 template <
typename StateA,
typename StateB>
142 #endif // INCLUDED_AugmentedState_h_GUID_7A7BD6AE_F672_4096_679B_D5BB21D42445
Eigen::Matrix< Scalar, n, 1 > Vector
A vector of length n.
StateTypeB const & b() const
Access the second part of the state.
typename detail::Dimension_impl< T >::type Dimension
Eigen::Matrix< Scalar, n, n > SquareMatrix
A square matrix, n x n.
The main namespace for all C++ elements of the framework, internal and external.
AugmentedState< typename std::remove_const< StateA >::type, typename std::remove_const< StateB >::type > DeducedAugmentedState
AugmentedState(AugmentedState &&other)
Move constructor.
AugmentedState(StateA &a, StateB &b)
Constructor.
StateTypeA const & a() const
Access the first part of the state.
void setStateVector(Eigen::MatrixBase< Derived > const &state)
StateTypeB & b()
Access the second part of the state.
void setErrorCovariance(Eigen::MatrixBase< Derived > const &P)
AugmentedState & operator=(AugmentedState const &other)=delete
non-assignable
std::size_t DimensionType
Type for dimensions.
DeducedAugmentedState< StateA, StateB > makeAugmentedState(StateA &a, StateB &b)
Factory function, akin to std::tie(), to make an augmented state.