Skip to content

Conversation

@ArisMorgens
Copy link
Member

This PR fixes #530 and should be merged after the firmware PR #1560 is merged. It adds a supervisor subsystem for reading the supervisor states.

Specifically:

  • read_bitfield() returns the full bitfield value.
  • read_state_list() returns a list of all active states.
  • All the individual state checks return True if they're active and False if they're not. can_be_armed, is_armed, is_auto_armed, can_fly, is_flying, is_tumbled, is_locked, is_crashed, active_hl_control, finished_hl_traj, disabled_hl_control

Every time we want to read a state, the entire bitfield is fetched. To avoid sending CRTP packets too frequently, the bitfield is cached for 0.1 seconds.

Also, 2 simple examples are added; 1 for reading the supervisor states and 1 for flying using the state information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add supervisor state reading interface

2 participants