artisynth.core.mechmodels
Class FrameState

java.lang.Object
  extended by artisynth.core.mechmodels.FrameState
All Implemented Interfaces:
ScalableUnits

public class FrameState
extends java.lang.Object
implements ScalableUnits


Constructor Summary
FrameState()
           
 
Method Summary
 void addScaledVelocity(double s, Twist v)
          Adds a scaled velocity to this frame's existing velocity.
 void addVelocity(Twist v)
          Adds a velocity to this frame's existing velocity.
 void adjustPose(Twist delx)
          Adjusts the pose of this FrameState by an increment specified as a twist delx.
 void adjustPose(Twist vel, double h)
          Adjusts the pose of this FrameState by a velocity (in Frame coordinates) applied over a time interval h.
 boolean equals(ComponentState state)
           
 int get(VectorNd x, int idx)
           
 AxisAngle getAxisAngle()
           
 int getBodyVel(double[] buf, int idx, Twist bodyVel)
           
 void getBodyVelocity(Twist v)
          Gets the velocity of the frame in body coordinates.
 int getPos(double[] buf, int idx)
           
 RigidTransform3d getPose()
           
 void getPose(RigidTransform3d X)
           
 Point3d getPosition()
           
 Quaternion getRotation()
           
 int getVel(double[] buf, int idx)
           
 Twist getVelocity()
          Returns the velocity of the frame in world coordinates.
 void getVelocity(Twist v)
          Gets the velocity of the frame in world coordinates.
 void rotDerivative(Quaternion qvel)
          Computes the time derivative of qrot given the current value of w.
 void scaleDistance(double s)
          Scales all distance coordinates.
 void scaleMass(double s)
          Scales all mass units.
 void set(FrameState state)
           
 int set(VectorNd x, int idx)
           
 int setBodyVel(double[] buf, int idx)
           
 void setBodyVelocity(Twist v)
          Sets the velocity of the frame in body coordinates.
 int setPos(double[] buf, int idx)
           
 void setPose(RigidTransform3d X)
           
 void setPosition(Point3d p)
           
 void setRotation(Quaternion q)
           
 int setVel(double[] buf, int idx)
           
 void setVelocity(Twist v)
          Sets the velocity of the frame in world coordinates.
 java.lang.String toString()
           
 java.lang.String toString(NumberFormat fmt)
           
 java.lang.String toString(java.lang.String fmtStr)
           
 void updatePose()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FrameState

public FrameState()
Method Detail

set

public void set(FrameState state)

set

public int set(VectorNd x,
               int idx)

get

public int get(VectorNd x,
               int idx)

setPose

public void setPose(RigidTransform3d X)

adjustPose

public void adjustPose(Twist delx)
Adjusts the pose of this FrameState by an increment specified as a twist delx. The increment is specified in the frame of the pose itself. In other words, if the frame pose is X, and dX is the rigid transform associated with delx, then this routine computes
   X = X dX
 

Parameters:
delx - incremental displacement

adjustPose

public void adjustPose(Twist vel,
                       double h)
Adjusts the pose of this FrameState by a velocity (in Frame coordinates) applied over a time interval h. In other words, if the frame pose is X, and vel is a twist specifying the velocity, then this routine computes
  X = X vel h
 

Parameters:
vel - velocity in frame coordinates
h - time interval over which to apply the velocity

updatePose

public void updatePose()

getPose

public RigidTransform3d getPose()

getPose

public void getPose(RigidTransform3d X)

getPosition

public Point3d getPosition()

setPosition

public void setPosition(Point3d p)

getRotation

public Quaternion getRotation()

setRotation

public void setRotation(Quaternion q)

setVelocity

public void setVelocity(Twist v)
Sets the velocity of the frame in world coordinates.

Parameters:
v - spatial velocity

addVelocity

public void addVelocity(Twist v)
Adds a velocity to this frame's existing velocity.

Parameters:
v - spatial velocity to add

addScaledVelocity

public void addScaledVelocity(double s,
                              Twist v)
Adds a scaled velocity to this frame's existing velocity.

Parameters:
s - scale factor
v - spatial velocity to add

getVelocity

public Twist getVelocity()
Returns the velocity of the frame in world coordinates.

Returns:
frame velocity in world coordinates (should not be modified)

getVelocity

public void getVelocity(Twist v)
Gets the velocity of the frame in world coordinates.

Parameters:
v - returns the spatial velocity

getBodyVelocity

public void getBodyVelocity(Twist v)
Gets the velocity of the frame in body coordinates.

Parameters:
v - returns the spatial velocity

setBodyVelocity

public void setBodyVelocity(Twist v)
Sets the velocity of the frame in body coordinates.

Parameters:
v - spatial velocity

rotDerivative

public void rotDerivative(Quaternion qvel)
Computes the time derivative of qrot given the current value of w.

Parameters:
qvel - returns the derivative of qrot

getPos

public int getPos(double[] buf,
                  int idx)

getAxisAngle

public AxisAngle getAxisAngle()

getVel

public int getVel(double[] buf,
                  int idx)

getBodyVel

public int getBodyVel(double[] buf,
                      int idx,
                      Twist bodyVel)

setPos

public int setPos(double[] buf,
                  int idx)

setVel

public int setVel(double[] buf,
                  int idx)

setBodyVel

public int setBodyVel(double[] buf,
                      int idx)

toString

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

toString

public java.lang.String toString(NumberFormat fmt)

toString

public java.lang.String toString(java.lang.String fmtStr)

scaleDistance

public void scaleDistance(double s)
Description copied from interface: ScalableUnits
Scales all distance coordinates.

Specified by:
scaleDistance in interface ScalableUnits
Parameters:
s - scaling factor

scaleMass

public void scaleMass(double s)
Description copied from interface: ScalableUnits
Scales all mass units.

Specified by:
scaleMass in interface ScalableUnits
Parameters:
s - scaling factor

equals

public boolean equals(ComponentState state)