39 #include <opencv2/core/core.hpp> 47 class EpipolarGeometry;
73 const cv::Mat & odomCovariance = cv::Mat::eye(6,6,CV_64FC1),
74 const std::vector<float> & odomVelocity = std::vector<float>(),
75 const std::map<std::string, float> & externalStats = std::map<std::string, float>());
80 float odomLinearVariance,
81 float odomAngularVariance,
82 const std::vector<float> & odomVelocity = std::vector<float>(),
83 const std::map<std::string, float> & externalStats = std::map<std::string, float>());
86 const cv::Mat & image,
87 int id=0,
const std::map<std::string, float> & externalStats = std::map<std::string, float>());
101 void init(
const ParametersMap & parameters,
const std::string & databasePath =
"",
bool loadDatabaseParameters =
false);
114 void init(
const std::string & configFile =
"",
const std::string & databasePath =
"",
bool loadDatabaseParameters =
false);
123 void close(
bool databaseSaved =
true,
const std::string & ouputDatabasePath =
"");
131 int getLastLocationId()
const;
132 std::list<int> getWM()
const;
133 std::set<int> getSTM()
const;
134 int getWMSize()
const;
135 int getSTMSize()
const;
136 std::map<int, int> getWeights()
const;
137 int getTotalMemSize()
const;
139 bool isInSTM(
int locationId)
const;
140 bool isIDsGenerated()
const;
152 void setTimeThreshold(
float maxTimeAllowed);
154 void setInitialPose(
const Transform & initialPose);
156 bool labelLocation(
int id,
const std::string & label);
164 bool setUserData(
int id,
const cv::Mat & data);
165 void generateDOTGraph(
const std::string & path,
int id=0,
int margin=5);
167 const std::string & path,
173 void dumpPrediction()
const;
174 void dumpData()
const;
177 void setWorkingDirectory(std::string path);
178 void rejectLastLoopClosure();
179 void deleteLastLocation();
180 void setOptimizedPoses(
const std::map<int, Transform> & poses);
181 Signature getSignatureCopy(
int id,
bool images,
bool scan,
bool userData,
bool occupancyGrid,
bool withWords,
bool withGlobalDescriptors)
const;
183 void get3DMap(std::map<int, Signature> & signatures,
184 std::map<int, Transform> & poses,
185 std::multimap<int, Link> & constraints,
187 bool global)
const,
"Use getGraph() instead with withImages=true, withScan=true, withUserData=true and withGrid=true.");
188 void getGraph(std::map<int, Transform> & poses,
189 std::multimap<int, Link> & constraints,
192 std::map<int, Signature> * signatures = 0,
193 bool withImages =
false,
194 bool withScan =
false,
195 bool withUserData =
false,
196 bool withGrid =
false,
197 bool withWords =
true,
198 bool withGlobalDescriptors =
true)
const;
201 int detectMoreLoopClosures(
202 float clusterRadius = 0.5
f,
203 float clusterAngle =
M_PI/6.0
f,
205 bool intraSession =
true,
206 bool interSession =
true,
209 bool addLink(
const Link & link);
210 cv::Mat getInformation(
const cv::Mat & covariance)
const;
213 void clearPath(
int status);
216 const std::vector<std::pair<int, Transform> > &
getPath()
const {
return _path;}
217 std::vector<std::pair<int, Transform> > getPathNextPoses()
const;
218 std::vector<int> getPathNextNodes()
const;
219 int getPathCurrentGoalId()
const;
224 std::map<int, Transform> getForwardWMPoses(
int fromId,
int maxNearestNeighbors,
float radius,
int maxDiffID)
const;
225 std::map<int, std::map<int, Transform> >
getPaths(
const std::map<int, Transform> & poses,
const Transform & target,
int maxGraphDepth = 0)
const;
226 void adjustLikelihood(std::map<int, float> & likelihood)
const;
227 std::pair<int, float> selectHypothesis(
const std::map<int, float> & posterior,
228 const std::map<int, float> & likelihood)
const;
231 void optimizeCurrentMap(
int id,
233 std::map<int, Transform> & optimizedPoses,
234 cv::Mat & covariance,
235 std::multimap<int, Link> * constraints = 0,
237 int * iterationsDone = 0)
const;
238 std::map<int, Transform> optimizeGraph(
240 const std::set<int> & ids,
241 const std::map<int, Transform> & guessPoses,
243 cv::Mat & covariance,
244 std::multimap<int, Link> * constraints = 0,
246 int * iterationsDone = 0)
const;
247 void updateGoalIndex();
248 bool computePath(
int targetNode, std::map<int, Transform> nodes,
const std::multimap<int, rtabmap::Link> & constraints);
250 void setupLogFiles(
bool overwrite =
false);
251 void flushStatisticLogs();
349 std::vector<std::pair<int,Transform> >
_path;
Transform getMapCorrection() const
Transform _mapCorrectionBackup
EpipolarGeometry * _epipolarGeometry
const Transform & getPathTransformToGoal() const
bool _currentSessionHasGPS
unsigned int _maxLocalRetrieved
double getLastProcessTime() const
std::vector< std::pair< int, Transform > > _path
bool _optimizeFromGraphEndChanged
float _distanceTravelledSinceLastLocalization
def init(descriptorDim, matchThreshold, iterations, cuda, model_path)
bool _scanMatchingIdsSavedInLinks
const std::string & getWorkingDir() const
float _rgbdAngularSpeedUpdate
std::map< std::string, std::string > ParametersMap
float _rgbdLinearSpeedUpdate
unsigned int _maxMemoryAllowed
int _proximityMaxGraphDepth
std::list< std::string > _bufferedLogsF
float getGoalReachedRadius() const
float _maxLoopClosureDistance
float getLoopClosureValue() const
const std::map< int, Transform > & getLocalOptimizedPoses() const
std::map< int, Transform > _odomCachePoses
float _newMapOdomChangeDistance
int getHighestHypothesisId() const
float _pathLinearVelocity
Optimizer * _graphOptimizer
bool _proximityRawPosesUsed
float _optimizationMaxError
BayesFilter * _bayesFilter
bool _statisticLoggedHeaders
bool _savedLocalizationIgnored
unsigned int getPathCurrentGoalIndex() const
std::map< int, Transform > _odomCacheAddLink
int getLoopClosureId() const
bool _statisticLogsBufferedInRAM
std::list< std::pair< int, Transform > > RTABMAP_EXP computePath(const std::map< int, rtabmap::Transform > &poses, const std::multimap< int, int > &links, int from, int to, bool updateNewCosts=false)
Transform _lastLocalizationPose
float getTimeThreshold() const
std::multimap< int, Link > _odomCacheConstraints
unsigned int _pathCurrentIndex
float _pathAngularVelocity
std::pair< int, float > _highestHypothesis
RecoveryProgressState state
bool _startNewMapOnLoopClosure
bool _someNodesHaveBeenTransferred
float getHighestHypothesisValue() const
std::map< int, std::pair< cv::Point3d, Transform > > _gpsGeocentricCache
std::map< int, float > RTABMAP_EXP getNodesInRadius(int nodeId, const std::map< int, Transform > &nodes, float radius)
int getPathStatus() const
float _proximityFilteringRadius
const std::vector< std::pair< int, Transform > > & getPath() const
const ParametersMap & getParameters() const
unsigned int _pathGoalIndex
std::list< std::map< int, Transform > > RTABMAP_EXP getPaths(std::map< int, Transform > poses, const std::multimap< int, Link > &links)
const Memory * getMemory() const
std::vector< float > _odomCorrectionAcc
std::multimap< int, Link > _constraints
bool _optimizeFromGraphEnd
bool _publishLastSignatureData
std::list< std::string > _bufferedLogsI
bool _startNewMapOnGoodSignature
const Transform & getLastLocalizationPose() const
ParametersMap _parameters
int _lastLocalizationNodeId
bool _goalsSavedInUserData
std::pair< int, float > _loopClosureHypothesis
const std::multimap< int, Link > & getLocalConstraints() const
float _localImmunizationRatio
RTABMAP_DEPRECATED(typedef SensorData Image,"rtabmap::Image class is renamed to rtabmap::SensorData, use the last one instead.")
std::set< unsigned int > _pathUnreachableNodes
bool _neighborLinkRefining
bool _verifyLoopClosureHypothesis
std::map< int, Transform > _optimizedPoses
unsigned int getPathCurrentIndex() const
float getLocalRadius() const
int _proximityMaxNeighbors
std::string _databasePath
Transform _pathTransformToGoal
unsigned int _maxRetrieved