KrisLibrary  1.0.0
Public Member Functions | List of all members
EquilibriumTester Class Reference

Testing COM equilibrium given some number of contacts. More...

#include <Stability.h>

Public Member Functions

void Setup (const std::vector< ContactPoint > &contacts, const Vector3 &fext, int numFCEdges, const Vector3 &com)
 
void Setup (const std::vector< CustomContactPoint > &contacts, const Vector3 &fext, const Vector3 &com)
 
void Setup (const CustomContactFormation &contacts, const Vector3 &fext, const Vector3 &com)
 
void SetupAnyCOM (const std::vector< ContactPoint > &contacts, const Vector3 &fext, int numFCEdges)
 
void SetupAnyCOM (const std::vector< CustomContactPoint > &contacts, const Vector3 &fext)
 
void SetupAnyCOM (const CustomContactFormation &contacts, const Vector3 &fext)
 
bool TestCOM (const std::vector< ContactPoint > &contacts, const Vector3 &fext, int numFCEdges, const Vector3 &com)
 
bool TestCOM (const std::vector< CustomContactPoint > &contacts, const Vector3 &fext, const Vector3 &com)
 
bool TestCOM (const CustomContactFormation &contacts, const Vector3 &fext, const Vector3 &com)
 
bool TestAnyCOM (const std::vector< ContactPoint > &contacts, const Vector3 &fext, int numFCEdges)
 
bool TestAnyCOM (const std::vector< CustomContactPoint > &contacts, const Vector3 &fext)
 
bool TestAnyCOM (const CustomContactFormation &contacts, const Vector3 &fext)
 
void ChangeContacts (const std::vector< ContactPoint > &contacts)
 
void ChangeContact (int i, ContactPoint &contact)
 
void ChangeGravity (const Vector3 &fext)
 
void ChangeCOM (const Vector3 &com)
 
void SetRobustnessFactor (Real frobust)
 
void SetRobustnessFactor (int i, Real frobust)
 
void LimitContactForce (int i, Real maximum, const Vector3 &dir)
 
void LimitContactForceSum (const std::vector< int > &indices, Real maximum, const Vector3 &dir)
 
bool TestCurrent ()
 
void GetValidCOM (Vector3 &com) const
 
void GetForceVector (Vector &f) const
 
void GetForces (std::vector< Vector3 > &f) const
 
void Clear ()
 
bool IsEmpty ()
 
int NumContacts () const
 
int NumFCEdges () const
 

Detailed Description

Testing COM equilibrium given some number of contacts.

The class methods have a potential advantage over the static TestCOM() and TestAnyCOM() functions if you're testing multiple centers of mass with the same number of contacts. They also let you do more sophisticated things with robustness and force limiting.

However, if the contacts remain the same, and you're testing a large number of COMs (10-20), it's better to use the SupportPolygon class to compute the entire support polygon.

See also
SupportPolygon

Member Function Documentation

void EquilibriumTester::Setup ( const std::vector< ContactPoint > &  contacts,
const Vector3 fext,
int  numFCEdges,
const Vector3 com 
)

Sets up the LP sum fk = fext sum [pk-p]fk = [cm-p]fext fk in FCk (p is a constant shift)

Referenced by Setup().

void EquilibriumTester::Setup ( const std::vector< CustomContactPoint > &  contacts,
const Vector3 fext,
const Vector3 com 
)

Sets up the LP sum fk = fext sum [pk-p]fk = [cm-p]fext fk in FCk (p is a constant shift)

References Setup().

void EquilibriumTester::SetupAnyCOM ( const std::vector< ContactPoint > &  contacts,
const Vector3 fext,
int  numFCEdges 
)

Sets up LP over fk,cm sum fk = fext sum (pk-p) x fk + fext x cm = 0 fk in FCk (add p to cm to get a stable com)

References Math3D::Matrix3::setCrossProduct().

void EquilibriumTester::SetupAnyCOM ( const std::vector< CustomContactPoint > &  contacts,
const Vector3 fext 
)

Sets up LP over fk,cm sum fk = fext sum (pk-p) x fk + fext x cm = 0 fk in FCk (add p to cm to get a stable com)

References Math3D::Matrix3::setCrossProduct().

void EquilibriumTester::SetupAnyCOM ( const CustomContactFormation contacts,
const Vector3 fext 
)

The documentation for this class was generated from the following files: