-
Notifications
You must be signed in to change notification settings - Fork 56
add ball reidentification #1788
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: main
Are you sure you want to change the base?
Conversation
crates/ball_filter/src/hypothesis.rs
Outdated
pub fn identifier(&self) -> u64 { | ||
self.identifier | ||
} | ||
|
||
pub fn set_identifier(&mut self, identifier: u64) { | ||
self.identifier = identifier; | ||
} | ||
|
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.
if you have public getter and setter, why not make the member public in the first place?
pub fn set_last_output_identifier(&mut self, identifier: Option<u64>) { | ||
self.last_output_hypothesis_identifier = identifier; | ||
} | ||
|
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.
same here? why have a setter?
crates/ball_filter/src/lib.rs
Outdated
pub fn best_hypothesis(&self, validity_threshold: f32) -> Option<&BallHypothesis> { | ||
self.hypotheses | ||
.iter() | ||
.filter(|hypothesis| hypothesis.validity >= validity_threshold) | ||
.max_by(|a, b| a.validity.partial_cmp(&b.validity).unwrap()) | ||
} | ||
|
||
pub fn last_output_hypothesis_if_available(&self) -> Option<&BallHypothesis> { |
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.
pub fn last_output_hypothesis_if_available(&self) -> Option<&BallHypothesis> { | |
pub fn last_output_hypothesis(&self) -> Option<&BallHypothesis> { |
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.
done
crates/control/src/ball_filter.rs
Outdated
@@ -187,7 +191,17 @@ impl BallFilter { | |||
.expect("time ran backwards"); | |||
let validity_high_enough = | |||
hypothesis.validity >= filter_parameters.validity_discard_threshold; | |||
let ball_kicked = matches!(walking_engine_mode, Mode::Kicking(_)); | |||
|
|||
let ball_kicked = matches!( |
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.
let ball_kicked = matches!( | |
let ball_kicked_with_side_kick = matches!( |
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.
done
2a04dd7
to
6449d03
Compare
Why? What?
Adds ball reidentification to the ball filter.
Also disables removing ball hypotheses in kicks (except side)
Fixes #
ToDo / Known Issues
If this is a WIP describe which problems are to be fixed.
Ideas for Next Iterations (Not This PR)
If there are some improvements that could be done in a next iteration, describe them here.
How to Test
Describe how to test your changes. (For the reviewer)