mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 01:20:25 +08:00
Update version 0.10.11:
-Added parameter "Mem/ReduceGraph" with new link type (NeighborMerged) -DatabaseViewer: add Info panel, fixed empty extracted database when "RGB images" is not checked -ConsoleWidget: added buffer size and refresh rate options -DBDriver: new database info getters -Graph: added reduceGraph() method, added Dijsktra computePath() with links only -Updated default parameters: RGBD/LocalLoopDetectionSpace=true, RGBD/LinearUpdate=0.1 and RGBD/AngularUpdate=0.1 -Goals are saved with label instead of ID if the target node has a label -DataRecorder: fixed saving incrementally the database (instead of only at the end) -MainWindow: When waypoints are used, resend the current goal (1 sec delay) if it has failed setting it
This commit is contained in:
@@ -98,6 +98,15 @@ public:
|
||||
bool isConnected() const;
|
||||
long getMemoryUsed() const; // In bytes
|
||||
std::string getDatabaseVersion() const;
|
||||
long getImagesMemoryUsed() const;
|
||||
long getDepthImagesMemoryUsed() const;
|
||||
long getLaserScansMemoryUsed() const;
|
||||
long getUserDataMemoryUsed() const;
|
||||
long getWordsMemoryUsed() const;
|
||||
int getLastNodesSize() const; // working memory
|
||||
int getLastDictionarySize() const; // working memory
|
||||
int getTotalNodesSize() const;
|
||||
int getTotalDictionarySize() const;
|
||||
|
||||
void executeNoResult(const std::string & sql) const;
|
||||
|
||||
@@ -130,6 +139,15 @@ private:
|
||||
virtual bool isConnectedQuery() const = 0;
|
||||
virtual long getMemoryUsedQuery() const = 0; // In bytes
|
||||
virtual bool getDatabaseVersionQuery(std::string & version) const = 0;
|
||||
virtual long getImagesMemoryUsedQuery() const = 0;
|
||||
virtual long getDepthImagesMemoryUsedQuery() const = 0;
|
||||
virtual long getLaserScansMemoryUsedQuery() const = 0;
|
||||
virtual long getUserDataMemoryUsedQuery() const = 0;
|
||||
virtual long getWordsMemoryUsedQuery() const = 0;
|
||||
virtual int getLastNodesSizeQuery() const = 0;
|
||||
virtual int getLastDictionarySizeQuery() const = 0;
|
||||
virtual int getTotalNodesSizeQuery() const = 0;
|
||||
virtual int getTotalDictionarySizeQuery() const = 0;
|
||||
|
||||
virtual void executeNoResultQuery(const std::string & sql) const = 0;
|
||||
|
||||
|
||||
@@ -244,19 +244,23 @@ bool RTABMAP_EXP exportPoses(
|
||||
std::multimap<int, Link>::iterator RTABMAP_EXP findLink(
|
||||
std::multimap<int, Link> & links,
|
||||
int from,
|
||||
int to);
|
||||
int to,
|
||||
bool checkBothWays = true);
|
||||
std::multimap<int, int>::iterator RTABMAP_EXP findLink(
|
||||
std::multimap<int, int> & links,
|
||||
int from,
|
||||
int to);
|
||||
int to,
|
||||
bool checkBothWays = true);
|
||||
std::multimap<int, Link>::const_iterator RTABMAP_EXP findLink(
|
||||
const std::multimap<int, Link> & links,
|
||||
int from,
|
||||
int to);
|
||||
int to,
|
||||
bool checkBothWays = true);
|
||||
std::multimap<int, int>::const_iterator RTABMAP_EXP findLink(
|
||||
const std::multimap<int, int> & links,
|
||||
int from,
|
||||
int to);
|
||||
int to,
|
||||
bool checkBothWays = true);
|
||||
|
||||
/**
|
||||
* Get only the the most recent or older poses in the defined radius.
|
||||
@@ -284,6 +288,12 @@ std::multimap<int, int> RTABMAP_EXP radiusPosesClustering(
|
||||
float radius,
|
||||
float angle);
|
||||
|
||||
void reduceGraph(
|
||||
const std::map<int, Transform> & poses,
|
||||
const std::multimap<int, Link> & links,
|
||||
std::multimap<int, int> & hyperNodes, //<parent ID, child ID>
|
||||
std::multimap<int, Link> & hyperLinks);
|
||||
|
||||
/**
|
||||
* Perform A* path planning in the graph.
|
||||
* @param poses The graph's poses
|
||||
@@ -300,6 +310,23 @@ std::list<std::pair<int, Transform> > RTABMAP_EXP computePath(
|
||||
int to,
|
||||
bool updateNewCosts = false);
|
||||
|
||||
/**
|
||||
* Perform Dijkstra path planning in the graph.
|
||||
* @param poses The graph's poses
|
||||
* @param links The graph's links (from node id -> to node id)
|
||||
* @param from initial node
|
||||
* @param to final node
|
||||
* @param updateNewCosts Keep up-to-date costs while traversing the graph.
|
||||
* @param useSameCostForAllLinks Ignore distance between nodes
|
||||
* @return the path ids from id "from" to id "to" including initial and final nodes.
|
||||
*/
|
||||
std::list<int> RTABMAP_EXP computePath(
|
||||
const std::multimap<int, Link> & links,
|
||||
int from,
|
||||
int to,
|
||||
bool updateNewCosts = false,
|
||||
bool useSameCostForAllLinks = false);
|
||||
|
||||
/**
|
||||
* Perform Dijkstra path planning in the graph.
|
||||
* @param fromId initial node
|
||||
|
||||
@@ -38,7 +38,15 @@ namespace rtabmap {
|
||||
class RTABMAP_EXP Link
|
||||
{
|
||||
public:
|
||||
enum Type {kNeighbor, kGlobalClosure, kLocalSpaceClosure, kLocalTimeClosure, kUserClosure, kVirtualClosure, kUndef};
|
||||
enum Type {
|
||||
kNeighbor,
|
||||
kGlobalClosure,
|
||||
kLocalSpaceClosure,
|
||||
kLocalTimeClosure,
|
||||
kUserClosure,
|
||||
kVirtualClosure,
|
||||
kNeighborMerged,
|
||||
kUndef};
|
||||
Link();
|
||||
Link(int from,
|
||||
int to,
|
||||
|
||||
@@ -77,7 +77,7 @@ public:
|
||||
bool postInitClosingEvents = false);
|
||||
std::map<int, float> computeLikelihood(const Signature * signature,
|
||||
const std::list<int> & ids);
|
||||
int incrementMapId();
|
||||
int incrementMapId(std::map<int, int> * reducedIds = 0);
|
||||
void updateAge(int signatureId);
|
||||
|
||||
std::list<int> forget(const std::set<int> & ignoredIds = std::set<int>());
|
||||
@@ -155,6 +155,7 @@ public:
|
||||
bool isIDsGenerated() const {return _generateIds;}
|
||||
int getLastGlobalLoopClosureId() const {return _lastGlobalLoopClosureId;}
|
||||
const Feature2D * getFeature2D() const {return _feature2D;}
|
||||
bool isGraphReduced() const {return _reduceGraph;}
|
||||
|
||||
void setRoi(const std::string & roi);
|
||||
|
||||
@@ -197,7 +198,8 @@ private:
|
||||
void clear();
|
||||
void moveToTrash(Signature * s, bool keepLinkedToGraph = true, std::list<int> * deletedWords = 0);
|
||||
|
||||
void addSignatureToWm(Signature * signature);
|
||||
void moveSignatureToWMFromSTM(int id, int * reducedTo = 0);
|
||||
void addSignatureToWmFromLTM(Signature * signature);
|
||||
Signature * _getSignature(int id) const;
|
||||
std::list<Signature *> getRemovableSignatures(int count,
|
||||
const std::set<int> & ignoredIds = std::set<int>());
|
||||
@@ -231,6 +233,7 @@ private:
|
||||
bool _saveDepth16Format;
|
||||
bool _notLinkedNodesKeptInDb;
|
||||
bool _incrementalMemory;
|
||||
bool _reduceGraph;
|
||||
int _maxStMemSize;
|
||||
float _recentWmRatio;
|
||||
bool _transferSortingByWeightId;
|
||||
|
||||
@@ -189,7 +189,8 @@ class RTABMAP_EXP Parameters
|
||||
RTABMAP_PARAM(Mem, SaveDepth16Format, bool, true, "Save depth image into 16 bits format to reduce memory used. Warning: values over ~65 meters are ignored (maximum 65535 millimeters).");
|
||||
RTABMAP_PARAM(Mem, NotLinkedNodesKept, bool, true, "Keep not linked nodes in db (rehearsed nodes and deleted nodes).");
|
||||
RTABMAP_PARAM(Mem, STMSize, unsigned int, 10, "Short-term memory size.");
|
||||
RTABMAP_PARAM(Mem, IncrementalMemory, bool, true, "SLAM mode, otherwise it is Localization mode.");
|
||||
RTABMAP_PARAM(Mem, IncrementalMemory, bool, true, "SLAM mode, otherwise it is Localization mode.");
|
||||
RTABMAP_PARAM(Mem, ReduceGraph, bool, false, "Reduce graph. Merge nodes when loop closures are added (ignoring those with user data set).");
|
||||
RTABMAP_PARAM(Mem, RecentWmRatio, float, 0.2, "Ratio of locations after the last loop closure in WM that cannot be transferred.");
|
||||
RTABMAP_PARAM(Mem, TransferSortingByWeightId, bool, false, "On transfer, signatures are sorted by weight->ID only (i.e. the oldest of the lowest weighted signatures are transferred first). If false, the signatures are sorted by weight->Age->ID (i.e. the oldest inserted in WM of the lowest weighted signatures are transferred first). Note that retrieval updates the age, not the ID.");
|
||||
RTABMAP_PARAM(Mem, RehearsalIdUpdatedToNewOne, bool, false, "On merge, update to new id. When false, no copy.");
|
||||
@@ -286,8 +287,8 @@ class RTABMAP_EXP Parameters
|
||||
// RGB-D SLAM
|
||||
RTABMAP_PARAM(RGBD, Enabled, bool, true, "");
|
||||
RTABMAP_PARAM(RGBD, PoseScanMatching, bool, false, "Laser scan matching for odometry pose correction (laser scans are required).");
|
||||
RTABMAP_PARAM(RGBD, LinearUpdate, float, 0.0, "Minimum linear displacement to update the map. Rehearsal is done prior to this, so weights are still updated.");
|
||||
RTABMAP_PARAM(RGBD, AngularUpdate, float, 0.0, "Minimum angular displacement to update the map. Rehearsal is done prior to this, so weights are still updated.");
|
||||
RTABMAP_PARAM(RGBD, LinearUpdate, float, 0.1, "Minimum linear displacement to update the map. Rehearsal is done prior to this, so weights are still updated.");
|
||||
RTABMAP_PARAM(RGBD, AngularUpdate, float, 0.1, "Minimum angular displacement to update the map. Rehearsal is done prior to this, so weights are still updated.");
|
||||
RTABMAP_PARAM(RGBD, NewMapOdomChangeDistance, float, 0, "A new map is created if a change of odometry translation greater than X m is detected (0 m = disabled).");
|
||||
RTABMAP_PARAM(RGBD, OptimizeFromGraphEnd, bool, false, "Optimize graph from the newest node. If false, the graph is optimized from the oldest node of the current graph (this adds an overhead computation to detect to oldest mode of the current graph, but it can be useful to preserve the map referential from the oldest node). Warning when set to false: when some nodes are transferred, the first referential of the local map may change, resulting in momentary changes in robot/map position (which are annoying in teleoperation).");
|
||||
RTABMAP_PARAM(RGBD, OptimizeMaxError, float, 1.0, "Reject loop closures if optimization error is greater than this value (0=disabled). This will help to detect when a wrong loop closure is added to the graph.");
|
||||
@@ -303,7 +304,7 @@ class RTABMAP_EXP Parameters
|
||||
|
||||
// Local loop closure detection
|
||||
RTABMAP_PARAM(RGBD, LocalLoopDetectionTime, bool, false, "Detection over all locations in STM.");
|
||||
RTABMAP_PARAM(RGBD, LocalLoopDetectionSpace, bool, false, "Detection over locations (in Working Memory or STM) near in space.");
|
||||
RTABMAP_PARAM(RGBD, LocalLoopDetectionSpace, bool, true, "Detection over locations (in Working Memory or STM) near in space.");
|
||||
RTABMAP_PARAM(RGBD, LocalLoopDetectionMaxGraphDepth, int, 50, "Maximum depth from the current/last loop closure location and the local loop closure hypotheses. Set 0 to ignore.");
|
||||
RTABMAP_PARAM(RGBD, LocalLoopDetectionPathFilteringRadius, float, 0.5, "Path filtering radius.");
|
||||
RTABMAP_PARAM(RGBD, LocalLoopDetectionPathOdomPosesUsed, bool, true, "When comparing to a local path, merge the scan using the odometry poses instead of the ones in the optimized local graph.");
|
||||
|
||||
@@ -154,6 +154,7 @@ public:
|
||||
void setRawLikelihood(const std::map<int, float> & rawLikelihood) {_rawLikelihood = rawLikelihood;}
|
||||
void setLocalPath(const std::vector<int> & localPath) {_localPath=localPath;}
|
||||
void setCurrentGoalId(int goal) {_currentGoalId=goal;}
|
||||
void setReducedIds(const std::map<int, int> & reducedIds) {_reducedIds = reducedIds;}
|
||||
|
||||
// getters
|
||||
bool extended() const {return _extended;}
|
||||
@@ -173,6 +174,7 @@ public:
|
||||
const std::map<int, float> & rawLikelihood() const {return _rawLikelihood;}
|
||||
const std::vector<int> & localPath() const {return _localPath;}
|
||||
int currentGoalId() const {return _currentGoalId;}
|
||||
const std::map<int, int> & reducedIds() const {return _reducedIds;}
|
||||
|
||||
const std::map<std::string, float> & data() const {return _data;}
|
||||
|
||||
@@ -198,6 +200,8 @@ private:
|
||||
std::vector<int> _localPath;
|
||||
int _currentGoalId;
|
||||
|
||||
std::map<int, int> _reducedIds;
|
||||
|
||||
// Format for statistics (Plottable statistics must go in that map) :
|
||||
// {"Group/Name/Unit", value}
|
||||
// Example : {"Timing/Total time/ms", 500.0f}
|
||||
|
||||
@@ -46,7 +46,13 @@ class FlannIndex;
|
||||
class RTABMAP_EXP VWDictionary
|
||||
{
|
||||
public:
|
||||
enum NNStrategy{kNNFlannNaive, kNNFlannKdTree, kNNFlannLSH, kNNBruteForce, kNNBruteForceGPU, kNNUndef};
|
||||
enum NNStrategy{
|
||||
kNNFlannNaive,
|
||||
kNNFlannKdTree,
|
||||
kNNFlannLSH,
|
||||
kNNBruteForce,
|
||||
kNNBruteForceGPU,
|
||||
kNNUndef};
|
||||
static const int ID_START;
|
||||
static const int ID_INVALID;
|
||||
|
||||
@@ -79,6 +85,7 @@ public:
|
||||
unsigned int getIndexMemoryUsed() const;
|
||||
void setNNStrategy(NNStrategy strategy);
|
||||
bool isIncremental() const {return _incrementalDictionary;}
|
||||
bool isIncrementalFlann() const {return _incrementalFlann;}
|
||||
void setIncrementalDictionary();
|
||||
void setFixedDictionary(const std::string & dictionaryPath);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user