public class EllipsoidJoint extends JointBase implements CopyableComponent
longitude
and latitude
, which describe a
point on the ellipsoid in polar coordinates. If c1
, s1
c2
, and s2
are the cosine and sine of longitude
and
latitude
, respectively, the semi-axis lengths of the ellipsoid are
rx
, ry
, and rz
, and the origin of C is given with
respect to D by a vector p
, then
[ rx s2 ] p = [ -ry s1 c2 ] [ rz c1 c2 ]which is the equation of an ellipsoid in polar coordinates, with longitude giving the rotation angle about the x axis.
The longitude and latitude coordinates define a frame with respect to D
known as "frame 2". With respect to D, the origin of frame 2 is p
described above, while the orientation of frame 2 is determined in
one of two ways:
latitude
angle.
(p.x/rx, p.y/ry, p.z/rz)
, while the x direction is the same
as that which would result by treating the longitude and latitude
coordinates as the first two joints of an XYZ GimbalCoupling.
theta
and phi
, provide two additional
rotational degrees of freedom between frame 2 and frame C, consisting of a
rotation by theta
about the frame 2 z axis, followed by an
additional rotation about a ``wing'' axis in the (rotated) x-y plane, where
the wing axis is defined by an angle alpha
with respect to the x
axis. The default wing axis corresponds to the x axis (i.e., alpha
=
0).
The longitude
, latitude
theta
phi
values
are available as properties (given in degrees) which can be read and also,
under appropriate circumstances, set. Setting these values causes an
adjustment in the positions of one or both bodies connected to this joint,
along with adjacent bodies connected to them, with preference given to
bodies that are not attached to ``ground''. If this is done during
simulation, and particularly if one or both of the bodies connected to this
joint are moving dynamically, the results will be unpredictable and will
likely conflict with the simulation.
ModelComponent.NavpanelVisibility
Modifier and Type | Field and Description |
---|---|
static int |
LATITUDE_IDX |
static int |
LONGITUDE_IDX |
static PropertyList |
myProps |
static int |
PHI_IDX |
static int |
THETA_IDX |
DEFAULT_SHAFT_LENGTH, DEFAULT_SHAFT_RADIUS
debug, useOldDerivativeMethod
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
COPY_REFERENCES, REST_POSITION
TG_ARTICULATED, TG_DRAGGER, TG_PRESERVE_ORIENTATION, TG_SIMULATING
TRANSPARENT, TWO_DIMENSIONAL
Constructor and Description |
---|
EllipsoidJoint()
No-args constructor needed for writing/scanning.
|
EllipsoidJoint(ConnectableBody bodyA,
ConnectableBody bodyB,
RigidTransform3d TCW,
RigidTransform3d TDW,
double A,
double B,
double C)
Creates a
EllipsoidJoint connecting two connectable bodies,
bodyA and bodyB . |
EllipsoidJoint(double A,
double B,
double C,
double alpha,
boolean useOpenSimApprox)
Creates an
EllipsoidJoint which is not attached to any bodies. |
EllipsoidJoint(RigidBody bodyA,
RigidTransform3d TCA,
RigidBody bodyB,
RigidTransform3d TDB,
double A,
double B,
double C,
double alpha,
boolean openSimCompatible)
Creates a
EllipsoidJoint connecting two rigid bodies, bodyA
and bodyB . |
Modifier and Type | Method and Description |
---|---|
RenderProps |
createRenderProps()
Factory method to create render properties appropriate to this object.
|
PropertyList |
getAllPropertyInfo()
Returns a list giving static information about all properties exported by
this object.
|
double |
getAlpha() |
EllipsoidCoupling |
getCoupling()
Returns the coupling used by this connector.
|
boolean |
getDrawEllipsoid() |
double |
getLatitude()
Queries this joint's latitude angle.
|
DoubleInterval |
getLatitudeRange()
Queries the latitude range limits for this joint.
|
double |
getLongitude()
Queries this joint's longitude angle.
|
DoubleInterval |
getLongitudeRange()
Queries the longitude angle range limits for this joint.
|
double |
getMaxLatitude()
Queries the upper latitude range limit for this joint.
|
double |
getMaxLongitude()
Queries the upper longitude range limit for this joint.
|
double |
getMaxPhi()
Queries the upper phi range limit for this joint, in degrees.
|
double |
getMaxTheta()
Queries the upper theta range limit for this joint.
|
double |
getMinLatitude()
Queries the lower latitude range limit for this joint.
|
double |
getMinLongitude()
Queries the lower longitude range limit for this joint.
|
double |
getMinPhi()
Queries the lower phi range limit for this joint, in degrees.
|
double |
getMinTheta()
Queries the lower theta range limit for this joint.
|
double |
getPhi()
Queries this joint's phi angle.
|
DoubleInterval |
getPhiRange()
Queries the phi angle range limits for this joint.
|
Vector3d |
getSemiAxisLengths()
Queries the semi-axis lengths for this ellipsoid.
|
double |
getTheta()
Queries this joint's theta angle.
|
DoubleInterval |
getThetaRange()
Queries the theta angle range limits for this joint.
|
boolean |
isLatitudeLocked()
Queries whether the latitude coordinate for this joint is locked.
|
boolean |
isLongitudeLocked()
Queries whether the longitude coordinate for this joint is locked.
|
boolean |
isOpenSimCompatible() |
boolean |
isPhiLocked()
Queries whether the phi coordinate for this joint is locked.
|
boolean |
isThetaLocked()
Queries whether the theta coordinate for this joint is locked.
|
void |
prerender(RenderList list)
Called prior to rendering to allow this object to update the internal
state required for rendering (such as by caching rendering coordinates).
|
void |
render(Renderer renderer,
int flags)
Render this object using the functionality of the supplied
Renderer . |
void |
setDrawEllipsoid(boolean enable) |
void |
setLatitude(double latitude)
Sets this joint's latitude angle.
|
void |
setLatitudeLocked(boolean locked)
Set whether the latitude coordinate for this joint is locked.
|
void |
setLatitudeRange(double min,
double max)
Sets the latitude range limits for this joint.
|
void |
setLatitudeRange(DoubleInterval range)
Sets the range limits of the latitude for this joint.
|
void |
setLongitude(double longitude)
Sets this joint's longitude angle.
|
void |
setLongitudeLocked(boolean locked)
Set whether the longitude coordinate for this joint is locked.
|
void |
setLongitudeRange(double min,
double max)
Sets the longitude range limits for this joint.
|
void |
setLongitudeRange(DoubleInterval range)
Sets the range limits of the longitude for this joint.
|
void |
setMaxLatitude(double max)
Sets the upper latitude range limit for this joint.
|
void |
setMaxLongitude(double max)
Sets the upper longitude range limit for this joint.
|
void |
setMaxPhi(double max)
Sets the upper phi range limit for this joint.
|
void |
setMaxTheta(double max)
Sets the upper theta range limit for this joint.
|
void |
setMinLatitude(double min)
Sets the lower latitude range limit for this joint.
|
void |
setMinLongitude(double min)
Sets the lower longitude range limit for this joint.
|
void |
setMinPhi(double min)
Sets the lower phi range limit for this joint.
|
void |
setMinTheta(double min)
Sets the lower theta range limit for this joint.
|
void |
setPhi(double phi)
Sets this joint's phi angle.
|
void |
setPhiLocked(boolean locked)
Set whether the phi coordinate for this joint is locked.
|
void |
setPhiRange(double min,
double max)
Sets the phi range limits for this joint.
|
void |
setPhiRange(DoubleInterval range)
Sets the range limits of phi for this joint.
|
void |
setTheta(double theta)
Sets this joint's theta angle.
|
void |
setThetaLocked(boolean locked)
Set whether the theta coordinate for this joint is locked.
|
void |
setThetaRange(double min,
double max)
Sets the theta range limits for this joint.
|
void |
setThetaRange(DoubleInterval range)
Sets the range limits of theta for this joint.
|
void |
updateBounds(Vector3d pmin,
Vector3d pmax)
Update the minimum and maximum points for this object.
|
addCoordinateSolveBlocks, addCoordinateVelJacobian, applyCoordinateForce, coordinatesToTCD, getCoordinate, getCoordinateDeg, getCoordinateIndex, getCoordinateMotionType, getCoordinateName, getCoordinateRange, getCoordinateRangeDeg, getCoordinates, getCoordinateSpeed, getCoordinateValue, getMaxCoordinate, getMaxCoordinateDeg, getMinCoordinate, getMinCoordinateDeg, getPosition, getShaftLength, getShaftRadius, getStoredCoordinates, getStoredTCD, getStoredTCD, isCoordinateLocked, numCoordinates, setCoordinate, setCoordinateDeg, setCoordinateLocked, setCoordinateName, setCoordinateRange, setCoordinateRangeDeg, setCoordinates, setShaftLength, setShaftRadius
addBilateralConstraints, addFrictionConstraints, addMasterBlocks, addTransformableDependencies, addUnilateralConstraints, computeConstraintMatrixA, computeConstraintMatrixB, connectToHierarchy, copy, disconnectFromHierarchy, findAttachedBodies, getActivation, getAxisLength, getBilateralForceInA, getBilateralForceInA, getBilateralForceInB, getBilateralForceInB, getBilateralForceInC, getBilateralForceInC, getBilateralForces, getBilateralInfo, getBilateralSizes, getBodyA, getBodyB, getCompliance, getConstrainedComponents, getConstraint, getConstraintFlags, getConstraintForce, getCopyReferences, getCurrentTCD, getCurrentTCW, getCurrentTCW, getCurrentTDW, getCurrentTDW, getDamping, getDrawFrameC, getDrawFrameD, getFrameAttachmentA, getFrameAttachmentB, getFrictionForces, getFrictionState, getHardReferences, getLinearCompliance, getPenetrationTol, getPenetrationTolMode, getPose, getRenderFrame, getRotaryCompliance, getRotaryLimitTol, getRotaryLimitTolMode, getState, getStateVersion, getTransformDGeometryOnly, getTransformPositionOnly, getUnilateralForceInA, getUnilateralForceInA, getUnilateralForceInB, getUnilateralForceInB, getUnilateralForceInC, getUnilateralForceInC, getUnilateralForces, getUnilateralInfo, getUnilateralSizes, getUnilateralState, hasState, isActive, isConnectedToBodies, isDuplicatable, isEnabled, isNotAttached, maxFrictionConstraintSets, numBilateralConstraints, numConstraints, numEngagedUnilateralConstraints, numUnilateralConstraints, printConnectedBodies, printConstraintInfo, scaleDistance, scaleMass, setAlwaysAdjustBodyA, setAxisLength, setBilateralForces, setBodies, setBodies, setBodies, setBodies, setCompliance, setCurrentTCW, setCurrentTDW, setDamping, setDrawFrameC, setDrawFrameD, setEnabled, setFrictionForces, setFrictionState, setLinearCompliance, setPenetrationTol, setPenetrationTolMode, setRotaryCompliance, setRotaryLimitTol, setRotaryLimitTolMode, setState, setTransformDGeometryOnly, setTransformPositionOnly, setUnilateralForces, setUnilateralState, transformGeometry, transformGeometry, updateAttachments, updateConstraints, zeroForces
defaultRenderPropsAreNull, getRenderHints, getRenderProps, getSelection, isSelectable, isVisible, numSelectionQueriesNeeded, setRenderProps, setVisible, updateRenderProps
checkFlag, checkName, checkNameUniqueness, clearFlag, clone, createTempFlag, getChildren, getGrandParent, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, hasChildren, isFixed, isMarked, isScanning, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, postscan, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, scan, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setScanning, setSelected, setWritable, updateReferences, write
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
copy, getCopyReferences, isDuplicatable
connectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, hasState, isFixed, isMarked, isSelected, notifyParentOfChange, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, setWritable, updateReferences
getProperty
getChildren, hasChildren
postscan
isWritable, write
transformPriority
advanceState, getAuxVarDerivative, getAuxVarState, numAuxVars, requiresAdvance, setAuxVarState
public static final int LONGITUDE_IDX
public static final int LATITUDE_IDX
public static final int THETA_IDX
public static final int PHI_IDX
public static PropertyList myProps
public EllipsoidJoint()
public EllipsoidJoint(double A, double B, double C, double alpha, boolean useOpenSimApprox)
EllipsoidJoint
which is not attached to any bodies.
It can subsequently be connected using one of the setBodies
methods.public EllipsoidJoint(RigidBody bodyA, RigidTransform3d TCA, RigidBody bodyB, RigidTransform3d TDB, double A, double B, double C, double alpha, boolean openSimCompatible)
EllipsoidJoint
connecting two rigid bodies, bodyA
and bodyB
. If A and B describe the coordinate frames of bodyA
and bodyB
, then TCA
and TDB
give the
(fixed) transforms from the joint's C and D frames to A and B,
respectively. Since C and D are specified independently, the joint
transform TCD may not necessarily be initialized to the identity.
Specifying bodyB
as null
will cause bodyA
to
be connected to ground, with TDB
then being the same as TDW
.
bodyA
- rigid body ATCA
- transform from joint frame C to body frame AbodyB
- rigid body B (or null
)TDB
- transform from joint frame D to body frame BA
- semi-axis length along xB
- semi-axis length along yC
- semi-axis length along zalpha
- angle of the second rotation axis, with respect to the x
axis of frame 2, as described in this class's Javadoc headeropenSimCompatible
- if true
, make this joint compatible with
the OpenSim ellispoid joint, as described in this class's Javadoc header.public EllipsoidJoint(ConnectableBody bodyA, ConnectableBody bodyB, RigidTransform3d TCW, RigidTransform3d TDW, double A, double B, double C)
EllipsoidJoint
connecting two connectable bodies,
bodyA
and bodyB
. The joint frames C and D are located
independently with respect to world coordinates by TCW
and TDW
. Specifying bodyB
as null
will cause bodyA
to be connected to ground.bodyA
- body AbodyB
- body B (or null
)TCW
- initial transform from joint frame C to worldTDW
- initial transform from joint frame D to worldA
- semi-axis length along xB
- semi-axis length along yC
- semi-axis length along zpublic PropertyList getAllPropertyInfo()
HasProperties
getAllPropertyInfo
in interface HasProperties
getAllPropertyInfo
in class JointBase
public boolean getDrawEllipsoid()
public void setDrawEllipsoid(boolean enable)
public EllipsoidCoupling getCoupling()
BodyConnector
getCoupling
in class BodyConnector
public boolean isOpenSimCompatible()
public double getAlpha()
public double getLongitude()
public void setLongitude(double longitude)
longitude
- new longitude angle (in degrees)public DoubleInterval getLongitudeRange()
setLongitudeRange(DoubleInterval)
for more details.public double getMinLongitude()
public double getMaxLongitude()
public void setLongitudeRange(DoubleInterval range)
[-inf, inf]
, which implies no limits. If the longitude travels
beyond these limits during dynamic simulation, unilateral constraints
will be activated to enforce them. Setting the lower limit to -inf
or the upper limit to inf
removes the lower or upper limit,
respectively. Specifying range
as null
will set the range
to (-inf, inf)
.range
- longitude range limits for this joint (in degrees)public void setLongitudeRange(double min, double max)
setLongitudeRange(DoubleInterval)
.min
- minimum longitude angle (in degrees)max
- maximum longitude angle (in degrees)public void setMaxLongitude(double max)
inf
removes the upper limit.max
- upper longitude range limit (in degrees)public void setMinLongitude(double min)
-inf
removes the lower limit.min
- lower longitude range limit (in degrees)public boolean isLongitudeLocked()
true
if longitude is lockedpublic void setLongitudeLocked(boolean locked)
locked
- if true
, locks longitudepublic double getLatitude()
public void setLatitude(double latitude)
latitude
- new latitude angle (in degrees)public DoubleInterval getLatitudeRange()
setLatitudeRange(DoubleInterval)
for more details.public double getMinLatitude()
public double getMaxLatitude()
public void setLatitudeRange(DoubleInterval range)
[-inf, inf]
, which implies no limits. If the latitude travels
beyond these limits during dynamic simulation, unilateral constraints
will be activated to enforce them. Setting the lower limit to -inf
or the upper limit to inf
removes the lower or upper limit,
respectively. Specifying range
as null
will set the range
to (-inf, inf)
.range
- latitude range limits for this joint (in degrees)public void setLatitudeRange(double min, double max)
setLatitudeRange(DoubleInterval)
.min
- minimum latitude angle (in degrees)max
- maximum latitude angle (in degrees)public void setMaxLatitude(double max)
inf
removes the upper limit.max
- upper latitude range limit (in degrees)public void setMinLatitude(double min)
-inf
removes the lower limit.min
- lower latitude range limit (in degrees)public boolean isLatitudeLocked()
true
if latitude is lockedpublic void setLatitudeLocked(boolean locked)
locked
- if true
, locks latitudepublic double getTheta()
public void setTheta(double theta)
theta
- new theta angle (in degrees)public DoubleInterval getThetaRange()
setThetaRange(DoubleInterval)
for more details.public double getMinTheta()
public double getMaxTheta()
public void setThetaRange(DoubleInterval range)
[-inf, inf]
, which implies no limits. If theta travels
beyond these limits during dynamic simulation, unilateral constraints
will be activated to enforce them. Setting the lower limit to -inf
or the upper limit to inf
removes the lower or upper limit,
respectively. Specifying range
as null
will set the range
to (-inf, inf)
.range
- theta range limits for this joint (in degrees)public void setThetaRange(double min, double max)
setThetaRange(DoubleInterval)
.min
- minimum theta angle (in degrees)max
- maximum theta angle (in degrees)public void setMaxTheta(double max)
inf
removes the upper limit.max
- upper theta range limit (in degrees)public void setMinTheta(double min)
-inf
removes the lower limit.min
- lower theta range limit (in degrees)public boolean isThetaLocked()
true
if theta is lockedpublic void setThetaLocked(boolean locked)
locked
- if true
, locks thetapublic double getPhi()
public void setPhi(double phi)
phi
- new phi angle (in degrees)public DoubleInterval getPhiRange()
setPhiRange(DoubleInterval)
for more details.public double getMinPhi()
public double getMaxPhi()
public void setPhiRange(DoubleInterval range)
[-inf, inf]
, which implies no limits. If phi travels beyond these limits
during dynamic simulation, unilateral constraints will be activated to
enforce them. Setting the lower limit to -inf
or the upper limit
to inf
removes the lower or upper limit, respectively. Specifying
range
as null
will set the range to (-inf, inf)
.range
- phi range limits for this joint (in degrees)public void setPhiRange(double min, double max)
setPhiRange(DoubleInterval)
.min
- minimum phi angle (in degrees)max
- maximum phi angle (in degrees)public void setMaxPhi(double max)
inf
removes the upper limit.max
- upper phi range limit (in degrees)public void setMinPhi(double min)
-inf
removes the lower limit.min
- lower phi range limit (in degrees)public boolean isPhiLocked()
true
if phi is lockedpublic void setPhiLocked(boolean locked)
locked
- if true
, locks phipublic Vector3d getSemiAxisLengths()
public RenderProps createRenderProps()
HasRenderProps
createRenderProps
in interface HasRenderProps
createRenderProps
in class RenderableComponentBase
public void prerender(RenderList list)
IsRenderable
list.addIfVisible (obj);
for each of the objects in question.prerender
in interface IsRenderable
prerender
in class BodyConnector
list
- list of objects to be renderedpublic void updateBounds(Vector3d pmin, Vector3d pmax)
IsRenderable
updateBounds
in interface IsRenderable
updateBounds
in class BodyConnector
pmin
- minimum pointpmax
- maximum pointpublic void render(Renderer renderer, int flags)
IsRenderable
Renderer
.render
in interface IsRenderable
render
in class BodyConnector
renderer
- provides the functionality used to perform the rendering.flags
- flags that may be used to control different
aspects of the rendering. Flags are defined in Renderer
and currently include
Renderer.HIGHLIGHT
and
Renderer.SORT_FACES
.