Skip to content

Copter: add GPS_HACC_GOOD parameter for horizontal accuracy pre-arm c… - #34083

Open
muramura wants to merge 1 commit into
ArduPilot:masterfrom
muramura:copter-gps-hacc-good
Open

Copter: add GPS_HACC_GOOD parameter for horizontal accuracy pre-arm c…#34083
muramura wants to merge 1 commit into
ArduPilot:masterfrom
muramura:copter-gps-hacc-good

Conversation

@muramura

Copy link
Copy Markdown
Contributor

Summary

Adds GPS_HACC_GOOD parameter (default: 1.5m) to ParametersG2 for Copter to enforce a maximum GPS horizontal accuracy requirement during pre-arm checks.

Classification & Testing (check all that apply and add your own)

  • Checked by a human programmer
  • Non-functional change
  • No-binary change
  • Infrastructure change (e.g. unit tests, helper scripts)
  • Automated test(s) verify changes (e.g. unit test, autotest)
  • Tested manually, description below (e.g. SITL)
  • Tested on hardware
  • Logs attached
  • Logs available on request

Testing Details:

  • SITL (Copter):
    • Verified default parameter is loaded as GPS_HACC_GOOD = 1.5m.
    • In LOITER mode with simulated error SIM_GPS1_ACC = 2.5m (exceeding threshold), pre-arm check failed with PreArm: High GPS HACC and prevented arming.
    • Relaxing GPS_HACC_GOOD to 3.0m cleared the error to pre-arm good and allowed arming.
    • Setting GPS_HACC_GOOD = 0 disabled the check and allowed arming.
  • Hardware Test:
    • Built and verified parameter registration and MAVLink telemetry on ESP32-S3 (esp32s3m5stampfly).
スクリーンショット 2026-08-17 0 48 42

Description

Motivation

  • In high-precision operations (such as agricultural spraying drones using Network RTK), verifying actual positional accuracy (HAcc in meters) is critical to ensure accurate route execution and avoid boundary errors.
  • While GPS_HDOP_GOOD checks satellite geometric dilution, checking horizontal_accuracy provides direct assurance that position estimate has converged before arming.
  • Adding GPS_HACC_GOOD allows users to enforce a required horizontal accuracy threshold before arming (or set to 0 to disable).

Implementation Details

  • Uses existing AP_GPS::horizontal_accuracy(float &hacc) method. If the connected GNSS receiver does not support/report accuracy, the check is safely bypassed.

Parameter Details

  • Name: GPS_HACC_GOOD
  • Class: ParametersG2
  • Default: 1.5 (meters)
  • Range: 0 to 10 (0 disables check)
  • Increment: 0.1
  • User: Advanced

AI Disclosure

This contribution was developed with AI pair-programming assistance (Antigravity).

…heck

Add GPS_HACC_GOOD parameter to ParametersG2 (default 1.5m) to allow
enforcing a maximum GPS horizontal accuracy (HAcc) before arming.
This improves safety, especially for RTK/high-precision positioning
where satellite geometry (HDOP) may look good while actual positional
accuracy is still settling.
@Hwurzburg Hwurzburg added the WikiNeeded needs wiki update label Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Copter WikiNeeded needs wiki update

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants