Controller Update 5
This commit is contained in:
@@ -12,8 +12,9 @@ GPS_TYPE 1 # Auto-detect
|
||||
# ====================
|
||||
# Geofence Settings
|
||||
# ====================
|
||||
# Safety cage - uses GPS for boundaries
|
||||
FENCE_ENABLE 1
|
||||
# Disabled for now - causes "fence requires position" errors
|
||||
# TODO: Re-enable after basic flight works
|
||||
FENCE_ENABLE 0
|
||||
FENCE_TYPE 3 # Alt + Circle
|
||||
FENCE_ACTION 2 # Land on breach
|
||||
FENCE_ALT_MAX 10 # Maximum altitude (meters)
|
||||
|
||||
@@ -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