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>());
79 ret << a().stateVector(),
b().stateVector();
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>
130 typename std::remove_const<StateB>::type>;
133 template <
typename StateA,
typename StateB>
142 #endif // INCLUDED_AugmentedState_h_GUID_7A7BD6AE_F672_4096_679B_D5BB21D42445 typename detail::Dimension_impl< T >::type Dimension
Given a state or measurement, get the dimension as a std::integral_constant.
Definition: FlexibleKalmanBase.h:87
StateTypeA const & a() const
Access the first part of the state.
Definition: AugmentedState.h:113
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
AugmentedState(AugmentedState &&other)
Move constructor.
Definition: AugmentedState.h:62
AugmentedState(StateA &a, StateB &b)
Constructor.
Definition: AugmentedState.h:56
State type that consists entirely of references to two independent sub-states.
Definition: AugmentedState.h:41
void setStateVector(Eigen::MatrixBase< Derived > const &state)
Definition: AugmentedState.h:70
StateTypeB const & b() const
Access the second part of the state.
Definition: AugmentedState.h:118
StateTypeB & b()
Access the second part of the state.
Definition: AugmentedState.h:116
void setErrorCovariance(Eigen::MatrixBase< Derived > const &P)
Definition: AugmentedState.h:92
AugmentedState & operator=(AugmentedState const &other)=delete
non-assignable
std::size_t DimensionType
Type for dimensions.
Definition: FlexibleKalmanBase.h:51
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:127
DeducedAugmentedState< StateA, StateB > makeAugmentedState(StateA &a, StateB &b)
Factory function, akin to std::tie(), to make an augmented state.
Definition: AugmentedState.h:134
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:48