us.ihmc.utilities.screwTheory
Class SpatialMotionVector

java.lang.Object
  extended by us.ihmc.utilities.screwTheory.SpatialMotionVector
Direct Known Subclasses:
SpatialAccelerationVector, SpatialMotionVectorTest.GenericSpatialMotionVector, Twist

public abstract class SpatialMotionVector
extends java.lang.Object


Field Summary
static int SIZE
           
 
Constructor Summary
SpatialMotionVector()
           
SpatialMotionVector(ReferenceFrame bodyFrame, ReferenceFrame baseFrame, ReferenceFrame expressedInFrame)
          Initiates the angular velocity and linear velocity to zero
SpatialMotionVector(ReferenceFrame bodyFrame, ReferenceFrame baseFrame, ReferenceFrame expressedInFrame, org.ejml.data.DenseMatrix64F matrix)
          Construct using a Matrix ([angular; linear])
SpatialMotionVector(ReferenceFrame bodyFrame, ReferenceFrame baseFrame, ReferenceFrame expressedInFrame, double[] array)
          Construct using a double array ([angular; linear])
SpatialMotionVector(ReferenceFrame bodyFrame, ReferenceFrame baseFrame, ReferenceFrame expressedInFrame, javax.vecmath.Vector3d linearPart, javax.vecmath.Vector3d angularPart)
           
 
Method Summary
 void checkReferenceFramesMatch(ReferenceFrame bodyFrame, ReferenceFrame baseFrame, ReferenceFrame expressedInFrame)
           
 javax.vecmath.Vector3d getAngularPartCopy()
           
 ReferenceFrame getBaseFrame()
           
 ReferenceFrame getBodyFrame()
           
 ReferenceFrame getExpressedInFrame()
           
 javax.vecmath.Vector3d getLinearPartCopy()
           
 void invert()
          Inverts the spatial motion vector, i.e.: Given the spatial motion of frame A with respect to frame B, expressed in frame C, this method computes the spatial motion of frame B with respect to frame A, expressed in frame C (or vice versa), by just taking the additive inverse.
 void limitAngularPartMagnitude(double maximumMagnitude)
           
 void limitLinearPartMagnitude(double maximumMagnitude)
           
 void normalize()
           
 void packAngularPart(FrameVector vectorToPack)
          Packs an existing FrameVector with the angular velocity part
 void packAngularPart(javax.vecmath.Vector3d vectorToPack)
          Packs an existing Vector3d with the angular velocity part
 void packLinearPart(FrameVector vectorToPack)
          Packs an existing FrameVector with the linear velocity part
 void packLinearPart(javax.vecmath.Vector3d vectorToPack)
          Packs an existing Vector3d with the linear velocity part
 void packMatrix(org.ejml.data.DenseMatrix64F matrix, int rowStart)
          Packs an existing matrix based on this spatial motion vector ([angular part; linear part]).
 void scale(double scalar)
           
 void scaleAngularPart(double scalar)
           
 void scaleLinearPart(double scalar)
           
 void set(org.ejml.data.DenseMatrix64F matrix)
           
 void set(ReferenceFrame bodyFrame, ReferenceFrame baseFrame, ReferenceFrame expressedInFrame, org.ejml.data.DenseMatrix64F matrix, int rowStart)
          Sets this spatial motion vector based on a matrix ([angular part; linear part]).
 void set(ReferenceFrame bodyFrame, ReferenceFrame baseFrame, ReferenceFrame expressedInFrame, javax.vecmath.Vector3d linearPart, javax.vecmath.Vector3d angularPart)
          Sets this spatial motion vector based
 void setAngularPart(javax.vecmath.Vector3d newAngularVelocity)
          Sets the angular velocity part of the spatial motion vector
 void setAngularPartX(double val)
          Sets the X coordinate of the angular velocity part of the spatial motion vector
 void setAngularPartY(double val)
          Sets the Y coordinate of the angular velocity part of the spatial motion vector
 void setAngularPartZ(double val)
          Sets the Z coordinate of the angular velocity part of the spatial motion vector
 void setLinearPart(javax.vecmath.Vector3d newLinearVelocity)
          Sets the linear velocity part of the spatial motion vector
 void setLinearPartX(double val)
          Sets the X coordinate of the linear velocity part of the spatial motion vector
 void setLinearPartY(double val)
          Sets the Y coordinate of the linear velocity part of the spatial motion vector
 void setLinearPartZ(double val)
          Sets the Z coordinate of the linear velocity part of the spatial motion vector
 void setToZero()
          Sets both the angular and the linear part to zero
 void setToZero(ReferenceFrame bodyFrame, ReferenceFrame baseFrame, ReferenceFrame expressedInFrame)
           
 void times(double scalar)
          Multiplies this spatial motion vector by a scalar
 org.ejml.data.DenseMatrix64F toMatrix()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SIZE

public static final int SIZE
See Also:
Constant Field Values
Constructor Detail

SpatialMotionVector

public SpatialMotionVector()

SpatialMotionVector

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

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

SpatialMotionVector

public SpatialMotionVector(ReferenceFrame bodyFrame,
                           ReferenceFrame baseFrame,
                           ReferenceFrame expressedInFrame,
                           javax.vecmath.Vector3d linearPart,
                           javax.vecmath.Vector3d angularPart)
Parameters:
bodyFrame - what we're specifying the motion of
baseFrame - with respect to what we're specifying the motion
expressedInFrame - in which reference frame the motion is expressed
linearPart - linear part of the spatial motion vector
angularPart - angular part of the spatial motion vector

SpatialMotionVector

public SpatialMotionVector(ReferenceFrame bodyFrame,
                           ReferenceFrame baseFrame,
                           ReferenceFrame expressedInFrame,
                           org.ejml.data.DenseMatrix64F matrix)
Construct using a Matrix ([angular; linear])


SpatialMotionVector

public SpatialMotionVector(ReferenceFrame bodyFrame,
                           ReferenceFrame baseFrame,
                           ReferenceFrame expressedInFrame,
                           double[] array)
Construct using a double array ([angular; linear])

Method Detail

getBodyFrame

public ReferenceFrame getBodyFrame()
Returns:
the frame *of which* this object expresses the motion

getBaseFrame

public ReferenceFrame getBaseFrame()
Returns:
the frame *with respect to which* this spatial motion vector is defined

getExpressedInFrame

public ReferenceFrame getExpressedInFrame()
Returns:
the reference frame *in which this spatial motion vector is expressed

setAngularPart

public void setAngularPart(javax.vecmath.Vector3d newAngularVelocity)
Sets the angular velocity part of the spatial motion vector


setAngularPartX

public void setAngularPartX(double val)
Sets the X coordinate of the angular velocity part of the spatial motion vector


setAngularPartY

public void setAngularPartY(double val)
Sets the Y coordinate of the angular velocity part of the spatial motion vector


setAngularPartZ

public void setAngularPartZ(double val)
Sets the Z coordinate of the angular velocity part of the spatial motion vector


setLinearPartX

public void setLinearPartX(double val)
Sets the X coordinate of the linear velocity part of the spatial motion vector


setLinearPartY

public void setLinearPartY(double val)
Sets the Y coordinate of the linear velocity part of the spatial motion vector


setLinearPartZ

public void setLinearPartZ(double val)
Sets the Z coordinate of the linear velocity part of the spatial motion vector


setLinearPart

public void setLinearPart(javax.vecmath.Vector3d newLinearVelocity)
Sets the linear velocity part of the spatial motion vector


setToZero

public void setToZero()
Sets both the angular and the linear part to zero


set

public void set(ReferenceFrame bodyFrame,
                ReferenceFrame baseFrame,
                ReferenceFrame expressedInFrame,
                org.ejml.data.DenseMatrix64F matrix,
                int rowStart)
Sets this spatial motion vector based on a matrix ([angular part; linear part]).

Parameters:
matrix -

set

public void set(ReferenceFrame bodyFrame,
                ReferenceFrame baseFrame,
                ReferenceFrame expressedInFrame,
                javax.vecmath.Vector3d linearPart,
                javax.vecmath.Vector3d angularPart)
Sets this spatial motion vector based


set

public void set(org.ejml.data.DenseMatrix64F matrix)

setToZero

public void setToZero(ReferenceFrame bodyFrame,
                      ReferenceFrame baseFrame,
                      ReferenceFrame expressedInFrame)

getAngularPartCopy

public javax.vecmath.Vector3d getAngularPartCopy()
Returns:
a copy of the angular part

getLinearPartCopy

public javax.vecmath.Vector3d getLinearPartCopy()
Returns:
a copy of the linear part

toMatrix

public org.ejml.data.DenseMatrix64F toMatrix()
Returns:
a matrix representation of this spatial motion vector ([angular part; linear part]).

packMatrix

public void packMatrix(org.ejml.data.DenseMatrix64F matrix,
                       int rowStart)
Packs an existing matrix based on this spatial motion vector ([angular part; linear part]).

Parameters:
matrix - matrix to pack

packAngularPart

public void packAngularPart(javax.vecmath.Vector3d vectorToPack)
Packs an existing Vector3d with the angular velocity part


packLinearPart

public void packLinearPart(javax.vecmath.Vector3d vectorToPack)
Packs an existing Vector3d with the linear velocity part


limitLinearPartMagnitude

public void limitLinearPartMagnitude(double maximumMagnitude)

limitAngularPartMagnitude

public void limitAngularPartMagnitude(double maximumMagnitude)

packAngularPart

public void packAngularPart(FrameVector vectorToPack)
Packs an existing FrameVector with the angular velocity part


packLinearPart

public void packLinearPart(FrameVector vectorToPack)
Packs an existing FrameVector with the linear velocity part


times

public void times(double scalar)
Multiplies this spatial motion vector by a scalar

Parameters:
scalar - the scaling factor

invert

public void invert()
Inverts the spatial motion vector, i.e.: Given the spatial motion of frame A with respect to frame B, expressed in frame C, this method computes the spatial motion of frame B with respect to frame A, expressed in frame C (or vice versa), by just taking the additive inverse. See Duindam, Port-Based Modeling and Control for Efficient Bipedal Walking Robots, page 25, lemma 2.8 (d) (and (e), for generalizing to any expressedInFrame) http://sites.google.com/site/vincentduindam/publications Duindam proves this fact for twists, but differentiating the statement results in the same thing for derivatives of twists


scale

public void scale(double scalar)

scaleLinearPart

public void scaleLinearPart(double scalar)

scaleAngularPart

public void scaleAngularPart(double scalar)

normalize

public void normalize()

checkReferenceFramesMatch

public void checkReferenceFramesMatch(ReferenceFrame bodyFrame,
                                      ReferenceFrame baseFrame,
                                      ReferenceFrame expressedInFrame)

toString

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