shady.common.multi.chain
Class TowerBlock

java.lang.Object
  extended by shady.common.multi.chain.Block
      extended by shady.common.multi.chain.TowerBlock

public class TowerBlock
extends Block

Controller for a block in the original MultiShady tower.

This implementation is not a direct translation of the original scheme implementation, some details are different.

The block is composed of five MemberShadys (M[0..4]) and four segments (S[0..3]), all of length SL:


 r-----------S1-----------l-----------M2-----------r-----------S2-----------l
  \                                                                        /
   M1                                                                     M3
    \                                                                    /
     l                                                                  r
      \                                                                /
       S0                                                             S3
        \                                                            /
         r                                                          l
          \                                                        /
           M0                                                     M4
            \                                                    /
             l                                                  r


Below is configuration when it is bent with some angles labeled. See shady.sim.ui.multi.block-bend.fig for a fully labeled version of this figure.

                                                             --------------- 
                                      -----------------------            d /
                 ---------------------                                    / 
       ----------                                                        /
        \ c                                                             /
          \                                                            /
            \                                                         /
            b|                                                       /
              |                                                     /
               |                                                   /
              b/                                                  / 
              /                                                  /
             / a                                               e/

 
Angles and lengths in the figure are not precise, but illustrate that, in nominal pose (DOF = 0.0), the block is a symmetric open trapezoid whose leg endpoints coincide vertically with the midpoints of S1 and S2. The end-frame origin is at the midpoint of M2, the end-frame x-axis coincides with the body vector (vector from l to r barrel) of M2, and the end-frame y-axis points up. The orientations of all members and segments in the block form a clockwise head-to-tail chain starting at the free end of the left leg and ending at the free end of the right leg.

The top of the block is treated as a rigid segment, the distance between the leg endpoints is held fixed (CC+2SL), and the legs are abstracted as linear actuators. At least one leg is fully extended at all times: for DOF in the range [-1.0,0.0) this is the right leg, and the block tilts to the left; for DOF in the range (0.0,1.0] the left leg is fully extended and the block tilts to the right. The length of the shortened leg is proportional to the DOF, and the total pose of the block is fully constrained by assuring that the lower angle on the fully extended leg is fixed. Additionally, the bend in the bent leg is fully constrained by assuring that the angles formed between the member shadys and the muntin between them are equal (defined as "b").

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.

Author:
Marsette (Marty) A. Vona, III, Carrick Detweiler

Field Summary
static double BLOCK_LOWER_ANGLE
          The lower angles in the nominal pose.
static double BLOCK_UPPER_ANGLE
          The upper angles in the nominal pose.
static double BOTTOM
          The length of the BOTTOM of the block: 2.0*SL+CC
static double CC
          The length of each shady.
private static java.lang.String cvsid
          CVS id.
static double DPART
          Defined in shady.sim.ui.multi.block-bend.fig.
protected  Point.OnSegment eePoint
          The end-effector point, which is at 0.5 along the body segment of member 2.
static double LEG_MAX
          The maximum length of both legs in the tower.
static double LEG_MIN
          The minimum length of both legs in the tower.
static double M3L_X
          The x coordinate of the left gripper of the M3 shady in the nominal pose.
static double M3L_Y
          The y coordinate of the left gripper of the M3 shady in the nominal pose.
static int NUM_MEMBERS
          Number of member shadys in this tower block.
static int NUM_SEGMENTS
          Number of segments in this tower block.
static double OTHER_DIAG
          Defined in shady.sim.ui.multi.block-bend.fig.
static double SL
          The length of each muntin segment used in this tower block.
static double THETA_MAX_ABS
          The absolute value of the maximum possible tilt angle.
static double TOP
          The length of the top of the block: 2.0*SL+CC
 
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
TowerBlock(MultiShadyCommonAPI multiShady, MultiEnvironment multiEnvironment, Sentinel sentinel)
          TBD
TowerBlock(MultiShadyCommonAPI multiShady, MultiEnvironment multiEnvironment, Sentinel sentinel, int memberStartIndex, int segmentStartIndex)
          TBD
 
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.
protected  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.
 
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, update, updateChain
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cvsid

private static final java.lang.String cvsid

CVS id.

See Also:
Constant Field Values

NUM_MEMBERS

public static final int NUM_MEMBERS

Number of member shadys in this tower block.

See Also:
Constant Field Values

NUM_SEGMENTS

public static final int NUM_SEGMENTS

Number of segments in this tower block.

See Also:
Constant Field Values

CC

public static final double CC

The length of each shady.

See Also:
Constant Field Values

SL

public static final double SL

The length of each muntin segment used in this tower block.

See Also:
Constant Field Values

TOP

public static final double TOP

The length of the top of the block: 2.0*SL+CC

See Also:
Constant Field Values

BOTTOM

public static final double BOTTOM

The length of the BOTTOM of the block: 2.0*SL+CC

See Also:
Constant Field Values

LEG_MIN

public static final double LEG_MIN

The minimum length of both legs in the tower.

See Also:
Constant Field Values

LEG_MAX

public static final double LEG_MAX

The maximum length of both legs in the tower.

See Also:
Constant Field Values

BLOCK_UPPER_ANGLE

public static final double BLOCK_UPPER_ANGLE

The upper angles in the nominal pose.


BLOCK_LOWER_ANGLE

public static final double BLOCK_LOWER_ANGLE

The lower angles in the nominal pose.


OTHER_DIAG

public static final double OTHER_DIAG

Defined in shady.sim.ui.multi.block-bend.fig. This is the edge M3_l to M0_l in the triangle formed by M0_l, M3_l, and M4_r.


DPART

public static final double DPART

Defined in shady.sim.ui.multi.block-bend.fig. This is the angle located at M3_l in the triangle formed by M0_l, M3_l, and M4_r.


THETA_MAX_ABS

public static final double THETA_MAX_ABS

The absolute value of the maximum possible tilt angle.


M3L_X

public static final double M3L_X

The x coordinate of the left gripper of the M3 shady in the nominal pose. Note that the right gripper of M1 will have a value of -1.0*M3L_X in the nominal pose.

See Also:
Constant Field Values

M3L_Y

public static final double M3L_Y

The y coordinate of the left gripper of the M3 shady in the nominal pose. Note that the right gripper of M1 will have the same value in the nominal pose.


eePoint

protected Point.OnSegment eePoint

The end-effector point, which is at 0.5 along the body segment of member 2.

Constructor Detail

TowerBlock

public TowerBlock(MultiShadyCommonAPI multiShady,
                  MultiEnvironment multiEnvironment,
                  Sentinel sentinel,
                  int memberStartIndex,
                  int segmentStartIndex)
TBD


TowerBlock

public TowerBlock(MultiShadyCommonAPI multiShady,
                  MultiEnvironment multiEnvironment,
                  Sentinel sentinel)
TBD

Method Detail

initMembersAndSegments

protected 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 implementation creates the tower block. All of the barrels are gripped normally on the segments (ie not inverted). Internally, the right grippers are connected to the beginning of the segments (0.0) and the left grippers are connected to the ends (1.0). The first and last shady are connected to the midpoints of the segments on the top of the previous block iff the previous is not a sentinel.

Specified by:
initMembersAndSegments in class Block

recompute

protected 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 implementation makes use of geometry described in the header to compute the transform for a given delta which represents the theta of bending.

Specified by:
recompute in class Block
Parameters:
transform - the computed transform is to be written here, not null
delta - 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].

recoverDOF

protected boolean recoverDOF()

Try 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.

This impl recovers DOF as set by recompute(vona.math.RigidTransform2D, double).

Specified by:
recoverDOF in class Block
Returns:
true iff successful

getEEPoint

public 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 returns eePoint.

Specified by:
getEEPoint in class Block
Returns:
the end-effector point

getEEOrientationOffset

public 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.

Specified by:
getEEOrientationOffset in class Block
Returns:
the offset in radians of the EE frame orientation relative to the orientation of the Segment of the end-effector point