|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectartisynth.core.modelbase.ModelComponentBase
artisynth.core.modelbase.RenderableComponentBase
artisynth.core.mechmodels.DynamicMechComponentBase
artisynth.core.mechmodels.Frame
public class Frame
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface artisynth.core.modelbase.ModelComponent |
---|
ModelComponent.NavpanelVisibility |
Field Summary | |
---|---|
static boolean |
dynamicVelInWorldCoords
|
static PropertyList |
myProps
|
RigidTransform3d |
myRenderFrame
|
Fields inherited from class artisynth.core.modelbase.ModelComponentBase |
---|
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames |
Fields inherited from interface artisynth.core.util.TransformableGeometry |
---|
ARTICULATED, SIMULATING |
Fields inherited from interface artisynth.core.modelbase.CopyableComponent |
---|
COPY_REFERENCES |
Fields inherited from interface maspack.render.GLRenderable |
---|
TRANSLUCENT, TWO_DIMENSIONAL |
Constructor Summary | |
---|---|
Frame()
|
|
Frame(RigidTransform3d X)
|
Method Summary | |
---|---|
void |
addExternalForce(Wrench w)
|
void |
addForce(Wrench w)
|
void |
addPointForce(Vector3d f,
Point3d pos)
Adds the effect of a force applied at a specific postion with respect to this frame. |
void |
addPosImpulse(double[] xbuf,
int xidx,
double h,
double[] vbuf,
int vidx)
|
void |
addPosJacobian(SparseNumberedBlockMatrix S,
double s)
Scales the components of the position Jacobian associated with this force effector and adds it to the supplied solve matrix M. |
void |
addScaledExternalForce(double s,
Wrench w)
|
void |
addSolveBlock(SparseNumberedBlockMatrix S)
|
void |
addSolveBlocks(SparseNumberedBlockMatrix S)
Adds any needed blocks to a solve matrix in order to accomodate the Jacobian terms associated with this force effector. |
int |
addTargetJacobian(SparseBlockMatrix J,
int bi)
Add a row to the motion target Jacobian for this motion target. |
void |
addVelJacobian(SparseNumberedBlockMatrix S,
double s)
Scales the components of the velocity Jacobian associated with this force effector and adds it to the supplied solve matrix M. |
void |
applyForces(double t)
Adds forces to the components affected by this force effector at a particular time. |
void |
applyGravity(Vector3d gacc)
Applies a gravity force to this component, given a prescribed gravity acceleration vector. |
void |
computeAppliedWrench(Matrix6x1 wr,
Vector3d f,
Vector3d p)
Computes the wrench (in body coordinates) produced by applying a force at a particular point. |
void |
computeAppliedWrench(Wrench wr,
Vector3d f,
Vector3d p)
Computes the wrench (in body coordinates) produced by applying a point at a particular point. |
void |
computePointPosition(Vector3d pos,
Point3d loc)
Computes the position, in world coordinates, of a point attached to this frame. |
void |
computePointVelocity(Vector3d vel,
Point3d loc)
Computes the velocity, in world coordinates, of a point attached to this frame. |
void |
computePointVelocity(Vector3d vel,
Point3d loc,
Twist frameVel)
Computes the velocity, in world coordinates, of a point attached to this frame. |
ModelComponent |
copy(int flags,
java.util.Map<ModelComponent,ModelComponent> copyMap)
Create a copy of this component. |
MatrixBlock |
createMassBlock()
Create a matrix block for representing the mass of this component, initialized to the component's effective mass (instrinsic mass plus the mass due to all attachmented components). |
RenderProps |
createRenderProps()
Factory method to create render properties appropriate to this object. |
MatrixBlock |
createSolveBlock()
|
static void |
drawAxes(GLRenderer renderer,
RigidTransform3d XFrameToWorld,
float len)
|
PropertyList |
getAllPropertyInfo()
Returns a list giving static information about all properties exported by this object. |
double |
getAxisLength()
|
void |
getBodyForce(Wrench wr)
|
void |
getBodyVelocity(Twist v)
|
int |
getBodyVelState(double[] buf,
int idx)
|
boolean |
getCopyReferences(java.util.List<ModelComponent> refs,
ModelComponent ancestor)
Collects external references which must also be copied in order to duplicate this component. |
Wrench |
getExternalForce()
|
Wrench |
getForce()
|
int |
getForce(double[] f,
int idx)
|
void |
getForce(Wrench wr)
|
double |
getFrameDamping()
|
PropertyMode |
getFrameDampingMode()
|
int |
getJacobianType()
Returns a code indicating the matrix type that results when the Jacobian terms of this force effector are added to the solve matrix. |
double |
getMass(double t)
Returns the scalar mass of this component at time t. |
void |
getMass(Matrix M,
double t)
Gets the mass of this component at a particular time. |
int |
getMassForces(VectorNd f,
double t,
int idx)
Gets the mass forces for this component at a particular time. |
Vector3d |
getMoment()
|
AxisAngle |
getOrientation()
|
int |
getPosDerivative(double[] dxdt,
int idx)
|
RigidTransform3d |
getPose()
|
void |
getPose(RigidTransform3d XFrameToWorld)
|
Point3d |
getPosition()
|
int |
getPosState(double[] buf,
int idx)
|
int |
getPosStateSize()
|
double |
getRotaryDamping()
|
PropertyMode |
getRotaryDampingMode()
|
Quaternion |
getRotation()
|
void |
getSelection(java.util.LinkedList<java.lang.Object> list,
int qid)
Append to list the component (or components) associated with
the qid -th selection query issued by this component's render
method. |
void |
getState(FrameState state)
|
int |
getState(VectorNd x,
int idx)
|
MotionTarget.TargetActivity |
getTargetActivity()
|
AxisAngle |
getTargetOrientation()
|
int |
getTargetPos(double[] post,
double s,
double h,
int idx)
|
RigidTransform3d |
getTargetPose()
|
Point3d |
getTargetPosition()
|
int |
getTargetVel(double[] velt,
double s,
double h,
int idx)
|
Twist |
getTargetVelocity()
|
java.lang.String[] |
getTracables()
|
TracingProbe |
getTracingProbe(java.lang.String tracableName)
|
Vector3d |
getTransForce()
|
Twist |
getVelocity()
|
void |
getVelocity(Twist v)
|
int |
getVelState(double[] buf,
int idx)
|
int |
getVelStateSize()
|
int |
getWorldVelState(double[] buf,
int idx)
|
boolean |
isDuplicatable()
Returns true if this component can be duplicated. |
boolean |
isMassConstant()
|
void |
prerender(RenderList list)
Prepare for rendering, and potentially add itself to a list to be drawn by a GLRenderer. |
void |
render(GLRenderer renderer,
int flags)
Render this object using Open GL via the JOGL. |
void |
resetTargets()
|
void |
scaleDistance(double s)
Scales all distance coordinates. |
void |
scaleMass(double s)
Scales all mass units. |
void |
setAxisLength(double len)
|
void |
setBodyVelocity(Twist v)
|
void |
setExternalForce(Wrench w)
|
int |
setForce(double[] f,
int idx)
|
void |
setForce(Wrench w)
|
void |
setForcesToExternal()
|
void |
setFrameDamping(double d)
|
void |
setFrameDampingMode(PropertyMode mode)
|
void |
setOrientation(AxisAngle axisAng)
|
void |
setPose(RigidTransform3d XFrameToWorld)
|
void |
setPosition(Point3d pos)
|
int |
setPosState(double[] buf,
int idx)
|
void |
setRotaryDamping(double d)
|
void |
setRotaryDampingMode(PropertyMode mode)
|
void |
setRotation(Quaternion q)
|
void |
setState(DynamicMechComponent c)
Sets the state of this DynamicMechComponent from that of another. |
void |
setState(Frame frame)
|
int |
setState(VectorNd x,
int idx)
|
void |
setTargetActivity(MotionTarget.TargetActivity activity)
|
void |
setTargetOrientation(AxisAngle axisAng)
|
int |
setTargetPos(double[] post,
int idx)
|
void |
setTargetPose(RigidTransform3d X)
|
void |
setTargetPosition(Point3d pos)
|
int |
setTargetVel(double[] velt,
int idx)
|
void |
setTargetVelocity(Twist vel)
|
void |
setVelocity(double vx,
double vy,
double vz,
double wx,
double wy,
double wz)
|
void |
setVelocity(Twist v)
|
int |
setVelState(double[] buf,
int idx)
|
void |
transformGeometry(AffineTransform3dBase X)
Applies an affine transformation to the geometry of this object. |
void |
transformGeometry(AffineTransform3dBase X,
TransformableGeometry topObject,
int flags)
Applies an affine transformation to the geometry of this object. |
void |
updateBounds(Point3d pmin,
Point3d pmax)
Update the minimum and maximum points for this object. |
void |
updatePose()
|
boolean |
velocityLimitExceeded(double tlimit,
double rlimit)
Checks if the current component velocity exceeds specified limits. |
void |
zeroExternalForces()
|
void |
zeroForces()
|
Methods inherited from class artisynth.core.mechmodels.DynamicMechComponentBase |
---|
addMasterAttachment, getAttachment, getInverseMass, getMasterAttachments, getSolveIndex, hasState, isActive, isAttached, isControllable, isDynamic, isParametric, removeMasterAttachment, setAttached, setSolveIndex |
Methods inherited from class artisynth.core.modelbase.RenderableComponentBase |
---|
getRenderHints, getRenderProps, isSelectable, numSelectionQueriesNeeded, setRenderProps, updateRenderProps |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface artisynth.core.mechmodels.DynamicMechComponent |
---|
addMasterAttachment, checkFlag, clearFlag, getAttachment, getInverseMass, getMasterAttachments, getSolveIndex, isActive, isAttached, isControllable, isDynamic, isParametric, removeMasterAttachment, setAttached, setFlag, setSolveIndex |
Methods inherited from interface artisynth.core.modelbase.ModelComponent |
---|
connectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, hasState, isFixed, isMarked, isSelected, notifyParentOfChange, postscan, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, updateReferences |
Methods inherited from interface maspack.properties.HierarchyNode |
---|
getChildren, hasChildren |
Methods inherited from interface maspack.util.Scannable |
---|
isWritable, write |
Field Detail |
---|
public static boolean dynamicVelInWorldCoords
public RigidTransform3d myRenderFrame
public static PropertyList myProps
Constructor Detail |
---|
public Frame()
public Frame(RigidTransform3d X)
Method Detail |
---|
public PropertyList getAllPropertyInfo()
HasProperties
getAllPropertyInfo
in interface HasProperties
getAllPropertyInfo
in class ModelComponentBase
public Wrench getForce()
public void getForce(Wrench wr)
public void getBodyForce(Wrench wr)
public Vector3d getTransForce()
public Vector3d getMoment()
public void setForce(Wrench w)
public void addForce(Wrench w)
public Wrench getExternalForce()
public void setExternalForce(Wrench w)
public void addExternalForce(Wrench w)
public void addScaledExternalForce(double s, Wrench w)
public Twist getVelocity()
public void getVelocity(Twist v)
public void setVelocity(Twist v)
public void setVelocity(double vx, double vy, double vz, double wx, double wy, double wz)
public void setPose(RigidTransform3d XFrameToWorld)
public RigidTransform3d getPose()
public void getPose(RigidTransform3d XFrameToWorld)
getPose
in interface HasCoordinateFrame
public Point3d getPosition()
public void setPosition(Point3d pos)
public AxisAngle getOrientation()
public void setOrientation(AxisAngle axisAng)
public Quaternion getRotation()
public void setRotation(Quaternion q)
public void updatePose()
public void applyGravity(Vector3d gacc)
applyGravity
in interface DynamicMechComponent
public double getAxisLength()
public void setAxisLength(double len)
public void computePointPosition(Vector3d pos, Point3d loc)
pos
- returns the point positionloc
- position of the point, in body coordinatespublic void computePointVelocity(Vector3d vel, Point3d loc)
vel
- returns the point velocityloc
- position of the point, in body coordinatespublic void computePointVelocity(Vector3d vel, Point3d loc, Twist frameVel)
vel
- returns the point velocityloc
- position of the point, in body coordinatesframeVel
- velocity of the frame, in rotated world coordinatespublic void addPointForce(Vector3d f, Point3d pos)
public void computeAppliedWrench(Wrench wr, Vector3d f, Vector3d p)
wr
- returns the wrench in body coordinatesf
- applied force at the point (world coordinates)p
- location of the point on the body (body coordinates)public void computeAppliedWrench(Matrix6x1 wr, Vector3d f, Vector3d p)
wr
- returns the wrench in body coordinatesf
- applied force at the point (world coordinates)p
- location of the point on the body (body coordinates)public void resetTargets()
resetTargets
in interface MotionTargetComponent
public MotionTarget.TargetActivity getTargetActivity()
getTargetActivity
in interface MotionTargetComponent
public void setTargetActivity(MotionTarget.TargetActivity activity)
setTargetActivity
in interface MotionTargetComponent
public Point3d getTargetPosition()
public void setTargetPosition(Point3d pos)
public AxisAngle getTargetOrientation()
public void setTargetOrientation(AxisAngle axisAng)
public RigidTransform3d getTargetPose()
public void setTargetPose(RigidTransform3d X)
public Twist getTargetVelocity()
public void setTargetVelocity(Twist vel)
public int getTargetVel(double[] velt, double s, double h, int idx)
getTargetVel
in interface MotionTargetComponent
public int setTargetVel(double[] velt, int idx)
setTargetVel
in interface MotionTargetComponent
public int getTargetPos(double[] post, double s, double h, int idx)
getTargetPos
in interface MotionTargetComponent
public int setTargetPos(double[] post, int idx)
setTargetPos
in interface MotionTargetComponent
public int addTargetJacobian(SparseBlockMatrix J, int bi)
MotionTargetComponent
vt = J u
addTargetJacobian
in interface MotionTargetComponent
J
- motion target Jacobianbi
- block row index for the row to be added
public double getFrameDamping()
public void setFrameDamping(double d)
public PropertyMode getFrameDampingMode()
public void setFrameDampingMode(PropertyMode mode)
public double getRotaryDamping()
public void setRotaryDamping(double d)
public PropertyMode getRotaryDampingMode()
public void setRotaryDampingMode(PropertyMode mode)
public RenderProps createRenderProps()
HasRenderProps
createRenderProps
in interface HasRenderProps
createRenderProps
in class RenderableComponentBase
public void prerender(RenderList list)
GLRenderable
prerender
in interface GLRenderable
prerender
in class RenderableComponentBase
public void updateBounds(Point3d pmin, Point3d pmax)
GLRenderable
updateBounds
in interface GLRenderable
updateBounds
in class RenderableComponentBase
pmin
- minimum pointpmax
- maximum pointpublic static void drawAxes(GLRenderer renderer, RigidTransform3d XFrameToWorld, float len)
public void render(GLRenderer renderer, int flags)
GLRenderable
render
in interface GLRenderable
render
in class RenderableComponentBase
renderer
- renderer object which is used to perform the rendering. Provides pointers
to GL and GLU, along with helper functions.flags
- supplies flags that may be used to control different
aspects of the rendering. Flags are defined in GLRenderer
and currently include
GLRenderer.SELECTED
,
GLRenderer.VERTEX_COLORING
,
GLRenderer.HSV_COLOR_INTERPOLATION
,
GLRenderer.SORT_FACES
, and
GLRenderer.CLEAR_MESH_DISPLAY_LISTS
.public void getSelection(java.util.LinkedList<java.lang.Object> list, int qid)
GLSelectable
list
the component (or components) associated with
the qid
-th selection query issued by this component's render
method. This will only be called if this component manages its own
selection (i.e., the number nums
returned by GLSelectable.numSelectionQueriesNeeded()
is positive), and qid
will in
turn be a number between 0 and nums
-1.
getSelection
in interface GLSelectable
getSelection
in class RenderableComponentBase
list
- selected objects are appended to the end of this listqid
- index of the selection querypublic void transformGeometry(AffineTransform3dBase X)
TransformableGeometry
transformGeometry (X, this, 0);
transformGeometry
in interface TransformableGeometry
X
- affine transformationpublic void transformGeometry(AffineTransform3dBase X, TransformableGeometry topObject, int flags)
TransformableGeometry
topComponent
should be the component for which the method
was initially invoked. The variable flags
provides
information about the context in which the transformation is
being applied. At present, the available flags are
TransformableGeometry.SIMULATING
and TransformableGeometry.ARTICULATED
.
transformGeometry
in interface TransformableGeometry
X
- affine transformationtopObject
- component on which the method was initially invokedflags
- provides information about the context in which the
transformation is being applied.public void scaleDistance(double s)
ScalableUnits
scaleDistance
in interface ScalableUnits
s
- scaling factorpublic void zeroExternalForces()
zeroExternalForces
in interface DynamicMechComponent
public void zeroForces()
zeroForces
in interface DynamicMechComponent
public void setForcesToExternal()
setForcesToExternal
in interface DynamicMechComponent
public void applyForces(double t)
ForceEffector
applyForces
in interface ForceEffector
t
- time (seconds)public void addVelJacobian(SparseNumberedBlockMatrix S, double s)
ForceEffector
M is guaranteed to be the same matrix supplied in the most recent call to
addSolveBlocks
, and so implementations may choose
to cache the relevant matrix blocks from that call, instead of retrieving
them directly from M.
addVelJacobian
in interface ForceEffector
S
- solve matrix to which scaled velocity Jacobian is to be addeds
- scaling factor for velocity Jacobianpublic void addPosJacobian(SparseNumberedBlockMatrix S, double s)
ForceEffector
M is guaranteed to be the same matrix supplied in the most recent call to
addSolveBlocks
, and so implementations may choose
to cache the relevant matrix blocks from that call, instead of retrieving
them directly from M.
addPosJacobian
in interface ForceEffector
S
- solve matrix to which scaled position Jacobian is to be addeds
- scaling factor for position Jacobianpublic void addSolveBlocks(SparseNumberedBlockMatrix S)
ForceEffector
getSolveIndex
) for all dynamic or attached components affected by this
force effector.
addSolveBlocks
in interface ForceEffector
S
- solve matrix to which blocks should be addedpublic int getJacobianType()
ForceEffector
Matrix.SYMMETRIC
or Matrix.POSITIVE_DEFINITE
. The former should be set if adding the Jacobian
terms preserves symmetry, and the latter should be set if positive
definiteness if preserved. Both should be set if there is no Jacobian for
this effector (i.e., the Jacobian methods are not implemented). Matrix
types from all the force effectors are logically and-ed together to
determine the type for the entire solve matrix.
getJacobianType
in interface ForceEffector
public void scaleMass(double s)
ScalableUnits
scaleMass
in interface ScalableUnits
s
- scaling factorpublic MatrixBlock createMassBlock()
DynamicMechComponent
createMassBlock
in interface DynamicMechComponent
public boolean isMassConstant()
isMassConstant
in interface DynamicMechComponent
public double getMass(double t)
DynamicMechComponent
getMass
in interface DynamicMechComponent
public void getMass(Matrix M, double t)
DynamicMechComponent
getMass
in interface DynamicMechComponent
M
- matrix to return the mass int
- current timepublic int getMassForces(VectorNd f, double t, int idx)
DynamicMechComponent
f
, starting at the location
specified by idx
. Upon return, this method should
return the value of idx
incremented by the dimension
of the mass forces.
getMassForces
in interface DynamicMechComponent
f
- vector to return the forces int
- current timeidx
- starting location within f
where forces should be stored
idx
public void addSolveBlock(SparseNumberedBlockMatrix S)
addSolveBlock
in interface DynamicMechComponent
addSolveBlock
in class DynamicMechComponentBase
public MatrixBlock createSolveBlock()
createSolveBlock
in interface DynamicMechComponent
public void setState(Frame frame)
public int setState(VectorNd x, int idx)
public void getState(FrameState state)
public int getState(VectorNd x, int idx)
public void setState(DynamicMechComponent c)
DynamicMechComponent
setState
in interface DynamicMechComponent
c
- component from which the state is to be copied.public int getPosState(double[] buf, int idx)
getPosState
in interface DynamicMechComponent
public int setPosState(double[] buf, int idx)
setPosState
in interface DynamicMechComponent
public void addPosImpulse(double[] xbuf, int xidx, double h, double[] vbuf, int vidx)
addPosImpulse
in interface DynamicMechComponent
public int getPosDerivative(double[] dxdt, int idx)
getPosDerivative
in interface DynamicMechComponent
public int getVelState(double[] buf, int idx)
getVelState
in interface DynamicMechComponent
public int getBodyVelState(double[] buf, int idx)
public int getWorldVelState(double[] buf, int idx)
public int setVelState(double[] buf, int idx)
setVelState
in interface DynamicMechComponent
public int setForce(double[] f, int idx)
setForce
in interface DynamicMechComponent
public int getForce(double[] f, int idx)
getForce
in interface DynamicMechComponent
public ModelComponent copy(int flags, java.util.Map<ModelComponent,ModelComponent> copyMap)
CopyableComponent
COPY_REFERENCES
is set in flags
, then any component referenced
by this component should itself be set to a copy. This
should be done first checking copyMap
for an
existing copy of the referenced component. If there is no existing
copy, then a copy should be created by calling copy
recursively and adding the new copy to copyMap
.
copy
in interface CopyableComponent
copy
in class DynamicMechComponentBase
public void setBodyVelocity(Twist v)
public void getBodyVelocity(Twist v)
public java.lang.String[] getTracables()
getTracables
in interface Tracable
public TracingProbe getTracingProbe(java.lang.String tracableName)
getTracingProbe
in interface Tracable
public int getVelStateSize()
getVelStateSize
in interface DynamicMechComponent
getVelStateSize
in interface MotionTargetComponent
public int getPosStateSize()
getPosStateSize
in interface DynamicMechComponent
getPosStateSize
in interface MotionTargetComponent
public boolean velocityLimitExceeded(double tlimit, double rlimit)
velocityLimitExceeded
in interface DynamicMechComponent
tlimit
- translational velocity limitrlimit
- rotational velocity limit
public boolean isDuplicatable()
CopyableComponent
true
if and only if CopyableComponent.getCopyReferences(java.util.List, artisynth.core.modelbase.ModelComponent)
returns true.
This method is not currently used. It is intended to provide a faster
way of determining if a component can be duplicated, without having to
use CopyableComponent.getCopyReferences(java.util.List
to build the list of copy references.
isDuplicatable
in interface CopyableComponent
true
if this component can be duplicated.public boolean getCopyReferences(java.util.List<ModelComponent> refs, ModelComponent ancestor)
CopyableComponent
true
if and only if CopyableComponent.isDuplicatable()
returns
true.
getCopyReferences
in interface CopyableComponent
refs
- list to which references are appendedancestor
- root node of the hierarchy from which references are to be excluded
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |