Skip to content

Commit

Permalink
Fix setting internal state in game controller state filter
Browse files Browse the repository at this point in the history
Co-authored-by: LisaSchulz97 <[email protected]>
  • Loading branch information
knoellle and LisaSchulz97 committed Feb 14, 2024
1 parent f2cc05d commit b8ff072
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions crates/control/src/game_controller_state_filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ impl GameControllerStateFilter {
context.game_controller_state,
context.filtered_whistle,
context.cycle_time,
self.state,
self.opponent_state,
&mut self.state,
&mut self.opponent_state,
);
let filtered_game_controller_state = FilteredGameControllerState {
game_state: game_states.own,
Expand Down Expand Up @@ -93,25 +93,25 @@ fn filter_game_states(
game_controller_state: &GameControllerState,
filtered_whistle: &FilteredWhistle,
cycle_time: &CycleTime,
state: State,
opponent_state: State,
state: &mut State,
opponent_state: &mut State,
) -> FilteredGameStates {
let ball_detected_far_from_any_goal = ball_detected_far_from_any_goal(
robot_to_field,
ball_position,
field_dimensions,
config.whistle_acceptance_goal_distance,
);
let state = next_filtered_state(
state,
*state = next_filtered_state(
*state,
game_controller_state,
filtered_whistle.is_detected,
cycle_time.start_time,
config,
ball_detected_far_from_any_goal,
);
let opponent_state = next_filtered_state(
opponent_state,
*opponent_state = next_filtered_state(
*opponent_state,
game_controller_state,
filtered_whistle.is_detected,
cycle_time.start_time,
Expand Down

0 comments on commit b8ff072

Please sign in to comment.