Extract loop closure(Parents & Children)

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Extract loop closure(Parents & Children)

senia
Hi,
I want to extract all loop closure's from a processed DB.
I can view loop closures using "Database viewer" in the "parents" and "children" lines, and I tried to extract it using the statistics view - draw the "Accepted hypothesis Id" graph and save graph data, yet it saved just the first of the "children" nodes(miss multiply children, and without parents at all).
Is there another way to extract this data?
And if you can, specify the difference between children nodes and parents nodes.
Thank you.
Reply | Threaded
Open this post in threaded view
|

Re: Extract loop closure(Parents & Children)

senia
Another small question, what the Statistics->Loop->"Optimization error" value represent?
Reply | Threaded
Open this post in threaded view
|

Re: Extract loop closure(Parents & Children)

matlabbe
Administrator
Hi Senia,

From the resulting database:
Get all children:
$ sqlite3 rtabmap.db "select from_id, to_id from Link where type != 0 and from_id > to_id"

Get all parents:
$ sqlite3 rtabmap.db "select from_id, to_id from Link where type != 0 and from_id < to_id"

When a loop closure detection happens between two images, the parent node is the newest/current image, and the child is the oldest image. A child can have multiple parents and a parent can have multiple children.

The "Optimization error" is the final error after TORO/g2o or GTSAM optimization. For example with g2o, it is the chi^2 error.

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: Extract loop closure(Parents & Children)

senia
Thanks, Didn't know I could extract data manually using SQL from the database. Very helpful.
One more thing I encountered,
I want to save the "linkage" distance that occurs when a loop closure is detected, i.e the collected error from the last loop-closure/start.
Couldn't find in the database(SQL)/statistics view something that records those link distance("jumps", "adjacent", "error").
Hope you understood and could help.
Senia.
Reply | Threaded
Open this post in threaded view
|

Re: Extract loop closure(Parents & Children)

matlabbe
Administrator
Hi,

This distance is not explicitly saved. You can get the measured constraint of a loop closure with the Link.transform field (12 float BLOB array -> 3x4 transformation matrix). You can get the actual error between the nodes referred in this link (Link.from_id and Link.to_id) by getting the raw poses from the Node.pose field (format is the same as transform) and recomputing the constraint (PoseFrom.inv() * PoseTo).

cheers