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>());
89 void init(
const ParametersMap & parameters,
const std::string & databasePath =
"");
90 void init(
const std::string & configFile =
"",
const std::string & databasePath =
"");
99 void close(
bool databaseSaved =
true,
const std::string & ouputDatabasePath =
"");
107 int getLastLocationId()
const;
108 std::list<int> getWM()
const;
109 std::set<int> getSTM()
const;
110 int getWMSize()
const;
111 int getSTMSize()
const;
112 std::map<int, int> getWeights()
const;
113 int getTotalMemSize()
const;
115 std::multimap<int, cv::KeyPoint> getWords(
int locationId)
const;
116 bool isInSTM(
int locationId)
const;
117 bool isIDsGenerated()
const;
130 void setTimeThreshold(
float maxTimeAllowed);
132 void setInitialPose(
const Transform & initialPose);
134 bool labelLocation(
int id,
const std::string & label);
142 bool setUserData(
int id,
const cv::Mat & data);
143 void generateDOTGraph(
const std::string & path,
int id=0,
int margin=5);
145 const std::string & path,
151 void dumpPrediction()
const;
152 void dumpData()
const;
155 void setWorkingDirectory(std::string path);
156 void rejectLastLoopClosure();
157 void deleteLastLocation();
158 void setOptimizedPoses(
const std::map<int, Transform> & poses);
159 void get3DMap(std::map<int, Signature> & signatures,
160 std::map<int, Transform> & poses,
161 std::multimap<int, Link> & constraints,
164 void getGraph(std::map<int, Transform> & poses,
165 std::multimap<int, Link> & constraints,
168 std::map<int, Signature> * signatures = 0);
169 int detectMoreLoopClosures(
float clusterRadius = 0.5
f,
float clusterAngle =
M_PI/6.0
f,
int iterations = 1,
const ProgressState *
state = 0);
173 void clearPath(
int status);
176 const std::vector<std::pair<int, Transform> > &
getPath()
const {
return _path;}
177 std::vector<std::pair<int, Transform> > getPathNextPoses()
const;
178 std::vector<int> getPathNextNodes()
const;
179 int getPathCurrentGoalId()
const;
184 std::map<int, Transform> getForwardWMPoses(
int fromId,
int maxNearestNeighbors,
float radius,
int maxDiffID)
const;
185 std::map<int, std::map<int, Transform> >
getPaths(std::map<int, Transform> poses,
const Transform & target,
int maxGraphDepth = 0)
const;
186 void adjustLikelihood(std::map<int, float> & likelihood)
const;
187 std::pair<int, float> selectHypothesis(
const std::map<int, float> & posterior,
188 const std::map<int, float> & likelihood)
const;
191 void optimizeCurrentMap(
int id,
193 std::map<int, Transform> & optimizedPoses,
194 cv::Mat & covariance,
195 std::multimap<int, Link> * constraints = 0,
197 int * iterationsDone = 0)
const;
198 std::map<int, Transform> optimizeGraph(
200 const std::set<int> & ids,
201 const std::map<int, Transform> & guessPoses,
203 cv::Mat & covariance,
204 std::multimap<int, Link> * constraints = 0,
206 int * iterationsDone = 0)
const;
207 void updateGoalIndex();
208 bool computePath(
int targetNode, std::map<int, Transform> nodes,
const std::multimap<int, rtabmap::Link> & constraints);
210 void setupLogFiles(
bool overwrite =
false);
211 void flushStatisticLogs();
296 std::vector<std::pair<int,Transform> >
_path;
Transform getMapCorrection() const
Transform _mapCorrectionBackup
EpipolarGeometry * _epipolarGeometry
const Transform & getPathTransformToGoal() const
unsigned int _maxLocalRetrieved
double getLastProcessTime() const
std::vector< std::pair< int, Transform > > _path
bool RTABMAP_EXP exportPoses(const std::string &filePath, int format, const std::map< int, Transform > &poses, const std::multimap< int, Link > &constraints=std::multimap< int, Link >(), const std::map< int, double > &stamps=std::map< int, double >(), bool g2oRobust=false)
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 getLoopClosureValue() const
const std::map< int, Transform > & getLocalOptimizedPoses() const
float _newMapOdomChangeDistance
int getHighestHypothesisId() const
float _pathLinearVelocity
Optimizer * _graphOptimizer
bool _proximityRawPosesUsed
float _optimizationMaxError
BayesFilter * _bayesFilter
bool _statisticLoggedHeaders
bool _savedLocalizationIgnored
unsigned int getPathCurrentGoalIndex() const
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
unsigned int _pathCurrentIndex
float _pathAngularVelocity
std::pair< int, float > _highestHypothesis
RecoveryProgressState state
bool _startNewMapOnLoopClosure
bool _someNodesHaveBeenTransferred
float getHighestHypothesisValue() const
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::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
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