Skip to content

Commit 17dd27e

Browse files
committed
Only execute injected motion command in Playing
1 parent d561b59 commit 17dd27e

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

crates/control/src/behavior/node.rs

+8-5
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,14 @@ impl Behavior {
103103

104104
pub fn cycle(&mut self, mut context: CycleContext) -> Result<MainOutputs> {
105105
let world_state = context.world_state;
106-
if let Some(command) = &context.parameters.injected_motion_command {
107-
return Ok(MainOutputs {
108-
motion_command: command.clone().into(),
109-
dribble_path: None.into(),
110-
});
106+
107+
if world_state.robot.primary_state == PrimaryState::Playing {
108+
if let Some(command) = &context.parameters.injected_motion_command {
109+
return Ok(MainOutputs {
110+
motion_command: command.clone().into(),
111+
dribble_path: None.into(),
112+
});
113+
}
111114
}
112115

113116
if let Some(ball_state) = &world_state.ball {

0 commit comments

Comments
 (0)