contains functions for tracking the position of the sub using particle filter technic More...
#include <src/Robots/SeaBeeIII/Localization.H>
Public Member Functions | |
Localization (OptionManager &mgr, const std::string &descrName="Localization", const std::string &tagName="Localization") | |
~Localization () | |
virtual void | evolve () |
virtual void | updateMessage (const RobotSimEvents::EventMessagePtr &eMsg, const Ice::Current &) |
Get a message. | |
virtual void | registerTopics () |
void | initPoints (const short int) |
float | getNormalizer () |
float | rand_N () |
void | predict (RobotSimEvents::OrientationMessagePtr) |
void | update (RobotSimEvents::ObstacleMessagePtr) |
void | resample (int no=0) |
class pParticle & | getCurrentEstimate () |
contains functions for tracking the position of the sub using particle filter technic
Definition at line 78 of file Localization.H.
Localization::Localization | ( | OptionManager & | mgr, | |
const std::string & | descrName = "Localization" , |
|||
const std::string & | tagName = "Localization" | |||
) |
LocaLization Constructor function Initializes the Localization class
Definition at line 13 of file Localization.C.
References ModelComponent::addSubComponent(), initPoints(), and ZEROS.
Localization::~Localization | ( | ) |
~Localization() Destructor for the Localization class. Returns the total probability of all the particles
Definition at line 300 of file Localization.C.
void Localization::evolve | ( | ) | [virtual] |
class pParticle & Localization::getCurrentEstimate | ( | ) |
getCurrentEstimate Return the current estimate
Definition at line 266 of file Localization.C.
Referenced by predict().
float Localization::getNormalizer | ( | ) |
getNormalizer Returns the total probability of all the particles
Definition at line 70 of file Localization.C.
References Image< T >::setVal().
Referenced by resample().
void Localization::initPoints | ( | const short int | no = 1000 |
) |
initPoints initialize the points in the image
Definition at line 51 of file Localization.C.
Referenced by Localization().
void Localization::predict | ( | RobotSimEvents::OrientationMessagePtr | oMsg | ) |
predict predict the new position based on the updates received from the compass
First erase the current position of the point
Definition at line 129 of file Localization.C.
References distance(), getCurrentEstimate(), Point2D< T >::i, Image< T >::setVal(), SRC_POS, and ZEROS.
Referenced by updateMessage().
void Localization::registerTopics | ( | ) | [virtual] |
registerTopics For registering the messages that we want to listen to and publish
Reimplemented from RobotBrainComponent.
Definition at line 37 of file Localization.C.
References RobotBrainComponent::registerSubscription().
void Localization::resample | ( | int | no = 0 |
) |
resample the population and remove the unrelevant particles
Definition at line 225 of file Localization.C.
References getNormalizer(), mean(), and sqrt().
Referenced by updateMessage().
void Localization::update | ( | RobotSimEvents::ObstacleMessagePtr | oMsg | ) |
update update the position stats according to the obstacle position
Definition at line 210 of file Localization.C.
References Point2D< T >::i.
Referenced by updateMessage().
void Localization::updateMessage | ( | const RobotSimEvents::EventMessagePtr & | eMsg, | |
const Ice::Current & | ||||
) | [virtual] |
Get a message.
updateMessage Returns the total probability of all the particles
Reimplemented from RobotBrainComponent.
Definition at line 97 of file Localization.C.
References predict(), resample(), and update().