| Tekkotsu Homepage | Demos | Overview | Downloads | Dev. Resources | Reference | Credits |
HolonomicMotionModel< ParticleT > Class Template Reference#include <HolonomicMotionModel.h>
Inheritance diagram for HolonomicMotionModel< ParticleT >: ![]() Detailed Descriptiontemplate<typename ParticleT>
This class can model the path of a holonomic robot in two dimensions (x and y).
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Illustration of the equations used. Constant angular and linear velocities result in a circular arc as shown. The radius of the arc is directly determined by the ratio of the linear speed to the angular speed. The final position after time will be $@ $ along a bearing , where is the angle which has been turned during the interval of interest. |
You can call setPosition() to initialize the starting location or if the robot has been moved by some external means. You should call setVelocity() whenever the robot's velocity changes. The class will internally store the position and time at which the velocity change happened so that later calls to getPosition() will return points along the new path.
This class can be used as a motion model in the ParticleFilter class, or independently if desired for general purpose motion estimation. (see the standalone computeHolonomicMotion())
However, if you are looking for a motion model for ParticleFiltering, it may be more convenient to use DeadReckoningBehavior (found in Behaviors/Services) because you can start the behavior and it will subscribe to automatically receive LocomotionEvents from then on. If using HolonomicMotionModel directly with the particle filter, you would need to call setVelocity() yourself anytime the robot changes direction.
Variance parameters only come into play with updateMotion(), which is called on collections of particles. The other functions all return "ideal" motion calculations. Be aware that when using in a particle filter, the position is reset on particle updates (updateMotion()). In other words, the position returned by motion model is the offset achieved since the last particle update, not the position relative to world's origin, nor any other fixed point.
Caveat: acceleration is not handled by this model. That would be a nice addition...
Definition at line 54 of file HolonomicMotionModel.h.
Public Types | |
|
typedef ParticleFilter< ParticleT >::MotionModel::particle_collection | particle_collection |
| the collection type we'll be using to store the particles | |
Public Member Functions | |
| HolonomicMotionModel () | |
| constructor, with default noise parameters (xvar=yvar=50, avar=0.15f) | |
| HolonomicMotionModel (float xVariance, float yVariance, float aVariance) | |
| constructor, with noise parameters (pass 0's to make it an "ideal" motion model) | |
| virtual void | updateMotion (particle_collection &particles) |
| called by the particle filter when the current position of each particle should be updated | |
| void | getPosition (float &outx, float &outy, float &outa) const |
| stores the current position into the arguments (based on get_time() vs the time the position was last set) | |
| void | getPosition (float &outx, float &outy, float &outa, unsigned int curtime) const |
| stores the current position into the arguments (based on curtime vs the time the position was last set) | |
| void | setPosition (float x, float y, float angle) |
| sets the current position to the specified values and updates the timestamp to the current time | |
| void | setPosition (float x, float y, float angle, unsigned int curtime) |
| sets the current position to the specified values and updates the timestamp to the specified time | |
| void | getVelocity (float &outxv, float &outyv, float &outav) const |
| stores the current velocity into the arguments (no noise is added, this just echos the values passed to setVelocity()) | |
| void | setVelocity (float xv, float yv, float av) |
| sets the current velocity to the specified values and updates the position and timestamp to the current time | |
| void | setVelocity (float xv, float yv, float av, unsigned int curtime) |
| sets the current velocity to the specified values and updates the position and timestamp to the specified time | |
| void | setVariance (float xv, float yv, float av) |
| allows you to change the variance parameters (xvar, yvar, avar) | |
| void | setCrossVariance (float axis, float angle) |
| allows you to change the cross-variance parameters (crossAxis, crossAngle) | |
| float | getXVariance () const |
| accessor for xvar | |
| float | getYVariance () const |
| accessor for yvar | |
| float | getAVariance () const |
| accessor for avar | |
| float | getAxisCrossVariance () const |
| accessor for crossAxis | |
| float | getAngleCrossVariance () const |
| accessor for crossAngle | |
Protected Attributes | |
| float | xvel |
| current x velocity | |
| float | yvel |
| current y velocity | |
| float | avel |
| current angular velocity | |
| unsigned int | prevtime |
| time (in milliseconds) that the position was last set | |
| float | posx |
| x position at which prevtime was set | |
| float | posy |
| y position at which prevtime was set | |
| float | posa |
| orientation at which prevtime was set | |
| float | xvar |
| variance of x velocities as ratio of x speed, used when updating particle list (updateMotion()) | |
| float | yvar |
| variance of y velocities as ratio of y speed, used when updating particle list (updateMotion()) | |
| float | avar |
| variance of angular velocities as ratio of angular speed, used when updating particle list (updateMotion()) | |
| float | crossAxis |
| cross variance of x speed on y speed and vice versa | |
| float | crossAngle |
| cross variance of x,y speed on angular speed | |
| HolonomicMotionModel< ParticleT >::HolonomicMotionModel | ( | float | xVariance, | |
| float | yVariance, | |||
| float | aVariance | |||
| ) | [inline] |
constructor, with noise parameters (pass 0's to make it an "ideal" motion model)
Variance parameters only come into play with updateMotion(), which is called on collections of particles. The other functions all return "ideal" motion calculations.
Definition at line 67 of file HolonomicMotionModel.h.
| virtual void HolonomicMotionModel< ParticleT >::updateMotion | ( | particle_collection & | particles | ) | [inline, virtual] |
called by the particle filter when the current position of each particle should be updated
This will reset the motion model to set the origin at the current location after the particles are updated, so that the next call to updateMotion() will supply the particles with the displacement which occurred since the last update
Definition at line 77 of file HolonomicMotionModel.h.
|
Tekkotsu v3.0 |
Generated Fri May 11 20:08:13 2007 by Doxygen 1.4.7 |