|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.yobotics.simulationconstructionset.YoVariableHolderImplementation
com.yobotics.simulationconstructionset.Robot
public class Robot
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.
| Constructor Summary | |
|---|---|
Robot(RobotDefinitionFixedFrame definition)
|
|
Robot(java.lang.String name)
Creates a Robot with the specified name. |
|
| Method Summary | |
|---|---|
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 |
addStaticBranchGroup(javax.media.j3d.BranchGroup staticBranchGroup)
Adds the specified BranchGroup to the robot. |
void |
addStaticLink(Link staticLink)
Adds the specified link to the robot. |
void |
addStaticLinkNode(javax.media.j3d.Link link3d)
Adds the specified link3d to the robot. |
void |
addStaticSharedGroup(javax.media.j3d.SharedGroup staticSharedGroup)
Adds the specified SharedGroup 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. |
javax.media.j3d.BranchGroup |
getBranchGroupCopy(Joint joint)
Returns a copy of the BranchGroup for the specified joint with that joint as the root. |
void |
getCameraMountList(CameraMountList cameraMountList)
Steps through every joint adding each camera mount to the provided list. |
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()
Retrieves a list of all ground contact points associated with this robot. |
java.lang.String |
getName()
Gets the name of this Robot. |
java.util.ArrayList |
getRangeSensors()
Returns an ArrayList containing the range sensors of each joint. |
YoVariableRegistry |
getRobotsYoVariableRegistry()
|
javax.media.j3d.BranchGroup |
getRootBranchGroup()
Retrieves the BranchGroup for this robot. |
java.util.ArrayList<Joint> |
getRootJoints()
Retrieves an ArrayList containing the rootJoints of this robot. |
double |
getTime()
Gets this robot's time. |
void |
setController(RobotController controller)
Adds a controller to use with this Robot. |
void |
setController(RobotController controller,
int simulationTicksPerControlTick)
Adds a controller to use with this Robot. |
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 |
setGroundContactModel(GroundContactModel gcModel)
Sets the ground contact model for this robot. |
java.lang.String |
toString()
This method returns the display name of the robot followed by the names of each joint. |
void |
update()
Updates all joint data without updating graphics. |
void |
updateAllGroundContactPointVelocities()
Updates the velocities for all ground contact points. |
void |
updateGraphics()
Updates the graphics for all of the robot's nodes. |
void |
updateVelocities()
Updates the velocities and positions at each joint as well as the rotation matricies from and to the base coordinate system. |
| Methods inherited from class com.yobotics.simulationconstructionset.YoVariableHolderImplementation |
|---|
addVariablesToHolder, addVariableToHolder, getAllVariables, getAllVariablesArray, getVariable, getVariable, getVariables, getVariables, getVariables, hasUniqueVariable, hasUniqueVariable |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Robot(RobotDefinitionFixedFrame definition)
public Robot(java.lang.String name)
name - Name of the robot.| Method Detail |
|---|
public double getTime()
public double getGravityX()
public double getGravityY()
public double getGravityZ()
public void addYoVariableRegistry(YoVariableRegistry registry)
registry - YoVariableRegistrypublic void addRootJoint(Joint root)
root - Joint to be added as the root Joint. A robot is comprised of a forest of trees, with one root Joint per tree.public javax.media.j3d.BranchGroup getRootBranchGroup()
public javax.media.j3d.BranchGroup getBranchGroupCopy(Joint joint)
joint - Joint around which to base copied BranchGroup.
public GroundContactModel getGroundContactModel()
GroundContactModelpublic void decideGroundContactPointsInContact()
public java.util.ArrayList<Joint> getRootJoints()
public void setGravity(double gravityX,
double gravityY,
double gravityZ)
gX - X component of the Gravity vector.gY - Y component of the Gravity vector.gZ - Z component of the Gravity vector.public void setGravity(double gZ)
gZ - Z component of the Gravity vector. X and Y components are set to 0.0.public void addFunctionToIntegrate(FunctionToIntegrate functionToIntegrate)
functionToIntegrate - The function to be integrated.FunctionToIntegratepublic void setController(RobotController controller)
doControl methods when called.
Controllers added with this function doControl every simulation tick.
controller - RobotController to use with this robot.RobotController
public void setController(RobotController controller,
int simulationTicksPerControlTick)
controller - RobotController to use with this robot.simulationTicksPerControlTick - Number of simulation ticks per control tick.public void setGroundContactModel(GroundContactModel gcModel)
gcModel - GroundContactModel to be used with this robot.GroundContactModelpublic java.lang.String getName()
public void update()
public void updateAllGroundContactPointVelocities()
public void updateGraphics()
public void getCameraMountList(CameraMountList cameraMountList)
cameraMountList - CameraMountList to which all mount points are added.public java.util.ArrayList getRangeSensors()
public java.util.ArrayList<GroundContactPoint> getGroundContactPoints()
public void addStaticLink(Link staticLink)
staticLink - Link to be added.public void addStaticBranchGroup(javax.media.j3d.BranchGroup staticBranchGroup)
staticBranchGroup - BranchGroup to be added.public void addStaticSharedGroup(javax.media.j3d.SharedGroup staticSharedGroup)
staticSharedGroup - SharedGroup to be added.public void addStaticLinkNode(javax.media.j3d.Link link3d)
link3d - Link to be added.public void updateVelocities()
public YoVariableRegistry getRobotsYoVariableRegistry()
public void doAfterControlBeforeDynamics()
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:
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.
DT - Step time for the integration.
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).public double computeTranslationalKineticEnergy()
public double computeTranslationalKineticEnergy(Joint rootJoint)
rootJoint - Root Joint to compute energy from.
public double computeRotationalKineticEnergy()
public double computeRotationalKineticEnergy(Joint rootJoint)
rootJoint - Root Joint to compute energy from.
public double computeGravitationalPotentialEnergy()
public double computeGravitationalPotentialEnergy(Joint rootJoint)
public double computeCenterOfMass(javax.vecmath.Point3d comPoint)
comPoint - Center of Mass point, in World Coordinates, that is computed.
public double computeCenterOfMass(Joint rootJoint,
javax.vecmath.Point3d comPoint)
comPoint - Center of Mass point, in World Coordinates, that is computed.
public double computeLinearMomentum(javax.vecmath.Vector3d linearMomentum)
linearMomentum - Total linear momentum vector that is computed.
public double computeLinearMomentum(Joint rootJoint,
javax.vecmath.Vector3d linearMomentum)
rootJoint - Root Joint for which linear momentum is computed.linearMomentum - Total linear momentum vector that is computed.
public void computeAngularMomentum(javax.vecmath.Vector3d angularMomentum)
angularMomentum - Total angular momentum vector that is computed.
public void computeAngularMomentum(Joint rootJoint,
javax.vecmath.Vector3d angularMomentum)
rootJoint - Root Joint for which linear momentum is computed.angularMomentum - Total angular momentum vector that is computed.
public double computeCOMMomentum(javax.vecmath.Point3d comPoint,
javax.vecmath.Vector3d linearMomentum,
javax.vecmath.Vector3d angularMomentum)
comPoint - Center of Mass point that is computed.linearMomentum - Total linear momentum vector that is computed.angularMomentum - Total angular momentum vector that is computed.
public double computeCOMMomentum(Joint rootJoint,
javax.vecmath.Point3d comPoint,
javax.vecmath.Vector3d linearMomentum,
javax.vecmath.Vector3d angularMomentum)
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.
public void computeCenterOfPressure(javax.vecmath.Point3d copPoint,
javax.vecmath.Vector3d copForce,
javax.vecmath.Vector3d copMoment)
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.public java.lang.String toString()
toString in class java.lang.Objectpublic java.util.ArrayList<VarList> createAllVarLists()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||