interactive_slam icon indicating copy to clipboard operation
interactive_slam copied to clipboard

Ability to delete edge

Open tim-fan opened this issue 5 years ago • 7 comments

Hello, thanks for the great package! I'm just wondering if there is a way to delete edges with this tool? The map I import from hdl_graph_slam has some incorrect loop closures I'd like to delete. Additionally I sometimes manually add loop closures incorrectly, and I'd like a way to undo them.

Is there a way to delete these edges?

tim-fan avatar May 20 '20 01:05 tim-fan

The current implementation does not provide a way to delete an edge. But, we will definitely add this ability in the future version.

So far, you can try the devel branch that incorporates some new features, and one of them allows the user to replace an existing pose edge constraint. You can select two keyframes that are connected by a wrong edge and give a correct pose. Then, the existing constraint will be replaced with the new one.

koide3 avatar May 20 '20 03:05 koide3

OK, thanks for the info.

In the meantime for the incorrect hdl_graph_slam edges, I've found I can manually delete them in the exported g2o file. But yes a 'click and delete edge' feature would be very handy :thumbsup::thumbsup:

tim-fan avatar May 20 '20 03:05 tim-fan

Preliminary implementation of the deleting edge ability is now available on the devel branch.

koide3 avatar May 28 '20 08:05 koide3

Thank for adding delete edge button, but when I check the function void delete_edge(EdgeView::Ptr edge) and comment the part find and erase edges_view, the code still run fine. Can you explain the role of this part in this function ? Thanks!

ThanhNhann avatar Oct 13 '20 09:10 ThanhNhann

Can you point the code with a permalink so that I can take a look at it?

koide3 avatar Oct 14 '20 09:10 koide3

Thank for reply, the code is below! https://github.com/SMRT-AIST/interactive_slam/blob/1ecd2f95d3bd8eee6a986c8e49a8745ab40003aa/include/hdl_graph_slam/view/interactive_graph_view.hpp#L93-L97

ThanhNhann avatar Oct 14 '20 09:10 ThanhNhann

edges_view is a subset of drawables and used to manage right click menu. Even if you comment out these lines, the deleted edge properly disappears as far as the following lines are preserved and the drawing object of the edge is removed from drawables (some unused edge_view objects would remain though).

https://github.com/SMRT-AIST/interactive_slam/blob/1ecd2f95d3bd8eee6a986c8e49a8745ab40003aa/include/hdl_graph_slam/view/interactive_graph_view.hpp#L99-L103

koide3 avatar Oct 14 '20 10:10 koide3