us.ihmc.utilities.screwTheory
Class SpatialForceVector

java.lang.Object
  extended by us.ihmc.utilities.screwTheory.SpatialForceVector
Direct Known Subclasses:
Momentum, Wrench

public class SpatialForceVector
extends java.lang.Object


Field Summary
static java.lang.String[] AXIS_NAMES
           
static int SIZE
           
 
Constructor Summary
SpatialForceVector()
          Default constructor
SpatialForceVector(ReferenceFrame expressedInFrame)
          Initializes the components of the spatial acceleration vector to zero
SpatialForceVector(ReferenceFrame expressedInFrame, org.ejml.data.DenseMatrix64F matrix)
          Construct using a Matrix ([angularPart; linearPart])
SpatialForceVector(ReferenceFrame expressedInFrame, double[] matrix)
          Construct using a double array ([angularPart; linearPart])
SpatialForceVector(ReferenceFrame expressedInFrame, javax.vecmath.Vector3d linearPart, javax.vecmath.Vector3d angularPart)
           
SpatialForceVector(SpatialForceVector other)
          Copy constructor
 
Method Summary
 void add(SpatialForceVector other)
          Adds another spatial force vector to this one, after performing some reference frame checks.
 void addAngularPart(javax.vecmath.Vector3d angularPart)
          Adds to the angular part of the spatial force vector
 void addLinearPart(javax.vecmath.Vector3d linearPart)
          Adds to the force part of the spatial force vector
 void changeFrame(ReferenceFrame newReferenceFrame)
          Changes the reference frame in which this spatial force vector is expressed See Duindam, Port-Based Modeling and Control for Efficient Bipedal Walking Robots, page 36, eq.
 void checkAndSet(SpatialForceVector other)
           
static SpatialForceVector createUsingArm(ReferenceFrame expressedInFrame, javax.vecmath.Vector3d linearPart, javax.vecmath.Vector3d arm)
          Construct using linear part and arm
 FrameVector getAngularPartAsFrameVectorCopy()
           
 javax.vecmath.Vector3d getAngularPartCopy()
           
 ReferenceFrame getExpressedInFrame()
           
 FrameVector getLinearPartAsFrameVectorCopy()
           
 javax.vecmath.Vector3d getLinearPartCopy()
           
 void negate()
           
 void packAngularPart(FrameVector vectorToPack)
          Packs an existing FrameVector with the angular part.
 void packAngularPart(javax.vecmath.Vector3d vectorToPack)
          Packs an existing Vector3d with the angular part
 void packLinearPart(FrameVector vectorToPack)
          Packs an existing FrameVector with the linear part.
 void packLinearPart(javax.vecmath.Vector3d vectorToPack)
          Packs an existing Vector3d with the linear part
 void packMatrix(org.ejml.data.DenseMatrix64F matrix)
          Packs a matrix
 void packMatrix(double[] matrix)
           
 void packMatrixColumn(org.ejml.data.DenseMatrix64F matrix, int column)
           
 void scale(double scalar)
           
 void scaleAngularPart(double scalar)
           
 void scaleLinearPart(double scalar)
           
 void set(ReferenceFrame expressedInFrame, org.ejml.data.DenseMatrix64F matrix)
           
 void set(ReferenceFrame expressedInFrame, double[] doubleArray)
           
 void set(ReferenceFrame expressedInFrame, javax.vecmath.Vector3d linearPart, javax.vecmath.Vector3d angularPart)
           
 void set(SpatialForceVector other)
           
 void setAngularPart(javax.vecmath.Vector3d angularPart)
          Sets the angular part of the twist
 void setAngularPartX(double val)
          Sets the X coordinate of the angular part of the spatial force vector
 void setAngularPartY(double val)
          Sets the Y coordinate of the angular part of the spatial force vector
 void setAngularPartZ(double val)
          Sets the Z coordinate of the angular part of the spatial force vector
 void setLinearPart(javax.vecmath.Vector3d linearPart)
          Sets the linear part of the spatial force vector
 void setLinearPartX(double val)
          Sets the X coordinate of the linear part of the spatial force vector
 void setLinearPartY(double val)
          Sets the Y coordinate of the linear part of the spatial force vector
 void setLinearPartZ(double val)
          Sets the Z coordinate of the linear part of the spatial force vector
 void setToZero()
           
 void setUsingArm(ReferenceFrame expressedInFrame, javax.vecmath.Vector3d linearPart, javax.vecmath.Vector3d arm)
           
 void sub(SpatialForceVector other)
          Subtracts another spatial force vector from this one, after performing some reference frame checks.
 void subAngularPart(javax.vecmath.Vector3d angularPart)
           
 void subLinearPart(javax.vecmath.Vector3d linearPart)
           
 void times(double scalar)
          Multiplies this spatial force vector by a scalar
 org.ejml.data.DenseMatrix64F toDenseMatrix()
           
 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

AXIS_NAMES

public static final java.lang.String[] AXIS_NAMES
Constructor Detail

SpatialForceVector

public SpatialForceVector()
Default constructor


SpatialForceVector

public SpatialForceVector(ReferenceFrame expressedInFrame)
Initializes the components of the spatial acceleration vector to zero

Parameters:
expressedInFrame - the frame in which the spatial acceleration vector is expressed

SpatialForceVector

public SpatialForceVector(ReferenceFrame expressedInFrame,
                          javax.vecmath.Vector3d linearPart,
                          javax.vecmath.Vector3d angularPart)
Parameters:
expressedInFrame - the frame in which the spatial acceleration vector is expressed
linearPart - linear part part of the spatial acceleration vector
angularPart - angular part of the spatial acceleration vector

SpatialForceVector

public SpatialForceVector(ReferenceFrame expressedInFrame,
                          org.ejml.data.DenseMatrix64F matrix)
Construct using a Matrix ([angularPart; linearPart])


SpatialForceVector

public SpatialForceVector(ReferenceFrame expressedInFrame,
                          double[] matrix)
Construct using a double array ([angularPart; linearPart])


SpatialForceVector

public SpatialForceVector(SpatialForceVector other)
Copy constructor

Method Detail

createUsingArm

public static SpatialForceVector createUsingArm(ReferenceFrame expressedInFrame,
                                                javax.vecmath.Vector3d linearPart,
                                                javax.vecmath.Vector3d arm)
Construct using linear part and arm


setUsingArm

public void setUsingArm(ReferenceFrame expressedInFrame,
                        javax.vecmath.Vector3d linearPart,
                        javax.vecmath.Vector3d arm)

getExpressedInFrame

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

setAngularPart

public void setAngularPart(javax.vecmath.Vector3d angularPart)
Sets the angular part of the twist


setLinearPart

public void setLinearPart(javax.vecmath.Vector3d linearPart)
Sets the linear part of the spatial force vector


setAngularPartX

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


setAngularPartY

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


setAngularPartZ

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


setLinearPartX

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


setLinearPartY

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


setLinearPartZ

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


checkAndSet

public void checkAndSet(SpatialForceVector other)

set

public void set(SpatialForceVector other)

add

public void add(SpatialForceVector other)
Adds another spatial force vector to this one, after performing some reference frame checks.


sub

public void sub(SpatialForceVector other)
Subtracts another spatial force vector from this one, after performing some reference frame checks.


set

public void set(ReferenceFrame expressedInFrame,
                javax.vecmath.Vector3d linearPart,
                javax.vecmath.Vector3d angularPart)

set

public void set(ReferenceFrame expressedInFrame,
                org.ejml.data.DenseMatrix64F matrix)

set

public void set(ReferenceFrame expressedInFrame,
                double[] doubleArray)

addAngularPart

public void addAngularPart(javax.vecmath.Vector3d angularPart)
Adds to the angular part of the spatial force vector


subAngularPart

public void subAngularPart(javax.vecmath.Vector3d angularPart)

addLinearPart

public void addLinearPart(javax.vecmath.Vector3d linearPart)
Adds to the force part of the spatial force vector


subLinearPart

public void subLinearPart(javax.vecmath.Vector3d linearPart)

getAngularPartAsFrameVectorCopy

public FrameVector getAngularPartAsFrameVectorCopy()
Returns:
copy of the angular part as a FrameVector

getLinearPartAsFrameVectorCopy

public FrameVector getLinearPartAsFrameVectorCopy()
Returns:
copy of the angular part as a FrameVector

getAngularPartCopy

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

getLinearPartCopy

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

packMatrix

public void packMatrix(org.ejml.data.DenseMatrix64F matrix)
Packs a matrix

Parameters:
matrix -

packMatrixColumn

public void packMatrixColumn(org.ejml.data.DenseMatrix64F matrix,
                             int column)

toDenseMatrix

public org.ejml.data.DenseMatrix64F toDenseMatrix()
Returns:
a matrix representation of this spatial force vector. [linearPart; angularPart]

packAngularPart

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


packAngularPart

public void packAngularPart(FrameVector vectorToPack)
Packs an existing FrameVector with the angular part. The FrameVector must be in the same frame as the expressedInFrame


packLinearPart

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


packLinearPart

public void packLinearPart(FrameVector vectorToPack)
Packs an existing FrameVector with the linear part. The FrameVector must be in the same frame as the expressedInFrame


times

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

Parameters:
scalar - the scaling factor

changeFrame

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


scaleLinearPart

public void scaleLinearPart(double scalar)

scaleAngularPart

public void scaleAngularPart(double scalar)

scale

public void scale(double scalar)

negate

public void negate()

toString

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

setToZero

public void setToZero()

packMatrix

public void packMatrix(double[] matrix)