Moby
|
Container class for describing a unilateral constraint in the simulation. More...
#include <UnilateralConstraint.h>
Public Types | |
enum | UnilateralConstraintType { eNone, eContact, eLimit } |
enum | UnilateralConstraintClass { ePositive, eZero, eNegative } |
enum | Compliance { eRigid, eCompliant } |
Public Member Functions | |
UnilateralConstraint () | |
Creates an empty constraint. | |
UnilateralConstraint (const UnilateralConstraint &e) | |
UnilateralConstraint & | operator= (const UnilateralConstraint &e) |
double | calc_contact_vel (const Ravelin::Vector3d &v) const |
double | calc_constraint_vel () const |
Computes the velocity of this constraint. More... | |
double | calc_constraint_tol () const |
Computes the constraint tolerance. More... | |
UnilateralConstraintClass | determine_constraint_class () const |
Determines the type of constraint. | |
bool | is_impacting () const |
bool | is_resting () const |
bool | is_separating () const |
void | set_contact_parameters (const ContactParameters &cparams) |
Sets the contact parameters for this constraint. | |
void | determine_contact_tangents () |
Determines the set of contact tangents. | |
boost::shared_ptr< const Ravelin::Pose3d > | get_pose () const |
void | compute_constraint_data (Ravelin::MatrixNd &M, Ravelin::VectorNd &q) const |
Computes the constraint data. | |
void | compute_cross_constraint_data (const UnilateralConstraint &e, Ravelin::MatrixNd &M) const |
Updates the constraint data. | |
template<class OutputIterator > | |
OutputIterator | get_super_bodies (OutputIterator begin) const |
osg::Node * | to_visualization_data () const |
Makes a contact visualizable. | |
void | write_vrml (const std::string &filename, double sphere_radius=0.1, double normal_length=1.0) const |
Writes an constraint to the specified filename in VRML format for visualization. More... | |
template<class BidirectionalIterator > | |
void | insertion_sort (BidirectionalIterator first, BidirectionalIterator last) |
template<class OutputIterator > | |
OutputIterator | get_super_bodies (OutputIterator begin) const |
Static Public Member Functions | |
static void | determine_connected_constraints (const std::vector< UnilateralConstraint > &constraints, const std::vector< JointPtr > &implicit_joints, std::list< std::pair< std::list< UnilateralConstraint * >, std::list< boost::shared_ptr< Ravelin::SingleBodyd > > > > &groups, std::list< std::vector< boost::shared_ptr< Ravelin::DynamicBodyd > > > &remaining_islands) |
Given a vector of constraints, determines all of the sets of connected constraints. More... | |
static void | remove_inactive_groups (std::list< std::pair< std::list< UnilateralConstraint * >, std::list< boost::shared_ptr< Ravelin::SingleBodyd > > > > &groups) |
Removes groups of contacts that contain no active contacts. | |
Public Attributes | |
UnilateralConstraintType | constraint_type |
The type of constraint. | |
Compliance | compliance |
Compliance of the constraint. | |
JointPtr | limit_joint |
The joint at which the limit is reached (for limit constraints) | |
double | contact_stiffness |
double | contact_damping |
double | limit_stiffness |
double | limit_damping |
double | signed_violation |
Signed violation for this constraint. | |
double | limit_epsilon |
The coefficient of restitution for this limit. | |
unsigned | limit_dof |
The DOF at which the limit is reached (for limit constraints) | |
bool | limit_upper |
Whether the upper/lower limit is reached (for limit constraints) | |
double | limit_impulse |
Limit impulse magnitude (for limit constraints) | |
Point3d | contact_point |
The point contact (for contact constraints) | |
Ravelin::Vector3d | contact_normal |
The vector pointing outward from the contact on the first body, in world coordinates (for contact constraints) | |
Ravelin::Vector3d | contact_tan1 |
The first tangent direction to the contact normal. | |
Ravelin::Vector3d | contact_tan2 |
The second tangent direction to the contact normal. | |
Ravelin::SMomentumd | contact_impulse |
Impulse that has been applied (for contact constraints) More... | |
CollisionGeometryPtr | contact_geom1 |
The collision geometries involved (for contact constraints) | |
CollisionGeometryPtr | contact_geom2 |
double | contact_mu_coulomb |
The coefficient of Coulomb friction (for contact constraints) | |
double | contact_mu_viscous |
The coefficient of viscous friction (for contact constraints) | |
double | contact_penalty_Kp |
Penalty Method Depth Penalty. | |
double | contact_penalty_Kv |
Penalty Method Interpenetration Speed. | |
double | contact_epsilon |
The coefficient of restitution (for contact constraints) | |
unsigned | contact_NK |
The number of friction directions >= 4 (for contact constraints) | |
double | tol |
Tolerance for the constraint (users never need to modify this) | |
Container class for describing a unilateral constraint in the simulation.
double UnilateralConstraint::calc_constraint_tol | ( | ) | const |
Computes the constraint tolerance.
Positive velocity indicates separation, negative velocity indicates impact, zero velocity indicates rest.
double UnilateralConstraint::calc_constraint_vel | ( | ) | const |
Computes the velocity of this constraint.
Positive velocity indicates separation, negative velocity indicates impact, zero velocity indicates rest.
Referenced by Moby::operator<<().
|
static |
Given a vector of constraints, determines all of the sets of connected constraints.
A set of connected constraints is the set of all constraints such that, for a given constraint A in the set, there exists another constraint B for which A and B share at least one rigid body.
constraints | the list of constraints |
groups | the islands of connected constraints on return |
References constraint_type.
void UnilateralConstraint::write_vrml | ( | const std::string & | fname, |
double | sphere_radius = 0.1 , |
||
double | normal_length = 1.0 |
||
) | const |
Writes an constraint to the specified filename in VRML format for visualization.
Ravelin::SMomentumd Moby::UnilateralConstraint::contact_impulse |
Impulse that has been applied (for contact constraints)
Impulse applied to the body of the first geometry; the reverse of this force / impulse is applied to the body of the second geometry.