Add GraphSLAM data collection loop and full linearize/reduce/solve pi… - #2
Open
jsouvenir wants to merge 1 commit into
Open
Add GraphSLAM data collection loop and full linearize/reduce/solve pi…#2jsouvenir wants to merge 1 commit into
jsouvenir wants to merge 1 commit into
Conversation
…peline Adds a graphSLAM Webots controller (graphSLAM.py) that teleports the robot through rotate/move cycles while collecting synchronized odometry, landmark range-bearing, and ground-truth logs. Data collection helpers (get_odometry, get_landmark_row, rotate_step, move_forward_step) live in graphSLAM_data_collection.py, including a slew-rate limiter on rotate_step that fixes a spurious odometry velocity spike at the start of each rotation. navigation_tools.py holds shared geometry helpers split out of my_robot.py. Implements the full offline GraphSLAM pipeline in graph_slam_calculations.py: - graphSLAM_init: dead-reckons an initial pose trajectory and seeds landmark estimates from first sightings - graphSLAM_linearize: builds the information matrix/vector for one Gauss-Newton correction from motion and measurement edges - graphSLAM_reduce: eliminates landmark variables via Schur complement - graphSLAM_solve: solves the reduced system and back-substitutes landmark corrections - graphSLAM_run: iterates linearize/reduce/solve to convergence - Accuracy/diagnostic helpers (graphSLAM_accuracy, print_graphSLAM_accuracy, print_landmark_triangulation_check, print_landmark_observation_spread, print_worst_pose_errors) for comparing results against ground truth Each stage was verified against a synthetic scenario with known ground truth: linearize/reduce/solve match a full-system solve to floating-point precision, and graphSLAM_run converges landmark/pose estimates toward true positions. Known limitation: on real Webots runs, GraphSLAM currently underperforms dead reckoning (~-31% on the current path/cycle configuration). Root cause diagnosed as insufficient landmark observability -- stretches of the path where fewer than two landmarks are simultaneously visible, or where the visible landmark(s) are seen across a narrow angular window, leave individual poses underdetermined even though the overall landmark map converges well. Not an implementation bug: linearize/reduce/solve were verified independently, and the odometry-spike issue found during investigation was fixed separately. Remaining fix requires path/rotation schedule or camera FOV changes, not optimization changes. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a graphSLAM Webots controller (graphSLAM.py) that teleports the robot through rotate/move cycles while collecting synchronized odometry, landmark range-bearing, and ground-truth logs. Data collection helpers (get_odometry, get_landmark_row, rotate_step, move_forward_step) live in graphSLAM_data_collection.py, including a slew-rate limiter on rotate_step that fixes a spurious odometry velocity spike at the start of each rotation. navigation_tools.py holds shared geometry helpers split out of my_robot.py.
Implements the full offline GraphSLAM pipeline in graph_slam_calculations.py:
Each stage was verified against a synthetic scenario with known ground truth: linearize/reduce/solve match a full-system solve to floating-point precision, and graphSLAM_run converges landmark/pose estimates toward true positions.
Known limitation: on real Webots runs, GraphSLAM currently underperforms dead reckoning (~-31% on the current path/cycle configuration). Root cause diagnosed as insufficient landmark observability -- stretches of the path where fewer than two landmarks are simultaneously visible, or where the visible landmark(s) are seen across a narrow angular window, leave individual poses underdetermined even though the overall landmark map converges well. Not an implementation bug: linearize/reduce/solve were verified independently, and the odometry-spike issue found during investigation was fixed separately. Remaining fix requires path/rotation schedule or camera FOV changes, not optimization changes.