#include <Objects.h>
Inheritance diagram for Object:
Definition at line 61 of file Objects.h.
Object::Object | ( | ) |
This constructor creates an object, all variables are initialized by default (illegal) values
Definition at line 62 of file Objects.cpp.
References OBJECT_ILLEGAL, and objectType.
virtual void Object::show | ( | ostream & | os = cout |
) | [pure virtual] |
abstract function that should be defined in a subclass
Implemented in FixedObject, PlayerObject, BallObject, and AgentObject.
Referenced by WorldModel::show().
AngDeg Object::getRelativeAngle | ( | ) |
This method returns the relative angle of this object to the agent. This equals the angle of the relative position vector.
Definition at line 70 of file Objects.cpp.
References VecPosition::getDirection(), VecPosition::normalizeAngle(), and posRelative.
Referenced by WorldModel::getRelativeAngle().
double Object::getRelativeDistance | ( | ) |
This method returns the relative distance to this object. This equals the magnitude of the relative position vector.
Definition at line 78 of file Objects.cpp.
References VecPosition::getMagnitude(), and posRelative.
Referenced by WorldModel::getRelativeDistance().
double Object::getConfidence | ( | Time | time | ) |
This method returns the confidence of the information of this object. The confidence is related to the last time this object was seen and the specified time (normally the time of the last received message).
time | current time to compare with time object was last seen |
Definition at line 88 of file Objects.cpp.
References Time::getTime(), Time::getTimeDifference(), max(), and timeLastSeen.
Referenced by WorldModel::getConfidence(), WorldModel::processPerfectHearInfo(), WorldModel::processPerfectHearInfoBall(), and PlayerObject::show().
bool Object::setType | ( | ObjectT | o | ) |
This method sets the type of this object (i.e. OBJECT_BALL, FLAG_L_R_T).
o | ObjectT representing the type of this object |
Definition at line 103 of file Objects.cpp.
References objectType.
Referenced by WorldModel::mapUnknownPlayers(), WorldModel::processNewObjectInfo(), WorldModel::setAgentObjectType(), and WorldModel::WorldModel().
ObjectT Object::getType | ( | ) | const |
This method returns the type of this object.
Definition at line 111 of file Objects.cpp.
References objectType.
Referenced by WorldModel::getAgentObjectType(), FixedObject::getGlobalAngle(), FixedObject::getGlobalPosition(), WorldModel::getObjectPtrFromType(), WorldModel::getOppGoalieType(), WorldModel::getOwnGoalieType(), and WorldModel::mapUnknownPlayers().
This method sets the relative position and the time this information was received. The relative position is calculated using the given distance and the given (relative) angle.
dDist | relative distance to object | |
ang | relative angle to object | |
time | time relative position was received |
Definition at line 123 of file Objects.cpp.
References POLAR, posRelative, setTimeRelativePosition(), and VecPosition::setVecPosition().
Referenced by WorldModel::processNewObjectInfo(), and WorldModel::updateObjectRelativeFromGlobal().
bool Object::setRelativePosition | ( | VecPosition | v, | |
Time | time | |||
) |
This method sets the relative position and the time this information was received using a vecPosition.
p | new relative position | |
time | time relative position was received |
Definition at line 135 of file Objects.cpp.
References posRelative, and setTimeRelativePosition().
VecPosition Object::getRelativePosition | ( | ) | const |
This method returns the relative position of this object. The time of this information is related to the time returned by getTimeRelativePosition(), but is not checked. So if you want to know the relevance of this position use this method.
Definition at line 147 of file Objects.cpp.
References posRelative.
Referenced by WorldModel::getRelativePosition().
bool Object::setTimeRelativePosition | ( | Time | time | ) |
This method sets the time the relative position was received.
time | time relative position was received |
Definition at line 155 of file Objects.cpp.
References timeRelativePosition.
Referenced by setRelativePosition().
Time Object::getTimeRelativePosition | ( | ) | const |
This method returns the time that corresponds to the relative position of this object.
Definition at line 164 of file Objects.cpp.
References timeRelativePosition.
Referenced by WorldModel::initParticlesBall().
bool Object::setGlobalPosition | ( | VecPosition | p, | |
Time | time | |||
) |
This method sets the global position and the time this information was calculated.
p | new global position | |
time | time global position was received |
Definition at line 174 of file Objects.cpp.
References posGlobal, and setTimeGlobalPosition().
Referenced by WorldModel::processPerfectHearInfo(), WorldModel::processPerfectHearInfoBall(), WorldModel::processSeeGlobalInfo(), WorldModel::removeGhosts(), WorldModel::updateAfterSenseMessage(), WorldModel::updateAgentAndBallAfterSense(), WorldModel::updateAgentObjectAfterSee(), WorldModel::updateBallAfterKick(), WorldModel::updateBallForCollision(), WorldModel::updateDynamicObjectAfterSee(), and WorldModel::updateDynamicObjectForNextCycle().
VecPosition Object::getGlobalPosition | ( | ) | const |
This method returns the global position of this object. The time of this information is related to the time returned by getTimeGlobalPosition(), but is not checked. So if you want to know the relevance of this position use this method.
Definition at line 186 of file Objects.cpp.
References posGlobal.
Referenced by WorldModel::getAgentGlobalPosition(), WorldModel::getGlobalPosition(), WorldModel::getOppGoalieType(), WorldModel::getOwnGoalieType(), WorldModel::mapUnknownPlayers(), WorldModel::updateAgentObjectAfterSee(), and WorldModel::updateObjectRelativeFromGlobal().
bool Object::setTimeGlobalPosition | ( | Time | time | ) |
This method sets the time the global position was calculated
time | time global position was calculated |
Definition at line 194 of file Objects.cpp.
References timeGlobalPosition.
Referenced by setGlobalPosition().
Time Object::getTimeGlobalPosition | ( | ) | const |
This method returns the time that corresponds to the global position of this object.
Definition at line 203 of file Objects.cpp.
References timeGlobalPosition.
Referenced by WorldModel::getTimeGlobalPosition(), WorldModel::removeGhosts(), WorldModel::updateAll(), and WorldModel::updateObjectRelativeFromGlobal().
bool Object::setGlobalPositionLastSee | ( | VecPosition | p, | |
Time | time | |||
) |
This method sets the global position calculated using the last see message and the time of this see message. This opposed to the "normal" global position that is also updated when no see message has arrived in a new cycle.
p | new global position | |
time | time global position was received |
Definition at line 215 of file Objects.cpp.
References posGlobalLastSee, and setTimeGlobalPosDerivedFromSee().
Referenced by WorldModel::processSeeGlobalInfo(), WorldModel::updateAfterSenseMessage(), WorldModel::updateAgentObjectAfterSee(), and WorldModel::updateDynamicObjectAfterSee().
VecPosition Object::getGlobalPositionLastSee | ( | ) | const |
This method returns the global position of this object at the time of the last see message. The time of this information is related to the time returned by getTimeGlobalPosDerivedFromSee().
Definition at line 226 of file Objects.cpp.
References posGlobalLastSee.
Referenced by WorldModel::calculateStateBall(), and WorldModel::getGlobalPositionLastSee().
bool Object::setTimeGlobalPosDerivedFromSee | ( | Time | time | ) |
This method sets the time the global position was calculated using a see message.
time | time global position was calculated with see message |
Definition at line 235 of file Objects.cpp.
References timeGlobalPosDerivedFromSee.
Referenced by setGlobalPositionLastSee().
Time Object::getTimeGlobalPosDerivedFromSee | ( | ) | const |
This method returns the time that the global position was calculated using a see message.
Definition at line 244 of file Objects.cpp.
References timeGlobalPosDerivedFromSee.
Referenced by WorldModel::calculateStateBall(), and WorldModel::getTimeGlobalPositionLastSee().
bool Object::setTimeLastSeen | ( | Time | time | ) |
This method sets the time of the last see message in which this object was seen.
time | time this object was last seen |
Definition at line 253 of file Objects.cpp.
References timeLastSeen.
Referenced by WorldModel::processNewObjectInfo(), WorldModel::processPerfectHearInfo(), WorldModel::processPerfectHearInfoBall(), WorldModel::processSeeGlobalInfo(), WorldModel::removeGhosts(), WorldModel::resetTimeObjects(), WorldModel::setTimeLastSeen(), WorldModel::updateAfterSenseMessage(), and WorldModel::updateAgentObjectAfterSee().
Time Object::getTimeLastSeen | ( | ) | const |
This method returns the time that corresponds to the time this object was located in the last see message.
Definition at line 262 of file Objects.cpp.
References timeLastSeen.
Referenced by WorldModel::getTimeLastSeen(), WorldModel::isVisible(), and WorldModel::show().
ObjectT Object::objectType [protected] |
Type of this object
Definition at line 64 of file Objects.h.
Referenced by getType(), Object(), setType(), AgentObject::show(), BallObject::show(), PlayerObject::show(), and FixedObject::show().
Time Object::timeLastSeen [protected] |
Time last see message has arrived
Definition at line 65 of file Objects.h.
Referenced by getConfidence(), getTimeLastSeen(), setTimeLastSeen(), BallObject::show(), PlayerObject::show(), and FixedObject::show().
VecPosition Object::posGlobal [protected] |
Global position in the field
Definition at line 67 of file Objects.h.
Referenced by getGlobalPosition(), setGlobalPosition(), AgentObject::show(), BallObject::show(), and PlayerObject::show().
Time Object::timeGlobalPosition [protected] |
Server time of global position
Definition at line 68 of file Objects.h.
Referenced by getTimeGlobalPosition(), setTimeGlobalPosition(), AgentObject::show(), BallObject::show(), and PlayerObject::show().
VecPosition Object::posRelative [protected] |
Relative position of the object
Definition at line 69 of file Objects.h.
Referenced by getRelativeAngle(), getRelativeDistance(), getRelativePosition(), setRelativePosition(), BallObject::show(), and FixedObject::show().
Time Object::timeRelativePosition [protected] |
Server time of relative position
Definition at line 70 of file Objects.h.
Referenced by getTimeRelativePosition(), setTimeRelativePosition(), BallObject::show(), and FixedObject::show().
VecPosition Object::posGlobalLastSee [protected] |
Global position of last see msg
Definition at line 71 of file Objects.h.
Referenced by getGlobalPositionLastSee(), and setGlobalPositionLastSee().
Time Object::timeGlobalPosDerivedFromSee [protected] |
Time pos derived from see msg
Definition at line 72 of file Objects.h.
Referenced by getTimeGlobalPosDerivedFromSee(), setTimeGlobalPosDerivedFromSee(), and BallObject::show().