Skip to content

fix(mobile): keep pose graph vertex indices local - #770

Open
yunyv wants to merge 1 commit into
petercorke:mainfrom
yunyv:fix/posegraph-local-indices
Open

yunyv wants to merge 1 commit into
petercorke:mainfrom
yunyv:fix/posegraph-local-indices

Conversation

@yunyv

@yunyv yunyv commented Oct 14, 2026

Copy link
Copy Markdown

Summary

Keep pose-graph vertex indices local to the graph being loaded. PGVertex previously used a class-wide counter that every loader reset. Interleaving a second load could leave the first graph with indices such as [0, 3] for two vertices, breaking optimisation matrix indexing and lidar lookups.

Pass each graph's current vertex count when constructing its pose or landmark vertices instead of sharing a counter. Add deterministic interleaving regressions for g2o and TORO, sequential controls, optimisation equivalence, and lidar lookup with and without landmarks. Public PoseGraph arguments and file formats are unchanged.

Related issue

Addresses the graph-local vertex-counter item in #746. Other checklist items remain open; this is independent of #769.

Validation

Linux, Python 3.12.14:

  • On unchanged main (2de1e3e), the new tests give 4 failures and 2 passing controls; with the fix, 6 pass.
  • python -m pytest tests/ --ignore=tests/test_blocks.py --timeout=50 --timeout_method=thread -q: 998 passed, 12 skipped, 66 subtests passed. Both native extensions were built and verified available; collision dependencies were available. The run reports 14 existing deprecation warnings.
  • Ruff lint on the new tests, format checks on both changed files, security rules on both files, and git diff --check pass.
  • The existing eight Ruff findings in PoseGraph.py are unchanged (module naming, imports, dictionary style, and an unused local). This is not a claim of repository-wide lint cleanliness or of passing the upstream platform/Python CI matrix.

Checklist

  • PR title follows Conventional Commits
  • Tests pass locally
  • Added regression tests for this change
  • New/changed code uses modern type hints
  • Test docstrings describe the invariants; no public documentation change is needed
  • Focused on a single defect
  • No project-specific data files or notebooks added; test fixtures are created in temporary directories

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 17 complexity · 0 duplication

Metric Results
Complexity 17
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant