mirror of
https://github.com/bleackstorm/SteamFrame-FPV-Control-Center.git
synced 2026-12-03 07:31:57 +01:00
feat(terrain,ci): add lost-model GPS, GPX trace, inclinometer, throttle expo/crawl, relay ping, log rotation & release CI
This commit is contained in:
1 parent
c83f90570f
commit
9f0c64f873
20 files changed
+926
-78
No files matched your search
@@ -42,6 +42,13 @@ impl EngineControlHandle {
|
||||
.shared
|
||||
.controller_invert_steering
|
||||
.load(Ordering::Acquire);
|
||||
cfg.controller_throttle_expo =
|
||||
(self.shared.controller_throttle_expo_pct.load(Ordering::Acquire).min(80) as f32)
|
||||
/ 100.0;
|
||||
cfg.controller_crawl_mode = self
|
||||
.shared
|
||||
.controller_crawl_mode
|
||||
.load(Ordering::Acquire);
|
||||
cfg.gaz_avant_min = limits.forward_min;
|
||||
cfg.gear_1_max = limits.forward_max[0];
|
||||
cfg.gear_2_max = limits.forward_max[1];
|
||||
@@ -180,6 +187,48 @@ impl EngineControlHandle {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn throttle_expo(&self) -> f32 {
|
||||
(self
|
||||
.shared
|
||||
.controller_throttle_expo_pct
|
||||
.load(Ordering::Acquire)
|
||||
.min(80) as f32)
|
||||
/ 100.0
|
||||
}
|
||||
|
||||
pub fn set_throttle_expo(&self, expo: f32) {
|
||||
let pct = (expo.clamp(0.0, 0.8) * 100.0).round() as u8;
|
||||
let prev = self
|
||||
.shared
|
||||
.controller_throttle_expo_pct
|
||||
.swap(pct, Ordering::AcqRel);
|
||||
if prev != pct {
|
||||
log::info!(
|
||||
"[Action Utilisateur] Expo gaz Steam Controller : {:.2}",
|
||||
pct as f32 / 100.0
|
||||
);
|
||||
self.persist_live_config();
|
||||
}
|
||||
}
|
||||
|
||||
pub fn crawl_mode(&self) -> bool {
|
||||
self.shared.controller_crawl_mode.load(Ordering::Acquire)
|
||||
}
|
||||
|
||||
pub fn set_crawl_mode(&self, enabled: bool) {
|
||||
let prev = self
|
||||
.shared
|
||||
.controller_crawl_mode
|
||||
.swap(enabled, Ordering::AcqRel);
|
||||
if prev != enabled {
|
||||
log::info!(
|
||||
"[Action Utilisateur] Mode Précision / Rampant (50%) : {}",
|
||||
if enabled { "ACTIF" } else { "DÉSACTIVÉ" }
|
||||
);
|
||||
self.persist_live_config();
|
||||
}
|
||||
}
|
||||
|
||||
pub fn request_recenter(&self) {
|
||||
*self.shared.head_trim_deg.lock() = (0.0, 0.0);
|
||||
self.shared.recenter_flag.store(true, Ordering::Release);
|
||||
|
||||
Reference in new issue
Block a user