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

VisionPerceptor Class Reference

#include <visionperceptor.h>

Inheritance diagram for VisionPerceptor:

Inheritance graph
[legend]
Collaboration diagram for VisionPerceptor:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 VisionPerceptor ()
virtual ~VisionPerceptor ()
bool Percept (boost::shared_ptr< oxygen::PredicateList > predList)
void SetNoiseParams (float sigma_dist, float sigma_phi, float sigma_theta, float cal_error_abs)
 Set the noise parameters of the vision perceptor.
void SetSenseMyPos (bool sense)
 Turn sensing of agent position on/off.
void AddNoise (bool add_noise)
 Turn noise off/on.
void UseRandomNoise (bool random_noise)
 Turn randomization off/on.
void SetStaticSenseAxis (bool static_axis)
 Turn senses relative to the X-axis of the team off/on.

Protected Types

typedef boost::shared_ptr<
salt::NormalRNG<> > 
NormalRngPtr
typedef std::list< ObjectDataTObjectList

Protected Member Functions

virtual bool ConstructInternal ()
 constructs the internal ray collider
void SetupVisibleObjects (TObjectList &visibleObjects)
 prepares a list of visible objects
bool StaticAxisPercept (boost::shared_ptr< oxygen::PredicateList > predList)
 Percept implementation for a static relative axis.
bool DynamicAxisPercept (boost::shared_ptr< oxygen::PredicateList > predList)
 Percept implementation relative to the current orientation of the VisionPerceptor node.
bool CheckOcclusion (const salt::Vector3f &my_pos, const ObjectData &od) const
 Checks if the given object is occluded, seen from from my_pos.
void AddSense (oxygen::Predicate &predicate, ObjectData &od) const
 constructs a sense entry for the given object in the given predicate
void ApplyNoise (ObjectData &od) const
 applies noise to the setup ObjectData
virtual void OnLink ()
 This method is called, when the hierarchy object has been linked to a parent.
virtual void OnUnlink ()
 This rountine is called, before the hierarchy object is removed from the parent.

Protected Attributes

salt::Vector3f mError
 vision calibration error
bool mSenseMyPos
 true, if the absolute position of the agent is sensed.
float mSigmaDist
 sigma for random measurement error (distance)
float mSigmaTheta
 sigma for random measurement error (horizontal angle)
float mSigmaPhi
 sigma for random measurement error (latitudal angle)
float mCalErrorAbs
 absolute maximum value of the calibration error
bool mAddNoise
 flag if we should noisify the data
bool mUseRandomNoise
 flag if the error should be randomized each step
bool mStaticSenseAxis
 flag if the senses are always relative to the X-axis of the team, default true
boost::shared_ptr< oxygen::RayCollidermRay
 ray collider to check occlusion
NormalRngPtr mDistRng
 random number generator for distance errors
NormalRngPtr mThetaRng
 random number generator for angle errors
NormalRngPtr mPhiRng
 random number generator for angle errors
boost::shared_ptr< oxygen::ScenemActiveScene
boost::shared_ptr< oxygen::TransformmTransformParent
 a reference to the next transorm parent
boost::shared_ptr< oxygen::SceneServermSceneServer
 a reference to the scene server
boost::shared_ptr< AgentStatemAgentState
 a reference to the agent state

Classes

struct  ObjectData

Detailed Description

Definition at line 32 of file visionperceptor.h.


Member Typedef Documentation

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

Definition at line 35 of file visionperceptor.h.

typedef std::list<ObjectData> VisionPerceptor::TObjectList [protected]
 

Definition at line 61 of file visionperceptor.h.


Constructor & Destructor Documentation

VisionPerceptor::VisionPerceptor  ) 
 

Definition at line 33 of file visionperceptor.cpp.

References SetNoiseParams(), and oxygen::Perceptor::SetPredicateName().

Here is the call graph for this function:

VisionPerceptor::~VisionPerceptor  )  [virtual]
 

Definition at line 45 of file visionperceptor.cpp.

References mDistRng, mPhiRng, and mThetaRng.


Member Function Documentation

void VisionPerceptor::AddNoise bool  add_noise  ) 
 

Turn noise off/on.

Parameters:
add_noise flag if noise should be used at all.

Definition at line 92 of file visionperceptor.cpp.

References mAddNoise.

void VisionPerceptor::AddSense oxygen::Predicate predicate,
ObjectData od
const [protected]
 

constructs a sense entry for the given object in the given predicate

Definition at line 159 of file visionperceptor.cpp.

References zeitgeist::ParameterList::AddList(), zeitgeist::ParameterList::AddValue(), VisionPerceptor::ObjectData::mDist, VisionPerceptor::ObjectData::mObj, VisionPerceptor::ObjectData::mPhi, VisionPerceptor::ObjectData::mTheta, oxygen::Predicate::parameter, and ObjectState::PT_Player.

Referenced by DynamicAxisPercept(), and StaticAxisPercept().

Here is the call graph for this function:

void VisionPerceptor::ApplyNoise ObjectData od  )  const [protected]
 

applies noise to the setup ObjectData

Definition at line 192 of file visionperceptor.cpp.

References mAddNoise, VisionPerceptor::ObjectData::mDist, mDistRng, VisionPerceptor::ObjectData::mPhi, mPhiRng, mSigmaDist, mSigmaPhi, mSigmaTheta, VisionPerceptor::ObjectData::mTheta, mThetaRng, and mUseRandomNoise.

Referenced by DynamicAxisPercept(), and StaticAxisPercept().

bool VisionPerceptor::CheckOcclusion const salt::Vector3f my_pos,
const ObjectData od
const [protected]
 

Checks if the given object is occluded, seen from from my_pos.

Definition at line 353 of file visionperceptor.cpp.

Referenced by StaticAxisPercept().

bool VisionPerceptor::ConstructInternal  )  [protected, virtual]
 

constructs the internal ray collider

Reimplemented from zeitgeist::Object.

Definition at line 110 of file visionperceptor.cpp.

References zeitgeist::Object::GetCore(), zeitgeist::Object::GetLog(), and mRay.

Here is the call graph for this function:

bool VisionPerceptor::DynamicAxisPercept boost::shared_ptr< oxygen::PredicateList predList  )  [protected]
 

Percept implementation relative to the current orientation of the VisionPerceptor node.

Definition at line 278 of file visionperceptor.cpp.

References AddSense(), ApplyNoise(), zeitgeist::ParameterList::Clear(), SoccerBase::FlipView(), salt::gNormalizeRad(), salt::gRadToDeg(), salt::TVector< DATATYPE, ELEMENTS, TYPE >::Length(), mAddNoise, mAgentState, mError, VisionPerceptor::ObjectData::mPhi, oxygen::Perceptor::mPredicateName, VisionPerceptor::ObjectData::mRelPos, VisionPerceptor::ObjectData::mTheta, mTransformParent, oxygen::Predicate::name, oxygen::Predicate::parameter, and SetupVisibleObjects().

Referenced by Percept().

Here is the call graph for this function:

void VisionPerceptor::OnLink  )  [protected, virtual]
 

This method is called, when the hierarchy object has been linked to a parent.

At that point, traversal can commence. It can be overridden to support custom 'link' behavior.

Reimplemented from zeitgeist::Leaf.

Definition at line 73 of file visionperceptor.cpp.

References SoccerBase::GetActiveScene(), SoccerBase::GetAgentState(), SoccerBase::GetTransformParent(), mActiveScene, mAgentState, and mTransformParent.

Here is the call graph for this function:

void VisionPerceptor::OnUnlink  )  [protected, virtual]
 

This rountine is called, before the hierarchy object is removed from the parent.

It can be overridden to support custom 'unlink' behavior.

Reimplemented from zeitgeist::Leaf.

Definition at line 81 of file visionperceptor.cpp.

References mActiveScene, mAgentState, mDistRng, mPhiRng, mThetaRng, and mTransformParent.

bool VisionPerceptor::Percept boost::shared_ptr< oxygen::PredicateList predList  )  [virtual]
 

Returns:
true, if valid data is available and false otherwise.

Implements oxygen::Perceptor.

Definition at line 337 of file visionperceptor.cpp.

References DynamicAxisPercept(), mActiveScene, mAgentState, mStaticSenseAxis, mTransformParent, and StaticAxisPercept().

Here is the call graph for this function:

void VisionPerceptor::SetNoiseParams float  sigma_dist,
float  sigma_phi,
float  sigma_theta,
float  cal_error_abs
 

Set the noise parameters of the vision perceptor.

This will always create new calibration error values. The random noise added each step is normally distributed around 0.0. The (fixed) calibration error is calculated once for each axis. It is uniformly distributed between -cal_error_abs and cal_error_abs and added to the "camera" coordinates.

Parameters:
sigma_dist the sigma for the distance error distribution
sigma_phi the sigma for the horizontal angle error distribution
sigma_theta the sigma for the latitudal angle error distribution
cal_error_abs absolute value of the maximum calibration error along each axis.

Definition at line 53 of file visionperceptor.cpp.

References mCalErrorAbs, mDistRng, mError, mPhiRng, mSigmaDist, mSigmaPhi, mSigmaTheta, and mThetaRng.

Referenced by VisionPerceptor().

void VisionPerceptor::SetSenseMyPos bool  sense  ) 
 

Turn sensing of agent position on/off.

Definition at line 393 of file visionperceptor.cpp.

References mSenseMyPos.

void VisionPerceptor::SetStaticSenseAxis bool  static_axis  ) 
 

Turn senses relative to the X-axis of the team off/on.

Definition at line 104 of file visionperceptor.cpp.

References mStaticSenseAxis.

void VisionPerceptor::SetupVisibleObjects TObjectList visibleObjects  )  [protected]
 

prepares a list of visible objects

Definition at line 125 of file visionperceptor.cpp.

References zeitgeist::Node::begin(), zeitgeist::Node::end(), zeitgeist::Object::GetLog(), salt::TVector< DATATYPE, ELEMENTS, TYPE >::Length(), mActiveScene, VisionPerceptor::ObjectData::mDist, VisionPerceptor::ObjectData::mObj, VisionPerceptor::ObjectData::mRelPos, and mTransformParent.

Referenced by DynamicAxisPercept(), and StaticAxisPercept().

Here is the call graph for this function:

bool VisionPerceptor::StaticAxisPercept boost::shared_ptr< oxygen::PredicateList predList  )  [protected]
 

Percept implementation for a static relative axis.

Definition at line 218 of file visionperceptor.cpp.

References zeitgeist::ParameterList::AddList(), AddSense(), zeitgeist::ParameterList::AddValue(), ApplyNoise(), CheckOcclusion(), zeitgeist::ParameterList::Clear(), SoccerBase::FlipView(), salt::gArcCos(), salt::gArcTan2(), salt::gRadToDeg(), salt::TVector< DATATYPE, ELEMENTS, TYPE >::Length(), mAddNoise, mAgentState, VisionPerceptor::ObjectData::mDist, mError, VisionPerceptor::ObjectData::mPhi, oxygen::Perceptor::mPredicateName, VisionPerceptor::ObjectData::mRelPos, mSenseMyPos, VisionPerceptor::ObjectData::mTheta, mTransformParent, oxygen::Predicate::name, oxygen::Predicate::parameter, and SetupVisibleObjects().

Referenced by Percept().

Here is the call graph for this function:

void VisionPerceptor::UseRandomNoise bool  random_noise  ) 
 

Turn randomization off/on.

Parameters:
random_noise flag if the measurement noise is randomized each step.

Definition at line 98 of file visionperceptor.cpp.

References mUseRandomNoise.


Member Data Documentation

boost::shared_ptr<oxygen::Scene> VisionPerceptor::mActiveScene [protected]
 

Definition at line 166 of file visionperceptor.h.

Referenced by OnLink(), OnUnlink(), Percept(), and SetupVisibleObjects().

bool VisionPerceptor::mAddNoise [protected]
 

flag if we should noisify the data

Definition at line 147 of file visionperceptor.h.

Referenced by AddNoise(), ApplyNoise(), DynamicAxisPercept(), and StaticAxisPercept().

boost::shared_ptr<AgentState> VisionPerceptor::mAgentState [protected]
 

a reference to the agent state

Definition at line 172 of file visionperceptor.h.

Referenced by DynamicAxisPercept(), OnLink(), OnUnlink(), Percept(), and StaticAxisPercept().

float VisionPerceptor::mCalErrorAbs [protected]
 

absolute maximum value of the calibration error

Definition at line 145 of file visionperceptor.h.

Referenced by SetNoiseParams().

NormalRngPtr VisionPerceptor::mDistRng [protected]
 

random number generator for distance errors

Definition at line 160 of file visionperceptor.h.

Referenced by ApplyNoise(), OnUnlink(), SetNoiseParams(), and ~VisionPerceptor().

salt::Vector3f VisionPerceptor::mError [protected]
 

vision calibration error

Definition at line 133 of file visionperceptor.h.

Referenced by DynamicAxisPercept(), SetNoiseParams(), and StaticAxisPercept().

NormalRngPtr VisionPerceptor::mPhiRng [protected]
 

random number generator for angle errors

Definition at line 164 of file visionperceptor.h.

Referenced by ApplyNoise(), OnUnlink(), SetNoiseParams(), and ~VisionPerceptor().

boost::shared_ptr<oxygen::RayCollider> VisionPerceptor::mRay [protected]
 

ray collider to check occlusion

Definition at line 157 of file visionperceptor.h.

Referenced by ConstructInternal().

boost::shared_ptr<oxygen::SceneServer> VisionPerceptor::mSceneServer [protected]
 

a reference to the scene server

Definition at line 170 of file visionperceptor.h.

bool VisionPerceptor::mSenseMyPos [protected]
 

true, if the absolute position of the agent is sensed.

Definition at line 136 of file visionperceptor.h.

Referenced by SetSenseMyPos(), and StaticAxisPercept().

float VisionPerceptor::mSigmaDist [protected]
 

sigma for random measurement error (distance)

Definition at line 139 of file visionperceptor.h.

Referenced by ApplyNoise(), and SetNoiseParams().

float VisionPerceptor::mSigmaPhi [protected]
 

sigma for random measurement error (latitudal angle)

Definition at line 143 of file visionperceptor.h.

Referenced by ApplyNoise(), and SetNoiseParams().

float VisionPerceptor::mSigmaTheta [protected]
 

sigma for random measurement error (horizontal angle)

Definition at line 141 of file visionperceptor.h.

Referenced by ApplyNoise(), and SetNoiseParams().

bool VisionPerceptor::mStaticSenseAxis [protected]
 

flag if the senses are always relative to the X-axis of the team, default true

Definition at line 154 of file visionperceptor.h.

Referenced by Percept(), and SetStaticSenseAxis().

NormalRngPtr VisionPerceptor::mThetaRng [protected]
 

random number generator for angle errors

Definition at line 162 of file visionperceptor.h.

Referenced by ApplyNoise(), OnUnlink(), SetNoiseParams(), and ~VisionPerceptor().

boost::shared_ptr<oxygen::Transform> VisionPerceptor::mTransformParent [protected]
 

a reference to the next transorm parent

Definition at line 168 of file visionperceptor.h.

Referenced by DynamicAxisPercept(), OnLink(), OnUnlink(), Percept(), SetupVisibleObjects(), and StaticAxisPercept().

bool VisionPerceptor::mUseRandomNoise [protected]
 

flag if the error should be randomized each step

Definition at line 149 of file visionperceptor.h.

Referenced by ApplyNoise(), and UseRandomNoise().


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