|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectshady.common.multi.chain.Block
shady.common.multi.chain.Sentinel
public class Sentinel
Sentinel block in a MultiShady chain.
The Sentinel comes before the actual first block. It's main purpose is
to represent the transform from world frame to the "start frame" of the
first block (Block.getTransform(vona.math.RigidTransform2D)), which is tracked as a Point.OnSegment with orientation parallel or anti-parallel to
the segment's orientation.
Note that the represented transform is only computed from point
when update() is called. One place where this is done is at the
start of ChainIK.gotoTarget(double, double, double, int, double).
Copyright (C) 2006 Marsette A. Vona, III
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
| Field Summary | |
|---|---|
boolean |
aligned
If true, the x-axis of the start frame points along the start-to-end vector of the segment of point, else the vectors are
anti-parallel. |
private static java.lang.String |
cvsid
CVS id. |
Point.OnSegment |
point
The point identifying the origin of the start frame of the first block. |
| Fields inherited from class shady.common.multi.chain.Block |
|---|
dof, leftBarrel, locked, memberStartIndex, multiEnvironment, multiShady, next, numMembers, numSegments, previous, rightBarrel, segmentStartIndex, sentinel, transform |
| Constructor Summary | |
|---|---|
Sentinel(MultiShadyCommonAPI multiShady,
MultiEnvironment multiEnvironment,
Point.OnSegment point,
boolean aligned)
Create a new Sentinel. |
|
| Method Summary | |
|---|---|
double |
getEEOrientationOffset()
Return the offset in radians of the EE frame orientation relative to the orientation of the Segment of the end-effector point. |
Point.OnSegment |
getEEPoint()
Get the end-effector point. |
protected void |
initMembersAndSegments()
Subclasses must implement this to set up the MemberShadys and environment segments. |
(package private) void |
recompute(vona.math.RigidTransform2D transform,
double delta)
Subclasses must implement this to compute the transform from the Block.previouss end frame to this block's end frame according to Block.dof,
and possibly to update Block.leftBarrel and Block.rightBarrel from Block.dof. |
protected boolean |
recoverDOF()
Try to figure out the current Block.dof from the state of the barrel
angles in Block.multiShady. |
void |
update()
Update Block.transform from point and aligned. |
| Methods inherited from class shady.common.multi.chain.Block |
|---|
getDOF, getNext, getPrevious, getTransform, getTransform, hasNext, hasPrevious, isLocked, isSentinel, lock, lock, recompute, reverseUpdate, reverseUpdateChain, setDOF, setNominal, tweakDOF, unlock, updateChain |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final java.lang.String cvsid
CVS id.
public final Point.OnSegment point
The point identifying the origin of the start frame of the first block.
public final boolean aligned
If true, the x-axis of the start frame points along the start-to-end
vector of the segment of point, else the vectors are
anti-parallel.
| Constructor Detail |
|---|
public Sentinel(MultiShadyCommonAPI multiShady,
MultiEnvironment multiEnvironment,
Point.OnSegment point,
boolean aligned)
Create a new Sentinel.
multiShady - the MultiShady containing the chainmultiEnvironment - the MultiEnvironment containing the chainpoint - the point identifying the origin of the start frame of the
first blockaligned - if true, the x-axis of the start frame points along the
start-to-end vector of the segment of point, else the vectors
are anti-parallel| Method Detail |
|---|
public void update()
Update Block.transform from point and aligned.
update in class Blockprotected void initMembersAndSegments()
Subclasses must implement this to set up the MemberShadys and environment segments.
Block.numMembers and Block.numSegments must be set, and the
corresponding numbers of members and segments must be initialized
(according to Block.dof, Block.leftBarrel, Block.rightBarrel, and
Block.transform, which should all be consistent due to a prior call to
Block.recompute()) and added to Block.multiShady and Block.multiEnvironment. Internal barrels must be closed to form the block
topology, and barrels must be closed to connect to Block.previous iff
it's not a Sentinel.
This impl does nothing.
initMembersAndSegments in class Block
void recompute(vona.math.RigidTransform2D transform,
double delta)
Subclasses must implement this to compute the transform from the Block.previouss end frame to this block's end frame according to Block.dof,
and possibly to update Block.leftBarrel and Block.rightBarrel from Block.dof.
This impl just copies the fixed world-to-start transform.
recompute in class Blocktransform - the computed transform is to be written here, not nulldelta - if non-zero then the DOF is incremented by this amount before
computing the transform (the persistent Block.dof is not affected).
This is used by ChainIK to compute columns of the chain Jacobian.
The barrel angles are (allocated and) computed iff delta is 0.0. The
caller must ensure that the incremented value will be in the range
[-1.0,1.0].protected boolean recoverDOF()
BlockTry to figure out the current Block.dof from the state of the barrel
angles in Block.multiShady.
It can be assumed that the barrel angles were set as if by a
call to Block.recompute(RigidTransform2D, double). If this does not
appear to be the case then return false without modifying
dof.
recoverDOF in class Blockpublic Point.OnSegment getEEPoint()
Get the end-effector point.
Note that the point may either reference a standard Segment or
the body segment of a member as returned by ShadyPose.getBodySegment(double).
This impl just returns point.
getEEPoint in class Blockpublic double getEEOrientationOffset()
Return the offset in radians of the EE frame orientation relative to
the orientation of the Segment of the end-effector point.
This impl returns 0.0.
getEEOrientationOffset in class BlockSegment of the end-effector point
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||