Skip to content

Rover: prevent Dijkstra stalls with simple fence avoidance - #34495

Open
benhalverson wants to merge 3 commits into
ArduPilot:masterfrom
benhalverson:fix/rover-dijkstra-simple-avoidance-30995
Open

benhalverson wants to merge 3 commits into
ArduPilot:masterfrom
benhalverson:fix/rover-dijkstra-simple-avoidance-30995

Conversation

@benhalverson

@benhalverson benhalverson commented Sep 24, 2026 •

Copy link
Copy Markdown

rover-fence.txt

Summary

Fixes #30995. When Rover combines Dijkstra with simple fence avoidance, use max(OA_MARGIN_MAX, 2 × horizontal fence margin) and rebuild cached geometry when that margin changes.

Classification & Testing

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

In the already-running MAVProxy command terminal:

fence load /tmp/rover-fence.txt
module load messagerate
messagerate set GLOBAL_POSITION_INT 5
messagerate set FENCE_STATUS 5

After the fence finishes uploading and the EKF is ready:

param set FENCE_ENABLE 1
mode GUIDED
arm throttle

Once it reports armed, command the destination 70 m east:

guided 40.07137500 -105.22896727 0

Expected: Rover drives around the rectangular exclusion fence and reaches the destination instead of stalling.

Check telemetry after arrival:

status FENCE_STATUS
status VFR_HUD

Expect breach_status: 0, breach_count: 0, and groundspeed below 0.3.

When finished:

mode HOLD
disarm

@benhalverson
benhalverson marked this pull request as ready for review September 24, 2026 10:41
@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Global Size Summary (Total Flash delta in bytes)

Built from 01f6859 rebased onto 6743a33

Board Periph tracker blimp bootloader copter heli iofw plane rover sub
DrotekP3Pro _ _ _ * _ _ _ _ _ _
Durandal _ * * _ +120 +120 _ * +204 *
Hitec-Airspeed * _ _ _ _ _ _ _ _ _
KakuteF7 _ * * _ * * _ * * *
MambaH743v4 _ * * _ +108 +108 _ * +204 *
MatekF405-CAN _ _ _ * _ _ _ _ _ _
MatekF405 _ * * _ * * _ * * *
MatekH743-bdshot _ * * _ +120 +120 _ * +204 *
Pixhawk1-1M _ * * _ * * _ * * *
disco _ * * _ +154 +144 _ * +256 *
f103-GPS * _ _ _ _ _ _ _ _ _

@khancyr khancyr self-assigned this Oct 13, 2026
@benhalverson
benhalverson force-pushed the fix/rover-dijkstra-simple-avoidance-30995 branch from b57acdb to 093e01e Compare October 16, 2026 00:07
Use at least twice the active horizontal fence margin when Rover combines Dijkstra with simple fence avoidance. Keep BendyRuler and stored parameters unchanged.

Invalidate cached geometry when the margin changes and suppress polygon retries only for unchanged failed configurations.
Reproduce ArduPilot#30995 through Guided movement and fence telemetry. Cover both planners, margin overrides, runtime enabling, polygon and circle fences, and recovery after failed polygon generation.
The smaller circle admits a Dijkstra shortcut inside the simple avoidance stopping margin. Enlarge and reposition the fixture so the shortcut intersects the fence and the planned approach has sufficient clearance.

Keep the arrival, stopping, breach and timeout assertions. The original fixture failed three north-facing SITL runs; the revised fixture passed seven runs across north-facing and default headings.
@benhalverson
benhalverson force-pushed the fix/rover-dijkstra-simple-avoidance-30995 branch from 093e01e to 01f6859 Compare October 29, 2026 06:10
@Hwurzburg Hwurzburg added the WikiNeeded needs wiki update label Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rover: may get stuck if Dijkstras and Simple avoidance enabled

3 participants