public class SolidCoupling extends RigidBodyCoupling
debug
Constructor and Description |
---|
SolidCoupling() |
Modifier and Type | Method and Description |
---|---|
void |
coordinatesToTCD(RigidTransform3d TCD,
VectorNd coords)
Computes the TCD transform for a set of coordinates, if coordinates are
supported.
|
void |
initializeConstraints()
Called inside the
RigidBodyCoupling constructor to allocate
constraint and coordinate information, using calls to the addConstraint and addCoordinate methods. |
void |
projectToConstraints(RigidTransform3d TGD,
RigidTransform3d TCD,
VectorNd coords)
Project a transform TCD onto the nearest transform TGD that is legal
given this coupling's bilateral constraints.
|
void |
updateConstraints(RigidTransform3d TGD,
RigidTransform3d TCD,
Twist errC,
Twist velGD,
boolean updateEngaged)
Called from
RigidBodyCoupling.updateBodyStates(maspack.matrix.RigidTransform3d, maspack.matrix.RigidTransform3d, maspack.matrix.RigidTransform3d, maspack.spatialmotion.Twist, boolean) to update the constraints, usually
once per simulation step. |
clipCoordinate, clone, coordinatesToTCD, findNearestAngle, getBilateralConstraints, getBilateralForceG, getBilateralForces, getBreakSpeed, getCompliance, getConstraint, getConstraintFlags, getConstraintForce, getCoordinate, getCoordinateIndex, getCoordinateMotionType, getCoordinateName, getCoordinateRange, getCoordinates, getCoordinateSpeed, getCoordinateWrench, getDamping, getLinearLimitTol, getRotaryLimitTol, getState, getUnilateralConstraints, getUnilateralForceG, getUnilateralForces, getUnilateralState, isCoordinateLocked, main, numBilaterals, numConstraints, numCoordinates, numEngagedUnilaterals, numUnilaterals, printConstraintInfo, projectAndUpdateCoordinates, scaleDistance, setBilateralForces, setBreakSpeed, setCompliance, setCoordinateLocked, setCoordinateName, setCoordinateRange, setCoordinateValue, setCoordinateValues, setDamping, setLinearLimitTol, setRotaryLimitTol, setState, setUnilateralForces, setUnilateralState, TCDToCoordinates, transformGeometry, updateBodyStates, updateUnilateralConstraints, zeroForces
public void projectToConstraints(RigidTransform3d TGD, RigidTransform3d TCD, VectorNd coords)
RigidBodyCoupling
Optionally, the coupling may also extend the projection to include
unilateral constraints that are not associated with coordinate
limits. In particular, this should be done for constraints for which is
it desired to have the constraint error included in the errC
argument that is passed to RigidBodyCoupling.updateConstraints(maspack.matrix.RigidTransform3d, maspack.matrix.RigidTransform3d, maspack.spatialmotion.Twist, maspack.spatialmotion.Twist, boolean)
.
If this coupling supports coordinates and coords
is non-null
, then the coordinate values corresponding to TGD
should
also be computed and returned in coords
. The easiest way to do
this is to simply call RigidBodyCoupling.TCDToCoordinates(maspack.matrix.VectorNd, maspack.matrix.RigidTransform3d)
, although in some cases
it may be computationally cheaper to compute both the coordinates and the
projection at the same time. The method should not clip
the resulting coordinates to their range limits.
projectToConstraints
in class RigidBodyCoupling
TGD
- returns the nearest transform to TCD
that is legal with
respect to the bilateral (and possibly some unilateral) constraintsTCD
- transform from frame C to D to be projectedcoords
- if non-null
, should be used to return coordinate
valuespublic void initializeConstraints()
RigidBodyCoupling
RigidBodyCoupling
constructor to allocate
constraint and coordinate information, using calls to the addConstraint
and addCoordinate
methods. The method may be called
at other times if the constraints need to be reconfigured (such as when
switching constraints between bilateral and unilateral). Subclasses
should implement this method as needed.initializeConstraints
in class RigidBodyCoupling
public void updateConstraints(RigidTransform3d TGD, RigidTransform3d TCD, Twist errC, Twist velGD, boolean updateEngaged)
RigidBodyCoupling
RigidBodyCoupling.updateBodyStates(maspack.matrix.RigidTransform3d, maspack.matrix.RigidTransform3d, maspack.matrix.RigidTransform3d, maspack.spatialmotion.Twist, boolean)
to update the constraints, usually
once per simulation step. This method is responsible for:
updateEngaged
is true
, updating the engaged
and distance
attributes for all unilateral constraints
not associated with a joint limit.
Wrenches and their derivatives should be computed with respect to frame G, which is frame C with the constraint errors removed.
If the coupling supports coordinates, their values will be updated
before this method is called so as to correspond to TGD
.
updateConstraints
in class RigidBodyCoupling
TGD
- idealized joint transform from frame G to D, obtained
by calling RigidBodyCoupling.projectToConstraints(maspack.matrix.RigidTransform3d, maspack.matrix.RigidTransform3d, maspack.matrix.VectorNd)
on TCD
TCD
- actual joint transform from frame C to D; included
for legacy reasons and not normally usederrC
- error transform from frame C to G, represented as a
Twist
velGD
- velocity of frame G with respect to D, as seen in frame GupdateEngaged
- if true
, requests the updating of unilateral
engaged
and distance
attributes as describe above.public void coordinatesToTCD(RigidTransform3d TCD, VectorNd coords)
coordinatesToTCD
in class RigidBodyCoupling
TCD
- returns the TCD transformcoords
- supplies the coordinate values and
must have a length >= RigidBodyCoupling.numCoordinates()
.