13 #error "This header is C++-only." 17 #include <Eigen/Geometry> 19 #include "flexkalman/AugmentedProcessModel.h" 20 #include "flexkalman/AugmentedState.h" 21 #include "flexkalman/BaseTypes.h" 22 #include "flexkalman/PoseState.h" 26 namespace types = flexkalman::types;
27 using flexkalman::types::Vector;
31 template <
typename State>
33 :
public flexkalman::MeasurementBase<WorldDirectionMeasurement<State>>
36 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
41 types::Vector<3>
const &reference,
42 types::Vector<3>
const &variance)
43 : direction_(direction.normalized()),
44 reference_(reference.normalized()),
45 covariance_(variance.asDiagonal())
57 return s.getCombinedQuaternion() * reference_;
64 return predictedMeasurement - reference_;
74 types::Vector<3> direction_;
75 types::Vector<3> reference_;
81 class LinAccelWithGravityMeasurement
82 :
public flexkalman::MeasurementBase<LinAccelWithGravityMeasurement>
85 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
89 LinAccelWithGravityMeasurement(types::Vector<3>
const &direction,
90 types::Vector<3>
const &reference,
91 types::Vector<3>
const &variance)
92 : direction_(direction), reference_(reference),
93 covariance_(variance.asDiagonal())
113 State const &s)
const 115 s.getQuaternion().conjugate() *
116 predictedMeasurement
return predictedMeasurement -
117 reference_.normalized();
120 template <
typename State>
125 direction_ - reference_ * s.getQuaternion();
130 types::Vector<3> direction_;
131 types::Vector<3> reference_;
137 :
public flexkalman::MeasurementBase<BiasedGyroMeasurement>
140 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
145 types::Vector<3>
const &variance)
146 : angVel_(angVel), covariance_(variance.asDiagonal())
149 template <
typename State>
156 template <
typename State>
160 return s.b().stateVector() + angVel_;
163 template <
typename State>
166 State const &s)
const 168 return predictedMeasurement - s.a().angularVelocity();
171 template <
typename State>
179 types::Vector<3> angVel_;
187 :
public flexkalman::MeasurementBase<AbsolutePositionLeverArmMeasurement>
190 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
206 : measurement_(measurement),
207 knownLocationInBodySpace_(knownLocationInBodySpace),
208 covariance_(variance.asDiagonal())
220 return s.getIsometry() * knownLocationInBodySpace_;
225 State const & )
const 227 return measurement_ - predictedMeasurement;
types::Vector< 3 > predictMeasurement(State const &s) const
Definition: t_fusion.hpp:158
MeasurementSquareMatrix const & getCovariance(State const &)
Definition: t_fusion.hpp:212
types::SquareMatrix< Dimension > MeasurementSquareMatrix
Definition: t_fusion.hpp:39
MeasurementVector getResidual(State const &s) const
Definition: t_fusion.hpp:68
types::Vector< Dimension > MeasurementVector
Definition: t_fusion.hpp:193
For PS Move-like things, where there's a directly-computed absolute position that is not at the track...
Definition: t_fusion.hpp:186
MeasurementVector getResidual(MeasurementVector const &predictedMeasurement, State const &) const
Definition: t_fusion.hpp:224
MeasurementVector getResidual(State const &s) const
Definition: t_fusion.hpp:231
types::SquareMatrix< Dimension > MeasurementSquareMatrix
Definition: t_fusion.hpp:194
MeasurementSquareMatrix const & getCovariance(State const &)
Definition: t_fusion.hpp:151
WorldDirectionMeasurement(types::Vector< 3 > const &direction, types::Vector< 3 > const &reference, types::Vector< 3 > const &variance)
Definition: t_fusion.hpp:40
For things like accelerometers, which on some level measure the local vector of a world direction...
Definition: t_fusion.hpp:32
types::Vector< Dimension > MeasurementVector
Definition: t_fusion.hpp:142
MeasurementVector getResidual(MeasurementVector const &predictedMeasurement, State const &s) const
Definition: t_fusion.hpp:165
types::Vector< 3 > predictMeasurement(State const &s) const
Definition: t_fusion.hpp:55
types::Vector< 3 > predictMeasurement(State const &s) const
Definition: t_fusion.hpp:218
MeasurementSquareMatrix const & getCovariance(State const &)
Definition: t_fusion.hpp:49
AbsolutePositionLeverArmMeasurement(MeasurementVector const &measurement, MeasurementVector const &knownLocationInBodySpace, MeasurementVector const &variance)
Definition: t_fusion.hpp:202
flexkalman::pose_externalized_rotation::State State
Definition: t_fusion.hpp:191
MeasurementVector getResidual(State const &s) const
Definition: t_fusion.hpp:173
types::Vector< Dimension > MeasurementVector
Definition: t_fusion.hpp:38
BiasedGyroMeasurement(types::Vector< 3 > const &angVel, types::Vector< 3 > const &variance)
Definition: t_fusion.hpp:144
flexkalman::pose_externalized_rotation::State State
Definition: t_tracker_psmv_fusion.cpp:31
Definition: t_fusion.hpp:25
Definition: t_fusion.hpp:136
static EIGEN_MAKE_ALIGNED_OPERATOR_NEW constexpr size_t Dimension
Definition: t_fusion.hpp:37
MeasurementVector getResidual(MeasurementVector const &predictedMeasurement, State const &s) const
Definition: t_fusion.hpp:61
types::SquareMatrix< Dimension > MeasurementSquareMatrix
Definition: t_fusion.hpp:143