Abstract base class for locust models of different types. More...
#include <Robots/LoBot/lgmd/LocustModel.H>
Classes | |
struct | InitParams |
Public Member Functions | |
range< float > | get_range () const |
float | direction () const |
Retrieve the direction along which this locust is setup to look. | |
const Rectangle & | get_rect () const |
range< int > | get_lrf_range () const |
float | distance () const |
float | tti () const |
virtual void | update ()=0 |
virtual | ~LocustModel () |
Clean-up. | |
float | get_lgmd () const |
Methods to return the cached result of the LGMD computations. | |
float | value () const |
Protected Member Functions | |
void | adjust_range (const range< float > &r) |
LocustModel (const InitParams &) | |
void | update_lgmd (float lgmd) |
Protected Attributes | |
const InputSource * | m_source |
float | m_direction |
Rectangle | m_rect |
range< int > | m_lrf_range |
float | m_distance |
float | m_tti |
Abstract base class for locust models of different types.
This class acts as an abstract base for all the different locust/LGMD models supported by Lobot/Robolocust. Since it is an abstract class, it cannot be instantiated. However, its descendants are meant to be instantiated using the generic factory<LocustModel> defined in factory.hh.
Definition at line 79 of file LocustModel.H.
lobot::LocustModel::LocustModel | ( | const InitParams & | p | ) | [protected] |
A protected constructor because locust models are usually instantiated via a factory and config file setting. During initialization, derived class instances should pass in suitable values for the various initialization parameters using an InitParams structure.
Definition at line 68 of file LocustModel.C.
lobot::LocustModel::~LocustModel | ( | ) | [virtual] |
Clean-up.
Definition at line 182 of file LocustModel.C.
void lobot::LocustModel::adjust_range | ( | const range< float > & | r | ) | [inline, protected] |
This method allows derived classes to implement something other than a fixed range for the LGMD values they compute. Usually, they will call this method as part of their update cycle.
Definition at line 101 of file LocustModel.H.
float lobot::LocustModel::direction | ( | ) | const [inline] |
Retrieve the direction along which this locust is setup to look.
Definition at line 150 of file LocustModel.H.
References m_direction.
Referenced by lobot::LocustViz::LocustViz().
float lobot::LocustModel::distance | ( | ) | const [inline] |
This method returns the current distance in this locust's FOV as reported by the laser range finder.
Definition at line 163 of file LocustModel.H.
References m_distance.
Referenced by lobot::TTIEstimator::copy_lgmd().
float lobot::LocustModel::get_lgmd | ( | ) | const [inline] |
Methods to return the cached result of the LGMD computations.
Definition at line 140 of file LocustModel.H.
Referenced by lobot::TTIEstimator::copy_lgmd().
range<int> lobot::LocustModel::get_lrf_range | ( | ) | const [inline] |
This method returns the LRF angular range that specifies a locust's FOV when an LRF (rather than a camera) is the input source.
Definition at line 159 of file LocustModel.H.
References m_lrf_range.
range<float> lobot::LocustModel::get_range | ( | ) | const [inline] |
This method returns the minimum and maximum possible values of the LGMD measure this model can compute. This range is useful for normalization and other scaling operations.
Definition at line 147 of file LocustModel.H.
const Rectangle& lobot::LocustModel::get_rect | ( | ) | const [inline] |
This method returns the subportion of the input image that the this particular locust is "monitoring."
Definition at line 154 of file LocustModel.H.
References m_rect.
float lobot::LocustModel::tti | ( | ) | const [inline] |
This method returns the current time-to-impact computed by the LGMD model.
Definition at line 167 of file LocustModel.H.
References m_tti.
Referenced by lobot::TTIEstimator::copy_lgmd().
virtual void lobot::LocustModel::update | ( | ) | [pure virtual] |
This method triggers the LGMD computations that are to be performed by the locust model and caches the result internally.
Referenced by lobot::App::run().
void lobot::LocustModel::update_lgmd | ( | float | lgmd | ) | [inline, protected] |
Once a derived class has computed a suitable value for the LGMD measure, it should call this method to store that value for later retrieval by other parts of the Lobot/Robolocust framework.
Definition at line 200 of file LocustModel.H.
float lobot::LocustModel::m_direction [protected] |
Each locust will be setup to look in a particular direction. Zero degrees corresponds to looking straight ahead. Positive angles are for the left and negative angles for locusts looking to the right. The direction angles are specified in degrees.
Definition at line 113 of file LocustModel.H.
Referenced by direction().
float lobot::LocustModel::m_distance [protected] |
If the input source is a laser range finder, then each locust can (if required) keep track of the distance to approaching obstacles in its field of view. This can be useful, for instance, to gauge how well a particual model works w.r.t. ground truth.
Definition at line 131 of file LocustModel.H.
Referenced by distance().
range<int> lobot::LocustModel::m_lrf_range [protected] |
In case the locust model is set up to read its input from a laser range finder rather than a video frame source, we use a range of angles for the distance measurements instead of a rectangular subregion of an input image.
Definition at line 125 of file LocustModel.H.
Referenced by get_lrf_range().
Rectangle lobot::LocustModel::m_rect [protected] |
When working with vision as the primary sensing modality, each locust model will usually read only a subportion of the input image so as to allow simulation of multiple locusts with limited FOVs.
Definition at line 119 of file LocustModel.H.
Referenced by get_rect().
const InputSource* lobot::LocustModel::m_source [protected] |
Each instance of a locust model must have some input image source. Usually, this will be the compositor that reads the current frames from all the video streams and then stitches them together to create a crude sort of panaromic image.
Definition at line 107 of file LocustModel.H.
float lobot::LocustModel::m_tti [protected] |
In addition to computing an LGMD spike rate, some locust models might also work with a time-to-impact value.
Definition at line 135 of file LocustModel.H.
Referenced by tti().