Conversation
…equivalents Move send_emergency_stop() and send_emergency_stop_watchdog() to the Supervisor class using the CRTP supervisor channel. Deprecate the Localization versions with a backwards-compatible fallback to the old localization channel for firmware below protocol version 12.
All public methods now warn and bail early if the connected Crazyflie reports a protocol version < 12, which is required for the supervisor port.
|
Added CRTP protocol version guards to the supervisor subsystem. All public methods now warn and bail early if the connected firmware doesn't report protocol version ≥ 12. Honestly the versioning story in this Python lib has been a bit of a mess (most subsystems have no guards at all). The Rust rewrite will have a much stricter versioning contract so this kind of ambiguity won't carry over. |
gemenerik
left a comment
There was a problem hiding this comment.
We missed examples/swarm/christmas_tree.py, but I suppose this is being moved out into the demos repository
| stacklevel=2 | ||
| ) | ||
|
|
||
| self._cf.supervisor.send_arming_request(do_arm) |
There was a problem hiding this comment.
Unlike the localization deprecations (emergency stop ones) which fall back to the old packet on old firmware, these just warn and bail. May be desired since it nudges people to update though.
There was a problem hiding this comment.
As a user, I would prefer this version. However, I think it's pretty clear that the firmware/lib need to be updated in both cases.
Co-authored-by: Rik <49898887+gemenerik@users.noreply.github.com>
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.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_controlEvery 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.
Update:
The supervisor commands (
send_arming_requestandsend_recovery_request) are also moved fromplatformservice.pytosupervisor.py. The user can still use the old commands (e.g.scf.cf.platform.send_arming_request(True)) but they'll get a deprecation warning.