1#ifndef ROBOTOC_SPLIT_KKT_RESIDUAL_HXX_
2#define ROBOTOC_SPLIT_KKT_RESIDUAL_HXX_
13 assert(
dimf <= P_full_.size());
20 assert(
dims <= P_full_.size());
26 return Fx.head(dimv_);
30inline const Eigen::VectorBlock<const Eigen::VectorXd>
32 return Fx.head(dimv_);
37 return Fx.tail(dimv_);
41inline const Eigen::VectorBlock<const Eigen::VectorXd>
43 return Fx.tail(dimv_);
48 return P_full_.head(dims_);
53 return P_full_.head(dims_);
58 return lx.head(dimv_);
62inline const Eigen::VectorBlock<const Eigen::VectorXd>
64 return lx.head(dimv_);
69 return lx.tail(dimv_);
73inline const Eigen::VectorBlock<const Eigen::VectorXd>
75 return lx.tail(dimv_);
80 return lf_full_.head(dimf_);
84inline const Eigen::VectorBlock<const Eigen::VectorXd>
86 return lf_full_.head(dimf_);
92 err +=
Fx.squaredNorm();
94 err +=
P().squaredNorm();
96 err +=
lx.squaredNorm();
97 err +=
lu.squaredNorm();
98 err +=
la.squaredNorm();
99 err +=
ldv.squaredNorm();
100 if (
lf().size() > 0) {
101 err +=
lf().squaredNorm();
109 double feasibility =
Fx.template lpNorm<p>();
111 feasibility +=
P().template lpNorm<p>();
119 double feasibility = 0;
120 feasibility +=
lx.template lpNorm<p>();
121 feasibility +=
la.template lpNorm<p>();
122 feasibility +=
ldv.template lpNorm<p>();
124 feasibility +=
lf().template lpNorm<p>();
125 feasibility +=
lu.template lpNorm<p>();
132 if (
P().size() > 0) {
139 if (
lf().size() > 0) {
Eigen::VectorBlock< Eigen::VectorXd > Fq()
Residual in the state equation w.r.t. the configuration q.
Definition: split_kkt_residual.hxx:25
Eigen::VectorXd lu
KKT residual w.r.t. the control input torques u. Size is Robot::dimu().
Definition: split_kkt_residual.hpp:151
Eigen::VectorBlock< Eigen::VectorXd > lf()
KKT residual w.r.t. the stack of the contact forces f.
Definition: split_kkt_residual.hxx:79
double dualFeasibility() const
Returns the lp norm of the dual feasibility. Default norm is l1-norm. You can also specify l-infty no...
Definition: split_kkt_residual.hxx:118
double KKTError() const
Returns the squared norm of the KKT residual, that is, the primal and dual residual.
Definition: split_kkt_residual.hxx:90
void setSwitchingConstraintDimension(const int dims)
Sets the dimension of the switching constraint.
Definition: split_kkt_residual.hxx:18
Eigen::VectorBlock< Eigen::VectorXd > lv()
KKT residual w.r.t. the joint velocity v.
Definition: split_kkt_residual.hxx:68
Eigen::VectorBlock< Eigen::VectorXd > Fv()
Residual in the state equation w.r.t. the velocity v.
Definition: split_kkt_residual.hxx:36
void setContactDimension(const int dimf)
Sets contact status, i.e., set dimension of the contact forces.
Definition: split_kkt_residual.hxx:11
Eigen::VectorBlock< Eigen::VectorXd > P()
Residual in the switching constraint.
Definition: split_kkt_residual.hxx:47
Eigen::VectorXd ldv
KKT residual w.r.t. the impact change in the velocity ddv. Size is Robot::dimv().
Definition: split_kkt_residual.hpp:145
Eigen::VectorXd Fx
Residual in the state equation. Size is 2 * Robot::dimv().
Definition: split_kkt_residual.hpp:71
double primalFeasibility() const
Returns the lp norm of the primal feasibility, i.e., the constraint violation. Default norm is l1-nor...
Definition: split_kkt_residual.hxx:108
int dims() const
Returns the dimension of the stack of the contact forces at the current contact status.
Definition: split_kkt_residual.hxx:151
Eigen::VectorXd lx
KKT Residual w.r.t. the state x. Size is 2 * Robot::dimv().
Definition: split_kkt_residual.hpp:112
Eigen::VectorBlock< Eigen::VectorXd > lq()
KKT residual w.r.t. the configuration q.
Definition: split_kkt_residual.hxx:57
void setZero()
Sets the split KKT residual zero.
Definition: split_kkt_residual.hxx:130
double h
KKT residual w.r.t. the switching time, that is, this is the value of the Hamiltonian.
Definition: split_kkt_residual.hpp:169
int dimf() const
Returns the dimension of the stack of the contact forces at the current contact status.
Definition: split_kkt_residual.hxx:146
Eigen::VectorXd la
KKT residual w.r.t. the acceleration a. Size is Robot::dimv().
Definition: split_kkt_residual.hpp:139
Definition: constraint_component_base.hpp:17