#include <restrictedvisionperceptor.h>
Inheritance diagram for RestrictedVisionPerceptor:
Public Member Functions | |
RestrictedVisionPerceptor () | |
virtual | ~RestrictedVisionPerceptor () |
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 | SetStaticSenseAxis (bool static_axis) |
Turn senses relative to the X-axis of the team off/on. | |
void | SetViewCones (unsigned int hAngle, unsigned int vAngle) |
Set the visible area of the perceptor. | |
void | SetPanRange (int lower, int upper) |
Set the pan range. | |
void | SetTiltRange (int lower, int upper) |
Set the tilt range. | |
void | SetPanTilt (float pan, float tilt) |
Set the view angles. | |
void | ChangePanTilt (float pan, float tilt) |
Add values to the current view angles. | |
float | GetPan () const |
Get the horizontal view direction. | |
float | GetTilt () const |
Get the horizontal view direction. | |
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 RestrictedVisionPerceptor 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 | mStaticSenseAxis |
flag if the senses are always relative to the X-axis of the team, default true | |
unsigned int | mHViewCone |
horizontal opening of the vision cone | |
unsigned int | mVViewCone |
vertical opening of the vision cone | |
float | mPan |
horizontal view direction in degrees | |
int | mPanLower |
the lower bound for the horizontal view direction in degrees | |
int | mPanUpper |
the upper bound for the horizontal view direction in degrees | |
float | mTilt |
vertical view direction in degrees | |
int | mTiltLower |
the lower bound for the vertical view direction in degrees | |
int | mTiltUpper |
the upper bound for the vertical view direction in degrees | |
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 restrictedvisionperceptor.h.
|
Definition at line 35 of file restrictedvisionperceptor.h. |
|
Definition at line 63 of file restrictedvisionperceptor.h. |
|
Definition at line 34 of file restrictedvisionperceptor.cpp. References SetNoiseParams(), SetPanRange(), SetPanTilt(), oxygen::Perceptor::SetPredicateName(), SetTiltRange(), and SetViewCones(). Here is the call graph for this function: ![]() |
|
Definition at line 49 of file restrictedvisionperceptor.cpp. |
|
Turn noise off/on.
Definition at line 170 of file restrictedvisionperceptor.cpp. References mAddNoise. |
|
constructs a sense entry for the given object in the given predicate
Definition at line 232 of file restrictedvisionperceptor.cpp. References zeitgeist::ParameterList::AddList(), zeitgeist::ParameterList::AddValue(), RestrictedVisionPerceptor::ObjectData::mDist, RestrictedVisionPerceptor::ObjectData::mObj, RestrictedVisionPerceptor::ObjectData::mPhi, RestrictedVisionPerceptor::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 261 of file restrictedvisionperceptor.cpp. References mAddNoise, RestrictedVisionPerceptor::ObjectData::mDist, mDistRng, RestrictedVisionPerceptor::ObjectData::mPhi, mPhiRng, RestrictedVisionPerceptor::ObjectData::mTheta, and mThetaRng. Referenced by DynamicAxisPercept(), and StaticAxisPercept(). |
|
Add values to the current view angles.
Definition at line 133 of file restrictedvisionperceptor.cpp. References mPan, mTilt, and SetPanTilt(). Here is the call graph for this function: ![]() |
|
Checks if the given object is occluded, seen from from my_pos.
Definition at line 471 of file restrictedvisionperceptor.cpp. Referenced by StaticAxisPercept(). |
|
constructs the internal ray collider
Reimplemented from zeitgeist::Object. Definition at line 182 of file restrictedvisionperceptor.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 RestrictedVisionPerceptor node.
Definition at line 339 of file restrictedvisionperceptor.cpp. References zeitgeist::ParameterList::AddList(), AddSense(), zeitgeist::ParameterList::AddValue(), ApplyNoise(), zeitgeist::ParameterList::Clear(), SoccerBase::FlipView(), salt::gAbs(), zeitgeist::Object::GetLog(), salt::gNormalizeRad(), salt::gRadToDeg(), salt::TVector< DATATYPE, ELEMENTS, TYPE >::Length(), mAddNoise, mAgentState, mError, mHViewCone, RestrictedVisionPerceptor::ObjectData::mObj, RestrictedVisionPerceptor::ObjectData::mPhi, oxygen::Perceptor::mPredicateName, RestrictedVisionPerceptor::ObjectData::mRelPos, mSenseMyPos, RestrictedVisionPerceptor::ObjectData::mTheta, mTransformParent, mVViewCone, oxygen::Predicate::name, oxygen::Predicate::parameter, and SetupVisibleObjects(). Referenced by Percept(). Here is the call graph for this function: ![]() |
|
Get the horizontal view direction.
Definition at line 139 of file restrictedvisionperceptor.cpp. References mPan. Referenced by StaticAxisPercept(). |
|
Get the horizontal view direction.
Definition at line 145 of file restrictedvisionperceptor.cpp. References mTilt. Referenced by StaticAxisPercept(). |
|
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 151 of file restrictedvisionperceptor.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 159 of file restrictedvisionperceptor.cpp. References mActiveScene, mAgentState, mDistRng, mPhiRng, mThetaRng, and mTransformParent. |
|
Implements oxygen::Perceptor. Definition at line 452 of file restrictedvisionperceptor.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 57 of file restrictedvisionperceptor.cpp. References mCalErrorAbs, mDistRng, mError, mPhiRng, mSigmaDist, mSigmaPhi, mSigmaTheta, and mThetaRng. Referenced by RestrictedVisionPerceptor(). |
|
Set the pan range. As long as the agents have no inherent direction and 0 degrees horizontally is always directed towards the opponent side, it does not make much sense to restrict the pan range other than to a fixed angle, which disables panning effectively. A range of 360 degrees (e.g. from -180 to 180) means no restriction.
Definition at line 84 of file restrictedvisionperceptor.cpp. References salt::gNormalizeDeg(), mPanLower, and mPanUpper. Referenced by RestrictedVisionPerceptor(). Here is the call graph for this function: ![]() |
|
Set the view angles.
Definition at line 124 of file restrictedvisionperceptor.cpp. References gClampAngleDeg(), salt::gNormalizeDeg(), mPan, mPanLower, mPanUpper, mTilt, mTiltLower, and mTiltUpper. Referenced by ChangePanTilt(), and RestrictedVisionPerceptor(). Here is the call graph for this function: ![]() |
|
Turn sensing of agent position on/off.
Definition at line 511 of file restrictedvisionperceptor.cpp. References mSenseMyPos. |
|
Turn senses relative to the X-axis of the team off/on.
Definition at line 176 of file restrictedvisionperceptor.cpp. References mStaticSenseAxis. |
|
Set the tilt range. Contrary to the pan range, it makes much sense to restrict the tilt range. However, a range of 360 degrees (e.g. from -180 to 180) means no restriction.
Definition at line 99 of file restrictedvisionperceptor.cpp. References salt::gNormalizeDeg(), mTiltLower, and mTiltUpper. Referenced by RestrictedVisionPerceptor(). Here is the call graph for this function: ![]() |
|
prepares a list of visible objects
Definition at line 197 of file restrictedvisionperceptor.cpp. References zeitgeist::Node::begin(), zeitgeist::Node::end(), zeitgeist::Object::GetLog(), salt::TVector< DATATYPE, ELEMENTS, TYPE >::Length(), mActiveScene, RestrictedVisionPerceptor::ObjectData::mDist, RestrictedVisionPerceptor::ObjectData::mObj, RestrictedVisionPerceptor::ObjectData::mRelPos, and mTransformParent. Referenced by DynamicAxisPercept(), and StaticAxisPercept(). Here is the call graph for this function: ![]() |
|
Set the visible area of the perceptor.
Definition at line 77 of file restrictedvisionperceptor.cpp. References mHViewCone, and mVViewCone. Referenced by RestrictedVisionPerceptor(). |
|
Percept implementation for a static relative axis.
Definition at line 273 of file restrictedvisionperceptor.cpp. References zeitgeist::ParameterList::AddList(), AddSense(), zeitgeist::ParameterList::AddValue(), ApplyNoise(), CheckOcclusion(), zeitgeist::ParameterList::Clear(), SoccerBase::FlipView(), salt::gAbs(), salt::gArcCos(), salt::gArcTan2(), GetPan(), GetTilt(), salt::gNormalizeDeg(), salt::gRadToDeg(), salt::TVector< DATATYPE, ELEMENTS, TYPE >::Length(), mAddNoise, mAgentState, RestrictedVisionPerceptor::ObjectData::mDist, mError, mHViewCone, RestrictedVisionPerceptor::ObjectData::mPhi, oxygen::Perceptor::mPredicateName, RestrictedVisionPerceptor::ObjectData::mRelPos, mSenseMyPos, RestrictedVisionPerceptor::ObjectData::mTheta, mTransformParent, mVViewCone, oxygen::Predicate::name, oxygen::Predicate::parameter, and SetupVisibleObjects(). Referenced by Percept(). Here is the call graph for this function: ![]() |
|
Definition at line 223 of file restrictedvisionperceptor.h. Referenced by OnLink(), OnUnlink(), Percept(), and SetupVisibleObjects(). |
|
flag if we should noisify the data
Definition at line 189 of file restrictedvisionperceptor.h. Referenced by AddNoise(), ApplyNoise(), DynamicAxisPercept(), and StaticAxisPercept(). |
|
a reference to the agent state
Definition at line 229 of file restrictedvisionperceptor.h. Referenced by DynamicAxisPercept(), OnLink(), OnUnlink(), Percept(), and StaticAxisPercept(). |
|
absolute maximum value of the calibration error
Definition at line 187 of file restrictedvisionperceptor.h. Referenced by SetNoiseParams(). |
|
random number generator for distance errors
Definition at line 217 of file restrictedvisionperceptor.h. Referenced by ApplyNoise(), OnUnlink(), SetNoiseParams(), and ~RestrictedVisionPerceptor(). |
|
vision calibration error
Definition at line 175 of file restrictedvisionperceptor.h. Referenced by DynamicAxisPercept(), SetNoiseParams(), and StaticAxisPercept(). |
|
horizontal opening of the vision cone
Definition at line 197 of file restrictedvisionperceptor.h. Referenced by DynamicAxisPercept(), SetViewCones(), and StaticAxisPercept(). |
|
horizontal view direction in degrees
Definition at line 201 of file restrictedvisionperceptor.h. Referenced by ChangePanTilt(), GetPan(), and SetPanTilt(). |
|
the lower bound for the horizontal view direction in degrees
Definition at line 203 of file restrictedvisionperceptor.h. Referenced by SetPanRange(), and SetPanTilt(). |
|
the upper bound for the horizontal view direction in degrees
Definition at line 205 of file restrictedvisionperceptor.h. Referenced by SetPanRange(), and SetPanTilt(). |
|
random number generator for angle errors
Definition at line 221 of file restrictedvisionperceptor.h. Referenced by ApplyNoise(), OnUnlink(), SetNoiseParams(), and ~RestrictedVisionPerceptor(). |
|
ray collider to check occlusion
Definition at line 214 of file restrictedvisionperceptor.h. Referenced by ConstructInternal(). |
|
a reference to the scene server
Definition at line 227 of file restrictedvisionperceptor.h. |
|
true, if the absolute position of the agent is sensed.
Definition at line 178 of file restrictedvisionperceptor.h. Referenced by DynamicAxisPercept(), SetSenseMyPos(), and StaticAxisPercept(). |
|
sigma for random measurement error (distance)
Definition at line 181 of file restrictedvisionperceptor.h. Referenced by SetNoiseParams(). |
|
sigma for random measurement error (latitudal angle)
Definition at line 185 of file restrictedvisionperceptor.h. Referenced by SetNoiseParams(). |
|
sigma for random measurement error (horizontal angle)
Definition at line 183 of file restrictedvisionperceptor.h. Referenced by SetNoiseParams(). |
|
flag if the senses are always relative to the X-axis of the team, default true
Definition at line 194 of file restrictedvisionperceptor.h. Referenced by Percept(), and SetStaticSenseAxis(). |
|
random number generator for angle errors
Definition at line 219 of file restrictedvisionperceptor.h. Referenced by ApplyNoise(), OnUnlink(), SetNoiseParams(), and ~RestrictedVisionPerceptor(). |
|
vertical view direction in degrees
Definition at line 207 of file restrictedvisionperceptor.h. Referenced by ChangePanTilt(), GetTilt(), and SetPanTilt(). |
|
the lower bound for the vertical view direction in degrees
Definition at line 209 of file restrictedvisionperceptor.h. Referenced by SetPanTilt(), and SetTiltRange(). |
|
the upper bound for the vertical view direction in degrees
Definition at line 211 of file restrictedvisionperceptor.h. Referenced by SetPanTilt(), and SetTiltRange(). |
|
a reference to the next transorm parent
Definition at line 225 of file restrictedvisionperceptor.h. Referenced by DynamicAxisPercept(), OnLink(), OnUnlink(), Percept(), SetupVisibleObjects(), and StaticAxisPercept(). |
|
vertical opening of the vision cone
Definition at line 199 of file restrictedvisionperceptor.h. Referenced by DynamicAxisPercept(), SetViewCones(), and StaticAxisPercept(). |