Skip to content

Commit

Permalink
refreshing initial covariance after being modified in same sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
matlabbe committed Sep 21, 2024
1 parent 736096c commit 62bbcc7
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions guilib/src/DatabaseViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4357,7 +4357,14 @@ void DatabaseViewer::updateCovariances(const QList<Link> & links)
{
if(links.size())
{
EditConstraintDialog dialog(Transform::getIdentity(), links.first().infMatrix().inv());
cv::Mat infMatrix = links.first().infMatrix();
std::multimap<int, Link>::iterator findIter = rtabmap::graph::findLink(linksRefined_, links.first().from() ,links.first().to(), false, links.first().type());
if(findIter != linksRefined_.end())
{
infMatrix = findIter->second.infMatrix();
}

EditConstraintDialog dialog(Transform::getIdentity(), infMatrix.inv());
dialog.setPoseGroupVisible(false);
if(dialog.exec() != QDialog::Accepted)
{
Expand All @@ -4371,7 +4378,7 @@ void DatabaseViewer::updateCovariances(const QList<Link> & links)
progressDialog->setMinimumWidth(800);
progressDialog->show();

cv::Mat infMatrix = dialog.getCovariance().inv();
infMatrix = dialog.getCovariance().inv();

for(int i=0; i<links.size(); ++i)
{
Expand Down Expand Up @@ -6057,6 +6064,11 @@ void DatabaseViewer::editConstraint()
else if(ui_->label_type->text().toInt() == Link::kLandmark)
{
link = loopLinks_.at(ui_->horizontalSlider_loops->value());
std::multimap<int, Link>::iterator findIter = rtabmap::graph::findLink(linksRefined_, link.from() ,link.to(), false, link.type());
if(findIter != linksRefined_.end())
{
link = findIter->second;
}
}
else
{
Expand Down

0 comments on commit 62bbcc7

Please sign in to comment.