29 return 9 + 3 *
static_cast<int>(foot);
50 Matrix36 prediction_H_pose;
51 const Pose3 pose(state.
rotation(), state.
x(0));
52 const Point3 foothold = state.
x(footColumn);
53 const Vector3 prediction = pose.transformTo(foothold, prediction_H_pose);
56 H->setZero(3,
static_cast<Eigen::Index
>(state.
dim()));
57 H->block(0, 0, 3, 6) = prediction_H_pose;
59 H->block(0, start, 3, 3) = I_3x3;
76 : Base(model,
key), footColumn_(footColumn), measurement_(measurement) {}
79 NonlinearFactor::shared_ptr
clone()
const override {
80 return std::static_pointer_cast<NonlinearFactor>(
87 const Vector3 prediction =
90 return prediction - measurement_;
109 footColumn_(footColumn),
110 terrainHeight_(terrainHeight) {}
113 NonlinearFactor::shared_ptr
clone()
const override {
114 return std::static_pointer_cast<NonlinearFactor>(
122 H->setZero(1,
static_cast<Eigen::Index
>(state.
dim()));
125 H->block(0, start, 1, 3) = R.row(2);
128 return Vector1(state.
x(footColumn_).z() - terrainHeight_);
133 double terrainHeight_;
146 const Point3& measurement,
148 : Base(model, navKey, pointKey), measurement_(measurement) {}
151 NonlinearFactor::shared_ptr
clone()
const override {
152 return std::static_pointer_cast<NonlinearFactor>(
160 Matrix36 prediction_H_pose;
161 Matrix3 prediction_H_foothold;
162 const Vector3 prediction = navState.pose().
transformTo(
163 foothold, prediction_H_pose, prediction_H_foothold);
167 H1->block(0, 0, 3, 6) = prediction_H_pose;
170 *H2 = prediction_H_foothold;
173 return prediction - measurement_;
191 : Base(model, poseKey, pointKey), measurement_(measurement) {}
194 NonlinearFactor::shared_ptr
clone()
const override {
195 return std::static_pointer_cast<NonlinearFactor>(
203 return pose.
transformTo(foothold, H1, H2) - measurement_;
220 : Base(model,
key), terrainHeight_(terrainHeight) {}
223 NonlinearFactor::shared_ptr
clone()
const override {
224 return std::static_pointer_cast<NonlinearFactor>(
233 *H = Matrix13{{0.0, 0.0, 1.0}};
235 return Vector1(foothold.z() - terrainHeight_);
239 double terrainHeight_;
typedef and functions to augment Eigen's MatrixXd
Macros for Matrix constants to avoid excessive template instantiation.
Base class for noise model factors with N variables.
Global functions in a separate testing namespace.
Definition chartTesting.h:28
int leggedFootBlockStart(size_t foot)
Return the tangent-space start index of a foot block.
Definition LeggedEstimatorFactors.h:28
Matrix * OptionalMatrixType
This typedef will be used everywhere boost::optional<Matrix&> reference was used previously.
Definition NonlinearFactor.h:57
NoiseModelFactorT< Vector, ValueTypes... > NoiseModelFactorN
Noise model factor with N value types and dynamic-sized error vector.
Definition NoiseModelFactorN.h:561
Vector3 Point3
As of GTSAM 4, in order to make GTSAM more lean, it is now possible to just typedef Point3 to Vector3...
Definition Point3.h:38
noiseModel::Base::shared_ptr SharedNoiseModel
Aliases.
Definition NoiseModel.h:846
Vector3 extendedPoseContactPrediction(const ExtendedPose3d &state, size_t footColumn, OptionalMatrixType H={})
Predict the IMU-frame contact vector for an ExtendedPose3 state.
Definition LeggedEstimatorFactors.h:47
std::uint64_t Key
Integer nonlinear key type.
Definition types.h:43
size_t dim() const
Definition ExtendedPose3.h:166
Point3 x(size_t i, ComponentJacobian H={}) const
i-th R^3 component, returned by value.
Definition ExtendedPose3-inl.h:89
const Rot3 & rotation(ComponentJacobian H={}) const
Rotation component.
Definition ExtendedPose3-inl.h:76
A 3D pose (R,t) : (Rot3,Point3).
Definition Pose3.h:42
Point3 transformTo(const Point3 &point, OptionalJacobian< 3, 6 > Hself={}, OptionalJacobian< 3, 3 > Hpoint={}) const
takes point in world coordinates and transforms it to Pose coordinates
Definition Pose3.cpp:204
Matrix3 matrix() const
return 3*3 rotation matrix
Definition Rot3M.cpp:261
Vector evaluateError(const ExtendedPose3d &state, OptionalMatrixType H) const override
Evaluate the contact residual and optional Jacobian.
Definition LeggedEstimatorFactors.h:85
NonlinearFactor::shared_ptr clone() const override
Return a deep copy.
Definition LeggedEstimatorFactors.h:79
ExtendedPoseContactFactor(Key key, size_t footColumn, const Point3 &measurement, const SharedNoiseModel &model)
Construct from a state key, foot column, and IMU-frame measurement.
Definition LeggedEstimatorFactors.h:73
Vector evaluateError(const ExtendedPose3d &state, OptionalMatrixType H) const override
Evaluate the height residual and optional Jacobian.
Definition LeggedEstimatorFactors.h:119
NonlinearFactor::shared_ptr clone() const override
Return a deep copy.
Definition LeggedEstimatorFactors.h:113
ExtendedPoseHeightFactor(Key key, size_t footColumn, double terrainHeight, const SharedNoiseModel &model)
Construct from a state key, foot column, and terrain height.
Definition LeggedEstimatorFactors.h:106
NonlinearFactor::shared_ptr clone() const override
Return a deep copy.
Definition LeggedEstimatorFactors.h:151
NavStatePointContactFactor(Key navKey, Key pointKey, const Point3 &measurement, const SharedNoiseModel &model)
Construct from a NavState key, foothold key, and IMU-frame measurement.
Definition LeggedEstimatorFactors.h:145
Vector3 evaluateError(const NavState &navState, const Point3 &foothold, OptionalMatrixType H1, OptionalMatrixType H2) const override
Evaluate the contact residual and optional Jacobians.
Definition LeggedEstimatorFactors.h:157
NonlinearFactor::shared_ptr clone() const override
Return a deep copy.
Definition LeggedEstimatorFactors.h:194
Pose3PointContactFactor(Key poseKey, Key pointKey, const Point3 &measurement, const SharedNoiseModel &model)
Construct from a Pose3 key, foothold key, and IMU-frame measurement.
Definition LeggedEstimatorFactors.h:189
Vector3 evaluateError(const Pose3 &pose, const Point3 &foothold, OptionalMatrixType H1, OptionalMatrixType H2) const override
Evaluate the contact residual and optional Jacobians.
Definition LeggedEstimatorFactors.h:200
Vector evaluateError(const Point3 &foothold, OptionalMatrixType H) const override
Evaluate the height residual and optional Jacobian.
Definition LeggedEstimatorFactors.h:229
NonlinearFactor::shared_ptr clone() const override
Return a deep copy.
Definition LeggedEstimatorFactors.h:223
PointHeightFactor(Key key, double terrainHeight, const SharedNoiseModel &model)
Construct from a foothold key and terrain height.
Definition LeggedEstimatorFactors.h:218
Navigation state: Pose (rotation, translation) + velocity Following Barrau20icra, this class belongs ...
Definition NavState.h:45
NoiseModelFactorT()
Definition NoiseModelFactorN.h:257
virtual Vector evaluateError(const ValueTypes &... x, OptionalMatrixTypeT< ValueTypes >... H) const=0
Key key() const
Definition NoiseModelFactorN.h:307