public class SphericalCoupling extends RigidBodyCoupling
Modifier and Type | Field and Description |
---|---|
boolean |
applyEuler |
static int |
ROTATION_LIMIT |
static int |
RPY_LIMIT |
static int |
TILT_LIMIT |
BILATERAL, LINEAR, ROTARY, useNewDerivatives
Constructor and Description |
---|
SphericalCoupling() |
Modifier and Type | Method and Description |
---|---|
void |
getConstraintInfo(maspack.spatialmotion.RigidBodyCoupling.ConstraintInfo[] info,
RigidTransform3d TGD,
RigidTransform3d TCD,
RigidTransform3d XERR,
boolean setEngaged)
Computes the constraint frame G and the associated constraint information.
|
double |
getMaximumRotation()
Returns the maximum total rotation for this coupling.
|
void |
getMaximumRotation(double[] maxRot)
Returns the maximum total rotation for each axis.
|
double |
getMaximumTilt()
Returns the maximum value of theta for this revolute coupling.
|
void |
getPitchRange(double[] minmax)
Gets the minimum and maximum values for the coupling's pitch angle (in
radians).
|
int |
getRangeType() |
void |
getRollRange(double[] minmax)
Gets the minimum and maximum values for the coupling's roll angle (in
radians).
|
void |
getRpy(Vector3d angs,
RigidTransform3d TGD) |
void |
getYawRange(double[] minmax)
Gets the minimum and maximum values for the coupling's yaw angle (in
radians).
|
void |
initializeConstraintInfo(maspack.spatialmotion.RigidBodyCoupling.ConstraintInfo[] info) |
int |
maxUnilaterals()
Returns the maximum number of unilateral constraints associated with this
coupling.
|
int |
numBilaterals()
Returns the number of bilateral constraints associated with this coupling.
|
void |
projectToConstraint(RigidTransform3d TGD,
RigidTransform3d TCD)
Computes the frame G on the constraint surface which is closest to a given
frame C.
|
void |
setMaximumRotation(double max)
Sets the maximum total rotation for this coupling.
|
void |
setMaximumRotation(double maxx,
double maxy,
double maxz)
Sets the maximum total rotation about the x, y, and z axes.
|
void |
setMaximumTilt(double max)
Sets the maximum tilt for this coupling.
|
void |
setPitchRange(double min,
double max)
Sets the minimum and maximum values for the coupling's pitch angle (in
radians).
|
void |
setRangeType(int type) |
void |
setRollRange(double min,
double max)
Sets the minimum and maximum values for the coupling's roll angle (in
radians).
|
void |
setRpy(RigidTransform3d TGD,
Vector3d angs) |
void |
setYawRange(double min,
double max)
Sets the minimum and maximum values for the coupling's yaw angle (in
radians).
|
findNearestAngle, getAuxState, getBilateralConstraints, getBilateralForceG, getBilateralImpulses, getBreakAccel, getBreakSpeed, getCompliance, getConstraint, getConstraintInfo, getContactDistance, getDamping, getInitialAuxState, getUnilateralConstraints, getUnilateralForceG, getUnilateralImpulses, maxConstraints, numUnilaterals, printConstraintInfo, scaleDistance, setAuxState, setBilateralImpulses, setBreakAccel, setBreakSpeed, setCompliance, setContactDistance, setDamping, setDistanceAndZeroDerivative, setDistancesAndZeroDerivatives, setUnilateralImpulses, skipAuxState, transformGeometry, updateBodyStates, updateConstraintsFromC, updateUnilateralConstraints, zeroImpulses
public boolean applyEuler
public static final int TILT_LIMIT
public static final int ROTATION_LIMIT
public static final int RPY_LIMIT
public int getRangeType()
public void setRangeType(int type)
public void setMaximumRotation(double max)
ROTATION_LIMIT
. The maximum
must be greater than 0, and will be clipped to the range (0, PI]. Setting
the maximum to PI will remove the range restriction.max
- maximum total rotationpublic void setMaximumRotation(double maxx, double maxy, double maxz)
ROTATION_LIMIT
. For a
general orientation, the maximum rotation angle will be computed from the
length of the rotation axis weighted by the maximum values along each
principal axis.
Each maximum must be greater than 0, and will be clipped to the range (0, PI]. Setting all maximums to PI will remove the range restriction.
maxx
- maximum total rotation about xmaxy
- maximum total rotation about ymaxz
- maximum total rotation about zpublic void getMaximumRotation(double[] maxRot)
maxRot
- returns the maximum rotation for each axispublic double getMaximumRotation()
public void setRollRange(double min, double max)
RPY_LIMIT
.min
- Minimum roll anglemax
- Maximum roll anglepublic void getRollRange(double[] minmax)
minmax
- used to return the minimum and maximum valuessetRollRange(double, double)
public void setPitchRange(double min, double max)
RPY_LIMIT
.min
- Minimum pitch anglemax
- Maximum pitch anglepublic void getPitchRange(double[] minmax)
minmax
- used to return the minimum and maximum valuessetPitchRange(double, double)
public void setYawRange(double min, double max)
RPY_LIMIT
.min
- Minimum yaw anglemax
- Maximum yaw anglepublic void getYawRange(double[] minmax)
minmax
- used to return the minimum and maximum valuessetYawRange(double, double)
public void setMaximumTilt(double max)
TILT_LIMIT
. The maximum must be greater than 0, and
will be clipped to the range (0, PI].max
- maximum value for thetapublic double getMaximumTilt()
public int maxUnilaterals()
RigidBodyCoupling
maxUnilaterals
in class RigidBodyCoupling
public int numBilaterals()
RigidBodyCoupling
numBilaterals
in class RigidBodyCoupling
public void projectToConstraint(RigidTransform3d TGD, RigidTransform3d TCD)
RigidBodyCoupling
projectToConstraint
in class RigidBodyCoupling
TGD
- returns the transform from G to DTCD
- transform from frame C to Dpublic void getRpy(Vector3d angs, RigidTransform3d TGD)
public void setRpy(RigidTransform3d TGD, Vector3d angs)
public void initializeConstraintInfo(maspack.spatialmotion.RigidBodyCoupling.ConstraintInfo[] info)
initializeConstraintInfo
in class RigidBodyCoupling
public void getConstraintInfo(maspack.spatialmotion.RigidBodyCoupling.ConstraintInfo[] info, RigidTransform3d TGD, RigidTransform3d TCD, RigidTransform3d XERR, boolean setEngaged)
RigidBodyCoupling
Information for each constraint wrench is returned through an array of
ConstraintInfo objects supplied by the argument info
. This
array should have a fixed number of elements equal to the number of
bilateral constraints plus the maximum number of unilateral constraints.
Bilateral constraints appear first, followed by the unilateral
constraints. Constraint wrenches and their derivatives (with respect to
frame G) are set within the fields wrenchC
and
dotWrenchC
, repsectively. Distances to set within the
distance
; each of these should be the dot product of the
wrench with the linearization of the constraint error TCG. For computing
wrench derivatives, this method may use myVelBA
, which
gives the current velocity of B with repsect to A, in coordinate frame D.
Information only needs to be returned for constraints which are
potentially active, or engaged. Constraints which are
engaged have their ConstraintInfo.engaged
field set to a
non-zero value. Bilateral constraints are always engaged, and
their ConstraintInfo.engaged
field is automatically
set to 1 by the system. For unilateral constraints, the determination
of whether or not the constraint is engaged, and the setting of
the engaged
field, should be done
by this method if the argument setEngaged
is
true
. Otherwise, if setEngaged
is
false, the method should take the engaged settings as given.
Constraints which are engaged are those which
are returned by the calls getBilateralConstraints
or getUnilateralConstraints
.
getConstraintInfo
in class RigidBodyCoupling
info
- used to return information for each possible constraint wrenchesTGD
- returns the transform from G to DTCD
- transform from operation frame C to DXERR
- TODOsetEngaged
- if true
, this method should determine
if the constraint is engaged.