Skip to content

fix(state): sync actuator state when the active config changes - #9

Merged
Awesome-Ace22 merged 2 commits into
devfrom
bugfix/actuator-state-init
Oct 20, 2026
Merged

Awesome-Ace22 merged 2 commits into
devfrom
bugfix/actuator-state-init

Conversation

@Awesome-Ace22

@Awesome-Ace22 Awesome-Ace22 commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

What and why

Actuator state was only initialised at startup, so loading, uploading, replacing, patching or reloading a config left actuator_states out of step with the new config. Added RuntimeState.sync_actuators(): actuators that stay keep their stored state (the last command sent to hardware), new ones and ones whose type changed get their initial state, and removed ones are dropped. The config routes now share _publish_config(), which syncs, then broadcasts config_update and actuator_states to clients. Extracted _initial_state() from initialize_all() so both paths use it.

Closes UTATRocketry/Nova-Collected#23

How was this tested?

  • 1 Unit / Automated Test - CI
  • 2 Simulator Test - testing procedure with the hardware simulators
  • 3 Bench Test - testing procedure on the dev stack, with some real hardware
  • 4 Integration Test - full engine test procedure, real hardware, no propellants

Added tests/test_actuator_state_sync.py with three cases: switching configs adds, removes and keeps actuators; a type change resets state; and syncing from empty matches initialize_all.

Hardware impact

  • None - UI, docs or tooling only
  • Changes how a sensor is read, converted or shown
  • Changes how an actuator is commanded, or safety rules, interlocks, timeouts or sequencing → add the hardware-risk label; a lead must approve
  • Changes a message format, MQTT topic or FAS protocol that another repo depends on → title needs !, link the matching PRs:

It doesn't send any commands. It changes which actuator state the backend holds and shows after a config change, which operators rely on when commanding valves, so I'm treating it as hardware-risk.

Checklist

  • Targets dev (or main for a release/hotfix, or with a reason given above)
  • Branch is up to date ("Update branch" button)
  • No station config/calibrations, data files, secrets, .env files or build output committed
  • README/docs updated if behaviour changed (no documented behaviour changed)

@Awesome-Ace22 Awesome-Ace22 added the bug Something isn't working label Oct 20, 2026
@Awesome-Ace22 Awesome-Ace22 self-assigned this Oct 20, 2026
@Awesome-Ace22
Awesome-Ace22 merged commit 9259821 into dev Oct 20, 2026
2 of 4 checks passed
@Awesome-Ace22
Awesome-Ace22 deleted the bugfix/actuator-state-init branch October 20, 2026 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Initialize actuator state for new actuators when the config is switched

1 participant