Skip to content
Alex Baucom edited this page Mar 20, 2017 · 10 revisions

To maintain robot localization during the game, we employ a particle filter. This particle filter has two main components, a prediction step and an update step. The particle filter maintains a large number of particles (200 at the time of writing) which are each an estimate of the robot's position and orientation on the field. Each of these particles also has an associated weight to it which represents how much the filter trusts that particular particle.

In the prediction step, each of these particles are moved according to the odometry reported by the locomotion system. In addition to the odometry, artificial noise is added to the particles as well so that they spread out and capture uncertainty in the odometry estimate.

When landmarks are detected by the vision system (i.e. lines, corners, center circle, etc.), an update step is performed on the filter. This update step uses information about where the robot is relative to the landmark (which the vision system estimates) and adjusts the position, orientation, and weighting of each particle. If too many particles end up with very low weights, a resample step is performed which removes very low weighted particles and adds in new particles to areas of higher weight.

Some other notes about the localization system:

  • The Nao's gyroscope is also used to update the yaw angles. Due to noise and inaccuracy in the gyroscope measurements, the particle filter keeps track of the yaw error and uses this, along with the gyroscope, to compute the estimated yaw angle.
  • Initialization of the particles is very important. If the particles are initialized well, the filter will track the robot very accurately, but if they are not initialized well, the filter will not work. There are functions designed to handle every different initialization that the robots will encounter - starting from the sidelines, manual placement, returning from penalty, etc.
  • Since the field is symmetrical, it is very important to make sure the robot does not get too much error in the yaw direction, otherwise it can sometimes get flipped. With the gyroscope measurements, this should be much less of a problem now, but it is still a possible issue.
  • The robot does not use the goalposts for localization anymore. This used to be implemented but it was causing too many problems due to false detection once the rules changed to make the goalposts white so it was removed.
  • For more specific details about the code and tuning the localization system, please see Testing and Debugging Localization
Clone this wiki locally