Fix segfault after loading posegraph#527
Merged
SteveMacenski merged 2 commits intoSteveMacenski:ros2from Aug 24, 2022
Merged
Conversation
Owner
At the time of writing, I had just gotten out of several months working in the core of lib KartoSDK which has raw pointers galore for the graph-SLAM representations so it was just the headspace I was in. Plus, |
SteveMacenski
pushed a commit
that referenced
this pull request
Aug 24, 2022
* Assign mapper to closure_assistant after loading posgraph * Fix linting
SteveMacenski
added a commit
that referenced
this pull request
Aug 24, 2022
* Publish pose with covariance in localization mode. (#511) * Visualize localization nodes and edges with different colors in the pose graph marker message. (#513) * Fix edge marker id to not conflict with the localization edge marker. (#515) * Stop ceres problem from freeing loss function (#519) * Add map_and_localization node that supports toggling between mapping and localization modes with a service. (#512) * resolve API change from galactic (#524) * Fix segfault after loading posegraph (#527) * Assign mapper to closure_assistant after loading posgraph * Fix linting * Midigate spamming for 50Hz lidar (#526) * Increase scan filter queue_size * Add scan_queue_size as parameter Co-authored-by: Marc Alban <marcalban@hatchbed.com> Co-authored-by: john-maidbot <78750993+john-maidbot@users.noreply.github.com> Co-authored-by: Samuel Lindgren <samuel@dynorobotics.se>
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.
Basic Info
I was getting a segfault in in
localization_slam_toolbox_nodeafter loading a posegraph from a file here in the code:slam_toolbox/src/loop_closure_assistant.cpp
Line 189 in ae68b85
The problem is that the
LoopClosureAssistantwas created with a raw pointer to akarto::Mapperinstance from a unique pointer. The raw pointer is not replaced when a new serialized pose graph is loaded. Trying to call functions on themapper_pointer in theLoopClosureAssistantafter that will cause a segfault.| Primary OS tested on | Ubuntu |
| Robotic platform tested on | gazebo simulation of Husky |
Description of contribution in a few bullet points
mapper_pointer toLoopClosureAssistantLoopClosureAssistantinloadSerializedPoseGraphFuture work that may be required
It seems a bit strange to me that
LoopClosureAssistantis using raw pointers rather that smart pointers. I suspect there is a reason for this thought... If not, it not we should probably change it so it uses smart pointers and avoid segfaults like this.