public class FrameFrameAttachment extends FrameAttachment
ModelComponent.NavpanelVisibility
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, myProps, NULL_OBJ, useCompactPathNames
COPY_REFERENCES
Constructor and Description |
---|
FrameFrameAttachment() |
FrameFrameAttachment(Frame frame) |
FrameFrameAttachment(Frame frame,
Frame master) |
Modifier and Type | Method and Description |
---|---|
void |
addMassToMaster(MatrixBlock mblk,
MatrixBlock sblk,
int i) |
void |
addMassToMasters() |
void |
applyForces() |
FrameFrameAttachment |
copy(int flags,
java.util.Map<ModelComponent,ModelComponent> copyMap)
Create a copy of this component.
|
double |
getAverageMasterInertia()
Returns the average rotational inertia of the master components as seen
by the attached frame.
|
double |
getAverageMasterMass()
Returns the average mass of the master components as seen by the attached
frame.
|
boolean |
getCopyReferences(java.util.List<ModelComponent> refs,
ModelComponent ancestor)
Collects external references which must also be copied in order to
duplicate this component.
|
void |
getCurrentTFW(RigidTransform3d TFW)
Returns the current pose of the attached frame, in world coordinates.
|
void |
getCurrentVel(Twist vel,
Twist dg)
Returns the current velocity of the attached frame, in frame coordinates.
|
boolean |
getDerivative(double[] buf,
int idx) |
Frame |
getMaster() |
void |
getMasterForces(VectorNd f,
Wrench wr)
Computes the master forces that result when a wr is applied in the
attached coordinate frame.
|
RigidTransform3d |
getTFM() |
void |
getUndeformedTFW(RigidTransform3d TFW)
Returns the current undeformed pose of the attached frame, in world
coordinates.
|
boolean |
isDuplicatable()
Returns true if this component can be duplicated.
|
boolean |
isFlexible()
Indicates that this attachment is flexible.
|
void |
scaleDistance(double s)
Scales all distance coordinates.
|
void |
set(Frame master,
RigidTransform3d TFW) |
boolean |
setCurrentTFW(RigidTransform3d TFW)
Sets the current pose of the attached frame, in world coordinates.
|
void |
setWithTFM(Frame master,
RigidTransform3d TFM) |
void |
updateAttachment()
Update attachment to reflect changes in the slave state.
|
void |
updatePosStates() |
void |
updateVelStates() |
void |
writeItems(java.io.PrintWriter pw,
NumberFormat fmt,
CompositeComponent ancestor) |
getFrame, getMasterBlocks, getMasters, getSlave, getSlaveSolveIndex, invalidateMasters, numMasters, scaleMass, transformGeometry
addAttachmentJacobian, addBackRefs, addSolveBlocks, clone, connectToHierarchy, containsLoop, containsLoops, containsMaster, createOrderedList, disconnectFromHierarchy, getHardReferences, oneMasterActive, reduceConstraints, reduceMass, reduceRowMatrix, removeBackRefs
checkFlag, checkName, checkNameUniqueness, clearFlag, createTempFlag, getAllPropertyInfo, getChildren, getGrandParent, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, hasChildren, hasState, isConnectedToHierarchy, isFixed, isMarked, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, postscan, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, scan, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setSelected, updateReferences, write
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
connectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, hasState, isFixed, isMarked, isSelected, notifyParentOfChange, postscan, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, updateReferences
getAllPropertyInfo, getProperty
getChildren, hasChildren
isWritable, write
public FrameFrameAttachment()
public FrameFrameAttachment(Frame frame)
public boolean isFlexible()
FrameAttachment
isFlexible
in class FrameAttachment
true
if this attachment is flexible.public Frame getMaster()
public RigidTransform3d getTFM()
public void set(Frame master, RigidTransform3d TFW)
public void setWithTFM(Frame master, RigidTransform3d TFM)
public void updatePosStates()
updatePosStates
in class DynamicAttachment
public void updateVelStates()
updateVelStates
in class DynamicAttachment
public void updateAttachment()
DynamicAttachment
updateAttachment
in class DynamicAttachment
public boolean setCurrentTFW(RigidTransform3d TFW)
FrameAttachment
setCurrentTFW
in class FrameAttachment
TFW
- new pose for the attached frame, in world coordinatestrue
if the underlying master
components have changedpublic void applyForces()
applyForces
in class FrameAttachment
public boolean getDerivative(double[] buf, int idx)
getDerivative
in class DynamicAttachment
public void addMassToMaster(MatrixBlock mblk, MatrixBlock sblk, int i)
public void addMassToMasters()
addMassToMasters
in class DynamicAttachment
public void getCurrentTFW(RigidTransform3d TFW)
FrameAttachment
getCurrentTFW
in class FrameAttachment
TFW
- used to return current frame pose.public void getUndeformedTFW(RigidTransform3d TFW)
FrameAttachment
getCurrentTFW()
.getUndeformedTFW
in class FrameAttachment
TFW
- used to return current undeformed frame pose.FrameAttachment.isFlexible()
public void getCurrentVel(Twist vel, Twist dg)
FrameAttachment
\dot J velmwhere
J
is the matrix that maps master velocities
to the attached frame velocity (in frame coordinates), and velm
are the master velocities.getCurrentVel
in class FrameAttachment
vel
- used to return current frame velocitydg
- if not null
, returns the velocity derivative termpublic void getMasterForces(VectorNd f, Wrench wr)
f
is auto-sized
to the correct size. The first six elements of f
contain the
wrench applied to the master frame, rotated into world coordinates.f
- returns the master forceswr
- applied wrench (in attached frame coordinates)public double getAverageMasterMass()
getAverageMasterMass
in class FrameAttachment
public double getAverageMasterInertia()
getAverageMasterInertia
in class FrameAttachment
public void writeItems(java.io.PrintWriter pw, NumberFormat fmt, CompositeComponent ancestor) throws java.io.IOException
writeItems
in class FrameAttachment
java.io.IOException
public boolean isDuplicatable()
true
if and only if CopyableComponent.getCopyReferences(java.util.List<artisynth.core.modelbase.ModelComponent>, 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>, artisynth.core.modelbase.ModelComponent)
to build the list of copy references.
isDuplicatable
in interface CopyableComponent
isDuplicatable
in class FrameAttachment
true
if this component can be duplicated.public boolean getCopyReferences(java.util.List<ModelComponent> refs, ModelComponent ancestor)
true
if and only if CopyableComponent.isDuplicatable()
returns
true.getCopyReferences
in interface CopyableComponent
getCopyReferences
in class FrameAttachment
refs
- list to which references are appendedancestor
- root node of the hierarchy from which references are to be excludedpublic void scaleDistance(double s)
ScalableUnits
s
- scaling factorpublic FrameFrameAttachment 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 FrameAttachment
flags
- flags to control the copyingcopyMap
- map to possible existing instances of referenced
components