Skip to content

Loop Closure #420

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 16 commits into
base: dev
Choose a base branch
from
Open

Loop Closure #420

wants to merge 16 commits into from

Conversation

DiogoProPrayer
Copy link
Contributor

First iteration done, still have to test with graph slam

@DiogoProPrayer DiogoProPrayer requested a review from Copilot April 21, 2025 13:59
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a loop closure detection mechanism integrated into the Graph SLAM solver. Key changes include:

  • Adding a loop closure header and corresponding detection call in the SLAM solver.
  • Implementing a new LoopClosure class in the perception sensor library to detect when the robot closes a loop.
  • Providing the interface for the loop closure module via an updated header file.

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/slam/src/slam_solver/graph_slam_solver.cpp Introduces loop closure header and detection invocation in add_observations().
src/perception_sensor_lib/src/loop_closure/loop_closure.cpp Implements the loop closure detection logic with mutable internal state.
src/perception_sensor_lib/include/perception_sensor_lib/loop_closure/loop_closure.hpp Declares the LoopClosure class and its detect() method.
Files not reviewed (1)
  • src/perception_sensor_lib/CMakeLists.txt: Language not supported

Copy link
Contributor

@Davide64-dev Davide64-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please double check the submodules part. Don't know if it is correct, but it is kinda sus

@DiogoProPrayer
Copy link
Contributor Author

@Davide64-dev I wasn't able to merge with test/endtoend, there was a giant merge conflict
I experimented running state estimation with pacsim keys on simulation and got an error too

Copy link
Contributor

@marhcouto marhcouto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review done, check the points

@Davide64-dev
Copy link
Contributor

@DiogoProPrayer is this ready for a new review?

@DiogoProPrayer DiogoProPrayer requested a review from marhcouto May 13, 2025 09:24
Copy link
Contributor

@marhcouto marhcouto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, some more small changes

Copy link
Contributor

@lourenco31 lourenco31 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merging with the new data association will be bad :(

* @param threshold_dist distance (m) around origin to trigger closure
* @param first_x_cones consider a loop if you see any of these first X cones
*/
LapCounter(double threshold_dist, int first_x_cones, int border_width);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather see a struct with parameters, but if you have a reason not to do that, please update the doxygen documentation so that it also explains what border_width is

Copy link

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.

4 participants