Skip to content

Commit c7edaa8

Browse files
committed
Route emergency stop, arming and crash recovery through the supervisor
crazyflie-lib 0.8.1 moved these commands to the new supervisor subsystem and deprecated the localization and platform methods, which fails our build under -D warnings. Call the supervisor methods internally instead; the Python API is unchanged and keeps exposing them in their current locations. Moving them under a supervisor subsystem in the Python API too is left to the pending supervisor subsystem PR.
1 parent 3c486bc commit c7edaa8

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

rust/src/subsystems/localization.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ impl EmergencyControl {
8686
fn send_emergency_stop<'py>(&self, py: Python<'py>) -> PyResult<Bound<'py, PyAny>> {
8787
let cf = self.cf.clone();
8888
pyo3_async_runtimes::tokio::future_into_py(py, async move {
89-
cf.localization.emergency.send_emergency_stop().await
89+
cf.supervisor.send_emergency_stop().await
9090
.map_err(crate::error::to_pyerr)?;
9191
Ok(())
9292
})
@@ -102,7 +102,7 @@ impl EmergencyControl {
102102
fn send_emergency_stop_watchdog<'py>(&self, py: Python<'py>) -> PyResult<Bound<'py, PyAny>> {
103103
let cf = self.cf.clone();
104104
pyo3_async_runtimes::tokio::future_into_py(py, async move {
105-
cf.localization.emergency.send_emergency_stop_watchdog().await
105+
cf.supervisor.send_emergency_stop_watchdog().await
106106
.map_err(crate::error::to_pyerr)?;
107107
Ok(())
108108
})

rust/src/subsystems/platform.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl Platform {
113113
fn send_arming_request<'py>(&self, py: Python<'py>, do_arm: bool) -> PyResult<Bound<'py, PyAny>> {
114114
let cf = self.cf.clone();
115115
pyo3_async_runtimes::tokio::future_into_py(py, async move {
116-
cf.platform.send_arming_request(do_arm).await.map_err(to_pyerr)?;
116+
cf.supervisor.send_arming_request(do_arm).await.map_err(to_pyerr)?;
117117
Ok(())
118118
})
119119
}
@@ -125,7 +125,7 @@ impl Platform {
125125
fn send_crash_recovery_request<'py>(&self, py: Python<'py>) -> PyResult<Bound<'py, PyAny>> {
126126
let cf = self.cf.clone();
127127
pyo3_async_runtimes::tokio::future_into_py(py, async move {
128-
cf.platform.send_crash_recovery_request().await.map_err(to_pyerr)?;
128+
cf.supervisor.send_crash_recovery_request().await.map_err(to_pyerr)?;
129129
Ok(())
130130
})
131131
}

0 commit comments

Comments
 (0)