Behind the Scenes
What happens behind the scenes when calling .update()!
When you call the .update()
method on a ThreeSensorLocalization object, many processes run in the background. The process follows this flow:
Check each sensor to see if they are within the
sensorDistanceSafety
valueThis identifies which sensor to use, and which ones not to use
Find the closest 'Cardinal Angle' (0°, 90°, 180°, 270°) of the sensor's theta + robot theta
Based on the cardinal angle, assign whether the sensor calculates the X position or the Y position.
Check the number of sensors that are active:
1-2 active sensors: If the sensor calculates for X, add the sensor's horizontal component to a x position list. If the sensor calculates for Y, add the sensor's vertical component to a y position list.
3 active sensors: run the corner case condition.
Assign the average of each list to their corresponding position in Pose Estimate.
Here is a simple flow chart showing this entire process!
Last updated