public abstract class StaticRigidBodySolver
extends java.lang.Object
Constructor and Description |
---|
StaticRigidBodySolver() |
Modifier and Type | Method and Description |
---|---|
RigidBody |
findFixedBody()
Searches the bodies used by this solver for one that should be considers
to have a fixed position.
|
java.util.ArrayList<RigidBody> |
getBodies()
Returns the bodies associated with this solver.
|
java.util.ArrayList<RigidTransform3d> |
getBodyPoses()
Returns the poses of all the bodies associated with this solver.
|
java.util.ArrayList<BodyConstrainer> |
getConstrainers()
Returns the constrainers (e.g., joints and other constrainers) used by
this solver.
|
MechModel |
getMechModel()
Returns the MechModel associated with this solver.
|
double |
getModelSize()
Returns a characteristic size for the model.
|
boolean |
isConnectedToGround()
Returns
true if at least one of the bodies associated with this
solver is connected to ground via a BodyConnector . |
int |
numBodies()
Queries the number of rigid bodies associated with this solver.
|
int |
projectToConstraints(double tol,
int maxIter)
Performs repeated position updates until the error is below a specified
tolerance, or the number of iterations exceeds
maxIter . |
void |
resetBodiesDynamic()
Restore the
dynamic property setting of all the bodies associated
with this solver to their value at initialization. |
void |
restoreModelState()
Restores the state of the MechModel.
|
void |
saveModelState()
Saves the current state of the MechModel.
|
void |
setBodiesDynamic(boolean dynamic)
Sets the
dynamic property of all the bodies associated
with this solver. |
void |
setModelSize(double size)
Sets a characteristic size for the model.
|
void |
transformBodyPoses(RigidTransform3d T)
Transform the poses of all bodies used by this solver, by applying
a transform
T in world coordinates. |
public int numBodies()
public java.util.ArrayList<RigidBody> getBodies()
public java.util.ArrayList<RigidTransform3d> getBodyPoses()
public MechModel getMechModel()
public java.util.ArrayList<BodyConstrainer> getConstrainers()
public double getModelSize()
public void setModelSize(double size)
<= 0
will cause the size to be
computed automatically the next time getModelSize()
is called.public void saveModelState()
public void restoreModelState()
public int projectToConstraints(double tol, int maxIter)
maxIter
.tol
- desired tolerance for the errormaxIter
- maximum number of iterationspublic RigidBody findFixedBody()
grounded
property set. The second choice is any body that was
non-dynamic when this solver was initialized.null
if none foundpublic void transformBodyPoses(RigidTransform3d T)
T
in world coordinates. If TBW
is the
pose of a given body, then the new pose will be given by
TBW = T TBW
T
- transform to apply to body posespublic void setBodiesDynamic(boolean dynamic)
dynamic
property of all the bodies associated
with this solver.dynamic
- setting for each body's dynamic
propertypublic void resetBodiesDynamic()
dynamic
property setting of all the bodies associated
with this solver to their value at initialization.public boolean isConnectedToGround()
true
if at least one of the bodies associated with this
solver is connected to ground via a BodyConnector
. Note that if
the bodies are arranged into two or more disconnected chains, this means
that at least one chain is grounded, but not necessarily all of them.true
if one of the bodies is connected to ground.