Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

KickEffector Class Reference

#include <kickeffector.h>

Inheritance diagram for KickEffector:

Inheritance graph
[legend]
Collaboration diagram for KickEffector:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 KickEffector ()
virtual ~KickEffector ()
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
virtual void OnLink ()
 setup the reference to the ball body node
virtual void OnUnlink ()
 remove the reference to the ball body node
void SetKickMargin (float margin)
 set the kick margin (the area within objects are kickable)
void SetForceFactor (float force_factor)
 Set the force factor.
void SetTorqueFactor (float torque_factor)
 Set the torque factor.
void SetSteps (int steps)
 Set the number of steps the force is applied.
void SetNoiseParams (double sigma_force, double sigma_theta, double sigma_phi_end, double sigma_phi_mid)
 Set the noise parameters.
void SetMaxPower (float max_power)
 Set the maximum kick power.
void SetAngleRange (float min, float max)
 Set the latitudal angle range.

Protected Types

typedef boost::shared_ptr<
salt::NormalRNG<> > 
NormalRngPtr

Protected Attributes

boost::shared_ptr< oxygen::BodymBallBody
 reference to the body node of the ball
boost::shared_ptr< BallmBall
 reference to the body node of the ball
boost::shared_ptr< oxygen::AgentAspectmAgent
 reference to the agent aspect
NormalRngPtr mForceErrorRNG
 random number generator for the error distribution of the applied force
NormalRngPtr mThetaErrorRNG
 random number generator for the error distribution of the theta

Private Attributes

float mKickMargin
 the margin where objects can be kicked
float mPlayerRadius
 radius of the player
float mBallRadius
 radius of the ball
float mForceFactor
 force factor
float mTorqueFactor
 force factor
float mMaxPower
 the maximum kick power
float mMinAngle
 the minimal kick angle
float mMaxAngle
 the maximum kick angle
int mSteps
 number of simulation steps for applying kick force
double mSigmaPhiEnd
 sigma for angle error at the end of the range (latitudal angle)
double mSigmaPhiMid
 sigma for angle error in the middle of the range (latitudal angle)

Detailed Description

Definition at line 32 of file kickeffector.h.


Member Typedef Documentation

typedef boost::shared_ptr<salt::NormalRNG<> > KickEffector::NormalRngPtr [protected]
 

Definition at line 101 of file kickeffector.h.


Constructor & Destructor Documentation

KickEffector::KickEffector  ) 
 

Definition at line 35 of file kickeffector.cpp.

KickEffector::~KickEffector  )  [virtual]
 

Definition at line 45 of file kickeffector.cpp.


Member Function Documentation

shared_ptr< ActionObject > KickEffector::GetActionObject const oxygen::Predicate predicate  )  [virtual]
 

constructs an Actionobject, describing a predicate

Implements oxygen::Effector.

Definition at line 137 of file kickeffector.cpp.

References oxygen::Predicate::AdvanceValue(), oxygen::Predicate::begin(), zeitgeist::Object::GetLog(), GetPredicate(), and oxygen::Predicate::name.

Here is the call graph for this function:

virtual std::string KickEffector::GetPredicate  )  [inline, virtual]
 

returns the name of the predicate this effector implements.

Implements oxygen::Effector.

Definition at line 42 of file kickeffector.h.

Referenced by GetActionObject().

void KickEffector::OnLink  )  [virtual]
 

setup the reference to the ball body node

Reimplemented from zeitgeist::Leaf.

Definition at line 176 of file kickeffector.cpp.

References SoccerBase::GetBall(), SoccerBase::GetBallBody(), SoccerBase::GetBallCollider(), zeitgeist::Object::GetLog(), zeitgeist::Leaf::GetParent(), mAgent, mBall, mBallBody, mBallRadius, and mPlayerRadius.

Here is the call graph for this function:

void KickEffector::OnUnlink  )  [virtual]
 

remove the reference to the ball body node

Reimplemented from zeitgeist::Leaf.

Definition at line 212 of file kickeffector.cpp.

References mAgent, mBallBody, mForceErrorRNG, and mThetaErrorRNG.

bool KickEffector::Realize boost::shared_ptr< oxygen::ActionObject action  )  [virtual]
 

realizes the action described by the ActionObject

Implements oxygen::Effector.

Definition at line 50 of file kickeffector.cpp.

References salt::g2PI, salt::gAbs(), salt::gArcTan2(), salt::gCos(), salt::gDegToRad(), zeitgeist::Object::GetLog(), salt::gMax(), salt::gMin(), salt::gSin(), salt::TVector< DATATYPE, ELEMENTS, TYPE >::Length(), mAgent, mBall, mBallBody, mBallRadius, mForceErrorRNG, mForceFactor, mKickMargin, mMaxAngle, mMaxPower, mMinAngle, mPlayerRadius, mSigmaPhiEnd, mSigmaPhiMid, mSteps, mThetaErrorRNG, and mTorqueFactor.

Here is the call graph for this function:

void KickEffector::SetAngleRange float  min,
float  max
 

Set the latitudal angle range.

Parameters:
min minimum latitudal kick angle in degrees
max maximum latitudal kick angle in degrees
min has to be smaller than max.

Definition at line 263 of file kickeffector.cpp.

References zeitgeist::Object::GetLog(), mMaxAngle, and mMinAngle.

Here is the call graph for this function:

void KickEffector::SetForceFactor float  force_factor  ) 
 

Set the force factor.

The kick power vector is multiplied by this factor.

Definition at line 239 of file kickeffector.cpp.

References mForceFactor.

void KickEffector::SetKickMargin float  margin  ) 
 

set the kick margin (the area within objects are kickable)

Definition at line 221 of file kickeffector.cpp.

References mKickMargin.

void KickEffector::SetMaxPower float  max_power  ) 
 

Set the maximum kick power.

Definition at line 257 of file kickeffector.cpp.

References mMaxPower.

void KickEffector::SetNoiseParams double  sigma_force,
double  sigma_theta,
double  sigma_phi_end,
double  sigma_phi_mid
 

Set the noise parameters.

If used, the noise values are normally distributed around 0.0. Using this method, the sigmas of the distributions can be set. Values <= 0 mean that no noise will be added.

Parameters:
sigma_force for noise of the applied force
sigma_theta for noise of the angle in the x-y plane
sigma_phi_end for noise of the latitudal angle at the end of the range
sigma_phi_mid for noise of the latitudal angle in the middle of the angle range

Definition at line 227 of file kickeffector.cpp.

References mForceErrorRNG, mSigmaPhiEnd, mSigmaPhiMid, and mThetaErrorRNG.

void KickEffector::SetSteps int  steps  ) 
 

Set the number of steps the force is applied.

Parameters:
steps the number of steps to apply force and torque.

Definition at line 251 of file kickeffector.cpp.

References mSteps.

void KickEffector::SetTorqueFactor float  torque_factor  ) 
 

Set the torque factor.

The kick torque vector is multiplied by this factor.

Definition at line 245 of file kickeffector.cpp.

References mTorqueFactor.


Member Data Documentation

boost::shared_ptr<oxygen::AgentAspect> KickEffector::mAgent [protected]
 

reference to the agent aspect

Definition at line 108 of file kickeffector.h.

Referenced by OnLink(), OnUnlink(), and Realize().

boost::shared_ptr<Ball> KickEffector::mBall [protected]
 

reference to the body node of the ball

Definition at line 106 of file kickeffector.h.

Referenced by OnLink(), and Realize().

boost::shared_ptr<oxygen::Body> KickEffector::mBallBody [protected]
 

reference to the body node of the ball

Definition at line 104 of file kickeffector.h.

Referenced by OnLink(), OnUnlink(), and Realize().

float KickEffector::mBallRadius [private]
 

radius of the ball

Definition at line 121 of file kickeffector.h.

Referenced by OnLink(), and Realize().

NormalRngPtr KickEffector::mForceErrorRNG [protected]
 

random number generator for the error distribution of the applied force

Definition at line 111 of file kickeffector.h.

Referenced by OnUnlink(), Realize(), and SetNoiseParams().

float KickEffector::mForceFactor [private]
 

force factor

Definition at line 123 of file kickeffector.h.

Referenced by Realize(), and SetForceFactor().

float KickEffector::mKickMargin [private]
 

the margin where objects can be kicked

Definition at line 117 of file kickeffector.h.

Referenced by Realize(), and SetKickMargin().

float KickEffector::mMaxAngle [private]
 

the maximum kick angle

Definition at line 131 of file kickeffector.h.

Referenced by Realize(), and SetAngleRange().

float KickEffector::mMaxPower [private]
 

the maximum kick power

Definition at line 127 of file kickeffector.h.

Referenced by Realize(), and SetMaxPower().

float KickEffector::mMinAngle [private]
 

the minimal kick angle

Definition at line 129 of file kickeffector.h.

Referenced by Realize(), and SetAngleRange().

float KickEffector::mPlayerRadius [private]
 

radius of the player

Definition at line 119 of file kickeffector.h.

Referenced by OnLink(), and Realize().

double KickEffector::mSigmaPhiEnd [private]
 

sigma for angle error at the end of the range (latitudal angle)

Definition at line 135 of file kickeffector.h.

Referenced by Realize(), and SetNoiseParams().

double KickEffector::mSigmaPhiMid [private]
 

sigma for angle error in the middle of the range (latitudal angle)

Definition at line 137 of file kickeffector.h.

Referenced by Realize(), and SetNoiseParams().

int KickEffector::mSteps [private]
 

number of simulation steps for applying kick force

Definition at line 133 of file kickeffector.h.

Referenced by Realize(), and SetSteps().

NormalRngPtr KickEffector::mThetaErrorRNG [protected]
 

random number generator for the error distribution of the theta

Definition at line 113 of file kickeffector.h.

Referenced by OnUnlink(), Realize(), and SetNoiseParams().

float KickEffector::mTorqueFactor [private]
 

force factor

Definition at line 125 of file kickeffector.h.

Referenced by Realize(), and SetTorqueFactor().


The documentation for this class was generated from the following files:
Generated on Thu Apr 6 15:39:21 2006 for rcssserver3d by  doxygen 1.4.4