Skip to content

Commit

Permalink
add toggle between old calibration mode and new calibration mode (#1159)
Browse files Browse the repository at this point in the history
* add toggle between old calibration mode and new calibration mode

* false -> true
  • Loading branch information
MaikRe authored Jul 12, 2024
1 parent c2bdeb4 commit fe65a90
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
10 changes: 9 additions & 1 deletion crates/control/src/behavior/calibrate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,18 @@ use types::{
world_state::WorldState,
};

pub fn execute(world_state: &WorldState) -> Option<MotionCommand> {
pub fn execute(
world_state: &WorldState,
use_stand_head_unstiff_calibration: bool,
) -> Option<MotionCommand> {
if PrimaryState::Calibration != world_state.robot.primary_state {
return None;
}
if use_stand_head_unstiff_calibration {
return Some(MotionCommand::Stand {
head: HeadMotion::Unstiff,
});
}

let head =
if let Some(CalibrationCommand { target, camera, .. }) = world_state.calibration_command {
Expand Down
6 changes: 5 additions & 1 deletion crates/control/src/behavior/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ pub struct CycleContext {
maximum_step_size: Parameter<Step, "step_planner.max_step_size">,
enable_pose_detection: Parameter<bool, "pose_detection.enable">,
wide_stance: Parameter<WideStanceParameters, "wide_stance">,
use_stand_head_unstiff_calibration:
Parameter<bool, "calibration_controller.use_stand_head_unstiff_calibration">,
}

#[context]
Expand Down Expand Up @@ -273,7 +275,9 @@ impl Behavior {
*context.intercept_ball_parameters,
*context.maximum_step_size,
),
Action::Calibrate => calibrate::execute(world_state),
Action::Calibrate => {
calibrate::execute(world_state, *context.use_stand_head_unstiff_calibration)
}
Action::DefendGoal => defend.goal(&mut context.path_obstacles_output),
Action::DefendKickOff => defend.kick_off(&mut context.path_obstacles_output),
Action::DefendLeft => defend.left(&mut context.path_obstacles_output),
Expand Down
3 changes: 2 additions & 1 deletion etc/parameters/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -1530,6 +1530,7 @@
"look_at_dispatch_delay": {
"nanos": 0,
"secs": 1
}
},
"use_stand_head_unstiff_calibration": true
}
}

0 comments on commit fe65a90

Please sign in to comment.