mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-07-26 16:28:06 +08:00
Plan RTL paths that route around geofence boundaries — both inclusion and exclusion zones — instead of flying straight through them and breaching. The planner builds a visibility graph over the margin-inflated geofence polygons and circles and runs Dijkstra to find the shortest legal return path, falling back to a straight line to the destination when no valid path exists. Highlights: - New reusable libraries: src/lib/dijkstra (generic shortest path) and src/lib/geofence (fixed-point geometry, polygon inflation, bitangent visibility); the RTL planner lives in navigator/RTLPlanner. - Visibility graph keeps only bitangent edges and skips edges that poke into a forbidden region, greatly reducing edge-cost computation. - Corner splitting is limited to sharp convex corners. - Geometry validation: reject self-intersecting polygons and vertices outside the fixed-point range; centimeter fixed-point scaling keeps orientation tests exact and avoids drift at large distances. - Failure handling: a Status enum replaces silent bool returns, and failures (unbuildable fence, planner capacity overflow, dataman load errors, NaN waypoints, destinations that breach the fence) are surfaced to the operator via MAVLink warnings/criticals; the planner falls back to a straight-line RTL. - Destination updates are centralized in RTL::setRtlTypeAndDestination; the path is replanned only when the destination or geometry changes. - VTOLs always use the fixed-wing margin (FW loiter radius). - kMaxNodes is exposed as a Kconfig option (default 100); the feature is disabled on flash-constrained boards (FMUv4 and older, various F4/F7). - Tests: unit tests for the Dijkstra lib, geofence geometry utils, and the avoidance planner, plus a MAVSDK SITL test flying an RTL through a geofence. - Documentation: new "Geofence Awareness" section in the RTL docs. Co-authored-by: Balduin <balduin@auterion.com>
60 lines
1.9 KiB
Plaintext
60 lines
1.9 KiB
Plaintext
CONFIG_BOARD_TOOLCHAIN="arm-none-eabi"
|
|
CONFIG_BOARD_ARCHITECTURE="cortex-m4"
|
|
CONFIG_BOARD_CONSTRAINED_FLASH=y
|
|
CONFIG_BOARD_NO_HELP=y
|
|
CONFIG_BOARD_CONSTRAINED_MEMORY=y
|
|
CONFIG_BOARD_SERIAL_GPS1="/dev/ttyS3"
|
|
CONFIG_BOARD_SERIAL_TEL1="/dev/ttyS1"
|
|
CONFIG_BOARD_SERIAL_TEL2="/dev/ttyS2"
|
|
CONFIG_BOARD_SERIAL_TEL4="/dev/ttyS6"
|
|
CONFIG_DRIVERS_ADC_BOARD_ADC=y
|
|
CONFIG_DRIVERS_BAROMETER_MS5611=y
|
|
CONFIG_DRIVERS_CDCACM_AUTOSTART=y
|
|
CONFIG_DRIVERS_GNSS_SEPTENTRIO=y
|
|
CONFIG_DRIVERS_GPS=y
|
|
CONFIG_DRIVERS_IMU_INVENSENSE_MPU6000=y
|
|
CONFIG_DRIVERS_IMU_ST_L3GD20=y
|
|
CONFIG_DRIVERS_IMU_ST_LSM303D=y
|
|
CONFIG_DRIVERS_LIGHTS_RGBLED=y
|
|
CONFIG_DRIVERS_MAGNETOMETER_HMC5883=y
|
|
CONFIG_DRIVERS_PWM_OUT=y
|
|
CONFIG_DRIVERS_PX4IO=y
|
|
CONFIG_DRIVERS_TONE_ALARM=y
|
|
CONFIG_MODULES_BATTERY_STATUS=y
|
|
CONFIG_MODULES_COMMANDER=y
|
|
CONFIG_MODULES_CONTROL_ALLOCATOR=y
|
|
CONFIG_MODULES_DATAMAN=y
|
|
CONFIG_MODULES_EKF2=y
|
|
# CONFIG_EKF2_AUX_GLOBAL_POSITION is not set
|
|
# CONFIG_EKF2_AUXVEL is not set
|
|
# CONFIG_EKF2_BARO_COMPENSATION is not set
|
|
# CONFIG_EKF2_DRAG_FUSION is not set
|
|
# CONFIG_EKF2_EXTERNAL_VISION is not set
|
|
# CONFIG_EKF2_GNSS_YAW is not set
|
|
# CONFIG_EKF2_OPTICAL_FLOW is not set
|
|
# CONFIG_EKF2_RANGE_FINDER is not set
|
|
# CONFIG_EKF2_SIDESLIP is not set
|
|
CONFIG_MODULES_FLIGHT_MODE_MANAGER=y
|
|
CONFIG_MODULES_LAND_DETECTOR=y
|
|
CONFIG_MODULES_LOGGER=y
|
|
CONFIG_MODULES_MANUAL_CONTROL=y
|
|
CONFIG_MODULES_MAVLINK=y
|
|
CONFIG_MODULES_MC_ATT_CONTROL=y
|
|
CONFIG_MODULES_MC_POS_CONTROL=y
|
|
CONFIG_MODULES_MC_RATE_CONTROL=y
|
|
CONFIG_MODULES_NAVIGATOR=y
|
|
# CONFIG_NAVIGATOR_ADSB is not set
|
|
# CONFIG_NAVIGATOR_GEOFENCE_AVOIDANCE is not set
|
|
CONFIG_MODULES_RC_UPDATE=y
|
|
CONFIG_MODULES_SENSORS=y
|
|
# CONFIG_SENSORS_VEHICLE_AIRSPEED is not set
|
|
# CONFIG_SENSORS_VEHICLE_OPTICAL_FLOW is not set
|
|
CONFIG_SYSTEMCMDS_BL_UPDATE=y
|
|
CONFIG_SYSTEMCMDS_HARDFAULT_LOG=y
|
|
CONFIG_SYSTEMCMDS_MFT=y
|
|
CONFIG_SYSTEMCMDS_MTD=y
|
|
CONFIG_SYSTEMCMDS_PARAM=y
|
|
CONFIG_SYSTEMCMDS_REBOOT=y
|
|
CONFIG_SYSTEMCMDS_TUNE_CONTROL=y
|
|
CONFIG_SYSTEMCMDS_VER=y
|