Skip to content

Commit 6602bdf

Browse files
alireza787bclaude
andcommitted
fix(followers): enterprise audit v6.0.2 — fresh-eyes safety & correctness pass
CRITICAL safety fixes: - fw_attitude_rate: fix bank angle PID sign inversion (was computing -P*error instead of +P*error) - fw_attitude_rate: fix TargetLossAction local enum shadowing safety_types (RTL/ORBIT never fired) - fw_attitude_rate: fix rtl_triggered not reset on state reset (RTL permanently stuck after first trigger) - mc_attitude_rate: fix TargetLossAction local enum shadowing (RTL never fired) - mc_attitude_rate: remove dead _parse_target_loss_action method (unreachable code) - mc_velocity_ground: fix pid_z repulsive force bug (setpoint=min_descent_height caused drone to climb) High-priority fixes: - base_follower: move numpy import to module level (was re-imported on every 20Hz call) - mc_attitude_rate: TARGET_ALTITUDE_OFFSET default 0.0→15.0 (matches config) - mc_velocity_position: YAW_CONTROL_THRESHOLD default 0.05→0.02 (matches config) - mc_velocity_position: getattr altitude default 0.0→None (activates existing None guard) - mc_velocity_distance: ENABLE_ALTITUDE_CONTROL default True→False (safe ground testing) - mc_velocity_ground: MAX_RATE_OF_DESCENT default 2.0→1.0 (matches config) - gm_velocity_chase: remove inline import math in hot path (already at module level) - mc_velocity_distance: move inline 'from math import degrees' to module level Code quality: - gm_velocity_chase: strip emoji from logger calls (breaks log parsers/grep/enterprise logs) Config/schema cleanup: - config_schema.yaml: remove orphaned safety keys from per-follower sections - config_schema.yaml: fix range maxima, type mismatches, missing FW_ATTITUDE_RATE keys - config_default.yaml: align key names with code expectations - follower_commands.yaml: add missing deprecated aliases - scripts/generate_schema.py: remove dead section registrations Docs updates (12 files): - Fix Safety.GlobalLimits/FollowerOverrides config structure throughout - Fix AltitudeLimits/RateLimits from @DataClass to NamedTuple - Fix TrackerOutput angular field (remove stale gimbal_pan/gimbal_tilt) - Fix factory-pattern.md: deprecated aliases raise ValueError (not warnings) - Update follower count, remove pid_pursuit references, fix stale aliases - Fix safety-manager.md: FollowerLimits types, get_altitude_limits() signature Tests: 1547 passed, 49 skipped, 0 failed Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 2b0c747 commit 6602bdf

23 files changed

+254
-410
lines changed

configs/config_default.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1294,6 +1294,7 @@ GM_VELOCITY_CHASE:
12941294
# === Mount Configuration ===
12951295
MOUNT_TYPE: "HORIZONTAL" # Options: "HORIZONTAL", "VERTICAL"
12961296
CONTROL_MODE: "BODY" # Options: "NED", "BODY"
1297+
ROLL_RIGHT_SIGN: "NEGATIVE" # Options: NEGATIVE | POSITIVE — sign convention for roll-right direction
12971298

12981299
# === Required Tracker Fields ===
12991300
REQUIRED_TRACKER_FIELDS: ["angular"] # Must have angular data from gimbal
@@ -1928,7 +1929,7 @@ MC_ATTITUDE_RATE:
19281929
# ==============================================================================
19291930
MC_VELOCITY_GROUND:
19301931
# === Target Position Mode ===
1931-
TARGET_POSITION_MODE: center # Target positioning: "center", "initial"
1932+
TARGET_POSITION_MODE: center # Options: center | initial
19321933

19331934
# === Velocity Limits ===
19341935
# NOTE: MAX_VELOCITY_X/Y now in Safety.GlobalLimits as MAX_VELOCITY_LATERAL/FORWARD
@@ -2164,7 +2165,7 @@ Safety:
21642165
# Safety Behavior
21652166
EMERGENCY_STOP_ENABLED: true
21662167
RTL_ON_VIOLATION: true
2167-
TARGET_LOSS_ACTION: hover # hover, orbit, stop, rtl, continue
2168+
TARGET_LOSS_ACTION: hover # Options: hover | orbit | stop | rtl | continue
21682169
MAX_SAFETY_VIOLATIONS: 5
21692170

21702171
# ===========================================================================

0 commit comments

Comments
 (0)