39 #include <opencv2/core/core.hpp> 47 class EpipolarGeometry;
52 class PythonInterface;
74 const cv::Mat & odomCovariance = cv::Mat::eye(6,6,CV_64FC1),
75 const std::vector<float> & odomVelocity = std::vector<float>(),
76 const std::map<std::string, float> & externalStats = std::map<std::string, float>());
81 float odomLinearVariance,
82 float odomAngularVariance,
83 const std::vector<float> & odomVelocity = std::vector<float>(),
84 const std::map<std::string, float> & externalStats = std::map<std::string, float>());
87 const cv::Mat & image,
88 int id=0,
const std::map<std::string, float> & externalStats = std::map<std::string, float>());
102 void init(
const ParametersMap & parameters,
const std::string & databasePath =
"",
bool loadDatabaseParameters =
false);
115 void init(
const std::string & configFile =
"",
const std::string & databasePath =
"",
bool loadDatabaseParameters =
false);
124 void close(
bool databaseSaved =
true,
const std::string & ouputDatabasePath =
"");
132 int getLastLocationId()
const;
133 std::list<int> getWM()
const;
134 std::set<int> getSTM()
const;
135 int getWMSize()
const;
136 int getSTMSize()
const;
137 std::map<int, int> getWeights()
const;
138 int getTotalMemSize()
const;
140 bool isInSTM(
int locationId)
const;
141 bool isIDsGenerated()
const;
153 void setTimeThreshold(
float maxTimeAllowed);
155 void setInitialPose(
const Transform & initialPose);
157 bool labelLocation(
int id,
const std::string & label);
165 bool setUserData(
int id,
const cv::Mat & data);
166 void generateDOTGraph(
const std::string & path,
int id=0,
int margin=5);
168 const std::string & path,
174 void dumpPrediction()
const;
175 void dumpData()
const;
178 void setWorkingDirectory(std::string path);
179 void rejectLastLoopClosure();
180 void deleteLastLocation();
181 void setOptimizedPoses(
const std::map<int, Transform> & poses,
const std::multimap<int, Link> & constraints);
182 Signature getSignatureCopy(
int id,
bool images,
bool scan,
bool userData,
bool occupancyGrid,
bool withWords,
bool withGlobalDescriptors)
const;
184 void get3DMap(std::map<int, Signature> & signatures,
185 std::map<int, Transform> & poses,
186 std::multimap<int, Link> & constraints,
188 bool global)
const,
"Use getGraph() instead with withImages=true, withScan=true, withUserData=true and withGrid=true.");
189 void getGraph(std::map<int, Transform> & poses,
190 std::multimap<int, Link> & constraints,
193 std::map<int, Signature> * signatures = 0,
194 bool withImages =
false,
195 bool withScan =
false,
196 bool withUserData =
false,
197 bool withGrid =
false,
198 bool withWords =
true,
199 bool withGlobalDescriptors =
true)
const;
200 std::map<int, Transform>
getNodesInRadius(
const Transform & pose,
float radius,
int k=0, std::map<int, float> * distsSqr=0);
201 std::map<int, Transform>
getNodesInRadius(
int nodeId,
float radius,
int k=0, std::map<int, float> * distsSqr=0);
202 int detectMoreLoopClosures(
203 float clusterRadiusMax = 0.5
f,
204 float clusterAngle =
M_PI/6.0
f,
206 bool intraSession =
true,
207 bool interSession =
true,
209 float clusterRadiusMin = 0.0
f);
210 bool globalBundleAdjustment(
211 int optimizerType = 1 ,
212 bool rematchFeatures =
true,
214 float pixelVariance = 0.0
f);
215 int cleanupLocalGrids(
216 const std::map<int, Transform> & mapPoses,
222 bool filterScans =
false);
224 bool addLink(
const Link & link);
225 cv::Mat getInformation(
const cv::Mat & covariance)
const;
226 void addNodesToRepublish(
const std::vector<int> & ids);
229 void clearPath(
int status);
232 const std::vector<std::pair<int, Transform> > &
getPath()
const {
return _path;}
233 std::vector<std::pair<int, Transform> > getPathNextPoses()
const;
234 std::vector<int> getPathNextNodes()
const;
235 int getPathCurrentGoalId()
const;
240 std::map<int, Transform> getForwardWMPoses(
int fromId,
int maxNearestNeighbors,
float radius,
int maxDiffID)
const;
241 std::map<int, std::map<int, Transform> >
getPaths(
const std::map<int, Transform> & poses,
const Transform &
target,
int maxGraphDepth = 0)
const;
242 void adjustLikelihood(std::map<int, float> & likelihood)
const;
243 std::pair<int, float> selectHypothesis(
const std::map<int, float> & posterior,
244 const std::map<int, float> & likelihood)
const;
247 void optimizeCurrentMap(
int id,
249 std::map<int, Transform> & optimizedPoses,
250 cv::Mat & covariance,
251 std::multimap<int, Link> * constraints = 0,
253 int * iterationsDone = 0)
const;
254 std::map<int, Transform> optimizeGraph(
256 const std::set<int> & ids,
257 const std::map<int, Transform> & guessPoses,
259 cv::Mat & covariance,
260 std::multimap<int, Link> * constraints = 0,
262 int * iterationsDone = 0)
const;
263 void updateGoalIndex();
264 bool computePath(
int targetNode, std::map<int, Transform> nodes,
const std::multimap<int, rtabmap::Link> & constraints);
266 void createGlobalScanMap();
268 void setupLogFiles(
bool overwrite =
false);
269 void flushStatisticLogs();
377 std::vector<std::pair<int,Transform> >
_path;
385 #ifdef RTABMAP_PYTHON Transform _mapCorrectionBackup
EpipolarGeometry * _epipolarGeometry
std::map< int, Transform > _markerPriors
bool _currentSessionHasGPS
unsigned int _maxLocalRetrieved
const ParametersMap & getParameters() const
std::vector< std::pair< int, Transform > > _path
float getTimeThreshold() const
bool _optimizeFromGraphEndChanged
unsigned int getPathCurrentGoalIndex() const
float _distanceTravelledSinceLastLocalization
def init(descriptorDim, matchThreshold, iterations, cuda, model_path)
bool _scanMatchingIdsSavedInLinks
float _rgbdAngularSpeedUpdate
std::map< std::string, std::string > ParametersMap
float _rgbdLinearSpeedUpdate
float _markerPriorsAngularVariance
unsigned int _maxMemoryAllowed
int _proximityMaxGraphDepth
double _proximityMergedScanCovFactor
std::list< std::string > _bufferedLogsF
float getGoalReachedRadius() const
float _maxLoopClosureDistance
unsigned int getPathCurrentIndex() const
RTABMAP_DEPRECATED(typedef SensorData Image, "rtabmap::Image class is renamed to rtabmap::SensorData, use the last one instead.")
std::map< int, Transform > _odomCachePoses
float _newMapOdomChangeDistance
float _pathLinearVelocity
Optimizer * _graphOptimizer
std::set< int > _nodesToRepublish
Transform getMapCorrection() const
bool _proximityRawPosesUsed
float _optimizationMaxError
float _markerPriorsLinearVariance
BayesFilter * _bayesFilter
bool _statisticLoggedHeaders
double getLastProcessTime() const
unsigned int _maxRepublished
const Transform & getPathTransformToGoal() const
float getHighestHypothesisValue() const
const Memory * getMemory() const
std::map< int, float > getNodesInRadius(int nodeId, const std::map< int, Transform > &nodes, float radius)
const std::string & getWorkingDir() const
bool _statisticLogsBufferedInRAM
int getPathStatus() const
const std::vector< std::pair< int, Transform > > & getPath() const
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
const std::multimap< int, Link > & getLocalConstraints() const
std::multimap< int, Link > _odomCacheConstraints
float getLocalRadius() const
unsigned int _pathCurrentIndex
const std::map< int, Transform > & getLocalOptimizedPoses() const
float _pathAngularVelocity
bool _loopClosureIdentityGuess
std::pair< int, float > _highestHypothesis
RecoveryProgressState state
bool _startNewMapOnLoopClosure
bool _someNodesHaveBeenTransferred
float getLoopClosureValue() const
std::map< int, std::pair< cv::Point3d, Transform > > _gpsGeocentricCache
float _proximityFilteringRadius
unsigned int _pathGoalIndex
std::map< int, Transform > _globalScanMapPoses
std::list< std::map< int, Transform > > RTABMAP_EXP getPaths(std::map< int, Transform > poses, const std::multimap< int, Link > &links)
std::vector< float > _odomCorrectionAcc
std::multimap< int, Link > _constraints
const Transform & getLastLocalizationPose() const
bool _optimizeFromGraphEnd
bool _publishLastSignatureData
std::list< std::string > _bufferedLogsI
bool _startNewMapOnGoodSignature
ParametersMap _parameters
int _lastLocalizationNodeId
bool _goalsSavedInUserData
std::pair< int, float > _loopClosureHypothesis
float _localImmunizationRatio
std::set< unsigned int > _pathUnreachableNodes
bool _neighborLinkRefining
bool _verifyLoopClosureHypothesis
int getHighestHypothesisId() const
std::map< int, Transform > _optimizedPoses
int _proximityMaxNeighbors
std::string _databasePath
bool _createGlobalScanMap
int getLoopClosureId() const
Transform _pathTransformToGoal
unsigned int _maxRetrieved