public class FrameFrameAttachment extends FrameAttachment
ModelComponent.NavpanelVisibility
Modifier and Type | Field and Description |
---|---|
boolean |
debug |
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, myProps, NULL_OBJ, useCompactPathNames
COPY_REFERENCES, REST_POSITION
Constructor and Description |
---|
FrameFrameAttachment() |
FrameFrameAttachment(Frame frame) |
FrameFrameAttachment(Frame frame,
Frame master) |
FrameFrameAttachment(Frame frame,
Frame master,
RigidTransform3d TFM) |
Modifier and Type | Method and Description |
---|---|
void |
addMassToMasters() |
void |
applyForce(Wrench wr)
Applies a force to this frame, in world coordinates, by propagating
it through to the underlying master bodies.
|
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 frame,
Frame master,
RigidTransform3d TFM) |
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, getGT, getMasterBlocks, getMasters, getSlave, invalidateMasters, mulSubGT, mulSubGTM, mulSubMG, numMasters, scaleMass, transformGeometry
addBackRefs, addBackRefs, addConnectedMasterRefs, clone, connectAttachment, connectToHierarchy, disconnectFromHierarchy, getAttachment, getHardReferences, oneMasterActive, oneMasterNotAttached, removeBackRefs, removeBackRefs, removeConnectedMasterRefs, setSlaveAffectsStiffness, slaveAffectsStiffness
checkFlag, checkName, checkNameUniqueness, clearFlag, createTempFlag, getAllPropertyInfo, getChildren, getGrandParent, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, hasChildren, hasState, 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
connectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, hasState, isFixed, isMarked, isSelected, notifyParentOfChange, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, setWritable, updateReferences
getAllPropertyInfo, getProperty
getChildren, hasChildren
postscan
isWritable, write
public FrameFrameAttachment()
public FrameFrameAttachment(Frame frame)
public FrameFrameAttachment(Frame frame, Frame master, RigidTransform3d TFM)
public boolean isFlexible()
FrameAttachment
isFlexible
in class FrameAttachment
true
if this attachment is flexible.public Frame getMaster()
public RigidTransform3d getTFM()
public void set(Frame frame, Frame master, RigidTransform3d TFM)
public void set(Frame master, RigidTransform3d TFW)
public void setWithTFM(Frame master, RigidTransform3d TFM)
public void updatePosStates()
updatePosStates
in interface DynamicAttachment
updatePosStates
in class DynamicAttachmentBase
public void updateVelStates()
updateVelStates
in interface DynamicAttachment
updateVelStates
in class DynamicAttachmentBase
public void updateAttachment()
DynamicAttachmentBase
updateAttachment
in interface DynamicAttachment
updateAttachment
in class DynamicAttachmentBase
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 interface DynamicAttachment
applyForces
in class FrameAttachment
public boolean getDerivative(double[] buf, int idx)
getDerivative
in interface DynamicAttachment
getDerivative
in class DynamicAttachmentBase
public void addMassToMasters()
addMassToMasters
in interface DynamicAttachment
addMassToMasters
in class DynamicAttachmentBase
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 applyForce(Wrench wr)
applyForce
in class FrameAttachment
wr
- force to apply to the framepublic 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 DynamicAttachmentComp
copy
in interface CopyableComponent
copy
in class FrameAttachment
flags
- flags to control the copyingcopyMap
- map to possible existing instances of referenced
components