us.ihmc.utilities.screwTheory
Class Twist

java.lang.Object
  extended by us.ihmc.utilities.screwTheory.SpatialMotionVector
      extended by us.ihmc.utilities.screwTheory.Twist

public class Twist
extends SpatialMotionVector


Field Summary
 
Fields inherited from class us.ihmc.utilities.screwTheory.SpatialMotionVector
SIZE
 
Constructor Summary
Twist()
           
Twist(ReferenceFrame bodyFrame, ReferenceFrame baseFrame, ReferenceFrame expressedInFrame)
          Initiates the angular velocity and linear velocity to zero
Twist(ReferenceFrame bodyFrame, ReferenceFrame baseFrame, ReferenceFrame expressedInFrame, org.ejml.data.DenseMatrix64F twistMatrix)
          Construct using a Matrix ([omega; v])
Twist(ReferenceFrame bodyFrame, ReferenceFrame baseFrame, ReferenceFrame expressedInFrame, double[] twist)
          Construct using a double array ([omega; v])
Twist(ReferenceFrame bodyFrame, ReferenceFrame baseFrame, ReferenceFrame expressedInFrame, double angularVelocityMagnitude, double linearVelocityMagnitude, javax.vecmath.Vector3d axisOfRotation, javax.vecmath.Vector3d offset)
          Construct based on a screw representation of the twist
Twist(ReferenceFrame bodyFrame, ReferenceFrame baseFrame, ReferenceFrame expressedInFrame, javax.vecmath.Vector3d linearVelocity, javax.vecmath.Vector3d angularVelocity)
           
Twist(Twist other)
          Copy constructor
 
Method Summary
 void add(Twist other)
          Adds another twist to this twist, after doing some reference frame checks.
 void changeBaseFrameNoRelativeTwist(ReferenceFrame newBaseFrame)
          Changes the base frame, assuming there is no relative twist between the old base frame and the new base frame A consequence of Duindam, Port-Based Modeling and Control for Efficient Bipedal Walking Robots, page 25, lemma 2.8 (a) http://sites.google.com/site/vincentduindam/publications
 void changeBodyFrameNoRelativeTwist(ReferenceFrame newBodyFrame)
          Changes the body frame, assuming there is no relative twist between the old body frame and the new body frame A consequence of Duindam, Port-Based Modeling and Control for Efficient Bipedal Walking Robots, page 25, lemma 2.8 (a) http://sites.google.com/site/vincentduindam/publications
 void changeFrame(ReferenceFrame newReferenceFrame)
          Changes the reference frame in which this spatial motion vector is expressed See Duindam, Port-Based Modeling and Control for Efficient Bipedal Walking Robots, page 25, lemma 2.8 (c) http://sites.google.com/site/vincentduindam/publications
 void checkAndSet(Twist other)
          Sets this twist so that it is the same as another twist
 double dot(Wrench wrench)
          Takes the dot product of this twist and a wrench, resulting in the (reference frame independent) instantaneous power.
 javax.vecmath.Vector3d getAngularVelocityInBaseFrame()
          Returns the angular velocity of the body frame with respect to the base frame, expressed in the base frame.
 FrameVector getBodyOriginLinearVelocityInBaseFrame()
          Returns the linear velocity of the body frame with respect to the base frame, expressed in the base frame.
 void packAngularVelocityInBaseFrame(javax.vecmath.Vector3d vectorToPack)
          Packs the angular velocity of the body frame with respect to the base frame, expressed in the base frame.
 void packBodyOriginLinearPartInBaseFrame(FrameVector frameVectorToPack)
          Packs a version of the linear velocity, rotated to the base frame.
 void packVelocityOfPointFixedInBodyFrame(FrameVector frameVectorToPack, FramePoint pointFixedInBodyFrame)
          Packs the linear velocity of a point that is fixed in bodyFrame but is expressed in baseFrame, with respect to baseFrame, expressed in expressedInFrame
 void set(Twist other)
           
 void setScrew(ReferenceFrame bodyFrame, ReferenceFrame baseFrame, ReferenceFrame expressedInFrame, double angularVelocityMagnitude, double linearVelocityMagnitude, javax.vecmath.Vector3d axisOfRotation, javax.vecmath.Vector3d offset)
           
 void sub(Twist other)
           
 java.lang.String toString()
           
 
Methods inherited from class us.ihmc.utilities.screwTheory.SpatialMotionVector
checkReferenceFramesMatch, getAngularPartCopy, getBaseFrame, getBodyFrame, getExpressedInFrame, getLinearPartCopy, invert, limitAngularPartMagnitude, limitLinearPartMagnitude, normalize, packAngularPart, packAngularPart, packLinearPart, packLinearPart, packMatrix, scale, scaleAngularPart, scaleLinearPart, set, set, set, setAngularPart, setAngularPartX, setAngularPartY, setAngularPartZ, setLinearPart, setLinearPartX, setLinearPartY, setLinearPartZ, setToZero, setToZero, times, toMatrix
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Twist

public Twist()

Twist

public Twist(ReferenceFrame bodyFrame,
             ReferenceFrame baseFrame,
             ReferenceFrame expressedInFrame)
Initiates the angular velocity and linear velocity to zero

Parameters:
bodyFrame - what we're specifying the twist of
baseFrame - with respect to what we're specifying the twist
expressedInFrame - in which reference frame the twist is expressed

Twist

public Twist(ReferenceFrame bodyFrame,
             ReferenceFrame baseFrame,
             ReferenceFrame expressedInFrame,
             javax.vecmath.Vector3d linearVelocity,
             javax.vecmath.Vector3d angularVelocity)
Parameters:
bodyFrame - what we're specifying the twist of
baseFrame - with respect to what we're specifying the twist
expressedInFrame - in which reference frame the twist is expressed
linearVelocity - linear velocity part of the twist
angularVelocity - angular velocity part of the twist

Twist

public Twist(ReferenceFrame bodyFrame,
             ReferenceFrame baseFrame,
             ReferenceFrame expressedInFrame,
             org.ejml.data.DenseMatrix64F twistMatrix)
Construct using a Matrix ([omega; v])


Twist

public Twist(ReferenceFrame bodyFrame,
             ReferenceFrame baseFrame,
             ReferenceFrame expressedInFrame,
             double[] twist)
Construct using a double array ([omega; v])


Twist

public Twist(Twist other)
Copy constructor


Twist

public Twist(ReferenceFrame bodyFrame,
             ReferenceFrame baseFrame,
             ReferenceFrame expressedInFrame,
             double angularVelocityMagnitude,
             double linearVelocityMagnitude,
             javax.vecmath.Vector3d axisOfRotation,
             javax.vecmath.Vector3d offset)
Construct based on a screw representation of the twist

Parameters:
bodyFrame - what we're specifying the twist of
baseFrame - with respect to what we're specifying the twist
expressedInFrame - in which reference frame the twist is expressed
angularVelocityMagnitude - magnitude of angular velocity about axisOfRotation
linearVelocityMagnitude - magnitude of linear velocity in the direction of axisOfRotation
axisOfRotation - axis of rotation
offset - any vector from the origin of expressedInFrame to axisOfRotation
Method Detail

checkAndSet

public void checkAndSet(Twist other)
Sets this twist so that it is the same as another twist


packAngularVelocityInBaseFrame

public void packAngularVelocityInBaseFrame(javax.vecmath.Vector3d vectorToPack)
Packs the angular velocity of the body frame with respect to the base frame, expressed in the base frame. The vector is computed by simply rotating the angular velocity part of this twist to base frame.


packBodyOriginLinearPartInBaseFrame

public void packBodyOriginLinearPartInBaseFrame(FrameVector frameVectorToPack)
Packs a version of the linear velocity, rotated to the base frame.


packVelocityOfPointFixedInBodyFrame

public void packVelocityOfPointFixedInBodyFrame(FrameVector frameVectorToPack,
                                                FramePoint pointFixedInBodyFrame)
Packs the linear velocity of a point that is fixed in bodyFrame but is expressed in baseFrame, with respect to baseFrame, expressed in expressedInFrame


getAngularVelocityInBaseFrame

public javax.vecmath.Vector3d getAngularVelocityInBaseFrame()
Returns the angular velocity of the body frame with respect to the base frame, expressed in the base frame. The vector is computed by simply rotating the angular velocity part of this twist to base frame.


getBodyOriginLinearVelocityInBaseFrame

public FrameVector getBodyOriginLinearVelocityInBaseFrame()
Returns the linear velocity of the body frame with respect to the base frame, expressed in the base frame. The vector is computed by simply rotating the angular velocity part of this twist to base frame.


changeBodyFrameNoRelativeTwist

public void changeBodyFrameNoRelativeTwist(ReferenceFrame newBodyFrame)
Changes the body frame, assuming there is no relative twist between the old body frame and the new body frame A consequence of Duindam, Port-Based Modeling and Control for Efficient Bipedal Walking Robots, page 25, lemma 2.8 (a) http://sites.google.com/site/vincentduindam/publications


changeBaseFrameNoRelativeTwist

public void changeBaseFrameNoRelativeTwist(ReferenceFrame newBaseFrame)
Changes the base frame, assuming there is no relative twist between the old base frame and the new base frame A consequence of Duindam, Port-Based Modeling and Control for Efficient Bipedal Walking Robots, page 25, lemma 2.8 (a) http://sites.google.com/site/vincentduindam/publications


changeFrame

public void changeFrame(ReferenceFrame newReferenceFrame)
Changes the reference frame in which this spatial motion vector is expressed See Duindam, Port-Based Modeling and Control for Efficient Bipedal Walking Robots, page 25, lemma 2.8 (c) http://sites.google.com/site/vincentduindam/publications


add

public void add(Twist other)
Adds another twist to this twist, after doing some reference frame checks. See Duindam, Port-Based Modeling and Control for Efficient Bipedal Walking Robots, page 25, lemma 2.8 (e) http://sites.google.com/site/vincentduindam/publications


sub

public void sub(Twist other)

dot

public double dot(Wrench wrench)
Takes the dot product of this twist and a wrench, resulting in the (reference frame independent) instantaneous power.

Parameters:
wrench - a wrench that 1) has an 'onWhat' reference frame that is the same as this twist's 'bodyFrame' reference frame. 2) is expressed in the same reference frame as this twist
Returns:
the instantaneous power associated with this twist and the wrench

set

public void set(Twist other)

setScrew

public void setScrew(ReferenceFrame bodyFrame,
                     ReferenceFrame baseFrame,
                     ReferenceFrame expressedInFrame,
                     double angularVelocityMagnitude,
                     double linearVelocityMagnitude,
                     javax.vecmath.Vector3d axisOfRotation,
                     javax.vecmath.Vector3d offset)

toString

public java.lang.String toString()
Overrides:
toString in class SpatialMotionVector