Skip to content
heuristicus edited this page Aug 31, 2011 · 2 revisions

Summary

Used to store representations of particles. Each particle at minimum requires a map, location and heading for initialisation, but weights for the angle and location can also be passed as initialisation parameters.

Information

set_heading

When the heading of the particle is set, the angle of the start of the sonar scan will be set based on the assumption that half the scan will be on one side of the heading, and half on the other. For example When the heading is 0 degrees, the scan will start at -135 degrees and end at 135 degrees if the scan range is 270 degrees.

get_ranges

Gets the ranges at the current location of the particle. This will take a scan every x degrees, where x is the sonar step provided in the launch file.

This method is very expensive, and will use most of the computation time of the program due to the need of calculating a large number of intersection points. The smaller the step, the longer this will take. Also, the more lines there are in the map that you are using, this will also be slower.

move

Moves the particle along a vector to face a certain angle. The vector is rotated by some angle to represent the noise that the heading is likely to experience when moving around. Noise is then applied to the end point of the line representing one step along the vector, and this is set to the location of the particle. The particle's heading is then set to the angle provided, and the noise that was applied to the angle of the vector is added to this.

copy

Copies a particle. Used by the localiser when resampling.