artisynth.core.mechmodels
Interface RigidBodyConstrainer

All Superinterfaces:
HasAuxState
All Known Implementing Classes:
FullPlanarJoint, JointBase, MarkerPlanarConnector, PlanarConnector, RevoluteJoint, RigidBodyConnector, RigidBodyContact, RollPitchJoint, SegmentedPlanarConnector, SolidJoint, SphericalJoint, SphericalJointBase, SphericalRpyJoint

public interface RigidBodyConstrainer
extends HasAuxState


Nested Class Summary
 
Nested classes/interfaces inherited from interface artisynth.core.mechmodels.HasAuxState
HasAuxState.StateContext
 
Method Summary
 MatrixNdBlock getBilateralBlockA(int numb)
           
 MatrixNdBlock getBilateralBlockB(int numb)
           
 int getBilateralConstraints(java.util.ArrayList<RigidBodyConstraint> bilaterals)
          Gets the bilateral constraints associated with this constrainer.
 int getBilateralImpulses(VectorNd lam, int idx)
           
 void getBilateralSizes(VectorNi sizes)
           
 RigidBody getBodyA()
          Returns the first body associated with this constrainer.
 RigidBody getBodyB()
          Returns the second body associated with this constrainer, or null if there is no such body.
 double getPenetrationTol()
           
 MatrixNdBlock getUnilateralBlockA(int numu)
           
 MatrixNdBlock getUnilateralBlockB(int numu)
           
 double getUnilateralConstraints(java.util.ArrayList<RigidBodyConstraint> unilaterals, boolean setEngaged)
          Gets the unilateral constraints associated with this constrainer.
 int getUnilateralImpulses(VectorNd the, int idx)
           
 void getUnilateralSizes(VectorNi sizes)
           
 boolean hasUnilateralConstraints()
          Returns true if this constrainer has unilateral constraints.
 int numBilateralConstraints()
          Returns the number of bilateral constraints associated with this constrainer.
 int numUnilateralConstraints()
          Returns the number of unilateral constraints which are currently engaged.
 int setBilateralImpulses(VectorNd lam, double h, int idx)
           
 void setPenetrationTol(double tol)
           
 int setUnilateralImpulses(VectorNd the, double h, int idx)
           
 void updateBodyStates(double t, boolean setEngaged)
          Updates internal information needed for computing constraints.
 double updateConstraints(double t, int flags)
           
 void updateUnilateralConstraints(java.util.ArrayList<RigidBodyConstraint> unilaterals, int offset, int num)
          Updates the unilateral constraints associated with this constrainer.
 void zeroImpulses()
           
 
Methods inherited from interface artisynth.core.mechmodels.HasAuxState
advanceAuxState, getAuxState, getInitialAuxState, setAuxState, skipAuxState
 

Method Detail

updateBodyStates

void updateBodyStates(double t,
                      boolean setEngaged)
Updates internal information needed for computing constraints.

Parameters:
t - current time (seconds)
setEngaged - if true, then the method should determine which unilateral constraints are engaged

getBodyA

RigidBody getBodyA()
Returns the first body associated with this constrainer.

Returns:
first body associated with this constrainer

getBodyB

RigidBody getBodyB()
Returns the second body associated with this constrainer, or null if there is no such body.

Returns:
second body associated with this constrainer

getBilateralBlockA

MatrixNdBlock getBilateralBlockA(int numb)

getBilateralBlockB

MatrixNdBlock getBilateralBlockB(int numb)

getUnilateralBlockA

MatrixNdBlock getUnilateralBlockA(int numu)

getUnilateralBlockB

MatrixNdBlock getUnilateralBlockB(int numu)

numBilateralConstraints

int numBilateralConstraints()
Returns the number of bilateral constraints associated with this constrainer.

Returns:
number of bilateral constraints

numUnilateralConstraints

int numUnilateralConstraints()
Returns the number of unilateral constraints which are currently engaged. This should be the same as the number of constraints that would be returned by getUnilateralConstraints with setEngaged set to false.

Returns:
number of currently engaged unilateral constraints

getBilateralConstraints

int getBilateralConstraints(java.util.ArrayList<RigidBodyConstraint> bilaterals)
Gets the bilateral constraints associated with this constrainer. They are supplied by the constrainer and appended to an array list.

Parameters:
bilaterals - array list into which the constrainer places the constraints

setBilateralImpulses

int setBilateralImpulses(VectorNd lam,
                         double h,
                         int idx)

getBilateralImpulses

int getBilateralImpulses(VectorNd lam,
                         int idx)

getBilateralSizes

void getBilateralSizes(VectorNi sizes)

getUnilateralSizes

void getUnilateralSizes(VectorNi sizes)

updateConstraints

double updateConstraints(double t,
                         int flags)

getUnilateralConstraints

double getUnilateralConstraints(java.util.ArrayList<RigidBodyConstraint> unilaterals,
                                boolean setEngaged)
Gets the unilateral constraints associated with this constrainer. They are supplied by the constrainer and appended to an array list.

Parameters:
unilaterals - array list into which the constrainer places the constraints
setEngaged - if true, recompute the set of unilateral constraints. If false, the set of unilateral constraints will stay the same.
Returns:
maximum penetration of the unilateral constraints

setUnilateralImpulses

int setUnilateralImpulses(VectorNd the,
                          double h,
                          int idx)

getUnilateralImpulses

int getUnilateralImpulses(VectorNd the,
                          int idx)

zeroImpulses

void zeroImpulses()

hasUnilateralConstraints

boolean hasUnilateralConstraints()
Returns true if this constrainer has unilateral constraints.

Returns:
true if there are unilateral constraints

updateUnilateralConstraints

void updateUnilateralConstraints(java.util.ArrayList<RigidBodyConstraint> unilaterals,
                                 int offset,
                                 int num)
Updates the unilateral constraints associated with this constrainer. The constraints are the same as those returned by the most recent call to getUnilateralConstraints, located at a specific offset within an array list.

Parameters:
unilaterals - contains constraints which should be updated
offset - starting location of constraints within unilaterals
num - number of constraints to update

setPenetrationTol

void setPenetrationTol(double tol)

getPenetrationTol

double getPenetrationTol()