Tango: added marker's max depth error setting

This commit is contained in:
matlabbe
2019-03-18 10:37:02 -04:00
parent c44349511d
commit 9c1c88d35e
5 changed files with 62 additions and 0 deletions
+10
View File
@@ -1139,10 +1139,15 @@ int RTABMapApp::Render()
int fastMovement = (int)uValue(stats.data(), rtabmap::Statistics::kMemoryFast_movement(), 0.0f); int fastMovement = (int)uValue(stats.data(), rtabmap::Statistics::kMemoryFast_movement(), 0.0f);
int loopClosure = (int)uValue(stats.data(), rtabmap::Statistics::kLoopAccepted_hypothesis_id(), 0.0f); int loopClosure = (int)uValue(stats.data(), rtabmap::Statistics::kLoopAccepted_hypothesis_id(), 0.0f);
int rejected = (int)uValue(stats.data(), rtabmap::Statistics::kLoopRejectedHypothesis(), 0.0f); int rejected = (int)uValue(stats.data(), rtabmap::Statistics::kLoopRejectedHypothesis(), 0.0f);
int landmark = (int)uValue(stats.data(), rtabmap::Statistics::kLoopLandmark_detected(), 0.0f);
if(!paused_ && loopClosure>0) if(!paused_ && loopClosure>0)
{ {
main_scene_.setBackgroundColor(0, 0.5f, 0); // green main_scene_.setBackgroundColor(0, 0.5f, 0); // green
} }
else if(!paused_ && landmark!=0)
{
main_scene_.setBackgroundColor(1, 0.65f, 0); // orange
}
else if(!paused_ && rejected>0) else if(!paused_ && rejected>0)
{ {
main_scene_.setBackgroundColor(0, 0.2f, 0); // dark green main_scene_.setBackgroundColor(0, 0.2f, 0); // dark green
@@ -1353,10 +1358,15 @@ int RTABMapApp::Render()
int loopClosure = (int)uValue(stats.data(), rtabmap::Statistics::kLoopAccepted_hypothesis_id(), 0.0f); int loopClosure = (int)uValue(stats.data(), rtabmap::Statistics::kLoopAccepted_hypothesis_id(), 0.0f);
int rejected = (int)uValue(stats.data(), rtabmap::Statistics::kLoopRejectedHypothesis(), 0.0f); int rejected = (int)uValue(stats.data(), rtabmap::Statistics::kLoopRejectedHypothesis(), 0.0f);
int landmark = (int)uValue(stats.data(), rtabmap::Statistics::kLoopLandmark_detected(), 0.0f);
if(!paused_ && loopClosure>0) if(!paused_ && loopClosure>0)
{ {
main_scene_.setBackgroundColor(0, 0.5f, 0); // green main_scene_.setBackgroundColor(0, 0.5f, 0); // green
} }
else if(!paused_ && landmark!=0)
{
main_scene_.setBackgroundColor(1, 0.65f, 0); // orange
}
else if(!paused_ && rejected>0) else if(!paused_ && rejected>0)
{ {
main_scene_.setBackgroundColor(0, 0.2f, 0); // dark green main_scene_.setBackgroundColor(0, 0.2f, 0); // dark green
@@ -198,6 +198,13 @@
android:entries="@array/pref_marker_detection_keys" android:entries="@array/pref_marker_detection_keys"
android:entryValues="@array/pref_marker_detection_values" android:entryValues="@array/pref_marker_detection_values"
android:defaultValue="@string/pref_default_marker_detection"/> android:defaultValue="@string/pref_default_marker_detection"/>
<ListPreference
android:key="@string/pref_key_marker_detection_depth_error"
android:title="@string/pref_title_marker_detection_depth_error"
android:summary="@string/pref_summary_marker_detection_depth_error"
android:entries="@array/pref_marker_detection_depth_error_keys"
android:entryValues="@array/pref_marker_detection_depth_error_values"
android:defaultValue="@string/pref_default_marker_detection_depth_error"/>
</PreferenceCategory> </PreferenceCategory>
<PreferenceCategory <PreferenceCategory
android:title="@string/pref_title_mapping_database"> android:title="@string/pref_title_mapping_database">
+41
View File
@@ -105,6 +105,8 @@
<string name="pref_default_optimize_end">true</string> <string name="pref_default_optimize_end">true</string>
<string name="pref_key_marker_detection">pref_key_marker_detection</string> <string name="pref_key_marker_detection">pref_key_marker_detection</string>
<string name="pref_default_marker_detection">-1</string> <string name="pref_default_marker_detection">-1</string>
<string name="pref_key_marker_detection_depth_error">pref_key_marker_detection_depth_error</string>
<string name="pref_default_marker_detection_depth_error">0.1</string>
<string name="pref_key_keep_all_db">pref_key_keep_all_db</string> <string name="pref_key_keep_all_db">pref_key_keep_all_db</string>
<string name="pref_default_keep_all_db">true</string> <string name="pref_default_keep_all_db">true</string>
<string name="pref_key_raw_scan_saved">pref_key_raw_scan_saved</string> <string name="pref_key_raw_scan_saved">pref_key_raw_scan_saved</string>
@@ -351,6 +353,8 @@
<string name="pref_summary_optimize_end">The map\'s graph is optimized from the last node. The map is moved when a loop closure happens instead of jumping the current pose back to localized area. </string> <string name="pref_summary_optimize_end">The map\'s graph is optimized from the last node. The map is moved when a loop closure happens instead of jumping the current pose back to localized area. </string>
<string name="pref_title_marker_detection">ArUco Marker Detection</string> <string name="pref_title_marker_detection">ArUco Marker Detection</string>
<string name="pref_summary_marker_detection">ArUco markers can be detected for localization and graph optimization.</string> <string name="pref_summary_marker_detection">ArUco markers can be detected for localization and graph optimization.</string>
<string name="pref_title_marker_detection_depth_error">Marker Depth Error Estimation</string>
<string name="pref_summary_marker_detection_depth_error">Size of markers are automatically initialized on the first marker seen. All markers should have the same size. This value is the maximum depth error to do the initialization to get accurate size of the tag. The lower it is, the more perpendicular the camera should be from the marker to do initialization, but size estimated would be more accurate.</string>
<string name="pref_title_keep_all_db">Save All Frames in Database</string> <string name="pref_title_keep_all_db">Save All Frames in Database</string>
<string name="pref_summary_keep_all_db">Discarded frames while not moving are still saved in database. Useful to replay exactly the scanning on RTAB-Map Desktop.</string> <string name="pref_summary_keep_all_db">Discarded frames while not moving are still saved in database. Useful to replay exactly the scanning on RTAB-Map Desktop.</string>
<string name="pref_title_raw_scan_saved">Save Raw Scan</string> <string name="pref_title_raw_scan_saved">Save Raw Scan</string>
@@ -648,6 +652,43 @@
<item>"19"</item> <item>"19"</item>
<item>"20"</item> <item>"20"</item>
</string-array> </string-array>
<string-array name="pref_marker_detection_depth_error_keys">
<item>"1 cm"</item>
<item>"2 cm"</item>
<item>"3 cm"</item>
<item>"4 cm"</item>
<item>"5 cm"</item>
<item>"6 cm"</item>
<item>"7 cm"</item>
<item>"8 cm"</item>
<item>"9 cm"</item>
<item>"10 cm"</item>
<item>"15 cm"</item>
<item>"20 cm"</item>
<item>"30 cm"</item>
<item>"40 cm"</item>
<item>"50 cm"</item>
<item>"100 cm"</item>
</string-array>
<string-array name="pref_marker_detection_depth_error_values">
<item>"0.01"</item>
<item>"0.02"</item>
<item>"0.03"</item>
<item>"0.04"</item>
<item>"0.05"</item>
<item>"0.06"</item>
<item>"0.07"</item>
<item>"0.08"</item>
<item>"0.09"</item>
<item>"0.1"</item>
<item>"0.15"</item>
<item>"0.20"</item>
<item>"0.30"</item>
<item>"0.40"</item>
<item>"0.50"</item>
<item>"1"</item>
</string-array>
<string name="pref_title_export_sub">Exporting&#8230;</string> <string name="pref_title_export_sub">Exporting&#8230;</string>
<string name="pref_title_export">Exporting</string> <string name="pref_title_export">Exporting</string>
@@ -777,6 +777,7 @@ public class RTABMapActivity extends Activity implements OnClickListener, OnItem
boolean optimizeFromGraphEnd = sharedPref.getBoolean(getString(R.string.pref_key_optimize_end), Boolean.parseBoolean(getString(R.string.pref_default_optimize_end))); boolean optimizeFromGraphEnd = sharedPref.getBoolean(getString(R.string.pref_key_optimize_end), Boolean.parseBoolean(getString(R.string.pref_default_optimize_end)));
String optimizer = sharedPref.getString(getString(R.string.pref_key_optimizer), getString(R.string.pref_default_optimizer)); String optimizer = sharedPref.getString(getString(R.string.pref_key_optimizer), getString(R.string.pref_default_optimizer));
String markerDetection = sharedPref.getString(getString(R.string.pref_key_marker_detection), getString(R.string.pref_default_marker_detection)); String markerDetection = sharedPref.getString(getString(R.string.pref_key_marker_detection), getString(R.string.pref_default_marker_detection));
String markerDetectionDepthError = sharedPref.getString(getString(R.string.pref_key_marker_detection_depth_error), getString(R.string.pref_default_marker_detection_depth_error));
mGPSSaved = sharedPref.getBoolean(getString(R.string.pref_key_gps_saved), Boolean.parseBoolean(getString(R.string.pref_default_gps_saved))); mGPSSaved = sharedPref.getBoolean(getString(R.string.pref_key_gps_saved), Boolean.parseBoolean(getString(R.string.pref_default_gps_saved)));
if(mGPSSaved) if(mGPSSaved)
{ {
@@ -842,6 +843,7 @@ public class RTABMapActivity extends Activity implements OnClickListener, OnItem
RTABMapLib.setMappingParameter("Aruco/Dictionary", markerDetection); RTABMapLib.setMappingParameter("Aruco/Dictionary", markerDetection);
RTABMapLib.setMappingParameter("Aruco/CornerRefinementMethod", Integer.parseInt(markerDetection) > 16?"3":"0"); RTABMapLib.setMappingParameter("Aruco/CornerRefinementMethod", Integer.parseInt(markerDetection) > 16?"3":"0");
} }
RTABMapLib.setMappingParameter("Aruco/MaxDepthError", markerDetectionDepthError);
if(!DISABLE_LOG) Log.d(TAG, "set exporting parameters..."); if(!DISABLE_LOG) Log.d(TAG, "set exporting parameters...");
RTABMapLib.setCloudDensityLevel(Integer.parseInt(sharedPref.getString(getString(R.string.pref_key_density), getString(R.string.pref_default_density)))); RTABMapLib.setCloudDensityLevel(Integer.parseInt(sharedPref.getString(getString(R.string.pref_key_density), getString(R.string.pref_default_density))));
@@ -207,6 +207,7 @@ public class SettingsActivity extends PreferenceActivity implements OnSharedPref
((Preference)findPreference(getString(R.string.pref_key_features_type))).setSummary("("+((ListPreference)findPreference(getString(R.string.pref_key_features_type))).getEntry() + ") "+getString(R.string.pref_summary_features_type)); ((Preference)findPreference(getString(R.string.pref_key_features_type))).setSummary("("+((ListPreference)findPreference(getString(R.string.pref_key_features_type))).getEntry() + ") "+getString(R.string.pref_summary_features_type));
((Preference)findPreference(getString(R.string.pref_key_optimizer))).setSummary("("+((ListPreference)findPreference(getString(R.string.pref_key_optimizer))).getEntry() + ") "+getString(R.string.pref_summary_optimizer)); ((Preference)findPreference(getString(R.string.pref_key_optimizer))).setSummary("("+((ListPreference)findPreference(getString(R.string.pref_key_optimizer))).getEntry() + ") "+getString(R.string.pref_summary_optimizer));
((Preference)findPreference(getString(R.string.pref_key_marker_detection))).setSummary("("+((ListPreference)findPreference(getString(R.string.pref_key_marker_detection))).getEntry() + ") "+getString(R.string.pref_summary_marker_detection)); ((Preference)findPreference(getString(R.string.pref_key_marker_detection))).setSummary("("+((ListPreference)findPreference(getString(R.string.pref_key_marker_detection))).getEntry() + ") "+getString(R.string.pref_summary_marker_detection));
((Preference)findPreference(getString(R.string.pref_key_marker_detection_depth_error))).setSummary("("+((ListPreference)findPreference(getString(R.string.pref_key_marker_detection_depth_error))).getEntry() + ") "+getString(R.string.pref_summary_marker_detection_depth_error));
((Preference)findPreference(getString(R.string.pref_key_cloud_voxel))).setSummary("("+((ListPreference)findPreference(getString(R.string.pref_key_cloud_voxel))).getEntry() + ") "+getString(R.string.pref_summary_cloud_voxel)); ((Preference)findPreference(getString(R.string.pref_key_cloud_voxel))).setSummary("("+((ListPreference)findPreference(getString(R.string.pref_key_cloud_voxel))).getEntry() + ") "+getString(R.string.pref_summary_cloud_voxel));
((Preference)findPreference(getString(R.string.pref_key_texture_size))).setSummary("("+((ListPreference)findPreference(getString(R.string.pref_key_texture_size))).getEntry() + ") "+getString(R.string.pref_summary_texture_size)); ((Preference)findPreference(getString(R.string.pref_key_texture_size))).setSummary("("+((ListPreference)findPreference(getString(R.string.pref_key_texture_size))).getEntry() + ") "+getString(R.string.pref_summary_texture_size));
@@ -267,6 +268,7 @@ public class SettingsActivity extends PreferenceActivity implements OnSharedPref
if(key.compareTo(getString(R.string.pref_key_features_type))==0) pref.setSummary("("+((ListPreference)pref).getEntry() + ") "+getString(R.string.pref_summary_features_type)); if(key.compareTo(getString(R.string.pref_key_features_type))==0) pref.setSummary("("+((ListPreference)pref).getEntry() + ") "+getString(R.string.pref_summary_features_type));
if(key.compareTo(getString(R.string.pref_key_optimizer))==0) pref.setSummary("("+((ListPreference)pref).getEntry() + ") "+getString(R.string.pref_summary_optimizer)); if(key.compareTo(getString(R.string.pref_key_optimizer))==0) pref.setSummary("("+((ListPreference)pref).getEntry() + ") "+getString(R.string.pref_summary_optimizer));
if(key.compareTo(getString(R.string.pref_key_marker_detection))==0) pref.setSummary("("+((ListPreference)pref).getEntry() + ") "+getString(R.string.pref_summary_marker_detection)); if(key.compareTo(getString(R.string.pref_key_marker_detection))==0) pref.setSummary("("+((ListPreference)pref).getEntry() + ") "+getString(R.string.pref_summary_marker_detection));
if(key.compareTo(getString(R.string.pref_key_marker_detection_depth_error))==0) pref.setSummary("("+((ListPreference)pref).getEntry() + ") "+getString(R.string.pref_summary_marker_detection_depth_error));
if(key.compareTo(getString(R.string.pref_key_cloud_voxel))==0) pref.setSummary("("+((ListPreference)pref).getEntry() + ") "+getString(R.string.pref_summary_cloud_voxel)); if(key.compareTo(getString(R.string.pref_key_cloud_voxel))==0) pref.setSummary("("+((ListPreference)pref).getEntry() + ") "+getString(R.string.pref_summary_cloud_voxel));
if(key.compareTo(getString(R.string.pref_key_texture_size))==0) pref.setSummary("("+((ListPreference)pref).getEntry() + ") "+getString(R.string.pref_summary_texture_size)); if(key.compareTo(getString(R.string.pref_key_texture_size))==0) pref.setSummary("("+((ListPreference)pref).getEntry() + ") "+getString(R.string.pref_summary_texture_size));