mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 09:30:25 +08:00
Local scan matching: set larger scan points for max scan points when it is not set. Fixed missing scan Ids in links' user data to correctly visualize proximity links by space in DatabaseViewer. CloudViewer: using line instead of arrow between the referential and the frustum. removed parameter "RGBD/ProximityPathScansMerged" as visual proximity by space already does that.
This commit is contained in:
@@ -172,7 +172,7 @@ void CloudViewer::clear()
|
||||
this->removeAllClouds();
|
||||
this->removeAllGraphs();
|
||||
this->removeAllCoordinates();
|
||||
this->removeAllArrows();
|
||||
this->removeAllLines();
|
||||
this->removeAllFrustums();
|
||||
this->removeAllTexts();
|
||||
this->clearTrajectory();
|
||||
@@ -793,11 +793,12 @@ void CloudViewer::removeAllCoordinates()
|
||||
UASSERT(_coordinates.empty());
|
||||
}
|
||||
|
||||
void CloudViewer::addOrUpdateArrow(
|
||||
void CloudViewer::addOrUpdateLine(
|
||||
const std::string & id,
|
||||
const Transform & from,
|
||||
const Transform & to,
|
||||
const QColor & color)
|
||||
const QColor & color,
|
||||
bool arrow)
|
||||
{
|
||||
if(id.empty())
|
||||
{
|
||||
@@ -805,11 +806,11 @@ void CloudViewer::addOrUpdateArrow(
|
||||
return;
|
||||
}
|
||||
|
||||
removeArrow(id);
|
||||
removeLine(id);
|
||||
|
||||
if(!from.isNull() && !to.isNull())
|
||||
{
|
||||
_arrows.insert(id);
|
||||
_lines.insert(id);
|
||||
|
||||
QColor c = Qt::gray;
|
||||
if(color.isValid())
|
||||
@@ -820,11 +821,18 @@ void CloudViewer::addOrUpdateArrow(
|
||||
pcl::PointXYZ pt1(from.x(), from.y(), from.z());
|
||||
pcl::PointXYZ pt2(to.x(), to.y(), to.z());
|
||||
|
||||
_visualizer->addArrow(pt2, pt1, c.redF(), c.greenF(), c.blueF(), false, id);
|
||||
if(arrow)
|
||||
{
|
||||
_visualizer->addArrow(pt2, pt1, c.redF(), c.greenF(), c.blueF(), false, id);
|
||||
}
|
||||
else
|
||||
{
|
||||
_visualizer->addLine(pt2, pt1, c.redF(), c.greenF(), c.blueF(), id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CloudViewer::removeArrow(const std::string & id)
|
||||
void CloudViewer::removeLine(const std::string & id)
|
||||
{
|
||||
if(id.empty())
|
||||
{
|
||||
@@ -832,21 +840,21 @@ void CloudViewer::removeArrow(const std::string & id)
|
||||
return;
|
||||
}
|
||||
|
||||
if(_arrows.find(id) != _arrows.end())
|
||||
if(_lines.find(id) != _lines.end())
|
||||
{
|
||||
_visualizer->removeShape(id);
|
||||
_arrows.erase(id);
|
||||
_lines.erase(id);
|
||||
}
|
||||
}
|
||||
|
||||
void CloudViewer::removeAllArrows()
|
||||
void CloudViewer::removeAllLines()
|
||||
{
|
||||
std::set<std::string> arrows = _arrows;
|
||||
std::set<std::string> arrows = _lines;
|
||||
for(std::set<std::string>::iterator iter = arrows.begin(); iter!=arrows.end(); ++iter)
|
||||
{
|
||||
this->removeArrow(*iter);
|
||||
this->removeLine(*iter);
|
||||
}
|
||||
UASSERT(_arrows.empty());
|
||||
UASSERT(_lines.empty());
|
||||
}
|
||||
|
||||
static const float frustum_vertices[] = {
|
||||
@@ -1112,7 +1120,7 @@ void CloudViewer::setFrustumShown(bool shown)
|
||||
if(!shown)
|
||||
{
|
||||
this->removeFrustum("reference_frustum");
|
||||
this->removeArrow("reference_frustum_arrow");
|
||||
this->removeLine("reference_frustum_line");
|
||||
this->update();
|
||||
}
|
||||
_aShowFrustum->setChecked(shown);
|
||||
@@ -1372,7 +1380,7 @@ void CloudViewer::updateCameraTargetPosition(const Transform & pose, const Trans
|
||||
this->addOrUpdateFrustum("reference_frustum", pose * baseToCamera, _frustumScale, _frustumColor);
|
||||
if(!baseToCamera.isIdentity())
|
||||
{
|
||||
this->addOrUpdateArrow("reference_frustum_arrow", pose, pose * baseToCamera, _frustumColor);
|
||||
this->addOrUpdateLine("reference_frustum_line", pose, pose * baseToCamera, _frustumColor);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3080,6 +3080,7 @@ void DatabaseViewer::updateConstraintView(
|
||||
memcmp(userData.data, "SCANS:", 6) == 0)
|
||||
{
|
||||
std::string scansStr = (const char *)userData.data;
|
||||
UINFO("Detected \"%s\" in links's user data", scansStr.c_str());
|
||||
if(!scansStr.empty())
|
||||
{
|
||||
std::list<std::string> strs = uSplit(scansStr, ':');
|
||||
@@ -3128,6 +3129,22 @@ void DatabaseViewer::updateConstraintView(
|
||||
posesOut,
|
||||
linksOut);
|
||||
|
||||
if(poses.size() != posesOut.size())
|
||||
{
|
||||
UWARN("Scan poses input and output are different! %d vs %d", (int)poses.size(), (int)posesOut.size());
|
||||
UWARN("Input poses: ");
|
||||
for(std::map<int, Transform>::iterator iter=poses.begin(); iter!=poses.end(); ++iter)
|
||||
{
|
||||
UWARN(" %d", iter->first);
|
||||
}
|
||||
UWARN("Input links: ");
|
||||
std::multimap<int, Link> modifiedLinks = updateLinksWithModifications(links_);
|
||||
for(std::multimap<int, Link>::iterator iter=modifiedLinks.begin(); iter!=modifiedLinks.end(); ++iter)
|
||||
{
|
||||
UWARN(" %d->%d", iter->second.from(), iter->second.to());
|
||||
}
|
||||
}
|
||||
|
||||
QTime time;
|
||||
time.start();
|
||||
std::map<int, rtabmap::Transform> finalPoses = optimizer->optimize(link.to(), posesOut, linksOut);
|
||||
|
||||
@@ -684,7 +684,6 @@ PreferencesDialog::PreferencesDialog(QWidget * parent) :
|
||||
_ui->localDetection_pathFilteringRadius->setObjectName(Parameters::kRGBDProximityPathFilteringRadius().c_str());
|
||||
_ui->localDetection_angle->setObjectName(Parameters::kRGBDProximityAngle().c_str());
|
||||
_ui->checkBox_localSpacePathOdomPosesUsed->setObjectName(Parameters::kRGBDProximityPathRawPosesUsed().c_str());
|
||||
_ui->checkBox_localSpaceAssembleScans->setObjectName(Parameters::kRGBDProximityPathScansMerged().c_str());
|
||||
_ui->rgdb_localImmunizationRatio->setObjectName(Parameters::kRGBDLocalImmunizationRatio().c_str());
|
||||
_ui->loopClosure_reextract->setObjectName(Parameters::kRGBDLoopClosureReextractFeatures().c_str());
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>-466</y>
|
||||
<y>0</y>
|
||||
<width>686</width>
|
||||
<height>2023</height>
|
||||
</rect>
|
||||
@@ -86,7 +86,7 @@
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
<number>11</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="page_22">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_29" stretch="0,1">
|
||||
@@ -6683,7 +6683,20 @@ If set to false, classic RTAB-Map loop closure detection is done using only imag
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout_50" columnstretch="0,1">
|
||||
<item row="3" column="0">
|
||||
<item row="3" column="1">
|
||||
<widget class="QLabel" name="label_scanMatching_4">
|
||||
<property name="text">
|
||||
<string>When comparing to a local path, merge the laser scans using the odometry poses instead of the ones in the optimized local graph.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QDoubleSpinBox" name="localDetection_pathFilteringRadius">
|
||||
<property name="suffix">
|
||||
<string> m</string>
|
||||
@@ -6699,7 +6712,7 @@ If set to false, classic RTAB-Map loop closure detection is done using only imag
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<item row="2" column="1">
|
||||
<widget class="QLabel" name="label_space3_3">
|
||||
<property name="text">
|
||||
<string>Path filtering radius to avoid merging laser scans which are close. 0 to ignore.</string>
|
||||
@@ -6712,20 +6725,7 @@ If set to false, classic RTAB-Map loop closure detection is done using only imag
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLabel" name="label_scanMatching_4">
|
||||
<property name="text">
|
||||
<string>When comparing to a local path, merge the laser scans using the odometry poses instead of the ones in the optimized local graph.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<item row="3" column="0">
|
||||
<widget class="QCheckBox" name="checkBox_localSpacePathOdomPosesUsed">
|
||||
<property name="text">
|
||||
<string/>
|
||||
@@ -6755,7 +6755,7 @@ If set to false, classic RTAB-Map loop closure detection is done using only imag
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<item row="5" column="1">
|
||||
<widget class="QLabel" name="label_scanMatching_6">
|
||||
<property name="text">
|
||||
<string>Save scan matching IDs in link's user data.</string>
|
||||
@@ -6768,33 +6768,13 @@ If set to false, classic RTAB-Map loop closure detection is done using only imag
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<item row="5" column="0">
|
||||
<widget class="QCheckBox" name="checkBox_localSpaceScanMatchingIDsSaved">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLabel" name="label_scanMatching_7">
|
||||
<property name="text">
|
||||
<string>Merge close laser scans on each path. If false, only the nearest laser scan on the path is used for ICP.</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QCheckBox" name="checkBox_localSpaceAssembleScans">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="label_scanMatching_8">
|
||||
<property name="text">
|
||||
|
||||
Reference in New Issue
Block a user