Skip to content

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

oleflb
Copy link
Contributor

@oleflb oleflb commented Mar 15, 2025

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)

@github-project-automation github-project-automation bot moved this to Request for Review in Development Mar 15, 2025
Comment on lines 51 to 58
pub fn identifier(&self) -> u64 {
self.identifier
}

pub fn set_identifier(&mut self, identifier: u64) {
self.identifier = identifier;
}

Copy link
Member

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?

Comment on lines +26 to +29
pub fn set_last_output_identifier(&mut self, identifier: Option<u64>) {
self.last_output_hypothesis_identifier = identifier;
}

Copy link
Member

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?

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> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pub fn last_output_hypothesis_if_available(&self) -> Option<&BallHypothesis> {
pub fn last_output_hypothesis(&self) -> Option<&BallHypothesis> {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -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!(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let ball_kicked = matches!(
let ball_kicked_with_side_kick = matches!(

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@schmidma schmidma self-assigned this Mar 25, 2025
@oleflb oleflb force-pushed the ball-filter-save-last-mode branch from 2a04dd7 to 6449d03 Compare March 26, 2025 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Request for Review
Development

Successfully merging this pull request may close these issues.

2 participants