|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.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,
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()
|
|
|
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 |
---|
public Robot(RobotDefinitionFixedFrame definition, java.lang.String name)
public Robot(java.lang.String name)
name
- Name of the robot.Method Detail |
---|
public void setDynamicIntegrationMethod(DynamicIntegrationMethod dynamicIntegrationMethod)
public double getTime()
public void setTime(double time)
public void setDynamic(boolean isDynamic)
public DoubleYoVariable getYoTime()
public double getGravityX()
public double getGravityY()
public double getGravityZ()
public void getGravity(javax.vecmath.Vector3d gravityVectorToPack)
public void addYoVariableRegistry(YoVariableRegistry registry)
registry
- YoVariableRegistrypublic void addDynamicGraphicObjectsListRegistry(DynamicGraphicObjectsListRegistry dynamicGraphicObjectsListRegistry)
public 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 GroundContactModel getGroundContactModel()
GroundContactModel
public void decideGroundContactPointsInContact()
public java.util.ArrayList<Joint> getRootJoints()
public void setGravity(double gravityX, double gravityY, double gravityZ)
gravityX
- X component of the Gravity vector.gravityY
- Y component of the Gravity vector.gravityZ
- Z component of the Gravity vector.public void setGravity(javax.vecmath.Vector3d gravity)
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.FunctionToIntegrate
public 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 setControllersAndCallInitialization(java.util.ArrayList<RobotControllerAndParameters> robotControllersAndParameters)
public void setController(RobotControllerAndParameters controllerAndParameters)
public void setGroundContactModel(GroundContactModel gcModel)
gcModel
- GroundContactModel to be used with this robot.GroundContactModel
public java.lang.String getName()
public void update()
public void updateForPlayback()
public void updateAllGroundContactPointVelocities()
public void getCameraMountList(CameraMountList cameraMountList)
cameraMountList
- CameraMountList to which all mount points are added.public java.util.ArrayList<SimulatedSensor> getSensors()
public <T extends SimulatedSensor> java.util.ArrayList<T> getSensors(java.lang.Class<T> sensorType)
public void getAllOneDegreeOfFreedomJoints(java.util.ArrayList<OneDegreeOfFreedomJoint> oneDegreeOfFreedomJoints)
public void getIMUMounts(java.util.ArrayList<IMUMount> imuMountsToPack)
public java.util.ArrayList<GroundContactPoint> getGroundContactPoints(int groundContactGroupIdentifier)
public java.util.ArrayList<GroundContactPoint> getAllGroundContactPoints()
public java.util.ArrayList<ExternalForcePoint> getAllExternalForcePoints()
public java.util.ArrayList<KinematicPoint> getAllKinematicPoints()
public void addStaticLink(Link staticLink)
staticLink
- Link to be added.public void addStaticLinkGraphics(Graphics3DObject linkGraphics)
linkGraphics
- LinkGraphics to be added.public void addStaticLinkGraphics(java.util.ArrayList<Graphics3DObject> linkGraphicsArray)
public void updateVelocities()
public YoVariableRegistry getRobotsYoVariableRegistry()
public void doAfterControlBeforeDynamics()
public void doDynamicsButDoNotIntegrate() throws UnreasonableAccelerationException
UnreasonableAccelerationException
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.Object
public java.util.ArrayList<VarList> createAllVarLists()
public java.util.ArrayList<SimulationRewoundListener> getSimulationRewoundListeners()
public java.util.ArrayList<RobotControllerAndParameters> getControllers()
public void setBodyExternalForcePoint(double fx, double fy, double fz)
public YoVariable getVariable(java.lang.String variableName)
YoVariableHolder
getVariable
in interface YoVariableHolder
variableName
- String Name of YoVariable to get. If contains a ".", then YoVariable's nameSpace ending must match that of name.
public boolean hasUniqueVariable(java.lang.String variableName)
YoVariableHolder
hasUniqueVariable
in interface YoVariableHolder
variableName
- String Name of YoVariable to check for. If contains a ".", then YoVariable's nameSpace ending must match that of name.
public java.util.ArrayList<YoVariable> getAllVariables()
YoVariableHolder
getAllVariables
in interface YoVariableHolder
public YoVariable[] getAllVariablesArray()
YoVariableHolder
getAllVariablesArray
in interface YoVariableHolder
public YoVariable getVariable(java.lang.String nameSpaceEnding, java.lang.String name)
YoVariableHolder
getVariable
in interface YoVariableHolder
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.
public boolean hasUniqueVariable(java.lang.String nameSpaceEnding, java.lang.String name)
YoVariableHolder
hasUniqueVariable
in interface YoVariableHolder
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.
public java.util.ArrayList<YoVariable> getVariables(java.lang.String nameSpaceEnding, java.lang.String name)
YoVariableHolder
getVariables
in interface YoVariableHolder
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.
public java.util.ArrayList<YoVariable> getVariables(java.lang.String name)
YoVariableHolder
getVariables
in interface YoVariableHolder
name
- String Name of YoVariable to get. If name contains a ".", then the YoVariable's nameSpace ending must match that of name.
public java.util.ArrayList<YoVariable> getVariables(NameSpace nameSpace)
YoVariableHolder
getVariables
in interface YoVariableHolder
nameSpace
- NameSpace to match.
public java.util.ArrayList<Graphics3DObject> getStaticLinkGraphics()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |