-
Notifications
You must be signed in to change notification settings - Fork 123
Fix ball filter linear regression relative error bug #3538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Fix ball filter linear regression relative error bug #3538
Conversation
GrayHoang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch!
Andrewyx
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense to me, but can you update ball_filter.h to include the fact it returns the value of the error itself now? Additionally, if possible, it would be helpful to note if that value is in terms of the MSE just so that future reference to this function is clearer as to how the regression error is being generated. Otherwise, nice work!
StarrryNight
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
…into avah/inaccurate_ball_velocity
ed13e36 to
f2df892
Compare
|
Note: I think that this change actually causes the pass_defender_tactic test to fail for some reason. I'll look into it and fix it |
ef45393
|
The issue with the failing pass defender tactic test was that the ball for this specific test goes out of bounds and bounces off the wall. With the original ball filter code, the velocity of the ball is not calculated properly right after a bounce (probably since the original code divided error by x position of ball which is 0), so it doesn't trigger the ballKicked function used in pass defender's passStarted guard. However, after the changes in this PR, the ball filter code notices the change in direction almost immediately, so it does register as a kick, meaning the robot tries to intercept the ball and fail the test. I just added an if statement to check if the ball is in the playing area 2026-01-19_215844.mp4 |
StarrryNight
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good work
Description
Fixes bug where ball velocity is inaccurately being calculated/estimated. The bug is caused by the following logic:
The simple fix is just to use absolute error, since relative error for linear regression in this context of coordinates makes no sense, since we expect similar error for the estimated trajectory of the ball no matter where it is on the field.
Testing Done
Ran tests for ball_filter and passes. Also ran the original test that caused this bug and it is fixed (proper velocity being reported)
Resolved Issues
fixes #3527
Review Checklist
It is the reviewers responsibility to also make sure every item here has been covered
.hfile) should have a javadoc style comment at the start of them. For examples, see the functions defined inthunderbots/software/geom. Similarly, all classes should have an associated Javadoc comment explaining the purpose of the class.TODO(or similar) statements should either be completed or associated with a github issue