Controller Update 5
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user