public class ThisPlayer extends Player implements IThisPlayer
Constructor and Description |
---|
ThisPlayer(java.lang.String teamname,
int id)
Constructor
|
Modifier and Type | Method and Description |
---|---|
org.apache.commons.math3.geometry.euclidean.threed.Vector3D |
calculateGlobal2DPosition(org.apache.commons.math3.geometry.euclidean.threed.Vector3D localPos)
Calculate global position in 2D based on own position and body direction.
|
Pose2D |
calculateGlobalBodyPose2D(Pose3D poseToTranslate)
Calculates the global 2D pose of a local 3D pose, e.g. of a body part
|
org.apache.commons.math3.geometry.euclidean.threed.Vector3D |
calculateGlobalPosition(org.apache.commons.math3.geometry.euclidean.threed.Vector3D localPos)
Calculate global position based on own position and orientation.
|
org.apache.commons.math3.geometry.euclidean.threed.Vector3D |
calculateLocalPosition(org.apache.commons.math3.geometry.euclidean.threed.Vector3D globalPosition)
Calculate local position based on own position and orientation.
|
Angle |
getBodyDirectionTo(org.apache.commons.math3.geometry.euclidean.threed.Vector3D position)
Returns the relative angle (rad) this player's torso has to the specified
position
|
double |
getMaxSpeed() |
org.apache.commons.math3.geometry.euclidean.threed.Rotation |
getOrientation()
Returns the player's local body orientation.
|
Pose3D |
getPose() |
PositionManager |
getPositionManager() |
boolean |
isInsidePolygonXY(org.apache.commons.math3.geometry.euclidean.threed.Vector3D absolutePosition,
org.apache.commons.math3.geometry.euclidean.threed.Vector3D[] polygon)
Checks if the passed 2D xy-point (absolute coordinate system) is inside
the passed polygon (xy, relative coordinate system)
|
boolean |
positionIsBehind(org.apache.commons.math3.geometry.euclidean.threed.Vector3D absolutePosition) |
boolean |
positionIsLeft(org.apache.commons.math3.geometry.euclidean.threed.Vector3D absolutePosition) |
boolean |
positionIsRight(org.apache.commons.math3.geometry.euclidean.threed.Vector3D absolutePosition) |
void |
setGlobalOrientation(org.apache.commons.math3.geometry.euclidean.threed.Rotation orientation)
Set player's global orientation in 3-dimensional space.
|
void |
setGlobalPosition(org.apache.commons.math3.geometry.euclidean.threed.Vector3D position,
float time)
Allows to set the global Position
|
void |
setGyroNoise(double gyroNoise)
For experiments only.
|
equals, getBodyPart, getBodyParts, getCollisionDistance, getGlobalOrientation, getHorizontalAngle, getID, getPossibleSpeed, getTeamname, getTimeForBackStep, getTimeForSideStep, getTimeToTurnAndRun, isGoalie, isLaying, isOwnTeam, setBodyparts, update, updateFromAudio, updateFromVision
getFuturePosition, getFuturePositions, getOldSpeed, getSpeed, isMoving, updateNoVision
getAge, getDirectionTo, getDirectionTo, getDistanceToXY, getDistanceToXY, getDistanceToXYZ, getDistanceToXYZ, getInformationSource, getLastSeenTime, getLocalPosition, getName, getPosition, getPreviousPosition, hashCode, isVisible, setPosition, setVisible, updateNoVision
getClass, notify, notifyAll, toString, wait, wait, wait
isGoalie
getBodyParts, getGlobalOrientation, getHorizontalAngle, getID, getTeamname, getTimeForBackStep, getTimeForSideStep, getTimeToTurnAndRun, isOwnTeam
getFuturePosition, getFuturePositions, getOldSpeed, getSpeed, isMoving
getAge, getCollisionDistance, getDirectionTo, getDirectionTo, getDistanceToXY, getDistanceToXY, getDistanceToXYZ, getDistanceToXYZ, getInformationSource, getLastSeenTime, getLocalPosition, getName, getPosition, getPreviousPosition, isLaying, isVisible
public ThisPlayer(java.lang.String teamname, int id)
teamname
- Team nameid
- Player numberpublic void setGlobalOrientation(org.apache.commons.math3.geometry.euclidean.threed.Rotation orientation)
Player
setGlobalOrientation
in class Player
orientation
- - new orientationpublic org.apache.commons.math3.geometry.euclidean.threed.Rotation getOrientation()
IThisPlayer
getOrientation
in interface IThisPlayer
public org.apache.commons.math3.geometry.euclidean.threed.Vector3D calculateGlobalPosition(org.apache.commons.math3.geometry.euclidean.threed.Vector3D localPos)
IThisPlayer
calculateGlobalPosition
in interface IThisPlayer
localPos
- - the position to transform, given in the local root
body systempublic org.apache.commons.math3.geometry.euclidean.threed.Vector3D calculateGlobal2DPosition(org.apache.commons.math3.geometry.euclidean.threed.Vector3D localPos)
IThisPlayer
calculateGlobal2DPosition
in interface IThisPlayer
localPos
- - the position to transform, given in the local root body
system (just xy matters)public Pose2D calculateGlobalBodyPose2D(Pose3D poseToTranslate)
IThisPlayer
calculateGlobalBodyPose2D
in interface IThisPlayer
poseToTranslate
- the 3D pose in local coordinate systempublic org.apache.commons.math3.geometry.euclidean.threed.Vector3D calculateLocalPosition(org.apache.commons.math3.geometry.euclidean.threed.Vector3D globalPosition)
IThisPlayer
calculateLocalPosition
in interface IThisPlayer
globalPosition
- - the position to transform, given in the global
coordinate systempublic Angle getBodyDirectionTo(org.apache.commons.math3.geometry.euclidean.threed.Vector3D position)
getBodyDirectionTo
in interface IThisPlayer
getBodyDirectionTo
in class Player
position
- the position to which to calculate the body anglepublic boolean isInsidePolygonXY(org.apache.commons.math3.geometry.euclidean.threed.Vector3D absolutePosition, org.apache.commons.math3.geometry.euclidean.threed.Vector3D[] polygon)
isInsidePolygonXY
in interface IThisPlayer
absolutePosition
- 2D vector (x,y) of the point to check in the
global coordinate systempolygon
- corner points of the polygon (x, y), in this player's
coordinate system and in clockwise order. The coordinates should
NOT take neck angles into account, i.e. assume head is straight.public boolean positionIsLeft(org.apache.commons.math3.geometry.euclidean.threed.Vector3D absolutePosition)
positionIsLeft
in interface IThisPlayer
position
- the position to checkpublic boolean positionIsRight(org.apache.commons.math3.geometry.euclidean.threed.Vector3D absolutePosition)
positionIsRight
in interface IThisPlayer
position
- the position to checkpublic boolean positionIsBehind(org.apache.commons.math3.geometry.euclidean.threed.Vector3D absolutePosition)
positionIsBehind
in interface IThisPlayer
position
- the position to checkpublic PositionManager getPositionManager()
getPositionManager
in interface IThisPlayer
public void setGyroNoise(double gyroNoise)
IThisPlayer
setGyroNoise
in interface IThisPlayer
gyroNoise
- the gyroNoise to setpublic double getMaxSpeed()
getMaxSpeed
in interface IPlayer
getMaxSpeed
in class Player
public Pose3D getPose()
public void setGlobalPosition(org.apache.commons.math3.geometry.euclidean.threed.Vector3D position, float time)
IThisPlayer
setGlobalPosition
in interface IThisPlayer
position
- in global Coordinates System