Class BeaconPoseProvider

  • All Implemented Interfaces:
    PoseProvider, MoveListener

    public class BeaconPoseProvider
    extends java.lang.Object
    implements PoseProvider, MoveListener

    A PoseProvider that uses beacon triangulation to pinpoint the pose (x, y, heading) of a robot. The starting position of the robot must be such that it roughly points in the direction of beacon 2, with beacon 1 to the right of the robot, and beacon 3 to the left. This ensures that when it performs the first scan, the beacons are scanned in order 1, 2, 3. After the first scan, the robot can move about on its own and will be able to scan them in any order.

    After it does a scan, you will either hear a beep or a buzz. A beep means the calculation worked. A buzz means something went wrong with the calculation. This could be the beacon ordering is wrong, or it didn't scan three beacons in, or the calculated beacon pose deviated significantly from the estimated odometry pose. In this case, the results are thrown out, the odometry pose is used, and it will try another scan after the next move. If you hear a lot of buzzes in a row, it probably means it will not recover.

    The class uses an OdometryPoseProvider internally for three reasons:

  • 1. To serve as a backup pose provider if the BeaconLocator detects less than 3 beacons, or greater than 3 (meaning a false reflection occurred).
  • 2. It is time consuming to scan beacons after every move. Instead, this will scan about every 5 moves. In between these scans, it uses the OdometryPoseProvider to navigate.
  • 3. It is essential to scan the beacons in order. This allows it to determine the identity of each beacon so they are properly fed to the equations. The OdometryPoseProvider keeps track of heading so it knows which beacons were scanned.

    The downside of using an OdometryPoseProvider to assist with detecting pose is that the robot needs to be placed with an approximate heading prior to first scan. Also, if the robot is moved at any time (lifted and placed with a different heading), it probably will no longer be able to identify the beacons and become hopelessly lost. As long as the wheels are always on the ground, this should not happen.

Author:
BB