New rtabmap-reduceGraph CLI tool (#1655)

* New rtabmap-reduceGraph CLI tool

* fixed some edge cases

* Regenerating optimized map if there was one before reducing the graph

* addMoreLoopClosures: refactored how ctrl-c is handled to stop faster when no loop closures are added

* Added kilted status

* Make offline tool always propagate neighbor merged links

* removed a parameter

* fixed disconnected graph

* fixed --help

* Added error log on Kp/NNStrategy not compatible with huge vocabulary. ReduceGraph/DetectMoreLoopClosures: Make sure original parameters are saved back on closing. g2o: fixing optimizer to Levenberg for SBA to avoid [SetJac] infinite jac fatal error.

* exposing neighbor merged ratio parameter to the tool

* show param in log

* refactored detectMoreLoopClosures to ignore too close nodes in terms of neighbor links based on Mem/STMSize parameter. Reduce graph: added direction parameter.

* Simplified: removed ratio parameter, removed recursive reduction. Just don't reduce if a NM link is longer than maxDistance.

* Removed NNStrategy override, as it was still done on closing when we changed back to original params

* DBViewer: show missing links when showing OptimizedPoses in GraphView, fixed clicking on landmark links

* DetectMoreLoopClosures: Added support for min graph distance option in MainWindow and DbViewer

* slight renaming of ROS jobs

* reprocess: added option --params_last
This commit is contained in:
matlabbe
2026-04-04 19:48:03 -07:00
committed by GitHub
parent 51cfc37923
commit 1ea8fa2e06
24 changed files with 865 additions and 294 deletions
+134 -114
View File
@@ -1729,7 +1729,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>314</width>
<width>403</width>
<height>188</height>
</rect>
</property>
@@ -1885,8 +1885,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>276</width>
<height>1598</height>
<width>518</width>
<height>1071</height>
</rect>
</property>
<attribute name="label">
@@ -2604,15 +2604,29 @@
<property name="geometry">
<rect>
<x>0</x>
<y>-152</y>
<y>-175</y>
<width>403</width>
<height>287</height>
<height>319</height>
</rect>
</property>
<attribute name="label">
<string>Detect more loop closures</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_10" columnstretch="0,1">
<item row="2" column="1">
<widget class="QLabel" name="label_30">
<property name="text">
<string>Angle</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLabel" name="label_34">
<property name="text">
<string>Inter-session</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QCheckBox" name="checkBox_detectMore_interSession">
<property name="text">
@@ -2620,6 +2634,103 @@
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_29">
<property name="text">
<string>Radius Max</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="label_32">
<property name="text">
<string>Intra-session</string>
</property>
</widget>
</item>
<item row="9" column="0">
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0">
<widget class="QDoubleSpinBox" name="doubleSpinBox_detectMore_angle">
<property name="suffix">
<string> degrees</string>
</property>
<property name="decimals">
<number>0</number>
</property>
<property name="maximum">
<double>180.000000000000000</double>
</property>
<property name="singleStep">
<double>1.000000000000000</double>
</property>
<property name="value">
<double>30.000000000000000</double>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_36">
<property name="text">
<string>Radius Min</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QSpinBox" name="spinBox_detectMore_iterations">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="value">
<number>5</number>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QLabel" name="label_38">
<property name="text">
<string>From/to map ID only (-1 is all)</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="label_31">
<property name="text">
<string>Iterations</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QCheckBox" name="checkBox_opt_graph_as_guess">
<property name="text">
<string/>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="checkBox_detectMore_intraSession">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QDoubleSpinBox" name="doubleSpinBox_detectMore_radiusMin">
<property name="suffix">
@@ -2639,43 +2750,6 @@
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="label_32">
<property name="text">
<string>Intra-session</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="label_31">
<property name="text">
<string>Iterations</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QSpinBox" name="spinBox_detectMore_iterations">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="value">
<number>5</number>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QCheckBox" name="checkBox_opt_graph_as_guess">
<property name="text">
<string/>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QLabel" name="label_37">
<property name="text">
@@ -2686,13 +2760,6 @@
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="label_30">
<property name="text">
<string>Angle</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QDoubleSpinBox" name="doubleSpinBox_detectMore_radius">
<property name="suffix">
@@ -2712,66 +2779,6 @@
</property>
</widget>
</item>
<item row="8" column="0">
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="checkBox_detectMore_intraSession">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_29">
<property name="text">
<string>Radius Max</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_36">
<property name="text">
<string>Radius Min</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLabel" name="label_34">
<property name="text">
<string>Inter-session</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QDoubleSpinBox" name="doubleSpinBox_detectMore_angle">
<property name="suffix">
<string> degrees</string>
</property>
<property name="decimals">
<number>0</number>
</property>
<property name="maximum">
<double>180.000000000000000</double>
</property>
<property name="singleStep">
<double>1.000000000000000</double>
</property>
<property name="value">
<double>30.000000000000000</double>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QSpinBox" name="spinBox_fromToMapId">
<property name="minimum">
@@ -2785,10 +2792,23 @@
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QLabel" name="label_38">
<item row="8" column="1">
<widget class="QLabel" name="label_40">
<property name="text">
<string>From/to map ID only (-1 is all)</string>
<string>Minimum graph distance</string>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QSpinBox" name="spinBox_minGraphDistance">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>9999</number>
</property>
<property name="value">
<number>10</number>
</property>
</widget>
</item>
@@ -2799,8 +2819,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>181</width>
<height>485</height>
<width>428</width>
<height>196</height>
</rect>
</property>
<attribute name="label">
+44 -18
View File
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>552</width>
<height>633</height>
<width>553</width>
<height>662</height>
</rect>
</property>
<property name="windowTitle">
@@ -67,10 +67,10 @@
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_3">
<item row="4" column="1">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Cluster radius</string>
<string>Inter-session</string>
</property>
<property name="wordWrap">
<bool>true</bool>
@@ -87,10 +87,10 @@
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="label_6">
<item row="0" column="1">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Iterations</string>
<string>Cluster radius</string>
</property>
<property name="wordWrap">
<bool>true</bool>
@@ -120,16 +120,6 @@
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Inter-session</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="intraSession">
<property name="text">
@@ -137,6 +127,16 @@
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Iterations</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QCheckBox" name="interSession">
<property name="text">
@@ -144,6 +144,32 @@
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Minimum graph distance</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QSpinBox" name="minGraphDistance">
<property name="suffix">
<string> nodes</string>
</property>
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>9999</number>
</property>
<property name="value">
<number>10</number>
</property>
</widget>
</item>
</layout>
</item>
<item>