Closed MichaelGrupp closed 3 years ago
Related to the linked RFC PR and the associated PR in cartographer_ros.
Hi there, I've tried this DeleteTrajectory service to try to remove a loaded frozen trajectory. It works well and the frozen trajectory is deleted. However, the code crashes after the frozen trajectory is deleted. The error is shown as below:
terminate called after throwing an instance of 'std::out_of_range' what(): map::at
I find it happens in constraint_builder_2d.cc. The line of "(*callback)(result);" I used the latest master for cartographer which has all the updates above. Does anyone have any idea why it happens and how to resolve it? Thanks very much in advance.
@cuicuihaohaoxuexi I'm also confused with this problem, my error is the same as you!
The deletion logic needs to take care of deleting all data that is "exclusively" connected to the submaps that are to be removed. This is achieved by looking at the data that is connected via constraints in the graph.
Deleting a frozen trajectory (one without optimization constraints) doesn't work that way and would leave dangling nodes in the graph.
This modifies the logic to use the
node_ids
field of the submap instead of the constraints.Signed-off-by: Michael Grupp grupp@magazino.eu