public class AgentModel extends java.lang.Object implements IAgentModel, java.io.Serializable
Constructor and Description |
---|
AgentModel(IAction action,
IAgentMetaModel metaModel,
IAgentIKSolver ikSolver,
double[] kickArea)
initializes all known Sensors like: UniversalJoints, HingeJoints,
ForceResistances and GyroRates
|
Modifier and Type | Method and Description |
---|---|
void |
attach(IObserver<IAgentModel> newObserver) |
void |
beamToPosition(org.apache.commons.math3.geometry.euclidean.threed.Vector3D position)
Set the beam position of the agent.
|
boolean |
detach(IObserver<IAgentModel> oldObserver) |
boolean |
equals(java.lang.Object o) |
magma.agent.agentmodel.impl.Accelerometer |
getAccelerometer(java.lang.String name)
Retrieve accelerometer values
|
java.util.List<IHingeJoint> |
getAllHingeJoints() |
double |
getAverageCoilTemperature() |
double |
getAverageMotorTemperature() |
IBodyPart |
getBodyPart(java.lang.String name) |
IBodyPart |
getBodyPartContainingCamera()
Returns the body part (of the sensed body model), which contains the
camera.
|
org.apache.commons.math3.geometry.euclidean.threed.Vector3D[] |
getBothLegKickRectangle()
Calculate the rectangle within the ball is kickable by both legs
|
org.apache.commons.math3.geometry.euclidean.threed.Vector3D |
getCenterOfMass()
Get the Center of mass
|
ForceResistance |
getForceResistance(java.lang.String name)
Returns a specified force resistance sensor of the agent
|
IBodyModel |
getFutureBodyModel()
Returns the future body model, which is a copy of the sensed/expected body
model, on which the actions for the current cycle are performed.
|
GyroRate |
getGyroRate(java.lang.String name)
Retrieves the specified gyro sensor
|
HingeJoint |
getHJ(java.lang.String name)
Returns read only access to a specified hinge joint in the sensed body
model of the agent
|
HingeJoint |
getHJExpected(java.lang.String name)
Returns read only access to a specified hinge joint in the expected body
model of the agent
|
org.apache.commons.math3.geometry.euclidean.threed.Vector3D[] |
getLeftLegKickRectangle()
Calculate the rectangle within the ball is kickable by the left leg
|
double |
getMaxCoilTemperature() |
double |
getMaxMotorTemperature() |
org.apache.commons.math3.geometry.euclidean.threed.Vector3D[] |
getRightLegKickRectangle()
Calculate the rectangle within the ball is kickable by the right leg
|
org.apache.commons.math3.geometry.euclidean.threed.Vector3D |
getStaticPivotPoint()
Returns the static pivot-point used as replacement of the CoM in the
balancing engine related movements.
|
IBodyPart |
getTorso()
Returns the root body part of the sensed body model.
|
UniversalJoint |
getUJ(java.lang.String name)
Returns a specified universal joint of the agent
|
IHingeJoint |
getWriteableHJ(java.lang.String name)
Returns a specified hinge joint of the agent
|
int |
hashCode() |
void |
reflectTargetStateToAction()
This method is called from the AgentRuntime in order to reflect the
target-state of the agent model into effector-actions, which can then be
send to the server.
|
void |
sayMessage(java.lang.String message)
Set the message to say in that cycle.
|
void |
setStiffness(float stiffness) |
void |
shutOff(boolean off)
Shuts off robot by setting stiffness = 0 in case of true
|
java.lang.String |
toString() |
boolean |
update(IPerception perception)
Called to trigger a update of the AgentModel based on the given perception
object.
|
void |
updateJointsSpeed(IBodyModel source)
Called to copy back joint speed values from the passed body model to this
agents body model.
|
public AgentModel(IAction action, IAgentMetaModel metaModel, IAgentIKSolver ikSolver, double[] kickArea)
public boolean update(IPerception perception)
IAgentModel
update
in interface IAgentModel
perception
- the Perceptionpublic void attach(IObserver<IAgentModel> newObserver)
attach
in interface IAgentModel
newObserver
- Observer object to add to the listmagma.util.observer.IPublishSubscribe#attach(magma.util.observer.
IObserver)
public boolean detach(IObserver<IAgentModel> oldObserver)
detach
in interface IAgentModel
oldObserver
- Observer object to delete from the listIPublishSubscribe.detach(magma.util.observer.IObserver)
public UniversalJoint getUJ(java.lang.String name)
IAgentModel
getUJ
in interface IAgentModel
name
- the name of the joint as specified in
IServerConfigFilesConstants.UNIVERSALJOINT_NAMESpublic HingeJoint getHJ(java.lang.String name)
IAgentModel
getHJ
in interface IAgentModel
name
- the name of the joint as specified in
IServerConfigFilesConstants.HINGEJOINT_NAMESpublic HingeJoint getHJExpected(java.lang.String name)
IAgentModel
getHJExpected
in interface IAgentModel
name
- the name of the joint as specified in
IServerConfigFilesConstants.HINGEJOINT_NAMESpublic IHingeJoint getWriteableHJ(java.lang.String name)
IAgentModel
getWriteableHJ
in interface IAgentModel
name
- the name of the joint as specified in
IServerConfigFilesConstants.HINGEJOINT_NAMESpublic IBodyPart getBodyPart(java.lang.String name)
getBodyPart
in interface IAgentModel
name
- the name of the body part to retrievepublic IBodyPart getTorso()
IAgentModel
getTorso
in interface IAgentModel
public org.apache.commons.math3.geometry.euclidean.threed.Vector3D getCenterOfMass()
IAgentModel
getCenterOfMass
in interface IAgentModel
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public org.apache.commons.math3.geometry.euclidean.threed.Vector3D[] getBothLegKickRectangle()
IAgentModel
getBothLegKickRectangle
in interface IAgentModel
public org.apache.commons.math3.geometry.euclidean.threed.Vector3D[] getLeftLegKickRectangle()
IAgentModel
getLeftLegKickRectangle
in interface IAgentModel
public org.apache.commons.math3.geometry.euclidean.threed.Vector3D[] getRightLegKickRectangle()
getRightLegKickRectangle
in interface IAgentModel
public int hashCode()
hashCode
in class java.lang.Object
public void shutOff(boolean off)
IAgentModel
shutOff
in interface IAgentModel
off
- true to switch offpublic void beamToPosition(org.apache.commons.math3.geometry.euclidean.threed.Vector3D position)
IAgentModel
beamToPosition
in interface IAgentModel
position
- x, y, rot (in meter, resp. degrees)public void sayMessage(java.lang.String message)
IAgentModel
sayMessage
in interface IAgentModel
public ForceResistance getForceResistance(java.lang.String name)
IAgentModel
getForceResistance
in interface IAgentModel
name
- the name of the sensor as specified in
IServerConfigFilesConstants.FORCERESISTANCE_NAMESpublic GyroRate getGyroRate(java.lang.String name)
IAgentModel
getGyroRate
in interface IAgentModel
name
- the name of the sensor as specified in
IServerConfigFilesConstants.GYRORATE_NAMESpublic magma.agent.agentmodel.impl.Accelerometer getAccelerometer(java.lang.String name)
IAgentModel
getAccelerometer
in interface IAgentModel
name
- the name of the sensorpublic java.lang.String toString()
toString
in class java.lang.Object
public void reflectTargetStateToAction()
IAgentModel
reflectTargetStateToAction
in interface IAgentModel
public void updateJointsSpeed(IBodyModel source)
IAgentModel
updateJointsSpeed
in interface IAgentModel
source
- the body model to take the values frompublic IBodyModel getFutureBodyModel()
IAgentModel
getFutureBodyModel
in interface IAgentModel
public IBodyPart getBodyPartContainingCamera()
IAgentModel
getBodyPartContainingCamera
in interface IAgentModel
public org.apache.commons.math3.geometry.euclidean.threed.Vector3D getStaticPivotPoint()
IAgentModel
getStaticPivotPoint
in interface IAgentModel
public java.util.List<IHingeJoint> getAllHingeJoints()
getAllHingeJoints
in interface IAgentModel
public double getMaxMotorTemperature()
getMaxMotorTemperature
in interface IAgentModel
public double getAverageMotorTemperature()
getAverageMotorTemperature
in interface IAgentModel
public double getMaxCoilTemperature()
getMaxCoilTemperature
in interface IAgentModel
public double getAverageCoilTemperature()
getAverageCoilTemperature
in interface IAgentModel
public void setStiffness(float stiffness)
setStiffness
in interface IAgentModel