Controller Update 5

This commit is contained in:
2026-02-09 06:31:00 +00:00
parent d3acd8789f
commit aed71490c0
2 changed files with 16 additions and 10 deletions

View File

@@ -12,8 +12,9 @@ GPS_TYPE 1 # Auto-detect
# ==================== # ====================
# Geofence Settings # Geofence Settings
# ==================== # ====================
# Safety cage - uses GPS for boundaries # Disabled for now - causes "fence requires position" errors
FENCE_ENABLE 1 # TODO: Re-enable after basic flight works
FENCE_ENABLE 0
FENCE_TYPE 3 # Alt + Circle FENCE_TYPE 3 # Alt + Circle
FENCE_ACTION 2 # Land on breach FENCE_ACTION 2 # Land on breach
FENCE_ALT_MAX 10 # Maximum altitude (meters) FENCE_ALT_MAX 10 # Maximum altitude (meters)

View File

@@ -193,14 +193,19 @@ class AutonomousController:
if gps_ok and home_ok: if gps_ok and home_ok:
print("[CTRL] GPS and home ready!") print("[CTRL] GPS and home ready!")
# NOW enable geofence since we have position # Wait for EKF position estimate to be valid
print("[CTRL] Enabling geofence: Alt=10m, Radius=20m") print("[CTRL] Waiting for EKF position estimate...")
self.set_param("FENCE_ENABLE", 1) time.sleep(5)
self.set_param("FENCE_TYPE", 3)
self.set_param("FENCE_ACTION", 2) # Skip fence for now - causes "need position estimate" errors
self.set_param("FENCE_ALT_MAX", 10) # TODO: Re-enable fence after basic flight works
self.set_param("FENCE_RADIUS", 20) # print("[CTRL] Enabling geofence: Alt=10m, Radius=20m")
time.sleep(1) # self.set_param("FENCE_ENABLE", 1)
# self.set_param("FENCE_TYPE", 3)
# self.set_param("FENCE_ACTION", 2)
# self.set_param("FENCE_ALT_MAX", 10)
# self.set_param("FENCE_RADIUS", 20)
return True return True
elapsed = int(time.time() - start) elapsed = int(time.time() - start)