public class PlanarTranslationCoupling extends RigidBodyCoupling
|Constructor and Description|
|Modifier and Type||Method and Description|
Computes the TCD transform for a set of coordinates, if coordinates are supported.
Called inside the
Project a transform TCD onto the nearest transform TGD that is legal given this coupling's bilateral constraints.
If coordinates are supported by this coupling, compute their values based on the supplied transform TCD from frame C to D, and return the result in
clipCoordinate, clone, coordinatesToTCD, findNearestAngle, getBilateralConstraints, getBilateralForceG, getBilateralForces, getBreakSpeed, getCompliance, getConstraint, getConstraintFlags, getConstraintForce, getCoordinate, getCoordinateRange, getCoordinates, getDamping, getLinearLimitTol, getRotaryLimitTol, getState, getUnilateralConstraints, getUnilateralForceG, getUnilateralForces, main, numBilaterals, numConstraints, numCoordinates, numEngagedUnilaterals, numUnilaterals, printConstraintInfo, projectAndUpdateCoordinates, scaleDistance, setBilateralForces, setBreakSpeed, setCompliance, setCoordinateRange, setCoordinateValue, setCoordinateValues, setDamping, setLinearLimitTol, setRotaryLimitTol, setState, setUnilateralForces, transformGeometry, updateBodyStates, updateUnilateralConstraints, zeroForces
public static final int X_IDX
public static final int Y_IDX
public void projectToConstraints(RigidTransform3d TGD, RigidTransform3d TCD, VectorNd coords)
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
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
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.
TGD- returns the nearest transform to
TCDthat is legal with respect to the bilateral (and possibly some unilateral) constraints
TCD- transform from frame C to D to be projected
coords- if non-
null, should be used to return coordinate values
public void initializeConstraints()
RigidBodyCouplingconstructor to allocate constraint and coordinate information, using calls to the
addCoordinatemethods. 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.
public void updateConstraints(RigidTransform3d TGD, RigidTransform3d TCD, Twist errC, Twist velGD, boolean updateEngaged)
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:
true, updating the
distanceattributes 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- idealized joint transform from frame G to D, obtained by calling
RigidBodyCoupling.projectToConstraints(maspack.matrix.RigidTransform3d, maspack.matrix.RigidTransform3d, maspack.matrix.VectorNd)on
TCD- actual joint transform from frame C to D; included for legacy reasons and not normally used
errC- error transform from frame C to G, represented as a
velGD- velocity of frame G with respect to D, as seen in frame G
true, requests the updating of unilateral
distanceattributes as describe above.
public void TCDToCoordinates(VectorNd coords, RigidTransform3d TCD)
coords. Otherwise this method does nothing.
It is assumed that
TCD is legal with respect the coupling's
bilateral constraints, as defined by
RigidBodyCoupling.projectToConstraints(maspack.matrix.RigidTransform3d, maspack.matrix.RigidTransform3d, maspack.matrix.VectorNd);
RigidBodyCoupling.projectToConstraints(maspack.matrix.RigidTransform3d, maspack.matrix.RigidTransform3d, maspack.matrix.VectorNd) should be used instead.
When setting coordinate values, they should not be clipped to
their maximum and minimum values (as defined by
public void coordinatesToTCD(RigidTransform3d TCD, double x, double y)
public void coordinatesToTCD(RigidTransform3d TCD, VectorNd coords)