com.yobotics.simulationconstructionset
Class Robot

java.lang.Object
  extended by com.yobotics.simulationconstructionset.Robot
All Implemented Interfaces:
YoVariableHolder, java.io.Serializable
Direct Known Subclasses:
ContactablePinJointRobot, ContactableRobot, ContactableStaticRobot, PointMassRobot, SimulationConstructionSetTest.SimpleRobot, SingleRigidBodyRobot

public class Robot
extends java.lang.Object
implements YoVariableHolder, java.io.Serializable

Title: Robot

Description: A Robot is a forest of trees of Joints, each Joint having an associated Link. The Robot contains all the dynamic information, including Joint types, offsets between Joints, Link masses, center of mass locations, and moments of inertia. Each root joint has children

Copyright: Copyright (c) 2000-2005

Company: Yobotics, Inc.

Version:
1.0
Author:
Jerry Pratt
See Also:
Serialized Form

Constructor Summary
Robot(RobotDefinitionFixedFrame definition, java.lang.String name)
           
Robot(java.lang.String name)
          Creates a Robot with the specified name.
 
Method Summary
 void addDynamicGraphicObjectsListRegistry(DynamicGraphicObjectsListRegistry dynamicGraphicObjectsListRegistry)
           
 void addFunctionToIntegrate(FunctionToIntegrate functionToIntegrate)
          Adds a FunctionToIntegrate which will be integrated each simulation step.
 void addRootJoint(Joint root)
          Adds a root Joint to this robot.
 void addStaticLink(Link staticLink)
          Adds the specified link to the robot.
 void addStaticLinkGraphics(java.util.ArrayList<Graphics3DObject> linkGraphicsArray)
           
 void addStaticLinkGraphics(Graphics3DObject linkGraphics)
          Adds the specified LinkGraphics to the robot.
 void addYoVariableRegistry(YoVariableRegistry registry)
          Adds a YoVariableRegistry to the robot.
 void computeAngularMomentum(Joint rootJoint, javax.vecmath.Vector3d angularMomentum)
          Computes the total angular momentum about the center of mass for the subtree rooted at the specified root Joint.
 void computeAngularMomentum(javax.vecmath.Vector3d angularMomentum)
          Computes the total angular momentum about the center of mass for this Robot.
 double computeCenterOfMass(Joint rootJoint, javax.vecmath.Point3d comPoint)
          Computes the Center of Mass of the subtree rooted at the specified root Joint.
 double computeCenterOfMass(javax.vecmath.Point3d comPoint)
          Computes the center of mass of this Robot.
 void computeCenterOfPressure(javax.vecmath.Point3d copPoint, javax.vecmath.Vector3d copForce, javax.vecmath.Vector3d copMoment)
          Computes the Center of Pressure of the GroundContactPoints attached to this Robot.
 double computeCOMMomentum(Joint rootJoint, javax.vecmath.Point3d comPoint, javax.vecmath.Vector3d linearMomentum, javax.vecmath.Vector3d angularMomentum)
          Computes the Center of Mass location and total linear and angular momentum about the center of mass for the subtree rooted at the specified root Joint.
 double computeCOMMomentum(javax.vecmath.Point3d comPoint, javax.vecmath.Vector3d linearMomentum, javax.vecmath.Vector3d angularMomentum)
          Computes the Center of Mass location and total linear and angular momentum about the Center of Mass for this Robot.
 double computeGravitationalPotentialEnergy()
          Computes the total gravitational potential energy of this Robot.
 double computeGravitationalPotentialEnergy(Joint rootJoint)
          Computes the total gravitational potential energy of the subtree rooted at the specified root Joint.
 double computeLinearMomentum(Joint rootJoint, javax.vecmath.Vector3d linearMomentum)
          Computes the total linear momentum of the center of mass for the subtree rooted at the specified root Joint.
 double computeLinearMomentum(javax.vecmath.Vector3d linearMomentum)
          Computes the total linear momentum of the center of mass for this Robot.
 double computeRotationalKineticEnergy()
          Computes the total rotational kinetic energy of this Robot.
 double computeRotationalKineticEnergy(Joint rootJoint)
          Computes the total rotational kinetic energy of the subtree rooted at the specified root Joint.
 double computeTranslationalKineticEnergy()
          Computes the total translational kinetic energy of this Robot.
 double computeTranslationalKineticEnergy(Joint rootJoint)
          Computes the total translational kinetic energy of the subtree rooted at the specified root Joint.
 java.util.ArrayList<VarList> createAllVarLists()
           
 void decideGroundContactPointsInContact()
          Step through each joint to determine if any points are in contact with the ground.
 void doAfterControlBeforeDynamics()
           
 void doDynamicsAndIntegrate(double DT)
          Calculates the robot dynamics and integrates to the next step.
 void doDynamicsButDoNotIntegrate()
          Will update the qdd values of the joints, but not integrate the velocities or anything like that.
 java.util.ArrayList<ExternalForcePoint> getAllExternalForcePoints()
           
 java.util.ArrayList<GroundContactPoint> getAllGroundContactPoints()
           
 java.util.ArrayList<KinematicPoint> getAllKinematicPoints()
           
 void getAllOneDegreeOfFreedomJoints(java.util.ArrayList<OneDegreeOfFreedomJoint> oneDegreeOfFreedomJoints)
           
 java.util.ArrayList<YoVariable> getAllVariables()
          Returns all the YoVariables in this YoVariableHolder
 YoVariable[] getAllVariablesArray()
          Returns all the YoVariables in this YoVariableHolder
 void getCameraMountList(CameraMountList cameraMountList)
          Steps through every joint adding each camera mount to the provided list.
 java.util.ArrayList<RobotControllerAndParameters> getControllers()
           
 void getGravity(javax.vecmath.Vector3d gravityVectorToPack)
           
 double getGravityX()
          Gets this robot's component of gravitational acceleration in the x-direction.
 double getGravityY()
          Gets this robot's component of gravitational acceleration in the y-direction.
 double getGravityZ()
          Gets this robot's component of gravitational acceleration in the z-direction.
 GroundContactModel getGroundContactModel()
          Retrieves this robot's ground contact model.
 java.util.ArrayList<GroundContactPoint> getGroundContactPoints(int groundContactGroupIdentifier)
          Retrieves a list of all ground contact points associated with this robot and the groundContactGroupIdentifier.
 void getIMUMounts(java.util.ArrayList<IMUMount> imuMountsToPack)
           
 java.lang.String getName()
          Gets the name of this Robot.
 YoVariableRegistry getRobotsYoVariableRegistry()
           
 java.util.ArrayList<Joint> getRootJoints()
          Retrieves an ArrayList containing the rootJoints of this robot.
 java.util.ArrayList<SimulatedSensor> getSensors()
           
<T extends SimulatedSensor>
java.util.ArrayList<T>
getSensors(java.lang.Class<T> sensorType)
          Returns an ArrayList appropriate to the type of sensor being queried containing all the sensors of that type for each joint.
 java.util.ArrayList<SimulationRewoundListener> getSimulationRewoundListeners()
           
 java.util.ArrayList<Graphics3DObject> getStaticLinkGraphics()
           
 double getTime()
          Gets this robot's time.
 YoVariable getVariable(java.lang.String variableName)
          Gets a YoVariable with the given name if it is in this YoVariableHolder, otherwise returns null.
 YoVariable getVariable(java.lang.String nameSpaceEnding, java.lang.String name)
          Gets a YoVariable with the given nameSpace and name if it is in this YoVariableHolder, otherwise returns null.
 java.util.ArrayList<YoVariable> getVariables(NameSpace nameSpace)
          Returns all the YoVariables with the given nameSpace that are in this YoVariableHolder, empty if there are none.
 java.util.ArrayList<YoVariable> getVariables(java.lang.String name)
          Returns all the YoVariables with the given name that are in this YoVariableHolder, empty if there are none.
 java.util.ArrayList<YoVariable> getVariables(java.lang.String nameSpaceEnding, java.lang.String name)
          Returns all the YoVariables with the given nameSpace and name that are in this YoVariableHolder, empty if there are none.
 DoubleYoVariable getYoTime()
          Gets this robot's time
 boolean hasUniqueVariable(java.lang.String variableName)
          Checks if this YoVariableHolder holds exactly one YoVariable with the given name.
 boolean hasUniqueVariable(java.lang.String nameSpaceEnding, java.lang.String name)
          Checks if this YoVariableHolder holds exactly one YoVariable with the given nameSpace and name.
 void setBodyExternalForcePoint(double fx, double fy, double fz)
           
 void setController(RobotController controller)
          Adds a controller to use with this Robot.
 void setController(RobotControllerAndParameters controllerAndParameters)
           
 void setController(RobotController controller, int simulationTicksPerControlTick)
          Adds a controller to use with this Robot.
 void setControllersAndCallInitialization(java.util.ArrayList<RobotControllerAndParameters> robotControllersAndParameters)
           
 void setDynamic(boolean isDynamic)
           
 void setDynamicIntegrationMethod(DynamicIntegrationMethod dynamicIntegrationMethod)
           
 void setGravity(double gZ)
          Sets the Z component of the gravity to the specified value.
 void setGravity(double gravityX, double gravityY, double gravityZ)
          Sets gravity to the specified values.
 void setGravity(javax.vecmath.Vector3d gravity)
           
 void setGroundContactModel(GroundContactModel gcModel)
          Sets the ground contact model for this robot.
 void setTime(double time)
          Sets this robot's time.
 java.lang.String toString()
          This method returns the display name of the robot followed by the names of each joint.
 void update()
          Returns a list of the YoVariables associated with this robot.
 void updateAllGroundContactPointVelocities()
          Updates the velocities for all ground contact points.
 void updateForPlayback()
           
 void updateVelocities()
          Updates the velocities and positions at each joint as well as the rotation matrices from and to the base coordinate system.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Robot

public Robot(RobotDefinitionFixedFrame definition,
             java.lang.String name)

Robot

public Robot(java.lang.String name)
Creates a Robot with the specified name. A Robot is a forest of trees of Joints, each Joint having an associated Link.

Parameters:
name - Name of the robot.
Method Detail

setDynamicIntegrationMethod

public void setDynamicIntegrationMethod(DynamicIntegrationMethod dynamicIntegrationMethod)

getTime

public double getTime()
Gets this robot's time.

Returns:
double

setTime

public void setTime(double time)
Sets this robot's time.


setDynamic

public void setDynamic(boolean isDynamic)

getYoTime

public DoubleYoVariable getYoTime()
Gets this robot's time

Returns:
YoVariable

getGravityX

public double getGravityX()
Gets this robot's component of gravitational acceleration in the x-direction.

Returns:
double

getGravityY

public double getGravityY()
Gets this robot's component of gravitational acceleration in the y-direction.

Returns:
double

getGravityZ

public double getGravityZ()
Gets this robot's component of gravitational acceleration in the z-direction.

Returns:
double

getGravity

public void getGravity(javax.vecmath.Vector3d gravityVectorToPack)

addYoVariableRegistry

public void addYoVariableRegistry(YoVariableRegistry registry)
Adds a YoVariableRegistry to the robot. Will be added as a child registry to the robot's registry.

Parameters:
registry - YoVariableRegistry

addDynamicGraphicObjectsListRegistry

public void addDynamicGraphicObjectsListRegistry(DynamicGraphicObjectsListRegistry dynamicGraphicObjectsListRegistry)

addRootJoint

public void addRootJoint(Joint root)
Adds a root Joint to this robot. This joint may have multiple child joints which also can have children. A robot may have any number of root joints.

Parameters:
root - Joint to be added as the root Joint. A robot is comprised of a forest of trees, with one root Joint per tree.

getGroundContactModel

public GroundContactModel getGroundContactModel()
Retrieves this robot's ground contact model.

Returns:
GroundContactModel The GroundContactModel of this robot.
See Also:
GroundContactModel

decideGroundContactPointsInContact

public void decideGroundContactPointsInContact()
Step through each joint to determine if any points are in contact with the ground.


getRootJoints

public java.util.ArrayList<Joint> getRootJoints()
Retrieves an ArrayList containing the rootJoints of this robot. These joints make up the entirety of the robot's visual component as all joints and links are at some level their children.

Returns:
ArrayList containing the root joints of the robot.

setGravity

public void setGravity(double gravityX,
                       double gravityY,
                       double gravityZ)
Sets gravity to the specified values. For example, if using meter-kilogram-seconds units of measure with Earth's gravity, then use setGravity(0.0, 0.0, -9.81);

Parameters:
gravityX - X component of the Gravity vector.
gravityY - Y component of the Gravity vector.
gravityZ - Z component of the Gravity vector.

setGravity

public void setGravity(javax.vecmath.Vector3d gravity)

setGravity

public void setGravity(double gZ)
Sets the Z component of the gravity to the specified value. For example, if using meter-kilogram-seconds units of measure with Earth's gravity, then use setGravity(-9.81);

Parameters:
gZ - Z component of the Gravity vector. X and Y components are set to 0.0.

addFunctionToIntegrate

public void addFunctionToIntegrate(FunctionToIntegrate functionToIntegrate)
Adds a FunctionToIntegrate which will be integrated each simulation step. If no functions are present that step is skipped.

Parameters:
functionToIntegrate - The function to be integrated.
See Also:
FunctionToIntegrate

setController

public void setController(RobotController controller)
Adds a controller to use with this Robot. A single robot can have multiple controllers, all of which execute their doControl methods when called. Controllers added with this function doControl every simulation tick.

Parameters:
controller - RobotController to use with this robot.
See Also:
RobotController

setController

public void setController(RobotController controller,
                          int simulationTicksPerControlTick)
Adds a controller to use with this Robot. This method provides a method for reducing the number of control ticks per simulation tick. In other words, the controller only executes once every x simulation ticks.

Parameters:
controller - RobotController to use with this robot.
simulationTicksPerControlTick - Number of simulation ticks per control tick.

setControllersAndCallInitialization

public void setControllersAndCallInitialization(java.util.ArrayList<RobotControllerAndParameters> robotControllersAndParameters)

setController

public void setController(RobotControllerAndParameters controllerAndParameters)

setGroundContactModel

public void setGroundContactModel(GroundContactModel gcModel)
Sets the ground contact model for this robot. This allow the robot to interact with its surroundings based on their characteristics.

Parameters:
gcModel - GroundContactModel to be used with this robot.
See Also:
GroundContactModel

getName

public java.lang.String getName()
Gets the name of this Robot.

Returns:
Name of this Robot.

update

public void update()
Returns a list of the YoVariables associated with this robot. This list does not include variables belonging to its GroundContactModel or controllers.


updateForPlayback

public void updateForPlayback()

updateAllGroundContactPointVelocities

public void updateAllGroundContactPointVelocities()
Updates the velocities for all ground contact points. This is called once per simulation tick to ensure all ground contact point velocities are updated.


getCameraMountList

public void getCameraMountList(CameraMountList cameraMountList)
Steps through every joint adding each camera mount to the provided list. This function is called by the GUI on one of two occasions. When the GUI is created and when a robot is set. In both cases the method is not called in the null robot case.

Parameters:
cameraMountList - CameraMountList to which all mount points are added.

getSensors

public java.util.ArrayList<SimulatedSensor> getSensors()

getSensors

public <T extends SimulatedSensor> java.util.ArrayList<T> getSensors(java.lang.Class<T> sensorType)
Returns an ArrayList appropriate to the type of sensor being queried containing all the sensors of that type for each joint.


getAllOneDegreeOfFreedomJoints

public void getAllOneDegreeOfFreedomJoints(java.util.ArrayList<OneDegreeOfFreedomJoint> oneDegreeOfFreedomJoints)

getIMUMounts

public void getIMUMounts(java.util.ArrayList<IMUMount> imuMountsToPack)

getGroundContactPoints

public java.util.ArrayList<GroundContactPoint> getGroundContactPoints(int groundContactGroupIdentifier)
Retrieves a list of all ground contact points associated with this robot and the groundContactGroupIdentifier.

Returns:
ArrayList containing the GroundContactPoints, if none exist the list will be empty.

getAllGroundContactPoints

public java.util.ArrayList<GroundContactPoint> getAllGroundContactPoints()

getAllExternalForcePoints

public java.util.ArrayList<ExternalForcePoint> getAllExternalForcePoints()

getAllKinematicPoints

public java.util.ArrayList<KinematicPoint> getAllKinematicPoints()

addStaticLink

public void addStaticLink(Link staticLink)
Adds the specified link to the robot. Static links have no effect on the simulation, they are purely cosmetic.

Parameters:
staticLink - Link to be added.

addStaticLinkGraphics

public void addStaticLinkGraphics(Graphics3DObject linkGraphics)
Adds the specified LinkGraphics to the robot. Static LinkGraphics have no effect on the simulation, they are purely cosmetic.

Parameters:
linkGraphics - LinkGraphics to be added.

addStaticLinkGraphics

public void addStaticLinkGraphics(java.util.ArrayList<Graphics3DObject> linkGraphicsArray)

updateVelocities

public void updateVelocities()
Updates the velocities and positions at each joint as well as the rotation matrices from and to the base coordinate system. Each joint stores both its rotational and translational velocities. The updated velocities are based on those of the previous joint in the chain. This also updates all kinetic and ground contact points.


getRobotsYoVariableRegistry

public YoVariableRegistry getRobotsYoVariableRegistry()

doAfterControlBeforeDynamics

public void doAfterControlBeforeDynamics()

doDynamicsButDoNotIntegrate

public void doDynamicsButDoNotIntegrate()
                                 throws UnreasonableAccelerationException
Will update the qdd values of the joints, but not integrate the velocities or anything like that. Good for testing inverse dynamics routines and things like that.

Throws:
UnreasonableAccelerationException

doDynamicsAndIntegrate

public void doDynamicsAndIntegrate(double DT)
                            throws UnreasonableAccelerationException

Calculates the robot dynamics and integrates to the next step. This integration is accomplished via the Runge-Kutta method which approximates the next point in the series by calculating four intermediary slopes. The robot dynamics are calculated four times using the following method to generate these Runge-Kutta slopes.

Robot dynamics are calculated via the Featherstone algorithm as discussed by Brian Mirtich in his Thesis, Impule-based Dynamic Simulation of Rigid Body Systems. This algorithm is implemented in four distinct passes as follows:

  1. The first pass recurses down the tree, calculating the linear and angular velocities for each link. In the process the rotation matricies and radius vectors are recalculated. The coordinate system of each joint/link space is centered on the current link's center of mass. Each joint contains a rotation matrix and corresponding radius vector to translate information to and from the previous link's coordinate system. These functions must be updated before the velocities may be calculated. The kinematic and ground contact points as well as torque for each joint are also updated.
  2. Pass two recurses down the tree again, calculating the isolated components of the spatial articulated inertia and spatial isolated zero-acceleration force for each link. Coriolis forces and forces from ground contact and kinetic points are included in these calculations.
  3. In the third pass the completed articulated inertia and articulated z.a. forces are calculated for each link by recursing up the tree. These values are based on the positions, velocities and torques of each link.
  4. The final pass recurses down the tree calculating the joint accelerations based on the information generated by the previous three passes. During this pass the joint positions, velocities and accelerations are stored for use in the Runge-Kutta calculations.

Between each run of the dynamics Euler Integration is used to shift the values in preparation for the next step. However, the values are returned to their original states before each integration. Each pass of the dynamics stores the Runge-Kutta slope for each parameter. Once the dynamics have been calculated the joints are checked for unreasonable accelerations. If none are present, Runge-Kutta is executed for each joint and the current time is updated.

Parameters:
DT - Step time for the integration.
Throws:
UnreasonableAccelerationException - This exception indicates that at least one joint underwent an unreasonable acceleration as defined by its joint type. This is often caused by overly large step times (DT).

computeTranslationalKineticEnergy

public double computeTranslationalKineticEnergy()
Computes the total translational kinetic energy of this Robot. This is the sum over i of 1/2 m_i v_i*v_i, where m_i is the mass of link i, and v_i is the translational velocity of the center of mass of link i.

Returns:
Total translational kinetic energy.

computeTranslationalKineticEnergy

public double computeTranslationalKineticEnergy(Joint rootJoint)
Computes the total translational kinetic energy of the subtree rooted at the specified root Joint. This is the sum over i of 1/2 m_i v_i*v_i, where m_i is the mass of link i, and v_i is the translational velocity of the center of mass of link i, and i includes all decendents of the specified root Joint.

Parameters:
rootJoint - Root Joint to compute energy from.
Returns:
Total translational kinetic energy of the subtree rooted at the specified root Joint.

computeRotationalKineticEnergy

public double computeRotationalKineticEnergy()
Computes the total rotational kinetic energy of this Robot. This is the sum over i of 1/2 w_i^T*J_i*w_i, where J_i is the ineria matrix of link i, and w_i is the rotational velocity vector of the center of mass of link i.

Returns:
Total rotational kinetic energy.

computeRotationalKineticEnergy

public double computeRotationalKineticEnergy(Joint rootJoint)
Computes the total rotational kinetic energy of the subtree rooted at the specified root Joint. This is the sum over i of 1/2 w_i^T*J_i*w_i, where J_i is the inertia matrix of link i, and w_i is the rotational velocity vector of the center of mass of link i, and i consisting of all the decendents of the specified root Joint.

Parameters:
rootJoint - Root Joint to compute energy from.
Returns:
Total rotational kinetic energy of the subtree rooted at the specified root Joint.

computeGravitationalPotentialEnergy

public double computeGravitationalPotentialEnergy()
Computes the total gravitational potential energy of this Robot. This is the sum over i of m_i*g*h_i, where m_i is the mass of link i, g is the gravitational constant, and h_i is the height above 0 of link i.

Returns:
Total gravitational potential energy.

computeGravitationalPotentialEnergy

public double computeGravitationalPotentialEnergy(Joint rootJoint)
Computes the total gravitational potential energy of the subtree rooted at the specified root Joint. This is the sum over i of m_i*g*h_i, where m_i is the mass of link i, g is the gravitational constant, and h_i is the height above 0 of link i, with i consisting of all the decendents of the specified root Joint.

Returns:
Total gravitational potential energy.

computeCenterOfMass

public double computeCenterOfMass(javax.vecmath.Point3d comPoint)
Computes the center of mass of this Robot. This center of mass position is returned by altering the provided Point3d. If the robot has no mass, it also has no center of mass point. This value is used in the calculation of center of momentum.

Parameters:
comPoint - Center of Mass point, in World Coordinates, that is computed.
Returns:
The total mass of the robot.

computeCenterOfMass

public double computeCenterOfMass(Joint rootJoint,
                                  javax.vecmath.Point3d comPoint)
Computes the Center of Mass of the subtree rooted at the specified root Joint. This center of mass position is returned by altering the provided Point3d. If the robot has no mass, it also has no center of mass point.

Parameters:
comPoint - Center of Mass point, in World Coordinates, that is computed.
Returns:
The total mass of the robot.

computeLinearMomentum

public double computeLinearMomentum(javax.vecmath.Vector3d linearMomentum)
Computes the total linear momentum of the center of mass for this Robot. The total mass of the robot is also computed and returned.

Parameters:
linearMomentum - Total linear momentum vector that is computed.
Returns:
The total mass of the robot.

computeLinearMomentum

public double computeLinearMomentum(Joint rootJoint,
                                    javax.vecmath.Vector3d linearMomentum)
Computes the total linear momentum of the center of mass for the subtree rooted at the specified root Joint. The total mass of the robot is also computed and returned.

Parameters:
rootJoint - Root Joint for which linear momentum is computed.
linearMomentum - Total linear momentum vector that is computed.
Returns:
The total mass of the robot.

computeAngularMomentum

public void computeAngularMomentum(javax.vecmath.Vector3d angularMomentum)
Computes the total angular momentum about the center of mass for this Robot.

Parameters:
angularMomentum - Total angular momentum vector that is computed.

computeAngularMomentum

public void computeAngularMomentum(Joint rootJoint,
                                   javax.vecmath.Vector3d angularMomentum)
Computes the total angular momentum about the center of mass for the subtree rooted at the specified root Joint.

Parameters:
rootJoint - Root Joint for which linear momentum is computed.
angularMomentum - Total angular momentum vector that is computed.

computeCOMMomentum

public double computeCOMMomentum(javax.vecmath.Point3d comPoint,
                                 javax.vecmath.Vector3d linearMomentum,
                                 javax.vecmath.Vector3d angularMomentum)
Computes the Center of Mass location and total linear and angular momentum about the Center of Mass for this Robot.

Parameters:
comPoint - Center of Mass point that is computed.
linearMomentum - Total linear momentum vector that is computed.
angularMomentum - Total angular momentum vector that is computed.
Returns:
Total mass of the robot.

computeCOMMomentum

public double computeCOMMomentum(Joint rootJoint,
                                 javax.vecmath.Point3d comPoint,
                                 javax.vecmath.Vector3d linearMomentum,
                                 javax.vecmath.Vector3d angularMomentum)
Computes the Center of Mass location and total linear and angular momentum about the center of mass for the subtree rooted at the specified root Joint.

Parameters:
rootJoint - Root Joint to computed momentum from.
comPoint - Center of Mass point that is computed.
linearMomentum - Total linear momentum vector that is computed.
angularMomentum - Total angular momentum vector that is computed.
Returns:
Total mass of the robot.

computeCenterOfPressure

public void computeCenterOfPressure(javax.vecmath.Point3d copPoint,
                                    javax.vecmath.Vector3d copForce,
                                    javax.vecmath.Vector3d copMoment)
Computes the Center of Pressure of the GroundContactPoints attached to this Robot.

Parameters:
copPoint - Center of Pressure point that is computed.
copForce - Center of Pressure total force vector that is computed.
copMoment - Total moment generated about the Center of Pressure from all the GroundContactPoints.

toString

public java.lang.String toString()
This method returns the display name of the robot followed by the names of each joint.

Overrides:
toString in class java.lang.Object
Returns:
String, display name of the robot

createAllVarLists

public java.util.ArrayList<VarList> createAllVarLists()

getSimulationRewoundListeners

public java.util.ArrayList<SimulationRewoundListener> getSimulationRewoundListeners()

getControllers

public java.util.ArrayList<RobotControllerAndParameters> getControllers()

setBodyExternalForcePoint

public void setBodyExternalForcePoint(double fx,
                                      double fy,
                                      double fz)

getVariable

public YoVariable getVariable(java.lang.String variableName)
Description copied from interface: YoVariableHolder
Gets a YoVariable with the given name if it is in this YoVariableHolder, otherwise returns null. If name contains a ".", then the YoVariable's nameSpace ending must match that of name. If there is more than one YoVariable that matches, then throws a RuntimeException.

Specified by:
getVariable in interface YoVariableHolder
Parameters:
variableName - String Name of YoVariable to get. If contains a ".", then YoVariable's nameSpace ending must match that of name.
Returns:
YoVariable matching the given name.

hasUniqueVariable

public boolean hasUniqueVariable(java.lang.String variableName)
Description copied from interface: YoVariableHolder
Checks if this YoVariableHolder holds exactly one YoVariable with the given name. If so, returns true, otherwise returns false. If name contains a ".", then the YoVariable's nameSpace ending must match that of name. If there is more than one YoVariable that matches, returns false.

Specified by:
hasUniqueVariable in interface YoVariableHolder
Parameters:
variableName - String Name of YoVariable to check for. If contains a ".", then YoVariable's nameSpace ending must match that of name.
Returns:
boolean Whether or not this YoVariableHolder holds exactly one Variable of the given name.

getAllVariables

public java.util.ArrayList<YoVariable> getAllVariables()
Description copied from interface: YoVariableHolder
Returns all the YoVariables in this YoVariableHolder

Specified by:
getAllVariables in interface YoVariableHolder
Returns:
ArrayList

getAllVariablesArray

public YoVariable[] getAllVariablesArray()
Description copied from interface: YoVariableHolder
Returns all the YoVariables in this YoVariableHolder

Specified by:
getAllVariablesArray in interface YoVariableHolder
Returns:
YoVariable[]

getVariable

public YoVariable getVariable(java.lang.String nameSpaceEnding,
                              java.lang.String name)
Description copied from interface: YoVariableHolder
Gets a YoVariable with the given nameSpace and name if it is in this YoVariableHolder, otherwise returns null. If name contains a ".", then throws a RuntimeException. If there is more than one YoVariable that matches, then throws a RuntimeException.

Specified by:
getVariable in interface YoVariableHolder
Parameters:
nameSpaceEnding - String nameSpaceEnding ending of YoVariable to get. The YoVariable's nameSpace ending must match that of nameSpace.
name - String Name of YoVariable to get. If contains a ".", then throws a RuntimeException.
Returns:
YoVariable matching the given nameSpace and name.

hasUniqueVariable

public boolean hasUniqueVariable(java.lang.String nameSpaceEnding,
                                 java.lang.String name)
Description copied from interface: YoVariableHolder
Checks if this YoVariableHolder holds exactly one YoVariable with the given nameSpace and name. If so, returns true, otherwise returns false. If name contains a ".", then throws a RuntimeException. If there is more than one YoVariable that matches, returns false.

Specified by:
hasUniqueVariable in interface YoVariableHolder
Parameters:
nameSpaceEnding - String NameSpace ending of YoVariable to check for. The YoVariable's nameSpace ending must match that of nameSpace.
name - String Name of YoVariable to check for. If contains a ".", then throws a RuntimeException.
Returns:
boolean Whether or not this YoVariableHolder holds exactly one Variable that matches the given nameSpace and name.

getVariables

public java.util.ArrayList<YoVariable> getVariables(java.lang.String nameSpaceEnding,
                                                    java.lang.String name)
Description copied from interface: YoVariableHolder
Returns all the YoVariables with the given nameSpace and name that are in this YoVariableHolder, empty if there are none. If name contains a ".", then throws a RuntimeException.

Specified by:
getVariables in interface YoVariableHolder
Parameters:
nameSpaceEnding - String NameSpace ending of YoVariables to get. The YoVariable's nameSpace ending must match that of nameSpace.
name - String Name of YoVariable to get. If contains a ".", then throws a RuntimeException.
Returns:
ArrayList matching the given nameSpace and name.

getVariables

public java.util.ArrayList<YoVariable> getVariables(java.lang.String name)
Description copied from interface: YoVariableHolder
Returns all the YoVariables with the given name that are in this YoVariableHolder, empty if there are none. If name contains a ".", then the YoVariable's nameSpace ending must match that of name.

Specified by:
getVariables in interface YoVariableHolder
Parameters:
name - String Name of YoVariable to get. If name contains a ".", then the YoVariable's nameSpace ending must match that of name.
Returns:
ArrayList matching the given name.

getVariables

public java.util.ArrayList<YoVariable> getVariables(NameSpace nameSpace)
Description copied from interface: YoVariableHolder
Returns all the YoVariables with the given nameSpace that are in this YoVariableHolder, empty if there are none.

Specified by:
getVariables in interface YoVariableHolder
Parameters:
nameSpace - NameSpace to match.
Returns:
ArrayList matching YoVariables.

getStaticLinkGraphics

public java.util.ArrayList<Graphics3DObject> getStaticLinkGraphics()