KrisLibrary
1.0.0
|
A more advanced ContactFormation that accepts custom contact points and custom constraints. More...
#include <Contact.h>
Public Member Functions | |
void | clear () |
Resets to an empty formation. | |
void | set (int link, const std::vector< ContactPoint > &contacts, int numFCEdges) |
Sets this to a list of contacts on a given link. | |
void | set (int link, const std::vector< CustomContactPoint > &contacts) |
Sets this to aa list of contacts on a given link. | |
void | set (const ContactFormation &formation, int numFCEdges) |
Sets this to a plain ContactFormation. | |
void | concat (const CustomContactFormation &formation) |
Adds another formation onto this one. | |
void | addLinkForceLimit (int link, const Vector3 &direction, Real maximum) |
void | addLinkWrenchLimit (int link, const Vector3 &fdirection, const Vector3 &mdirection, Real maximum) |
void | addForceLimit (const std::vector< int > &contacts, const Vector3 &direction, Real maximum) |
Convenience function: limits the extent of the sum of forces direction^T sum fi <= maximum. | |
void | addWrenchLimit (const std::vector< int > &contacts, const Vector3 &fdirection, const Vector3 &mdirection, Real maximum) |
void | addLinkForceConstraint (int link, const Matrix &A, const Vector &b, bool equality=false) |
void | addLinkWrenchConstraint (int link, const Matrix &A, const Vector &b, bool equality=false) |
void | addForceConstraint (const std::vector< int > &contacts, const Matrix &A, const Vector &b, bool equality=false) |
void | addForceConstraint (const std::vector< int > &contacts, const std::vector< Matrix > &A, const Vector &b, bool equality=false) |
void | addWrenchConstraint (const std::vector< int > &contacts, const Matrix &A, const Vector &b, bool equality=false) |
void | addWrenchConstraint (const std::vector< int > &contacts, const std::vector< Matrix > &A, const Vector &b, bool equality=false) |
int | numForceVariables () const |
Returns the total number of force variables. | |
int | numConstraints () const |
Returns the number of constraints. | |
Public Attributes | |
std::vector< int > | links |
std::vector< CustomContactPoint > | contacts |
std::vector< int > | targets |
std::vector< std::vector< int > > | constraintGroups |
std::vector< std::vector< Matrix > > | constraintMatrices |
std::vector< Vector > | constraintOffsets |
std::vector< bool > | constraintEqualities |
A more advanced ContactFormation that accepts custom contact points and custom constraints.
The contact contacts[i] is associated with links[i] (pointing from the opposing body into the robot). Usually the opposing body is the environment, but if targets is non-empty, it gives the index of the body for which contact is made.
void CustomContactFormation::addForceConstraint | ( | const std::vector< int > & | contacts, |
const Matrix & | A, | ||
const Vector & | b, | ||
bool | equality = false |
||
) |
Adds a constraint that the forces on the given contacts, when stacked into a big vector f=[f1,...,fn], must satisfy the constraint A*f <= b (or if equality=true, A*f=b).
void CustomContactFormation::addForceConstraint | ( | const std::vector< int > & | contacts, |
const std::vector< Matrix > & | A, | ||
const Vector & | b, | ||
bool | equality = false |
||
) |
Adds a constraint that the forces on the given contacts, must satisfy the constraint sum Ai*fi <= b (or if equality=true, sum Ai*fi=b).
void CustomContactFormation::addLinkForceConstraint | ( | int | link, |
const Matrix & | A, | ||
const Vector & | b, | ||
bool | equality = false |
||
) |
Adds a constraint that the sum of all forces on a given link satisfy the condition A*f <= b (or if equality=true, A*f=b).
void CustomContactFormation::addLinkForceLimit | ( | int | link, |
const Vector3 & | direction, | ||
Real | maximum | ||
) |
Convenience function: limits the extent of the sum of forces on the link direction^T force <= maximum
void CustomContactFormation::addLinkWrenchConstraint | ( | int | link, |
const Matrix & | A, | ||
const Vector & | b, | ||
bool | equality = false |
||
) |
Adds a constraint that the sum of all forces/moments on a given link satisfy the condition A*w <= b (or if equality=true, A*w=b).
void CustomContactFormation::addLinkWrenchLimit | ( | int | link, |
const Vector3 & | fdirection, | ||
const Vector3 & | mdirection, | ||
Real | maximum | ||
) |
Convenience function: limits the extent of the sum of forces on the link fdirection^T force + mdirection^T moment <= maximum
void CustomContactFormation::addWrenchConstraint | ( | const std::vector< int > & | contacts, |
const Matrix & | A, | ||
const Vector & | b, | ||
bool | equality = false |
||
) |
Adds a constraint that the wrenches on the given contacts, when stacked into a big vector w=[w1,...,wn], must satisfy the constraint A*f <= b (or if equality=true, A*f=b).
void CustomContactFormation::addWrenchConstraint | ( | const std::vector< int > & | contacts, |
const std::vector< Matrix > & | A, | ||
const Vector & | b, | ||
bool | equality = false |
||
) |
Adds a constraint that the wrenches on the given contacts, must satisfy the constraint sum Ai*wi <= b (or if equality=true, sum Ai*wi=b).
References Math3D::Matrix3::setCrossProduct().
void CustomContactFormation::addWrenchLimit | ( | const std::vector< int > & | contacts, |
const Vector3 & | fdirection, | ||
const Vector3 & | mdirection, | ||
Real | maximum | ||
) |
Convenience function: limits the extent of the sum of forces fdirection^T sum fi + mdirection^T sum mi <= maximum