36 :ConstraintSet(kSpecifyLater,
"Swing-Constraint-" + ee_motion)
50 int constraint_count = pure_swing_node_ids_.size()*2*
k2D;
52 SetRows(constraint_count);
65 auto curr = nodes.at(node_id);
67 Vector2d prev = nodes.at(node_id-1).p().topRows<
k2D>();
68 Vector2d next = nodes.at(node_id+1).p().topRows<
k2D>();
71 Vector2d xy_center = prev + 0.5*distance_xy;
73 for (
auto dim : {
X,
Y}) {
74 g(row++) = curr.p()(dim) - xy_center(dim);
75 g(row++) = curr.v()(dim) - des_vel_center(dim);
83 SwingConstraint::VecBound
86 return VecBound(GetRows(), ifopt::BoundZero);
98 for (
auto dim : {
X,
Y}) {
101 jac.coeffRef(row,
ee_motion_->Index(node_id+1,
kPos, dim)) = -0.5;
102 jac.coeffRef(row,
ee_motion_->Index(node_id-1,
kPos, dim)) = -0.5;
Nodes that are associated to either swing or stance phases.
PhaseNodes::Ptr ee_motion_
virtual void InitVariableDependedQuantities(const VariablesPtr &x) override
void FillJacobianBlock(std::string var_set, Jacobian &) const override
SwingConstraint(std::string ee_motion_id)
Links the swing constraint with current foot variables.
VectorXd GetValues() const override
std::vector< int > pure_swing_node_ids_
VecBound GetBounds() const override
std::string ee_motion_id_