Giter Club home page Giter Club logo

Comments (3)

matlabbe avatar matlabbe commented on May 24, 2024 1

Humm, I may know what is going on. The out of bound error may happen here:

Transform newT = newOptPoseInv * optPoses.at(iter->first);

Hypotheses:

  • The map has been created with landmarks and Optimizer/LandmarksIgnored=false, so the optimized graph will contain landmark poses.
  • In localization mode, after setting Optimizer/LandmarksIgnored=true, the landmark links are somewhat still used but internal graph optimization is ignoring them, so after local graph optimization the landmarks are ignored and optPoses won't contain landmark ids anymore.

Possible solution could be to add && !_graphOptimizer->landmarksIgnored() to this if:

if(!landmarksDetected.empty() && !_memory->isIncremental())

I'll try to reproduce in simulation and test if the above could fix it.

from rtabmap.

hellovuong avatar hellovuong commented on May 24, 2024

If I use GTSAM then this is the error
[ INFO] (2024-02-29 18:09:59.549) Rtabmap.cpp:2992::process() Landmark 400 observed again! Seen the first time by node 112. [FATAL] (2024-02-29 18:09:59.549) OptimizerGTSAM.cpp:144::optimize() Condition (uContains(poses, rootId)) not met! terminate called after throwing an instance of 'UException' what(): [FATAL] (2024-02-29 18:09:59.549) OptimizerGTSAM.cpp:144::optimize() Condition (uContains(poses, rootId)) not met!

from rtabmap.

hellovuong avatar hellovuong commented on May 24, 2024

I found out that the std map out of range happened in this for loop

					Transform newOptPoseInv = optPoses.at(signature->id()).inverse();
					for(std::multimap<int, Link>::iterator iter=localizationLinks.begin(); iter!=localizationLinks.end(); ++iter)
					{
						if(!_localizationSmoothing)
						{
							// Add original link without optimization
							UDEBUG("Adding new odom cache constraint %d->%d (%s)", 
								iter->second.from(), iter->second.to(), iter->second.transform().prettyPrint().c_str());
						}
						else
						{
							// Adjust with optimized poses, this will smooth the localization
							Transform newT = newOptPoseInv * optPoses.at(iter->first);
							UDEBUG("Adjusted localization link %d->%d after optimization", iter->second.from(), iter->second.to());
							UDEBUG("from %s", iter->second.transform().prettyPrint().c_str());
							UDEBUG("  to %s", newT.prettyPrint().c_str());
							iter->second.setTransform(newT);

							// Update link in the referred signatures
							if(iter->first > 0)
								_memory->updateLink(iter->second, false);
						}
						
						_odomCacheConstraints.insert(std::make_pair(signature->id(), iter->second));
					}

from rtabmap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.