Class ConvexHull

Inheritance Relationships

Base Type

Class Documentation

class ConvexHull : public OpenSoT::Constraint<Eigen::MatrixXd, Eigen::VectorXd>

The ConvexHull class implements a constraint of the type \(A_{\text{CH}}J_{\text{CoM}}\dot{q} \leq b_{\text{CH}}\), where every row in \(\left[ A_{\text{CH}} , -b_{\text{CH}}\right]\).

Public Types

typedef std::shared_ptr<ConvexHull> Ptr

Public Functions

ConvexHull(XBot::ModelInterface &robot, const std::list<std::string> &links_in_contact, const double safetyMargin = BOUND_SCALING)

ConvexHull constructor.

Parameters
  • x – the robot configuration vector

  • robot – the robot model, with floating base link set on the support foot

  • safetyMargin – the margin, in [m], of the bounds margins

bool getConvexHull(std::vector<Eigen::Vector3d> &ch)
void setSafetyMargin(const double safetyMargin)

setSafetyMargin sets a safety margin in [m] for the convex hull

Parameters

sagetyMargin

virtual void update()

Updates the A, b, Aeq, beq, Aineq, b*Bound matrices.

inline std::list<std::string> getLinksInContact()
inline void setLinksInContact(const std::list<std::string> &links_inc_contact)

Public Static Functions

static void getConstraints(const std::vector<Eigen::Vector3d> &points, Eigen::MatrixXd &A, Eigen::VectorXd &b, const double boundScaling = BOUND_SCALING)

getConstraints returns A and b such that \(A*\delta q < b\) implies staying in the convex hull

Parameters
  • points – a list of points representing the convex hull

  • A – the matrix of constraints

  • b – the vector of coefficients

static void getLineCoefficients(const Eigen::Vector3d &p0, const Eigen::Vector3d &p1, double &a, double &b, double &c)

getLineCoefficients returns implicit form of the a line passing between p0 and p1

Parameters
  • p0 – point 0

  • p1 – point 1

  • a – cofficient in the implicit representation of the rect as ax + by + c = 0

  • b – cofficient in the implicit representation of the rect as ax + by + c = 0

  • c – cofficient in the implicit representation of the rect as ax + by + c = 0