34 Pendulum::Pendulum(
const Eigen::Vector3d & com,
const Eigen::Vector3d & comd,
const Eigen::Vector3d & comdd)
36 reset(com, comd, comdd);
41 constexpr
double DEFAULT_HEIGHT = 0.8;
46 comddd_ = Eigen::Vector3d::Zero();
47 omega_ = std::sqrt(DEFAULT_LAMBDA);
54 Eigen::Vector3d com_prev =
com_;
55 Eigen::Vector3d comd_prev =
comd_;
56 omega_ = std::sqrt(lambda);
60 double ch = std::cosh(
omega_ * dt);
61 double sh = std::sinh(
omega_ * dt);
63 comd_ = comd_prev * ch +
omega_ * (com_prev - vrp) * sh;
64 com_ = com_prev * ch + comd_prev * sh /
omega_ - vrp * (ch - 1.0);
67 comddd_ = Eigen::Vector3d::Zero();
82 com_ += (height + n.dot(plane.
p() -
com_)) * n;
92 double lambda = n.dot(gravitoInertial) / n.dot(plane.
p() -
com_);
93 zmp_ =
com_ + gravitoInertial / lambda;
95 omega_ = std::sqrt(lambda);
void reset(const Eigen::Vector3d &com, const Eigen::Vector3d &comd=Eigen::Vector3d::Zero(), const Eigen::Vector3d &comdd=Eigen::Vector3d::Zero())
Reset to a new state from CoM position and its derivatives.
const Eigen::Vector3d & comdd() const
CoM acceleration in the world frame.
Eigen::Vector3d zmpd_
Velocity of the zero-tilting moment point.
Eigen::Vector3d comdd_
Acceleration of the center of mass.
void completeIPM(const Contact &plane)
Complete inverted pendulum inputs (ZMP and natural frequency) from contact plane. ...
const Eigen::Vector3d & comd() const
CoM velocity in the world frame.
EIGEN_MAKE_ALIGNED_OPERATOR_NEW Pendulum(const Eigen::Vector3d &com=Eigen::Vector3d::Zero(), const Eigen::Vector3d &comd=Eigen::Vector3d::Zero(), const Eigen::Vector3d &comdd=Eigen::Vector3d::Zero())
Initialize state from CoM position and its derivatives.
Eigen::Vector3d zmp_
Position of the zero-tilting moment point.
void integrateCoMJerk(const Eigen::Vector3d &comddd, double dt)
Integrate constant CoM jerk for a given duration.
Eigen::Vector3d com_
Position of the center of mass.
void resetCoMHeight(double height, const Contact &contact)
Reset CoM height above a given contact plane.
const Eigen::Vector3d & zmp() const
Zero-tilting moment point.
void integrateIPM(Eigen::Vector3d zmp, double lambda, double dt)
Integrate in floating-base inverted pendulum mode with constant inputs.
const Eigen::Vector3d gravity
Eigen::Vector3d comd_
Velocity of the center of mass.
Main controller namespace.
Eigen::Vector3d comddd_
Jerk of the center of mass.
const Eigen::Vector3d & com() const
CoM position in the world frame.
double omega_
Natural frequency in [Hz].