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

@@ -193,14 +193,19 @@ class AutonomousController:
if gps_ok and home_ok:
print("[CTRL] GPS and home ready!")
# NOW enable geofence since we have position
print("[CTRL] Enabling geofence: Alt=10m, Radius=20m")
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)
time.sleep(1)
# Wait for EKF position estimate to be valid
print("[CTRL] Waiting for EKF position estimate...")
time.sleep(5)
# Skip fence for now - causes "need position estimate" errors
# TODO: Re-enable fence after basic flight works
# print("[CTRL] Enabling geofence: Alt=10m, Radius=20m")
# 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
elapsed = int(time.time() - start)