Odometry Movement

Hey,
I recently created an Odometry tracking system which gives coordinates of where the robot is during any point in autonomous. For the next step, I was wondering if anyone knew how to make a robot turn to a given coordinate i.e start at [0, 0] and then turn to [5, 8]. Would I make a PID system that uses the x coordinate, the y coordinate, or a mixture of both for its desired and data values? Or would I need to create more points between the starting and desired points?

You would sum the output of two PID controllers running in parallel. One that controls the heading and another that controls the linear movement. You use the arctan trig function to calculate the angle needed to face the desired point and pythagorean theorem to get the distance between the current point and target point.

These two parameters are the target values that you input into the PID controllers and then send the output to the motors.

The logic for summing 2 PID controllers is better laid out here

5 Likes