33 struct InputWaiko :
public InputBase
37 Vector3 pos_meas_from_contacts_ = Vector3::Zero();
38 std::vector<Vector3> pos_meas_;
39 std::vector<Vector3> jacobians_;
40 std::vector<double> lambdas_;
44 : dt_(dt), yv_(yv), ya_(ya), yg_(yg)
57 std::optional<ContactPosInput> contact_pos_input_;
59 std::vector<Vector3> pos_inputs_;
61 std::vector<Matrix3> ori_inputs_;
64 inline static constexpr Index sizeX1 = 3;
65 inline static constexpr Index sizeX2 = 3;
66 inline static constexpr Index sizeOri = 4;
67 inline static constexpr Index sizePos = 3;
69 inline static constexpr Index sizeX1Tangent = 3;
70 inline static constexpr Index sizeX2Tangent = 3;
71 inline static constexpr Index sizeOriTangent = 3;
72 inline static constexpr Index sizePosTangent = 3;
74 inline static constexpr Index x1Index = 0;
75 inline static constexpr Index x2Index = sizeX1;
76 inline static constexpr Index posIndex = x2Index + sizeX2;
78 inline static constexpr Index x1IndexTangent = 0;
79 inline static constexpr Index x2IndexTangent = sizeX1Tangent;
80 inline static constexpr Index oriIndexTangent = x2IndexTangent + sizeX2Tangent;
81 inline static constexpr Index posIndexTangent = oriIndexTangent + sizeOriTangent;
95 WaikoHumanoid(
double alpha,
double beta,
double gamma,
double rho,
double mu,
double psi = 0.0);
122 const Vector3 & imuAnchorLinVel,
126 bool resetImuLocVelHat =
false);
142 bool resetImuLocVelHat =
false);
146 void addOriInput(
const Matrix3 & oriInput, TimeIndex k);
147 void addPoseInput(
const Matrix3 & oriInput,
const Vector3 & posInput, TimeIndex k);
220 void setWithOriCorrectFromContactPos(
bool withCorrection)
222 withOriCorrectFromContactPos_ = withCorrection;
224 bool getWithOriCorrectFromContactPos()
226 return withOriCorrectFromContactPos_;
229 const Eigen::VectorBlock<ObserverBase::StateVector, sizeX1> getEstimatedLocLinVel()
231 return x_().segment<sizeX1>(x1Index);
233 const Eigen::VectorBlock<ObserverBase::StateVector, sizeX2> getEstimatedTilt()
235 return x_().segment<sizeX2>(x2Index);
237 Matrix3 getEstimatedOrientation()
const
239 return state_ori_.toMatrix3();
241 const Eigen::VectorBlock<ObserverBase::StateVector, sizePos> getEstimatedLocPosition()
243 return x_().segment<sizePos>(posIndex);
245 Vector3 getEstimatedWorldPosition()
247 return positionAnchor_ + state_ori_.toMatrix3() * x_().segment<sizePos>(posIndex);
249 const Vector3 & getPositionAnchor()
const
251 return positionAnchor_;
253 void resetPositionAnchor(
const Vector3 & newPositionAnchor);
254 double getLastPositionAnchorResetJump()
const
256 return lastPositionAnchorResetJump_;
258 double getLastPositionAnchorResetLocalNormBefore()
const
260 return lastPositionAnchorResetLocalNormBefore_;
262 double getLastPositionAnchorResetLocalNormAfter()
const
264 return lastPositionAnchorResetLocalNormAfter_;
266 std::size_t getPositionAnchorResetCount()
const
268 return positionAnchorResetCount_;
275 return posCorrFromContactPos_;
281 return oriCorrFromContactPos_;
287 return oriCorrFromOriMeas_;
312 void startNewIteration_();
324 double alpha_, beta_, gamma_, rho_, mu_, psi_;
327 Vector3 positionAnchor_ = Vector3::Zero();
328 double lastPositionAnchorResetJump_ = 0.0;
329 double lastPositionAnchorResetLocalNormBefore_ = 0.0;
330 double lastPositionAnchorResetLocalNormAfter_ = 0.0;
331 std::size_t positionAnchorResetCount_ = 0;
335 Vector3 oriCorrFromOriMeas_ = Vector3::Zero();
338 Vector3 posCorrFromContactPos_ = Vector3::Zero();
341 Vector3 oriCorrFromContactPos_ = Vector3::Zero();
343 bool withOriCorrectFromContactPos_ =
false;
void setInput(double dt, const Vector3 &imuAnchorPos, const Vector3 &imuAnchorLinVel, const Vector3 &ya_k, const Vector3 &yg_k, TimeIndex k, bool resetImuLocVelHat=false)
sets the input
Implements integrators for the kinematics, in terms or rotations and translations.