Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Positioner

The Positioner class is the main class for the position tracking system. It is used to calculate the position of the robot using the tracking wheels. It also has functions to set the position of the robot and to get the position of the robot.

Inner Workings

This class combines data from Tracking Wheels and an inertial sensor to calculate the position of the robot. It uses the Positioner::update() function to update the position of the robot. This function is called every 10 milliseconds, so the position of the robot is updated every 10 milliseconds. All the math for this is obtained from the Odometry paper.

Basically, odometry boils down to estimating each individual robot movement as an arc, then calculating the change in positione of the robot from this arc.

Usage

All the user has to do is declare a Positioner, then make a thread that updates the positioner every 10 ms

Positioner p = Positioner(...);

void updatePos(){
    while(1){
        p.update();
        task::sleep(10);
    }
}
int main(){
    thread updatePosition = thread(updatePos);
}

Table of contents