Broken or misaligned breakbeams should not produce incorrect ball position in SensorFusion
A problem that we had in Robocup last year was that our breakbeams would fault in a tripped state (i.e. they would say that we have a ball when we actually don't). Our sensor fusion code assumed that since we had the ball in our dribbler, the ball must be near our robot even if the camera data says we are somewhere else. This led to situations where we would think we had the ball on one side of the field while the enemy team had an open shot on net.
We want to solve this problem by making sensor_fusion (which is in charge of creating the World object that the rest of our AI depends on) more robust.
If we get a breakbeam tripped message from the robot and the camera data says that the ball is more than a X threshold away from the actual robot, we're going to rely on camera data instead. Relevant code: https://github.com/UBC-Thunderbots/Software/blob/1528173facd4b72d7fd4265e99da5ca9e26b1e3d/src/software/sensor_fusion/sensor_fusion.cpp#L253
Checklist:
- [ ] Write a unit test for a stray ball detection and tripped robot using mocked
RobotStatusprotos insensor_fusion_test.cpp - [ ] Modify
sensor_fusion.cppto create aWorldusing camera data if any robot's breakbeam is tripped but the robot is far away from where the camera thinks the ball is
related ticket #3182