#include <visionperceptor.h>
Inheritance diagram for VisionPerceptor:
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< ObjectData > | TObjectList |
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::RayCollider > | mRay |
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::Scene > | mActiveScene |
boost::shared_ptr< oxygen::Transform > | mTransformParent |
a reference to the next transorm parent | |
boost::shared_ptr< oxygen::SceneServer > | mSceneServer |
a reference to the scene server | |
boost::shared_ptr< AgentState > | mAgentState |
a reference to the agent state | |
Classes | |
struct | ObjectData |
Definition at line 32 of file visionperceptor.h.
|
Definition at line 35 of file visionperceptor.h. |
|
Definition at line 61 of file visionperceptor.h. |
|
Definition at line 33 of file visionperceptor.cpp. References SetNoiseParams(), and oxygen::Perceptor::SetPredicateName(). Here is the call graph for this function: ![]() |
|
Definition at line 45 of file visionperceptor.cpp. |
|
Turn noise off/on.
Definition at line 92 of file visionperceptor.cpp. References mAddNoise. |
|
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: ![]() |
|
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(). |
|
Checks if the given object is occluded, seen from from my_pos.
Definition at line 353 of file visionperceptor.cpp. Referenced by StaticAxisPercept(). |
|
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: ![]() |
|
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: ![]() |
|
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: ![]() |
|
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. |
|
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: ![]() |
|
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.
Definition at line 53 of file visionperceptor.cpp. References mCalErrorAbs, mDistRng, mError, mPhiRng, mSigmaDist, mSigmaPhi, mSigmaTheta, and mThetaRng. Referenced by VisionPerceptor(). |
|
Turn sensing of agent position on/off.
Definition at line 393 of file visionperceptor.cpp. References mSenseMyPos. |
|
Turn senses relative to the X-axis of the team off/on.
Definition at line 104 of file visionperceptor.cpp. References mStaticSenseAxis. |
|
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: ![]() |
|
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: ![]() |
|
Turn randomization off/on.
Definition at line 98 of file visionperceptor.cpp. References mUseRandomNoise. |
|
Definition at line 166 of file visionperceptor.h. Referenced by OnLink(), OnUnlink(), Percept(), and SetupVisibleObjects(). |
|
flag if we should noisify the data
Definition at line 147 of file visionperceptor.h. Referenced by AddNoise(), ApplyNoise(), DynamicAxisPercept(), and StaticAxisPercept(). |
|
a reference to the agent state
Definition at line 172 of file visionperceptor.h. Referenced by DynamicAxisPercept(), OnLink(), OnUnlink(), Percept(), and StaticAxisPercept(). |
|
absolute maximum value of the calibration error
Definition at line 145 of file visionperceptor.h. Referenced by SetNoiseParams(). |
|
random number generator for distance errors
Definition at line 160 of file visionperceptor.h. Referenced by ApplyNoise(), OnUnlink(), SetNoiseParams(), and ~VisionPerceptor(). |
|
vision calibration error
Definition at line 133 of file visionperceptor.h. Referenced by DynamicAxisPercept(), SetNoiseParams(), and StaticAxisPercept(). |
|
random number generator for angle errors
Definition at line 164 of file visionperceptor.h. Referenced by ApplyNoise(), OnUnlink(), SetNoiseParams(), and ~VisionPerceptor(). |
|
ray collider to check occlusion
Definition at line 157 of file visionperceptor.h. Referenced by ConstructInternal(). |
|
a reference to the scene server
Definition at line 170 of file visionperceptor.h. |
|
true, if the absolute position of the agent is sensed.
Definition at line 136 of file visionperceptor.h. Referenced by SetSenseMyPos(), and StaticAxisPercept(). |
|
sigma for random measurement error (distance)
Definition at line 139 of file visionperceptor.h. Referenced by ApplyNoise(), and SetNoiseParams(). |
|
sigma for random measurement error (latitudal angle)
Definition at line 143 of file visionperceptor.h. Referenced by ApplyNoise(), and SetNoiseParams(). |
|
sigma for random measurement error (horizontal angle)
Definition at line 141 of file visionperceptor.h. Referenced by ApplyNoise(), and SetNoiseParams(). |
|
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(). |
|
random number generator for angle errors
Definition at line 162 of file visionperceptor.h. Referenced by ApplyNoise(), OnUnlink(), SetNoiseParams(), and ~VisionPerceptor(). |
|
a reference to the next transorm parent
Definition at line 168 of file visionperceptor.h. Referenced by DynamicAxisPercept(), OnLink(), OnUnlink(), Percept(), SetupVisibleObjects(), and StaticAxisPercept(). |
|
flag if the error should be randomized each step
Definition at line 149 of file visionperceptor.h. Referenced by ApplyNoise(), and UseRandomNoise(). |