#include <driveeffector.h>
Inheritance diagram for DriveEffector:
Public Member Functions | |
DriveEffector () | |
virtual | ~DriveEffector () |
virtual bool | Realize (boost::shared_ptr< oxygen::ActionObject > action) |
realizes the action described by the ActionObject | |
virtual std::string | GetPredicate () |
returns the name of the predicate this effector implements. | |
virtual boost::shared_ptr< oxygen::ActionObject > | GetActionObject (const oxygen::Predicate &predicate) |
constructs an Actionobject, describing a predicate | |
void | SetForceFactor (float force_factor) |
Set the force factor. | |
void | SetSigma (float sigma) |
Set the error distribution for calculating the applied force. | |
void | SetMaxPower (float max_power) |
Set the maximum length of the drive power vector. | |
void | SetConsumption (float consume_time) |
Set the battery consumption. | |
Protected Types | |
typedef boost::shared_ptr< salt::NormalRNG<> > | NormalRngPtr |
Protected Member Functions | |
virtual void | PrePhysicsUpdateInternal (float deltaTime) |
updates internal state before physics calculation | |
virtual void | OnLink () |
setup the reference to the agents body node | |
virtual void | OnUnlink () |
remove the reference to the agents body node | |
Protected Attributes | |
boost::shared_ptr< oxygen::Transform > | mTransformParent |
the reference to the parent transform node | |
boost::shared_ptr< oxygen::Body > | mBody |
the reference to the parents body node | |
boost::shared_ptr< AgentState > | mAgentState |
a reference to the agent state | |
salt::Vector3f | mForce |
the force that should be applied to the agent body | |
float | mMaxDistance |
the maximum distance from the plane | |
float | mForceFactor |
The force factor is the force applied to the body if the length of the drive power vector is greater or equal to mMaxDrivePower. | |
NormalRngPtr | mForceErrorRNG |
random number generator for the error distribution of the applied force | |
float | mMaxPower |
The maximum length of the drive power vector. | |
double | mConsumption |
The battery consumption for driving one second with full speed. |
Definition at line 30 of file driveeffector.h.
|
Definition at line 82 of file driveeffector.h. |
|
Definition at line 33 of file driveeffector.cpp. |
|
Definition at line 39 of file driveeffector.cpp. |
|
constructs an Actionobject, describing a predicate
Implements oxygen::Effector. Definition at line 91 of file driveeffector.cpp. References oxygen::Predicate::begin(), zeitgeist::Object::GetLog(), GetPredicate(), oxygen::Predicate::GetValue(), and oxygen::Predicate::name. Here is the call graph for this function: ![]() |
|
returns the name of the predicate this effector implements.
Implements oxygen::Effector. Definition at line 40 of file driveeffector.h. Referenced by GetActionObject(). |
|
setup the reference to the agents body node
Reimplemented from zeitgeist::Leaf. Definition at line 112 of file driveeffector.cpp. References SoccerBase::GetAgentState(), SoccerBase::GetBody(), zeitgeist::Object::GetLog(), SoccerBase::GetTransformParent(), mAgentState, mBody, mMaxDistance, and mTransformParent. Here is the call graph for this function: ![]() |
|
remove the reference to the agents body node
Reimplemented from zeitgeist::Leaf. Definition at line 132 of file driveeffector.cpp. References mBody, mForceErrorRNG, and mTransformParent. |
|
updates internal state before physics calculation
Reimplemented from oxygen::BaseNode. Definition at line 159 of file driveeffector.cpp. References SoccerBase::FlipView(), salt::TVector< DATATYPE, ELEMENTS, TYPE >::Length(), mAgentState, mBody, mConsumption, mForce, mMaxDistance, mTransformParent, and salt::TVector3< DATATYPE, TYPE >::z(). Here is the call graph for this function: ![]() |
|
realizes the action described by the ActionObject
Implements oxygen::Effector. Definition at line 44 of file driveeffector.cpp. References zeitgeist::Object::GetLog(), zeitgeist::Leaf::GetParent(), mBody, mForce, mForceErrorRNG, mForceFactor, mMaxPower, salt::TVector< DATATYPE, ELEMENTS, TYPE >::Normalize(), and salt::TVector< DATATYPE, ELEMENTS, TYPE >::SquareLength(). Here is the call graph for this function: ![]() |
|
Set the battery consumption. How long can you be driving full speed with a fully charged battery?
Definition at line 178 of file driveeffector.cpp. References mConsumption. |
|
Set the force factor. The drive power vector is multiplied by this factor divided by the maximum length of the drive power vector. Definition at line 140 of file driveeffector.cpp. References salt::gAbs(), and mForceFactor. Here is the call graph for this function: ![]() |
|
Set the maximum length of the drive power vector.
Definition at line 153 of file driveeffector.cpp. References mMaxPower. |
|
Set the error distribution for calculating the applied force. The force applied to a sphere is the drive power vector multiplied by the force factor divided by (maximum length of the drive power vector + Error). The error is normaly distributed around zero with a given sigma. If sigma is <= 0, no error will be applied. Definition at line 146 of file driveeffector.cpp. References mForceErrorRNG. |
|
a reference to the agent state
Definition at line 89 of file driveeffector.h. Referenced by OnLink(), and PrePhysicsUpdateInternal(). |
|
the reference to the parents body node
Definition at line 87 of file driveeffector.h. Referenced by OnLink(), OnUnlink(), PrePhysicsUpdateInternal(), and Realize(). |
|
The battery consumption for driving one second with full speed.
Definition at line 108 of file driveeffector.h. Referenced by PrePhysicsUpdateInternal(), and SetConsumption(). |
|
the force that should be applied to the agent body
Definition at line 92 of file driveeffector.h. Referenced by PrePhysicsUpdateInternal(), and Realize(). |
|
random number generator for the error distribution of the applied force
Definition at line 102 of file driveeffector.h. Referenced by OnUnlink(), Realize(), and SetSigma(). |
|
The force factor is the force applied to the body if the length of the drive power vector is greater or equal to mMaxDrivePower.
Definition at line 99 of file driveeffector.h. Referenced by Realize(), and SetForceFactor(). |
|
the maximum distance from the plane
Definition at line 95 of file driveeffector.h. Referenced by OnLink(), and PrePhysicsUpdateInternal(). |
|
The maximum length of the drive power vector.
Definition at line 105 of file driveeffector.h. Referenced by Realize(), and SetMaxPower(). |
|
the reference to the parent transform node
Definition at line 85 of file driveeffector.h. Referenced by OnLink(), OnUnlink(), and PrePhysicsUpdateInternal(). |