mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 17:40:23 +08:00
Tango: added "Settings->Mapping->ArUco Marker Detection" option
This commit is contained in:
@@ -100,6 +100,7 @@ rtabmap::ParametersMap RTABMapApp::getRtabmapParameters()
|
|||||||
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kRGBDProximityBySpace(), std::string("false"))); // just keep loop closure detection
|
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kRGBDProximityBySpace(), std::string("false"))); // just keep loop closure detection
|
||||||
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kRGBDLinearUpdate(), std::string("0.05")));
|
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kRGBDLinearUpdate(), std::string("0.05")));
|
||||||
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kRGBDAngularUpdate(), std::string("0.05")));
|
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kRGBDAngularUpdate(), std::string("0.05")));
|
||||||
|
parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kArucoMarkerLength(), std::string("0.0")));
|
||||||
|
|
||||||
if(parameters.find(rtabmap::Parameters::kOptimizerStrategy()) != parameters.end())
|
if(parameters.find(rtabmap::Parameters::kOptimizerStrategy()) != parameters.end())
|
||||||
{
|
{
|
||||||
@@ -1379,14 +1380,14 @@ int RTABMapApp::Render()
|
|||||||
LOGW("Looking fo data to load (%d) %fs", bufferedSensorData.size(), time.ticks());
|
LOGW("Looking fo data to load (%d) %fs", bufferedSensorData.size(), time.ticks());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::map<int, rtabmap::Transform> poses = rtabmapEvents.back()->getStats().poses();
|
std::map<int, rtabmap::Transform> posesWithMarkers = rtabmapEvents.back()->getStats().poses();
|
||||||
if(!rtabmapEvents.back()->getStats().mapCorrection().isNull())
|
if(!rtabmapEvents.back()->getStats().mapCorrection().isNull())
|
||||||
{
|
{
|
||||||
mapToOdom_ = rtabmapEvents.back()->getStats().mapCorrection();
|
mapToOdom_ = rtabmapEvents.back()->getStats().mapCorrection();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Transform pose in OpenGL world
|
// Transform pose in OpenGL world
|
||||||
for(std::map<int, rtabmap::Transform>::iterator iter=poses.begin(); iter!=poses.end(); ++iter)
|
for(std::map<int, rtabmap::Transform>::iterator iter=posesWithMarkers.begin(); iter!=posesWithMarkers.end(); ++iter)
|
||||||
{
|
{
|
||||||
if(!graphOptimization_)
|
if(!graphOptimization_)
|
||||||
{
|
{
|
||||||
@@ -1402,6 +1403,7 @@ int RTABMapApp::Render()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::map<int, rtabmap::Transform> poses(posesWithMarkers.lower_bound(0), posesWithMarkers.end());
|
||||||
const std::multimap<int, rtabmap::Link> & links = rtabmapEvents.back()->getStats().constraints();
|
const std::multimap<int, rtabmap::Link> & links = rtabmapEvents.back()->getStats().constraints();
|
||||||
if(poses.size())
|
if(poses.size())
|
||||||
{
|
{
|
||||||
@@ -1533,7 +1535,7 @@ int RTABMapApp::Render()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(poses.size())
|
if(!poses.empty())
|
||||||
{
|
{
|
||||||
//update cloud visibility
|
//update cloud visibility
|
||||||
boost::mutex::scoped_lock lock(meshesMutex_);
|
boost::mutex::scoped_lock lock(meshesMutex_);
|
||||||
@@ -1551,6 +1553,33 @@ int RTABMapApp::Render()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update markers
|
||||||
|
std::set<int> addedMarkers = main_scene_.getAddedMarkers();
|
||||||
|
for(std::set<int>::const_iterator iter=addedMarkers.begin();
|
||||||
|
iter!=addedMarkers.end();
|
||||||
|
++iter)
|
||||||
|
{
|
||||||
|
if(posesWithMarkers.find(*iter) == posesWithMarkers.end())
|
||||||
|
{
|
||||||
|
main_scene_.removeMarker(*iter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for(std::map<int, rtabmap::Transform>::const_iterator iter=posesWithMarkers.begin();
|
||||||
|
iter!=posesWithMarkers.end() && iter->first<0;
|
||||||
|
++iter)
|
||||||
|
{
|
||||||
|
int id = iter->first;
|
||||||
|
if(main_scene_.hasMarker(id))
|
||||||
|
{
|
||||||
|
//just update pose
|
||||||
|
main_scene_.setMarkerPose(id, iter->second);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
main_scene_.addMarker(id, iter->second);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -3320,6 +3349,7 @@ bool RTABMapApp::handleEvent(UEvent * event)
|
|||||||
uInsert(bufferedStatsData_, std::make_pair<std::string, float>(rtabmap::Statistics::kLoopHighest_hypothesis_value(), uValue(stats.data(), rtabmap::Statistics::kLoopHighest_hypothesis_value(), 0.0f)));
|
uInsert(bufferedStatsData_, std::make_pair<std::string, float>(rtabmap::Statistics::kLoopHighest_hypothesis_value(), uValue(stats.data(), rtabmap::Statistics::kLoopHighest_hypothesis_value(), 0.0f)));
|
||||||
uInsert(bufferedStatsData_, std::make_pair<std::string, float>(rtabmap::Statistics::kMemoryDistance_travelled(), uValue(stats.data(), rtabmap::Statistics::kMemoryDistance_travelled(), 0.0f)));
|
uInsert(bufferedStatsData_, std::make_pair<std::string, float>(rtabmap::Statistics::kMemoryDistance_travelled(), uValue(stats.data(), rtabmap::Statistics::kMemoryDistance_travelled(), 0.0f)));
|
||||||
uInsert(bufferedStatsData_, std::make_pair<std::string, float>(rtabmap::Statistics::kMemoryFast_movement(), uValue(stats.data(), rtabmap::Statistics::kMemoryFast_movement(), 0.0f)));
|
uInsert(bufferedStatsData_, std::make_pair<std::string, float>(rtabmap::Statistics::kMemoryFast_movement(), uValue(stats.data(), rtabmap::Statistics::kMemoryFast_movement(), 0.0f)));
|
||||||
|
uInsert(bufferedStatsData_, std::make_pair<std::string, float>(rtabmap::Statistics::kLoopLandmark_detected(), uValue(stats.data(), rtabmap::Statistics::kLoopLandmark_detected(), 0.0f)));
|
||||||
}
|
}
|
||||||
// else use last data
|
// else use last data
|
||||||
|
|
||||||
@@ -3338,6 +3368,7 @@ bool RTABMapApp::handleEvent(UEvent * event)
|
|||||||
float hypothesis = uValue(bufferedStatsData_, rtabmap::Statistics::kLoopHighest_hypothesis_value(), 0.0f);
|
float hypothesis = uValue(bufferedStatsData_, rtabmap::Statistics::kLoopHighest_hypothesis_value(), 0.0f);
|
||||||
float distanceTravelled = uValue(bufferedStatsData_, rtabmap::Statistics::kMemoryDistance_travelled(), 0.0f);
|
float distanceTravelled = uValue(bufferedStatsData_, rtabmap::Statistics::kMemoryDistance_travelled(), 0.0f);
|
||||||
int fastMovement = (int)uValue(bufferedStatsData_, rtabmap::Statistics::kMemoryFast_movement(), 0.0f);
|
int fastMovement = (int)uValue(bufferedStatsData_, rtabmap::Statistics::kMemoryFast_movement(), 0.0f);
|
||||||
|
int landmarkDetected = (int)uValue(bufferedStatsData_, rtabmap::Statistics::kLoopLandmark_detected(), 0.0f);
|
||||||
rtabmap::Transform currentPose = main_scene_.GetCameraPose();
|
rtabmap::Transform currentPose = main_scene_.GetCameraPose();
|
||||||
float x=0.0f,y=0.0f,z=0.0f,roll=0.0f,pitch=0.0f,yaw=0.0f;
|
float x=0.0f,y=0.0f,z=0.0f,roll=0.0f,pitch=0.0f,yaw=0.0f;
|
||||||
if(!currentPose.isNull())
|
if(!currentPose.isNull())
|
||||||
@@ -3357,7 +3388,7 @@ bool RTABMapApp::handleEvent(UEvent * event)
|
|||||||
jclass clazz = env->GetObjectClass(RTABMapActivity);
|
jclass clazz = env->GetObjectClass(RTABMapActivity);
|
||||||
if(clazz)
|
if(clazz)
|
||||||
{
|
{
|
||||||
jmethodID methodID = env->GetMethodID(clazz, "updateStatsCallback", "(IIIIFIIIIIIFIFIFFFFIFFFFFF)V" );
|
jmethodID methodID = env->GetMethodID(clazz, "updateStatsCallback", "(IIIIFIIIIIIFIFIFFFFIIFFFFFF)V" );
|
||||||
if(methodID)
|
if(methodID)
|
||||||
{
|
{
|
||||||
env->CallVoidMethod(RTABMapActivity, methodID,
|
env->CallVoidMethod(RTABMapActivity, methodID,
|
||||||
@@ -3381,6 +3412,7 @@ bool RTABMapApp::handleEvent(UEvent * event)
|
|||||||
optimizationMaxErrorRatio,
|
optimizationMaxErrorRatio,
|
||||||
distanceTravelled,
|
distanceTravelled,
|
||||||
fastMovement,
|
fastMovement,
|
||||||
|
landmarkDetected,
|
||||||
x,
|
x,
|
||||||
y,
|
y,
|
||||||
z,
|
z,
|
||||||
|
|||||||
@@ -188,6 +188,10 @@ void Scene::clear()
|
|||||||
{
|
{
|
||||||
delete iter->second;
|
delete iter->second;
|
||||||
}
|
}
|
||||||
|
for(std::map<int, tango_gl::Axis*>::iterator iter=markers_.begin(); iter!=markers_.end(); ++iter)
|
||||||
|
{
|
||||||
|
delete iter->second;
|
||||||
|
}
|
||||||
if(trace_)
|
if(trace_)
|
||||||
{
|
{
|
||||||
trace_->ClearVertexArray();
|
trace_->ClearVertexArray();
|
||||||
@@ -198,6 +202,7 @@ void Scene::clear()
|
|||||||
graph_ = 0;
|
graph_ = 0;
|
||||||
}
|
}
|
||||||
pointClouds_.clear();
|
pointClouds_.clear();
|
||||||
|
markers_.clear();
|
||||||
if(grid_)
|
if(grid_)
|
||||||
{
|
{
|
||||||
grid_->SetPosition(kHeightOffset);
|
grid_->SetPosition(kHeightOffset);
|
||||||
@@ -551,6 +556,12 @@ int Scene::Render() {
|
|||||||
glDepthMask(GL_TRUE);
|
glDepthMask(GL_TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//draw markers on foreground
|
||||||
|
for(std::map<int, tango_gl::Axis*>::const_iterator iter=markers_.begin(); iter!=markers_.end(); ++iter)
|
||||||
|
{
|
||||||
|
iter->second->Render(projectionMatrix, viewMatrix);
|
||||||
|
}
|
||||||
|
|
||||||
return (int)cloudsToDraw.size();
|
return (int)cloudsToDraw.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -648,6 +659,53 @@ void Scene::setTraceVisible(bool visible)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Should only be called in OpenGL thread!
|
//Should only be called in OpenGL thread!
|
||||||
|
void Scene::addMarker(
|
||||||
|
int id,
|
||||||
|
const rtabmap::Transform & pose)
|
||||||
|
{
|
||||||
|
LOGI("add marker %d", id);
|
||||||
|
std::map<int, tango_gl::Axis*>::iterator iter=markers_.find(id);
|
||||||
|
if(iter == markers_.end())
|
||||||
|
{
|
||||||
|
//create
|
||||||
|
tango_gl::Axis * drawable = new tango_gl::Axis();
|
||||||
|
drawable->SetScale(glm::vec3(0.05f,0.05f,0.05f));
|
||||||
|
drawable->SetLineWidth(5);
|
||||||
|
markers_.insert(std::make_pair(id, drawable));
|
||||||
|
}
|
||||||
|
setMarkerPose(id, pose);
|
||||||
|
}
|
||||||
|
void Scene::setMarkerPose(int id, const rtabmap::Transform & pose)
|
||||||
|
{
|
||||||
|
UASSERT(!pose.isNull());
|
||||||
|
std::map<int, tango_gl::Axis*>::iterator iter=markers_.find(id);
|
||||||
|
if(iter != markers_.end())
|
||||||
|
{
|
||||||
|
glm::vec3 position(pose.x(), pose.y(), pose.z());
|
||||||
|
Eigen::Quaternionf quat = pose.getQuaternionf();
|
||||||
|
glm::quat rotation(quat.w(), quat.x(), quat.y(), quat.z());
|
||||||
|
iter->second->SetPosition(position);
|
||||||
|
iter->second->SetRotation(rotation);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
bool Scene::hasMarker(int id) const
|
||||||
|
{
|
||||||
|
return markers_.find(id) != markers_.end();
|
||||||
|
}
|
||||||
|
void Scene::removeMarker(int id)
|
||||||
|
{
|
||||||
|
std::map<int, tango_gl::Axis*>::iterator iter=markers_.find(id);
|
||||||
|
if(iter != markers_.end())
|
||||||
|
{
|
||||||
|
delete iter->second;
|
||||||
|
markers_.erase(iter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
std::set<int> Scene::getAddedMarkers() const
|
||||||
|
{
|
||||||
|
return uKeysSet(markers_);
|
||||||
|
}
|
||||||
|
|
||||||
void Scene::addCloud(
|
void Scene::addCloud(
|
||||||
int id,
|
int id,
|
||||||
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
|
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
|
||||||
|
|||||||
@@ -102,6 +102,12 @@ class Scene {
|
|||||||
void setGridVisible(bool visible);
|
void setGridVisible(bool visible);
|
||||||
void setTraceVisible(bool visible);
|
void setTraceVisible(bool visible);
|
||||||
|
|
||||||
|
void addMarker(int id, const rtabmap::Transform & pose);
|
||||||
|
void setMarkerPose(int id, const rtabmap::Transform & pose);
|
||||||
|
bool hasMarker(int id) const;
|
||||||
|
void removeMarker(int id);
|
||||||
|
std::set<int> getAddedMarkers() const;
|
||||||
|
|
||||||
void addCloud(
|
void addCloud(
|
||||||
int id,
|
int id,
|
||||||
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
|
const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
|
||||||
@@ -167,6 +173,8 @@ class Scene {
|
|||||||
bool gridVisible_;
|
bool gridVisible_;
|
||||||
bool traceVisible_;
|
bool traceVisible_;
|
||||||
|
|
||||||
|
std::map<int, tango_gl::Axis*> markers_;
|
||||||
|
|
||||||
TangoSupportRotation color_camera_to_display_rotation_;
|
TangoSupportRotation color_camera_to_display_rotation_;
|
||||||
|
|
||||||
std::map<int, PointCloudDrawable*> pointClouds_;
|
std::map<int, PointCloudDrawable*> pointClouds_;
|
||||||
|
|||||||
@@ -191,6 +191,13 @@
|
|||||||
android:title="@string/pref_title_optimize_end"
|
android:title="@string/pref_title_optimize_end"
|
||||||
android:summary="@string/pref_summary_optimize_end"
|
android:summary="@string/pref_summary_optimize_end"
|
||||||
android:defaultValue="@string/pref_default_optimize_end"/>
|
android:defaultValue="@string/pref_default_optimize_end"/>
|
||||||
|
<ListPreference
|
||||||
|
android:key="@string/pref_key_marker_detection"
|
||||||
|
android:title="@string/pref_title_marker_detection"
|
||||||
|
android:summary="@string/pref_summary_marker_detection"
|
||||||
|
android:entries="@array/pref_marker_detection_keys"
|
||||||
|
android:entryValues="@array/pref_marker_detection_values"
|
||||||
|
android:defaultValue="@string/pref_default_marker_detection"/>
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
<PreferenceCategory
|
<PreferenceCategory
|
||||||
android:title="@string/pref_title_mapping_database">
|
android:title="@string/pref_title_mapping_database">
|
||||||
|
|||||||
@@ -103,6 +103,8 @@
|
|||||||
<string name="pref_default_optimizer">2</string>
|
<string name="pref_default_optimizer">2</string>
|
||||||
<string name="pref_key_optimize_end">pref_key_optimize_end</string>
|
<string name="pref_key_optimize_end">pref_key_optimize_end</string>
|
||||||
<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_default_marker_detection">-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>
|
||||||
@@ -347,6 +349,8 @@
|
|||||||
<string name="pref_summary_optimizer">Graph optimization approach.</string>
|
<string name="pref_summary_optimizer">Graph optimization approach.</string>
|
||||||
<string name="pref_title_optimize_end">Optimization from Graph End</string>
|
<string name="pref_title_optimize_end">Optimization from Graph End</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_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_summary_marker_detection">ArUco markers can be detected for localization and graph optimization.</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>
|
||||||
@@ -596,6 +600,46 @@
|
|||||||
<item>"1"</item>
|
<item>"1"</item>
|
||||||
<item>"0"</item>
|
<item>"0"</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
<string-array name="pref_marker_detection_keys">
|
||||||
|
<item>"Disabled"</item>
|
||||||
|
<item>"4X4_50"</item>
|
||||||
|
<item>"4X4_100"</item>
|
||||||
|
<item>"4X4_250"</item>
|
||||||
|
<item>"4X4_1000"</item>
|
||||||
|
<item>"5X5_50"</item>
|
||||||
|
<item>"5X5_100"</item>
|
||||||
|
<item>"5X5_250"</item>
|
||||||
|
<item>"5X5_1000"</item>
|
||||||
|
<item>"6X6_50"</item>
|
||||||
|
<item>"6X6_100"</item>
|
||||||
|
<item>"6X6_250"</item>
|
||||||
|
<item>"6X6_1000"</item>
|
||||||
|
<item>"7X7_50"</item>
|
||||||
|
<item>"7X7_100"</item>
|
||||||
|
<item>"7X7_250"</item>
|
||||||
|
<item>"7X7_1000"</item>
|
||||||
|
<item>"ARUCO_ORIGINAL"</item>
|
||||||
|
</string-array>
|
||||||
|
<string-array name="pref_marker_detection_values">
|
||||||
|
<item>"-1"</item>
|
||||||
|
<item>"0"</item>
|
||||||
|
<item>"1"</item>
|
||||||
|
<item>"2"</item>
|
||||||
|
<item>"3"</item>
|
||||||
|
<item>"4"</item>
|
||||||
|
<item>"5"</item>
|
||||||
|
<item>"6"</item>
|
||||||
|
<item>"7"</item>
|
||||||
|
<item>"8"</item>
|
||||||
|
<item>"9"</item>
|
||||||
|
<item>"10"</item>
|
||||||
|
<item>"11"</item>
|
||||||
|
<item>"12"</item>
|
||||||
|
<item>"13"</item>
|
||||||
|
<item>"14"</item>
|
||||||
|
<item>"15"</item>
|
||||||
|
<item>"16"</item>
|
||||||
|
</string-array>
|
||||||
|
|
||||||
<string name="pref_title_export_sub">Exporting…</string>
|
<string name="pref_title_export_sub">Exporting…</string>
|
||||||
<string name="pref_title_export">Exporting</string>
|
<string name="pref_title_export">Exporting</string>
|
||||||
|
|||||||
@@ -776,6 +776,7 @@ public class RTABMapActivity extends Activity implements OnClickListener, OnItem
|
|||||||
boolean keepAllDb = sharedPref.getBoolean(getString(R.string.pref_key_keep_all_db), Boolean.parseBoolean(getString(R.string.pref_default_keep_all_db)));
|
boolean keepAllDb = sharedPref.getBoolean(getString(R.string.pref_key_keep_all_db), Boolean.parseBoolean(getString(R.string.pref_default_keep_all_db)));
|
||||||
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));
|
||||||
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)
|
||||||
{
|
{
|
||||||
@@ -831,6 +832,15 @@ public class RTABMapActivity extends Activity implements OnClickListener, OnItem
|
|||||||
RTABMapLib.setMappingParameter("Mem/NotLinkedNodesKept", String.valueOf(keepAllDb));
|
RTABMapLib.setMappingParameter("Mem/NotLinkedNodesKept", String.valueOf(keepAllDb));
|
||||||
RTABMapLib.setMappingParameter("RGBD/OptimizeFromGraphEnd", String.valueOf(optimizeFromGraphEnd));
|
RTABMapLib.setMappingParameter("RGBD/OptimizeFromGraphEnd", String.valueOf(optimizeFromGraphEnd));
|
||||||
RTABMapLib.setMappingParameter("Optimizer/Strategy", optimizer);
|
RTABMapLib.setMappingParameter("Optimizer/Strategy", optimizer);
|
||||||
|
if(Float.parseFloat(markerDetection) == -1)
|
||||||
|
{
|
||||||
|
RTABMapLib.setMappingParameter("RGBD/MarkerDetection", "false");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RTABMapLib.setMappingParameter("RGBD/MarkerDetection", "true");
|
||||||
|
RTABMapLib.setMappingParameter("Aruco/Dictionary", markerDetection);
|
||||||
|
}
|
||||||
|
|
||||||
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))));
|
||||||
@@ -1111,6 +1121,7 @@ public class RTABMapActivity extends Activity implements OnClickListener, OnItem
|
|||||||
float optimizationMaxError,
|
float optimizationMaxError,
|
||||||
float optimizationMaxErrorRatio,
|
float optimizationMaxErrorRatio,
|
||||||
boolean fastMovement,
|
boolean fastMovement,
|
||||||
|
int landmarkDetected,
|
||||||
String[] statusTexts)
|
String[] statusTexts)
|
||||||
{
|
{
|
||||||
mStatusTexts = statusTexts;
|
mStatusTexts = statusTexts;
|
||||||
@@ -1191,6 +1202,11 @@ public class RTABMapActivity extends Activity implements OnClickListener, OnItem
|
|||||||
mToast.setText(String.format("Loop closure detected! (%d/%d inliers)", inliers, matches));
|
mToast.setText(String.format("Loop closure detected! (%d/%d inliers)", inliers, matches));
|
||||||
mToast.show();
|
mToast.show();
|
||||||
}
|
}
|
||||||
|
else if(landmarkDetected != 0)
|
||||||
|
{
|
||||||
|
mToast.setText(String.format("Landmark %d detected!", landmarkDetected));
|
||||||
|
mToast.show();
|
||||||
|
}
|
||||||
else if(rejected > 0)
|
else if(rejected > 0)
|
||||||
{
|
{
|
||||||
if(inliers >= Integer.parseInt(mMinInliers))
|
if(inliers >= Integer.parseInt(mMinInliers))
|
||||||
@@ -1206,7 +1222,7 @@ public class RTABMapActivity extends Activity implements OnClickListener, OnItem
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mToast.setText(String.format("Loop closure rejected, not enough inliers (%d/%d < %s).", inliers, matches, mMinInliers));
|
mToast.setText(String.format("Loop closure rejected, not enough inliers (%d/%d < %s).", inliers, matches, mMinInliers));
|
||||||
}
|
}
|
||||||
mToast.show();
|
mToast.show();
|
||||||
}
|
}
|
||||||
@@ -1248,6 +1264,7 @@ public class RTABMapActivity extends Activity implements OnClickListener, OnItem
|
|||||||
final float optimizationMaxErrorRatio,
|
final float optimizationMaxErrorRatio,
|
||||||
final float distanceTravelled,
|
final float distanceTravelled,
|
||||||
final int fastMovement,
|
final int fastMovement,
|
||||||
|
final int landmarkDetected,
|
||||||
final float x,
|
final float x,
|
||||||
final float y,
|
final float y,
|
||||||
final float z,
|
final float z,
|
||||||
@@ -1356,7 +1373,7 @@ public class RTABMapActivity extends Activity implements OnClickListener, OnItem
|
|||||||
|
|
||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
updateStatsUI(loopClosureId, inliers, matches, rejected, optimizationMaxError, optimizationMaxErrorRatio, fastMovement!=0, statusTexts);
|
updateStatsUI(loopClosureId, inliers, matches, rejected, optimizationMaxError, optimizationMaxErrorRatio, fastMovement!=0, landmarkDetected, statusTexts);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -206,6 +206,7 @@ public class SettingsActivity extends PreferenceActivity implements OnSharedPref
|
|||||||
((Preference)findPreference(getString(R.string.pref_key_features))).setSummary("("+((ListPreference)findPreference(getString(R.string.pref_key_features))).getEntry() + ") "+getString(R.string.pref_summary_features));
|
((Preference)findPreference(getString(R.string.pref_key_features))).setSummary("("+((ListPreference)findPreference(getString(R.string.pref_key_features))).getEntry() + ") "+getString(R.string.pref_summary_features));
|
||||||
((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_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));
|
||||||
@@ -265,6 +266,7 @@ public class SettingsActivity extends PreferenceActivity implements OnSharedPref
|
|||||||
if(key.compareTo(getString(R.string.pref_key_features))==0) pref.setSummary("("+((ListPreference)pref).getEntry() + ") "+getString(R.string.pref_summary_features));
|
if(key.compareTo(getString(R.string.pref_key_features))==0) pref.setSummary("("+((ListPreference)pref).getEntry() + ") "+getString(R.string.pref_summary_features));
|
||||||
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_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));
|
||||||
|
|||||||
@@ -711,7 +711,7 @@ class RTABMAP_EXP Parameters
|
|||||||
RTABMAP_PARAM(GridGlobal, ProbClampingMax, float, 0.971, "Probability clamping maximum (value between 0 and 1).");
|
RTABMAP_PARAM(GridGlobal, ProbClampingMax, float, 0.971, "Probability clamping maximum (value between 0 and 1).");
|
||||||
|
|
||||||
RTABMAP_PARAM(Aruco, Dictionary, int, 0, "Dictionary to use: DICT_4X4_50=0, DICT_4X4_100=1, DICT_4X4_250=2, DICT_4X4_1000=3, DICT_5X5_50=4, DICT_5X5_100=5, DICT_5X5_250=6, DICT_5X5_1000=7, DICT_6X6_50=8, DICT_6X6_100=9, DICT_6X6_250=10, DICT_6X6_1000=11, DICT_7X7_50=12, DICT_7X7_100=13, DICT_7X7_250=14, DICT_7X7_1000=15, DICT_ARUCO_ORIGINAL = 16, DICT_APRILTAG_16h5=17, DICT_APRILTAG_25h9=18, DICT_APRILTAG_36h10=19, DICT_APRILTAG_36h11=20");
|
RTABMAP_PARAM(Aruco, Dictionary, int, 0, "Dictionary to use: DICT_4X4_50=0, DICT_4X4_100=1, DICT_4X4_250=2, DICT_4X4_1000=3, DICT_5X5_50=4, DICT_5X5_100=5, DICT_5X5_250=6, DICT_5X5_1000=7, DICT_6X6_50=8, DICT_6X6_100=9, DICT_6X6_250=10, DICT_6X6_1000=11, DICT_7X7_50=12, DICT_7X7_100=13, DICT_7X7_250=14, DICT_7X7_1000=15, DICT_ARUCO_ORIGINAL = 16, DICT_APRILTAG_16h5=17, DICT_APRILTAG_25h9=18, DICT_APRILTAG_36h10=19, DICT_APRILTAG_36h11=20");
|
||||||
RTABMAP_PARAM(Aruco, MarkerLength, float, 0.1, "The length (m) of the markers' side.");
|
RTABMAP_PARAM(Aruco, MarkerLength, float, 0.1, "The length (m) of the markers' side. 0 means automatic marker length estimation using the depth image (the camera should look at the marker perpendicularly for initialization).");
|
||||||
RTABMAP_PARAM(Aruco, VarianceLinear, float, 0.001, "Linear variance to set on marker detections.");
|
RTABMAP_PARAM(Aruco, VarianceLinear, float, 0.001, "Linear variance to set on marker detections.");
|
||||||
RTABMAP_PARAM(Aruco, VarianceAngular, float, 0.01, "Angular variance to set on marker detections. Set to >=9999 to use only position (xyz) constraint in graph optimization.");
|
RTABMAP_PARAM(Aruco, VarianceAngular, float, 0.01, "Angular variance to set on marker detections. Set to >=9999 to use only position (xyz) constraint in graph optimization.");
|
||||||
RTABMAP_PARAM(Aruco, CornerRefinementMethod, int, 0, "Corner refinement method (0: None, 1: Subpixel, 2:contour, 3: AprilTag 2). For OpenCV <3.3.0, this is \"doCornerRefinement\" parameter: set 0 for false and 1 for true.");
|
RTABMAP_PARAM(Aruco, CornerRefinementMethod, int, 0, "Corner refinement method (0: None, 1: Subpixel, 2:contour, 3: AprilTag 2). For OpenCV <3.3.0, this is \"doCornerRefinement\" parameter: set 0 for false and 1 for true.");
|
||||||
|
|||||||
Reference in New Issue
Block a user