artisynth.core.mechmodels
Class Frame

java.lang.Object
  extended by artisynth.core.modelbase.ModelComponentBase
      extended by artisynth.core.modelbase.RenderableComponentBase
          extended by artisynth.core.mechmodels.DynamicMechComponentBase
              extended by artisynth.core.mechmodels.Frame
All Implemented Interfaces:
DynamicMechComponent, ForceEffector, MotionTargetComponent, CopyableComponent, HasCoordinateFrame, ModelComponent, RenderableComponent, Tracable, ScalableUnits, TransformableGeometry, java.lang.Cloneable, HasProperties, HierarchyNode, GLRenderable, GLSelectable, HasRenderProps, Renderable, Scannable
Direct Known Subclasses:
RigidBody, TargetFrame

public class Frame
extends DynamicMechComponentBase
implements TransformableGeometry, ScalableUnits, DynamicMechComponent, Tracable, MotionTargetComponent, CopyableComponent, HasCoordinateFrame


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 artisynth.core.modelbase.ModelComponentBase
checkFlag, checkName, checkNameUniqueness, clearFlag, clone, connectToHierarchy, createTempFlag, disconnectFromHierarchy, getChildren, getGrandParent, getHardReferences, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, hasChildren, isFixed, isMarked, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, postscan, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, scan, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setSelected, updateReferences, write
 
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

dynamicVelInWorldCoords

public static boolean dynamicVelInWorldCoords

myRenderFrame

public RigidTransform3d myRenderFrame

myProps

public static PropertyList myProps
Constructor Detail

Frame

public Frame()

Frame

public Frame(RigidTransform3d X)
Method Detail

getAllPropertyInfo

public PropertyList getAllPropertyInfo()
Description copied from interface: HasProperties
Returns a list giving static information about all properties exported by this object.

Specified by:
getAllPropertyInfo in interface HasProperties
Overrides:
getAllPropertyInfo in class ModelComponentBase
Returns:
static information for all exported properties

getForce

public Wrench getForce()

getForce

public void getForce(Wrench wr)

getBodyForce

public void getBodyForce(Wrench wr)

getTransForce

public Vector3d getTransForce()

getMoment

public Vector3d getMoment()

setForce

public void setForce(Wrench w)

addForce

public void addForce(Wrench w)

getExternalForce

public Wrench getExternalForce()

setExternalForce

public void setExternalForce(Wrench w)

addExternalForce

public void addExternalForce(Wrench w)

addScaledExternalForce

public void addScaledExternalForce(double s,
                                   Wrench w)

getVelocity

public Twist getVelocity()

getVelocity

public void getVelocity(Twist v)

setVelocity

public void setVelocity(Twist v)

setVelocity

public void setVelocity(double vx,
                        double vy,
                        double vz,
                        double wx,
                        double wy,
                        double wz)

setPose

public void setPose(RigidTransform3d XFrameToWorld)

getPose

public RigidTransform3d getPose()

getPose

public void getPose(RigidTransform3d XFrameToWorld)
Specified by:
getPose in interface HasCoordinateFrame

getPosition

public Point3d getPosition()

setPosition

public void setPosition(Point3d pos)

getOrientation

public AxisAngle getOrientation()

setOrientation

public void setOrientation(AxisAngle axisAng)

getRotation

public Quaternion getRotation()

setRotation

public void setRotation(Quaternion q)

updatePose

public void updatePose()

applyGravity

public void applyGravity(Vector3d gacc)
Applies a gravity force to this component, given a prescribed gravity acceleration vector.

Specified by:
applyGravity in interface DynamicMechComponent

getAxisLength

public double getAxisLength()

setAxisLength

public void setAxisLength(double len)

computePointPosition

public void computePointPosition(Vector3d pos,
                                 Point3d loc)
Computes the position, in world coordinates, of a point attached to this frame.

Parameters:
pos - returns the point position
loc - position of the point, in body coordinates

computePointVelocity

public void computePointVelocity(Vector3d vel,
                                 Point3d loc)
Computes the velocity, in world coordinates, of a point attached to this frame.

Parameters:
vel - returns the point velocity
loc - position of the point, in body coordinates

computePointVelocity

public void computePointVelocity(Vector3d vel,
                                 Point3d loc,
                                 Twist frameVel)
Computes the velocity, in world coordinates, of a point attached to this frame.

Parameters:
vel - returns the point velocity
loc - position of the point, in body coordinates
frameVel - velocity of the frame, in rotated world coordinates

addPointForce

public void addPointForce(Vector3d f,
                          Point3d pos)
Adds the effect of a force applied at a specific postion with respect to this frame. The force is in world coordinates and the position in frame coordinates.


computeAppliedWrench

public void computeAppliedWrench(Wrench wr,
                                 Vector3d f,
                                 Vector3d p)
Computes the wrench (in body coordinates) produced by applying a point at a particular point.

Parameters:
wr - returns the wrench in body coordinates
f - applied force at the point (world coordinates)
p - location of the point on the body (body coordinates)

computeAppliedWrench

public void computeAppliedWrench(Matrix6x1 wr,
                                 Vector3d f,
                                 Vector3d p)
Computes the wrench (in body coordinates) produced by applying a force at a particular point.

Parameters:
wr - returns the wrench in body coordinates
f - applied force at the point (world coordinates)
p - location of the point on the body (body coordinates)

resetTargets

public void resetTargets()
Specified by:
resetTargets in interface MotionTargetComponent

getTargetActivity

public MotionTarget.TargetActivity getTargetActivity()
Specified by:
getTargetActivity in interface MotionTargetComponent

setTargetActivity

public void setTargetActivity(MotionTarget.TargetActivity activity)
Specified by:
setTargetActivity in interface MotionTargetComponent

getTargetPosition

public Point3d getTargetPosition()

setTargetPosition

public void setTargetPosition(Point3d pos)

getTargetOrientation

public AxisAngle getTargetOrientation()

setTargetOrientation

public void setTargetOrientation(AxisAngle axisAng)

getTargetPose

public RigidTransform3d getTargetPose()

setTargetPose

public void setTargetPose(RigidTransform3d X)

getTargetVelocity

public Twist getTargetVelocity()

setTargetVelocity

public void setTargetVelocity(Twist vel)

getTargetVel

public int getTargetVel(double[] velt,
                        double s,
                        double h,
                        int idx)
Specified by:
getTargetVel in interface MotionTargetComponent

setTargetVel

public int setTargetVel(double[] velt,
                        int idx)
Specified by:
setTargetVel in interface MotionTargetComponent

getTargetPos

public int getTargetPos(double[] post,
                        double s,
                        double h,
                        int idx)
Specified by:
getTargetPos in interface MotionTargetComponent

setTargetPos

public int setTargetPos(double[] post,
                        int idx)
Specified by:
setTargetPos in interface MotionTargetComponent

addTargetJacobian

public int addTargetJacobian(SparseBlockMatrix J,
                             int bi)
Description copied from interface: MotionTargetComponent
Add a row to the motion target Jacobian for this motion target. The Jacobian maps state velocities u into motion target velocities vt according to
 vt = J u
 

Specified by:
addTargetJacobian in interface MotionTargetComponent
Parameters:
J - motion target Jacobian
bi - block row index for the row to be added
Returns:
bi + 1

getFrameDamping

public double getFrameDamping()

setFrameDamping

public void setFrameDamping(double d)

getFrameDampingMode

public PropertyMode getFrameDampingMode()

setFrameDampingMode

public void setFrameDampingMode(PropertyMode mode)

getRotaryDamping

public double getRotaryDamping()

setRotaryDamping

public void setRotaryDamping(double d)

getRotaryDampingMode

public PropertyMode getRotaryDampingMode()

setRotaryDampingMode

public void setRotaryDampingMode(PropertyMode mode)

createRenderProps

public RenderProps createRenderProps()
Description copied from interface: HasRenderProps
Factory method to create render properties appropriate to this object.

Specified by:
createRenderProps in interface HasRenderProps
Overrides:
createRenderProps in class RenderableComponentBase
Returns:
new render properties for this object

prerender

public void prerender(RenderList list)
Description copied from interface: GLRenderable
Prepare for rendering, and potentially add itself to a list to be drawn by a GLRenderer.

Specified by:
prerender in interface GLRenderable
Overrides:
prerender in class RenderableComponentBase

updateBounds

public void updateBounds(Point3d pmin,
                         Point3d pmax)
Description copied from interface: GLRenderable
Update the minimum and maximum points for this object. In an x-y-z coordinate system with x directed to the right and y directed upwards, the minimum and maximum points can be thought of as defining the left-lower-far and right-upper-near corners of a bounding cube. This method should only reduce the elements of the minimum point and increase the elements of the maximum point, since it may be used as part of an iteration to determine the bounding cube for several different objects.

Specified by:
updateBounds in interface GLRenderable
Overrides:
updateBounds in class RenderableComponentBase
Parameters:
pmin - minimum point
pmax - maximum point

drawAxes

public static void drawAxes(GLRenderer renderer,
                            RigidTransform3d XFrameToWorld,
                            float len)

render

public void render(GLRenderer renderer,
                   int flags)
Description copied from interface: GLRenderable
Render this object using Open GL via the JOGL.

Specified by:
render in interface GLRenderable
Specified by:
render in class RenderableComponentBase
Parameters:
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.

getSelection

public void getSelection(java.util.LinkedList<java.lang.Object> list,
                         int qid)
Description copied from interface: GLSelectable
Append to 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.

Specified by:
getSelection in interface GLSelectable
Overrides:
getSelection in class RenderableComponentBase
Parameters:
list - selected objects are appended to the end of this list
qid - index of the selection query

transformGeometry

public void transformGeometry(AffineTransform3dBase X)
Description copied from interface: TransformableGeometry
Applies an affine transformation to the geometry of this object. This method should be equivalent to
 transformGeometry (X, this, 0);
 

Specified by:
transformGeometry in interface TransformableGeometry
Parameters:
X - affine transformation

transformGeometry

public void transformGeometry(AffineTransform3dBase X,
                              TransformableGeometry topObject,
                              int flags)
Description copied from interface: TransformableGeometry
Applies an affine transformation to the geometry of this object. If recursively invoked within a component hierarchy, then 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.

Specified by:
transformGeometry in interface TransformableGeometry
Parameters:
X - affine transformation
topObject - component on which the method was initially invoked
flags - provides information about the context in which the transformation is being applied.

scaleDistance

public void scaleDistance(double s)
Description copied from interface: ScalableUnits
Scales all distance coordinates.

Specified by:
scaleDistance in interface ScalableUnits
Parameters:
s - scaling factor

zeroExternalForces

public void zeroExternalForces()
Specified by:
zeroExternalForces in interface DynamicMechComponent

zeroForces

public void zeroForces()
Specified by:
zeroForces in interface DynamicMechComponent

setForcesToExternal

public void setForcesToExternal()
Specified by:
setForcesToExternal in interface DynamicMechComponent

applyForces

public void applyForces(double t)
Description copied from interface: ForceEffector
Adds forces to the components affected by this force effector at a particular time. Component forces should be added and not set, since other forces may be added to the same components by other force effectors.

Specified by:
applyForces in interface ForceEffector
Parameters:
t - time (seconds)

addVelJacobian

public void addVelJacobian(SparseNumberedBlockMatrix S,
                           double s)
Description copied from interface: ForceEffector
Scales the components of the velocity Jacobian associated with this force effector and adds it to the supplied solve matrix M.

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.

Specified by:
addVelJacobian in interface ForceEffector
Parameters:
S - solve matrix to which scaled velocity Jacobian is to be added
s - scaling factor for velocity Jacobian

addPosJacobian

public void addPosJacobian(SparseNumberedBlockMatrix S,
                           double s)
Description copied from interface: ForceEffector
Scales the components of the position Jacobian associated with this force effector and adds it to the supplied solve matrix M.

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.

Specified by:
addPosJacobian in interface ForceEffector
Parameters:
S - solve matrix to which scaled position Jacobian is to be added
s - scaling factor for position Jacobian

addSolveBlocks

public void addSolveBlocks(SparseNumberedBlockMatrix S)
Description copied from interface: ForceEffector
Adds any needed blocks to a solve matrix in order to accomodate the Jacobian terms associated with this force effector. In general, blocks will be need to be added at locations given by the block indices (bi, bj), where bi and bj correspond to the solve indices (as returned by getSolveIndex) for all dynamic or attached components affected by this force effector.

Specified by:
addSolveBlocks in interface ForceEffector
Parameters:
S - solve matrix to which blocks should be added

getJacobianType

public int getJacobianType()
Description copied from interface: ForceEffector
Returns a code indicating the matrix type that results when the Jacobian terms of this force effector are added to the solve matrix. This should be a logical or-ing of either 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.

Specified by:
getJacobianType in interface ForceEffector
Returns:
solve matrix type resulting from adding Jacobian terms

scaleMass

public void scaleMass(double s)
Description copied from interface: ScalableUnits
Scales all mass units.

Specified by:
scaleMass in interface ScalableUnits
Parameters:
s - scaling factor

createMassBlock

public MatrixBlock createMassBlock()
Description copied from interface: DynamicMechComponent
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).

Specified by:
createMassBlock in interface DynamicMechComponent

isMassConstant

public boolean isMassConstant()
Specified by:
isMassConstant in interface DynamicMechComponent

getMass

public double getMass(double t)
Description copied from interface: DynamicMechComponent
Returns the scalar mass of this component at time t.

Specified by:
getMass in interface DynamicMechComponent

getMass

public void getMass(Matrix M,
                    double t)
Description copied from interface: DynamicMechComponent
Gets the mass of this component at a particular time.

Specified by:
getMass in interface DynamicMechComponent
Parameters:
M - matrix to return the mass in
t - current time

getMassForces

public int getMassForces(VectorNd f,
                         double t,
                         int idx)
Description copied from interface: DynamicMechComponent
Gets the mass forces for this component at a particular time. The forces should be stored in 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.

Specified by:
getMassForces in interface DynamicMechComponent
Parameters:
f - vector to return the forces in
t - current time
idx - starting location within f where forces should be stored
Returns:
updated value for idx

addSolveBlock

public void addSolveBlock(SparseNumberedBlockMatrix S)
Specified by:
addSolveBlock in interface DynamicMechComponent
Specified by:
addSolveBlock in class DynamicMechComponentBase

createSolveBlock

public MatrixBlock createSolveBlock()
Specified by:
createSolveBlock in interface DynamicMechComponent

setState

public void setState(Frame frame)

setState

public int setState(VectorNd x,
                    int idx)

getState

public void getState(FrameState state)

getState

public int getState(VectorNd x,
                    int idx)

setState

public void setState(DynamicMechComponent c)
Description copied from interface: DynamicMechComponent
Sets the state of this DynamicMechComponent from that of another.

Specified by:
setState in interface DynamicMechComponent
Parameters:
c - component from which the state is to be copied.

getPosState

public int getPosState(double[] buf,
                       int idx)
Specified by:
getPosState in interface DynamicMechComponent

setPosState

public int setPosState(double[] buf,
                       int idx)
Specified by:
setPosState in interface DynamicMechComponent

addPosImpulse

public void addPosImpulse(double[] xbuf,
                          int xidx,
                          double h,
                          double[] vbuf,
                          int vidx)
Specified by:
addPosImpulse in interface DynamicMechComponent

getPosDerivative

public int getPosDerivative(double[] dxdt,
                            int idx)
Specified by:
getPosDerivative in interface DynamicMechComponent

getVelState

public int getVelState(double[] buf,
                       int idx)
Specified by:
getVelState in interface DynamicMechComponent

getBodyVelState

public int getBodyVelState(double[] buf,
                           int idx)

getWorldVelState

public int getWorldVelState(double[] buf,
                            int idx)

setVelState

public int setVelState(double[] buf,
                       int idx)
Specified by:
setVelState in interface DynamicMechComponent

setForce

public int setForce(double[] f,
                    int idx)
Specified by:
setForce in interface DynamicMechComponent

getForce

public int getForce(double[] f,
                    int idx)
Specified by:
getForce in interface DynamicMechComponent

copy

public ModelComponent copy(int flags,
                           java.util.Map<ModelComponent,ModelComponent> copyMap)
Description copied from interface: CopyableComponent
Create a copy of this component. If 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.

Specified by:
copy in interface CopyableComponent
Overrides:
copy in class DynamicMechComponentBase

setBodyVelocity

public void setBodyVelocity(Twist v)

getBodyVelocity

public void getBodyVelocity(Twist v)

getTracables

public java.lang.String[] getTracables()
Specified by:
getTracables in interface Tracable

getTracingProbe

public TracingProbe getTracingProbe(java.lang.String tracableName)
Specified by:
getTracingProbe in interface Tracable

getVelStateSize

public int getVelStateSize()
Specified by:
getVelStateSize in interface DynamicMechComponent
Specified by:
getVelStateSize in interface MotionTargetComponent

getPosStateSize

public int getPosStateSize()
Specified by:
getPosStateSize in interface DynamicMechComponent
Specified by:
getPosStateSize in interface MotionTargetComponent

velocityLimitExceeded

public boolean velocityLimitExceeded(double tlimit,
                                     double rlimit)
Checks if the current component velocity exceeds specified limits. Used to check solution stability.

Specified by:
velocityLimitExceeded in interface DynamicMechComponent
Parameters:
tlimit - translational velocity limit
rlimit - rotational velocity limit
Returns:
true if velocity exceeds specified limits

isDuplicatable

public boolean isDuplicatable()
Description copied from interface: CopyableComponent
Returns true if this component can be duplicated. Duplication means that we can expect to be able to make a complete copy of the component along with all it's external references. This method should return 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, artisynth.core.modelbase.ModelComponent) to build the list of copy references.

Specified by:
isDuplicatable in interface CopyableComponent
Returns:
true if this component can be duplicated.

getCopyReferences

public boolean getCopyReferences(java.util.List<ModelComponent> refs,
                                 ModelComponent ancestor)
Description copied from interface: CopyableComponent
Collects external references which must also be copied in order to duplicate this component. These references should exclude those which are contained within a specified component hierarchy. This method should return true if and only if CopyableComponent.isDuplicatable() returns true.

Specified by:
getCopyReferences in interface CopyableComponent
Parameters:
refs - list to which references are appended
ancestor - root node of the hierarchy from which references are to be excluded
Returns:
false if it is discovered that the component cannot be duplicated