|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmaspack.contact.LemkeSolverBase
maspack.contact.FastContactSolver
Field Summary |
Fields inherited from interface maspack.contact.ContactSolver |
AUTO_EPSILON, CYCLING_DETECTED, NUMERIC_ERROR, SHOW_BASIS, SHOW_LEXICO_MINRATIO, SHOW_MINRATIO, SOLVED, UNBOUNDED_RAY |
Constructor Summary | |
FastContactSolver()
Creates a new fast contact solver. |
Method Summary | |
boolean |
getActivityReportingEnabled()
Experimental method. |
boolean |
getBasisPresetEnabled()
Experimental method. |
java.lang.String |
getBasisString()
Returns a string describing the basis associated with the most recently computed solution. |
boolean |
getCoriolisEnabled()
Returns true if coriolis forces are included in second order motion calculations. |
double |
getEpsilon()
|
boolean |
getFrictionEnabled()
Returns true if friction computation is enabled for this solver. |
double |
getMinimumSpeed()
Experimental method. |
int |
getNumFrictionDirections()
Sets the number of friction directions used by this solver. |
int |
getPivotCount()
|
boolean |
getRestitutionEnabled()
Returns true if restitution computation is enabled for this solver. |
double |
getRestitutionThreshold()
Gets the restitution threshold for this solver. |
int |
getSolutionOrder()
Returns the order used to compute contact solutions. |
double |
getStabilizingDistance()
Returns the currently stabilizing distance. |
boolean |
getVariableSize()
Returns true if variable sizing is enabled for this solver. |
void |
resetPivotCount()
|
void |
setActivityReportingEnabled(boolean enable)
Experimental method. |
void |
setBasisPresetEnabled(boolean enable)
Experimental method. |
void |
setCoriolisEnabled(boolean enable)
Enables the inclusion of coriolis forces for second order motion calculations. |
void |
setDebug(int code)
|
void |
setEpsilon(double eps)
Sets the numeric tolerance that should be used for contact solutions. A value of AUTO_EPSILON indicates
that the tolerance should be computed automatically whenever a
solution is computed, after which it may be queried using getEpsilon . |
void |
setFrictionEnabled(boolean enable)
Enables/disables friction computation for this solver. Friction computation is enabled by default. |
void |
setMinimumSpeed(double minSpeed)
Experimental method. |
void |
setNumFrictionDirections(int numdirs)
Sets the number of friction directions to be used by this solver (i.e., the number of sides in the polyhedral approximation to the friction cone). The default is 4. |
void |
setRestitutionEnabled(boolean enable)
Enables/disables restitution computation for this solver. Resitution is only computed for second order solutions, and involves computing a restoring velocity at each contact, as determined by the restitution coefficient specified for that contact . |
void |
setRestitutionThreshold(double threshold)
Sets the restitution threshold for this solver. This is the minimum speed along a contact normal below which no restitution is calculated (assuming restitution is enabled). |
void |
setSolutionOrder(int order)
Sets the order used to compute contact solutions. This should be either 1 or 2, where 1 corresponds to first order physics (force proportional to velocity), and 2 corresponds to the usual second order physics (force proportional to acceleration). |
void |
setStabilizingDistance(double dist)
Sets the solver's stabilizing distance. By default, this quantity is zero, but if it is set to a positive value, and the solver is performing second order motions, then it will try to apply appropriate impulses to the bodies to maintain a separation of dist units at each of the contact points. |
void |
setVariableSize(boolean enable)
Enables variable sizing of the LCP when solving a contact problem. |
int |
solve(Twist[] newVels,
Contact[] contacts,
int ncontacts,
RigidTransform3d[] XBodiesToWorld,
Twist[] vels,
SpatialInertia[] inertias,
Wrench[] appliedForces,
double timeStep)
Solves a multi-point contact problem for multiple rigid bodies. Information about each contact point should be supplied in the contact array.
Information for each |
int |
solve(Twist vel,
Contact[] contacts,
int ncontacts,
RigidTransform3d XBodyToWorld,
Twist oldVel,
SpatialInertia inertia,
Wrench wapplied,
double timeStep)
Solves a multi-point contact problem for a single rigid body. Information about each contact should be supplied in the contacts array. For each contact, the first body index
is assumed to correspond to the rigid body in question and should be
set to 0, and the second body index is assumed to correspond to a
fixed object and should be set to -1. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public FastContactSolver()
Method Detail |
public boolean getActivityReportingEnabled()
getActivityReportingEnabled
in interface ContactSolver
public void setActivityReportingEnabled(boolean enable)
setActivityReportingEnabled
in interface ContactSolver
public boolean getCoriolisEnabled()
getCoriolisEnabled
in interface ContactSolver
public void setCoriolisEnabled(boolean enable)
setCoriolisEnabled
in interface ContactSolver
enable
- if true, enables coriolis force calculationpublic void setFrictionEnabled(boolean enable)
setFrictionEnabled
in interface ContactSolver
enable
- enables friction computation if trueContactSolver.getFrictionEnabled()
public boolean getFrictionEnabled()
getFrictionEnabled
in interface ContactSolver
ContactSolver.setFrictionEnabled(boolean)
public void setRestitutionEnabled(boolean enable)
contact
.
setRestitutionEnabled
in interface ContactSolver
enable
- enables restitution computation if trueContactSolver.getRestitutionEnabled()
public boolean getRestitutionEnabled()
getRestitutionEnabled
in interface ContactSolver
ContactSolver.setRestitutionEnabled(boolean)
public void setRestitutionThreshold(double threshold)
setRestitutionThreshold
in interface ContactSolver
threshold
- minimum normal speedContactSolver.setRestitutionEnabled(boolean)
public double getRestitutionThreshold()
getRestitutionThreshold
in interface ContactSolver
ContactSolver.setRestitutionThreshold(double)
public void setBasisPresetEnabled(boolean enable)
setBasisPresetEnabled
in interface ContactSolver
public boolean getBasisPresetEnabled()
getBasisPresetEnabled
in interface ContactSolver
public void setEpsilon(double eps)
AUTO_EPSILON
indicates
that the tolerance should be computed automatically whenever a
solution is computed, after which it may be queried using getEpsilon
.
setEpsilon
in interface ContactSolver
eps
- numeric tolerancepublic void setVariableSize(boolean enable)
enable
- enables variable sizing if truegetVariableSize()
public boolean getVariableSize()
setVariableSize(boolean)
public int getSolutionOrder()
getSolutionOrder
in interface ContactSolver
ContactSolver.setSolutionOrder(int)
public void setSolutionOrder(int order)
setSolutionOrder
in interface ContactSolver
order
- desired solution order (1 or 2)ContactSolver.getSolutionOrder()
public void setStabilizingDistance(double dist)
dist
units at each of the contact points.
setStabilizingDistance
in interface ContactSolver
dist
- stabilizing distancepublic double getStabilizingDistance()
getStabilizingDistance
in interface ContactSolver
ContactSolver.setStabilizingDistance(double)
public void setMinimumSpeed(double minSpeed)
setMinimumSpeed
in interface ContactSolver
public double getMinimumSpeed()
getMinimumSpeed
in interface ContactSolver
public int getNumFrictionDirections()
getNumFrictionDirections
in interface ContactSolver
ContactSolver.setNumFrictionDirections(int)
public void setNumFrictionDirections(int numdirs)
setNumFrictionDirections
in interface ContactSolver
numdirs
- number of friction directionsContactSolver.getNumFrictionDirections()
public double getEpsilon()
getEpsilon
in interface ContactSolver
public int getPivotCount()
getPivotCount
in interface ContactSolver
public void resetPivotCount()
resetPivotCount
in interface ContactSolver
public void setDebug(int code)
setDebug
in interface ContactSolver
public int solve(Twist vel, Contact[] contacts, int ncontacts, RigidTransform3d XBodyToWorld, Twist oldVel, SpatialInertia inertia, Wrench wapplied, double timeStep)
contacts
array. For each contact, the first body index
is assumed to correspond to the rigid body in question and should be
set to 0, and the second body index is assumed to correspond to a
fixed object and should be set to -1.
solve
in interface ContactSolver
vel
- returns the updated velocity calculated
in body coordinatescontacts
- array of information about each contactncontacts
- number of contactsXBodyToWorld
- spatial body-to-world transform
for the rigid bodyoldVel
- initial spatial velocity the rigid body, in body
coordinates (only used if the order
of the
solution is 2)inertia
- spatial inertia for the rigid body, in body
coordinateswapplied
- external forces applied to the
rigid body, in body coordinatestimeStep
- time step associated with the motion (only
applicable if the order
of the solution is
2)public int solve(Twist[] newVels, Contact[] contacts, int ncontacts, RigidTransform3d[] XBodiesToWorld, Twist[] vels, SpatialInertia[] inertias, Wrench[] appliedForces, double timeStep)
contact
array.
Information for each contact
includes indices identifiying the two bodies associated with
it. These indices should correspond to the indices the body with
respect to newVels
, XBodiesToWorld
,
etc. For contacts between a body and a fixed object, the first body
index should reflect the body in question, and the second body index
should be set to -1.
solve
in interface ContactSolver
newVels
- returns the updated velocities calculated for each
rigid body, in body coordinatescontacts
- array of information about each contactncontacts
- number of contactsXBodiesToWorld
- spatial body-to-world transform
for each rigid bodyvels
- initial spatial velocity for each rigid body, in body
coordinates (only used if the order
of the
solution is 2)inertias
- spatial inertia for each rigid body,
in body coordinatesappliedForces
- external forces applied to each
rigid body, in body coordinatestimeStep
- time step size associated with the motion (only
applicable if the order
of the solution is
2)public java.lang.String getBasisString()
getBasisString
in interface ContactSolver
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |