How can I align the angle between points with the magnetic heading as the points move?

103 Views Asked by At

I have 3 robots which must track a point. The distance between all the robots and the point is known so a triangle can be formed between any 2 robots and the point.

If I find the angles in the triangle between Robot A, Robot B and the point as shown in my bad quality drawing below I can find an angle for Robot A to move along "towards" the point relative to Robot B.

I want to align Robot B on the triangle with magnetic north so that angle A becomes the magnetic heading towards the point from Robot A.

I think if I initially have Robot A move along using angle A as a magnetic heading the change in angle at the point will indicate how correct or incorrect the heading is.

Measuring this angle at constant intervals as the robot moves I plan to:

  • Rotate the robot to a new heading (add or subtract 20 degrees from the heading)
  • Observe how the angle at the point changes with the change in heading, if it increases change the direction of rotation, if it decreases continue rotating that direction until it begins to increase again

The biggest potential problem I can see with this method is Robot B's movement affecting the angle change.

Is there a better way to perform this calculation for quicker convergence on the correct heading?