Skip to content

geodesic_grid: fix undefined variable in _triangle_index neighbor-umbrella path#1669

Open
aryanputta wants to merge 1 commit into
ArduPilot:masterfrom
aryanputta:master
Open

geodesic_grid: fix undefined variable in _triangle_index neighbor-umbrella path#1669
aryanputta wants to merge 1 commit into
ArduPilot:masterfrom
aryanputta:master

Conversation

@aryanputta
Copy link
Copy Markdown

@aryanputta aryanputta commented Mar 25, 2026

Problem

_triangle_index in geodesic_grid.py calls _from_neighbor_umbrella with four arguments:

return _from_neighbor_umbrella(umbrella, v, w, inclusive)

inclusive is never defined anywhere in _triangle_index. Running this path raises a NameError at runtime. Additionally, _from_neighbor_umbrella (line 204) only accepts three parameters (idx, v, u), so even if inclusive were defined the call would raise a TypeError.

Flake8 also flags this as F821 (undefined name).

Closes #1607

Fix

Remove the spurious inclusive argument so the call matches the function signature:

return _from_neighbor_umbrella(umbrella, v, w)

Testing

Ran the existing geodesic grid unit tests locally -- all pass. The neighbor-umbrella path in _triangle_index now executes without error.

Checklist

  • Code change is real and addresses a runtime bug
  • - [x] No unrelated formatting or whitespace changes
  • - [x] No AI used

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

geodesic_grid.py: Undefined name 'inclusive'

2 participants