#include <Tasks/QPConstr.h>
Public Member Functions | |
CoMIncPlaneConstr (const std::vector< rbd::MultiBody > &mbs, int robotIndex, double step) | |
void | addPlane (int planeId, const Eigen::Vector3d &normal, double offset, double di, double ds, double damping, double dampingOff=0.) |
void | addPlane (int planeId, const Eigen::Vector3d &normal, double offset, double di, double ds, double damping, const Eigen::Vector3d &speed, const Eigen::Vector3d &normalDot, double dampingOff=0.) |
bool | rmPlane (int planeId) |
std::size_t | nrPlanes () const |
void | reset () |
Remove all plane. More... | |
Eigen::VectorXd & | selector () noexcept |
const Eigen::VectorXd & | selector () const noexcept |
void | updateNrPlanes () |
Reallocate A and b matrix. More... | |
virtual void | updateNrVars (const std::vector< rbd::MultiBody > &mbs, const SolverData &data) override |
virtual void | update (const std::vector< rbd::MultiBody > &mbs, const std::vector< rbd::MultiBodyConfig > &mbcs, const SolverData &data) override |
virtual std::string | nameInEq () const override |
virtual std::string | descInEq (const std::vector< rbd::MultiBody > &mbs, int line) override |
virtual int | nrInEq () const override |
virtual int | maxInEq () const override |
virtual const Eigen::MatrixXd & | AInEq () const override |
virtual const Eigen::VectorXd & | bInEq () const override |
![]() | |
virtual | ~ConstraintFunction () override |
void | addToSolver (QPSolver &sol) |
void | addToSolver (const std::vector< rbd::MultiBody > &mbs, QPSolver &sol) |
void | removeFromSolver (QPSolver &sol) |
![]() | |
virtual | ~Constraint () |
Prevent robot CoM to go out of a convex hull. For each plane that compose the convex hull:
\[ \dot{d} + \ddot{d}\Delta_{dt} \geq -\xi \frac{d - d_s}{d_i - d_s} \]
with \( d \) the CoM and the plane, \( d_i \) the interactive distance, \( d_s \) the security distance and \( \xi \) the damper.
The damper \( \xi \) can be calculated automatically each time the distance \( d \) go below the interactive distance \( d_i \) with the following formula:
\[ \xi = -\frac{d_i - d_s}{d - d_s}\alpha + \xi_{\text{off}} \]
tasks::qp::CoMIncPlaneConstr::CoMIncPlaneConstr | ( | const std::vector< rbd::MultiBody > & | mbs, |
int | robotIndex, | ||
double | step | ||
) |
mbs | Multi-robot system. |
robotIndex | Constrained robot Index in mbs. |
step | Time step in second. |
void tasks::qp::CoMIncPlaneConstr::addPlane | ( | int | planeId, |
const Eigen::Vector3d & | normal, | ||
double | offset, | ||
double | di, | ||
double | ds, | ||
double | damping, | ||
const Eigen::Vector3d & | speed, | ||
const Eigen::Vector3d & | normalDot, | ||
double | dampingOff = 0. |
||
) |
void tasks::qp::CoMIncPlaneConstr::addPlane | ( | int | planeId, |
const Eigen::Vector3d & | normal, | ||
double | offset, | ||
double | di, | ||
double | ds, | ||
double | damping, | ||
double | dampingOff = 0. |
||
) |
Add a plane to the convex hull. Don't forget to call updateNrPlanes and QPSolver::updateConstrSize. You can also only call QPSolver::nrVars or QPSolver::updateConstrsNrVars or QPSolver::updateNrVars.
planeId | Id of this plane, must be unique. |
normal | Normal of the plane, must be unitary and in the allowed zone direction. |
offset | Origin of the normal. |
di | \( d_i \). |
ds | \( d_s \). |
damping | \( \xi \), if set to 0 the damping is computed automatically. |
dampingOff | \( \xi_{\text{off}} \). |
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
std::size_t tasks::qp::CoMIncPlaneConstr::nrPlanes | ( | ) | const |
void tasks::qp::CoMIncPlaneConstr::reset | ( | ) |
Remove all plane.
bool tasks::qp::CoMIncPlaneConstr::rmPlane | ( | int | planeId | ) |
Remove a plane.
planeId | Plane id to remove. |
|
inlinenoexcept |
Access the joint selector (const)
By default the vector selects all joints in the robot
|
inlinenoexcept |
Access the joint selector
By default the vector selects all joints in the robot
|
overridevirtual |
Implements tasks::qp::Constraint.
void tasks::qp::CoMIncPlaneConstr::updateNrPlanes | ( | ) |
Reallocate A and b matrix.
|
overridevirtual |
Implements tasks::qp::Constraint.