Skip to content

Commit

Permalink
fixed naming and added a newline
Browse files Browse the repository at this point in the history
  • Loading branch information
larskna committed Feb 4, 2025
1 parent 27eedad commit 7e5060e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 deletions.
12 changes: 6 additions & 6 deletions crates/control/src/motion/dispatching_interpolator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ pub struct CycleContext {
stand_up_front_positions: Input<Joints<f32>, "stand_up_front_positions">,
stand_up_sitting_positions: Input<Joints<f32>, "stand_up_sitting_positions">,
wide_stance_positions: Input<Joints<f32>, "wide_stance_positions">,
keeper_jump_left_motor_command:
Input<MotorCommands<Joints<f32>>, "keeper_jump_left_motor_command">,
keeper_jump_right_motor_command:
Input<MotorCommands<Joints<f32>>, "keeper_jump_right_motor_command">,
keeper_jump_left_motor_commands:
Input<MotorCommands<Joints<f32>>, "keeper_jump_left_motor_commands">,
keeper_jump_right_motor_commands:
Input<MotorCommands<Joints<f32>>, "keeper_jump_right_motor_commands">,
walk_motor_commands: Input<MotorCommands<BodyJoints<f32>>, "walk_motor_commands">,

initial_pose: Parameter<Joints<f32>, "initial_pose">,
Expand Down Expand Up @@ -109,8 +109,8 @@ impl DispatchingInterpolator {
MotionType::StandUpFront => *context.stand_up_front_positions,
MotionType::StandUpSitting => *context.stand_up_sitting_positions,
MotionType::WideStance => *context.wide_stance_positions,
MotionType::KeeperJumpLeft => context.keeper_jump_left_motor_command.positions,
MotionType::KeeperJumpRight => context.keeper_jump_right_motor_command.positions,
MotionType::KeeperJumpLeft => context.keeper_jump_left_motor_commands.positions,
MotionType::KeeperJumpRight => context.keeper_jump_right_motor_commands.positions,
MotionType::CenterJump => *context.center_jump_positions,
MotionType::Unstiff => panic!("Dispatching Unstiff doesn't make sense"),
MotionType::Animation => context.animation_commands.positions,
Expand Down
5 changes: 3 additions & 2 deletions crates/control/src/motion/keeper_jump_left.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub struct CycleContext {
#[context]
#[derive(Default)]
pub struct MainOutputs {
pub keeper_jump_left_motor_command: MainOutput<MotorCommands<Joints<f32>>>,
pub keeper_jump_left_motor_commands: MainOutput<MotorCommands<Joints<f32>>>,
}

impl KeeperJumpLeft {
Expand All @@ -49,6 +49,7 @@ impl KeeperJumpLeft {
pub fn cycle(&mut self, context: CycleContext) -> Result<MainOutputs> {
let last_cycle_duration = context.cycle_time.last_cycle_duration;
let condition_input = context.condition_input;

if context.motion_selection.current_motion == MotionType::KeeperJumpLeft {
self.interpolator
.advance_by(last_cycle_duration, condition_input);
Expand All @@ -58,7 +59,7 @@ impl KeeperJumpLeft {
context.motion_safe_exits[MotionType::KeeperJumpLeft] = self.interpolator.is_finished();

Ok(MainOutputs {
keeper_jump_left_motor_command: self.interpolator.value().mirrored().into(),
keeper_jump_left_motor_commands: self.interpolator.value().mirrored().into(),
})
}
}
5 changes: 3 additions & 2 deletions crates/control/src/motion/keeper_jump_right.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub struct CycleContext {
#[context]
#[derive(Default)]
pub struct MainOutputs {
pub keeper_jump_right_motor_command: MainOutput<MotorCommands<Joints<f32>>>,
pub keeper_jump_right_motor_commands: MainOutput<MotorCommands<Joints<f32>>>,
}

impl KeeperJumpRight {
Expand All @@ -49,6 +49,7 @@ impl KeeperJumpRight {
pub fn cycle(&mut self, context: CycleContext) -> Result<MainOutputs> {
let last_cycle_duration = context.cycle_time.last_cycle_duration;
let condition_input = context.condition_input;

if context.motion_selection.current_motion == MotionType::KeeperJumpRight {
self.interpolator
.advance_by(last_cycle_duration, condition_input);
Expand All @@ -58,7 +59,7 @@ impl KeeperJumpRight {
context.motion_safe_exits[MotionType::KeeperJumpRight] = self.interpolator.is_finished();

Ok(MainOutputs {
keeper_jump_right_motor_command: self.interpolator.value().into(),
keeper_jump_right_motor_commands: self.interpolator.value().into(),
})
}
}
12 changes: 6 additions & 6 deletions crates/control/src/motion/motor_commands_collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ pub struct CycleContext {
stand_up_front_positions: Input<Joints<f32>, "stand_up_front_positions">,
stand_up_sitting_positions: Input<Joints<f32>, "stand_up_sitting_positions">,
wide_stance_positions: Input<Joints<f32>, "wide_stance_positions">,
keeper_jump_left_motor_command:
Input<MotorCommands<Joints<f32>>, "keeper_jump_left_motor_command">,
keeper_jump_right_motor_command:
Input<MotorCommands<Joints<f32>>, "keeper_jump_right_motor_command">,
keeper_jump_left_motor_commands:
Input<MotorCommands<Joints<f32>>, "keeper_jump_left_motor_commands">,
keeper_jump_right_motor_commands:
Input<MotorCommands<Joints<f32>>, "keeper_jump_right_motor_commands">,
center_jump_positions: Input<Joints<f32>, "center_jump_positions">,
walk_motor_commands: Input<MotorCommands<BodyJoints<f32>>, "walk_motor_commands">,
cycle_time: Input<CycleTime, "cycle_time">,
Expand Down Expand Up @@ -90,8 +90,8 @@ impl MotorCommandCollector {
let stand_up_front_positions = context.stand_up_front_positions;
let stand_up_sitting_positions = context.stand_up_sitting_positions;
let wide_stance_positions = context.wide_stance_positions;
let keeper_jump_left = context.keeper_jump_left_motor_command;
let keeper_jump_right = context.keeper_jump_right_motor_command;
let keeper_jump_left = context.keeper_jump_left_motor_commands;
let keeper_jump_right = context.keeper_jump_right_motor_commands;
let walk = context.walk_motor_commands;

let (positions, stiffnesses) = match motion_selection.current_motion {
Expand Down

0 comments on commit 7e5060e

Please sign in to comment.