Skip to content

Commit

Permalink
delet timer_start
Browse files Browse the repository at this point in the history
  • Loading branch information
phillip kammradt authored and schluis committed Dec 4, 2024
1 parent b3bc3d0 commit 2c7f3a5
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions crates/control/src/behavior/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ pub struct Behavior {
active_since: Option<SystemTime>,
previous_role: Role,
unprecise_threshold_start_time: Option<SystemTime>,
timer_started: bool,
}

#[context]
Expand Down Expand Up @@ -102,7 +101,6 @@ impl Behavior {
active_since: None,
previous_role: Role::Searcher,
unprecise_threshold_start_time: None,
timer_started: false,
})
}

Expand Down Expand Up @@ -308,19 +306,18 @@ impl Behavior {
match (
available_unprecise_kicks,
available_precise_kicks,
self.timer_started,
self.unprecise_threshold_start_time.is_none(),
) {
(Some(available_unprecise_kicks), None, false) => {
(Some(available_unprecise_kicks), None, true) => {
if is_kick_pose_reached(
available_unprecise_kicks.kick_pose,
context.in_walk_kicks[available_unprecise_kicks.variant].reached_thresholds,
world_state.robot.ground_to_upcoming_support,
) {
self.unprecise_threshold_start_time = Some(context.cycle_time.start_time);
self.timer_started = true;
}
}
(_, Some(_), true) => {
(_, Some(_), false) => {
self.unprecise_threshold_start_time = Some(context.cycle_time.start_time);
}
_ => {}
Expand Down

0 comments on commit 2c7f3a5

Please sign in to comment.