mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 01:20:25 +08:00
Added Memory::getAllLabels(), added labels to statistics and added DBDriver::getNodeInfo()
This commit is contained in:
@@ -97,7 +97,7 @@ public:
|
||||
void loadNodeData(std::list<Signature *> & signatures, bool loadMetricData) const;
|
||||
void getNodeData(int signatureId, cv::Mat & imageCompressed, cv::Mat & depthCompressed, cv::Mat & laserScanCompressed, float & fx, float & fy, float & cx, float & cy, Transform & localTransform) const;
|
||||
void getNodeData(int signatureId, cv::Mat & imageCompressed) const;
|
||||
void getPose(int signatureId, Transform & pose, int & mapId) const;
|
||||
bool getNodeInfo(int signatureId, Transform & pose, int & mapId, int & weight, std::string & label, double & stamp) const;
|
||||
void loadLinks(int signatureId, std::map<int, Link> & links, Link::Type type = Link::kUndef) const;
|
||||
void getWeight(int signatureId, int & weight) const;
|
||||
void getAllNodeIds(std::set<int> & ids, bool ignoreChildren = false) const;
|
||||
@@ -105,6 +105,7 @@ public:
|
||||
void getLastWordId(int & id) const;
|
||||
void getInvertedIndexNi(int signatureId, int & ni) const;
|
||||
void getNodeIdByLabel(const std::string & label, int & id) const;
|
||||
void getAllLabels(std::map<int, std::string> & labels) const;
|
||||
|
||||
protected:
|
||||
DBDriver(const ParametersMap & parameters = ParametersMap());
|
||||
@@ -135,11 +136,12 @@ private:
|
||||
virtual void loadNodeDataQuery(std::list<Signature *> & signatures, bool loadMetricData) const = 0;
|
||||
virtual void getNodeDataQuery(int signatureId, cv::Mat & imageCompressed, cv::Mat & depthCompressed, cv::Mat & laserScanCompressed, float & fx, float & fy, float & cx, float & cy, Transform & localTransform) const = 0;
|
||||
virtual void getNodeDataQuery(int signatureId, cv::Mat & imageCompressed) const = 0;
|
||||
virtual void getPoseQuery(int signatureId, Transform & pose, int & mapId) const = 0;
|
||||
virtual bool getNodeInfoQuery(int signatureId, Transform & pose, int & mapId, int & weight, std::string & label, double & stamp) const = 0;
|
||||
virtual void getAllNodeIdsQuery(std::set<int> & ids, bool ignoreChildren) const = 0;
|
||||
virtual void getLastIdQuery(const std::string & tableName, int & id) const = 0;
|
||||
virtual void getInvertedIndexNiQuery(int signatureId, int & ni) const = 0;
|
||||
virtual void getNodeIdByLabelQuery(const std::string & label, int & id) const = 0;
|
||||
virtual void getAllLabelsQuery(std::map<int, std::string> & labels) const = 0;
|
||||
|
||||
private:
|
||||
//non-abstract methods
|
||||
|
||||
@@ -96,9 +96,6 @@ public:
|
||||
const std::set<int> & getWorkingMem() const {return _workingMem;}
|
||||
const std::set<int> & getStMem() const {return _stMem;}
|
||||
int getMaxStMemSize() const {return _maxStMemSize;}
|
||||
void getPose(int locationId,
|
||||
Transform & pose,
|
||||
bool lookInDatabase = false) const;
|
||||
std::map<int, Link> getNeighborLinks(int signatureId,
|
||||
bool lookInDatabase = false) const;
|
||||
std::map<int, Link> getLoopClosureLinks(int signatureId,
|
||||
@@ -111,9 +108,17 @@ public:
|
||||
const Signature * getLastWorkingSignature() const;
|
||||
int getSignatureIdByLabel(const std::string & label, bool lookInDatabase = true) const;
|
||||
bool labelSignature(int id, const std::string & label);
|
||||
std::map<int, std::string> getAllLabels() const;
|
||||
int getDatabaseMemoryUsed() const; // in bytes
|
||||
double getDbSavingTime() const;
|
||||
int getMapId(int signatureId) const;
|
||||
Transform getOdomPose(int signatureId, bool lookInDatabase = false) const;
|
||||
bool getNodeInfo(int signatureId,
|
||||
Transform & odomPose,
|
||||
int & mapId,
|
||||
int & weight,
|
||||
std::string & label,
|
||||
double & stamp,
|
||||
bool lookInDatabase = false) const;
|
||||
cv::Mat getImageCompressed(int signatureId) const;
|
||||
Signature getSignatureData(int locationId, bool uncompressedData = false);
|
||||
Signature getSignatureDataConst(int locationId) const;
|
||||
|
||||
@@ -113,11 +113,13 @@ public:
|
||||
std::map<int, Transform> & poses,
|
||||
std::multimap<int, Link> & constraints,
|
||||
std::map<int, int> & mapIds,
|
||||
std::map<int, std::string> & labels,
|
||||
bool optimized,
|
||||
bool global) const;
|
||||
void getGraph(std::map<int, Transform> & poses,
|
||||
std::multimap<int, Link> & constraints,
|
||||
std::map<int, int> & mapIds,
|
||||
std::map<int, std::string> & labels,
|
||||
bool optimized,
|
||||
bool global);
|
||||
void clearPath();
|
||||
|
||||
@@ -148,12 +148,14 @@ public:
|
||||
const std::map<int, Signature> & signatures,
|
||||
const std::map<int, Transform> & poses,
|
||||
const std::multimap<int, Link> & constraints,
|
||||
const std::map<int, int> & mapIds) :
|
||||
const std::map<int, int> & mapIds,
|
||||
const std::map<int, std::string> & labels) :
|
||||
UEvent(0),
|
||||
_signatures(signatures),
|
||||
_poses(poses),
|
||||
_constraints(constraints),
|
||||
_mapIds(mapIds)
|
||||
_mapIds(mapIds),
|
||||
_labels(labels)
|
||||
{}
|
||||
|
||||
virtual ~RtabmapEvent3DMap() {}
|
||||
@@ -162,6 +164,7 @@ public:
|
||||
const std::map<int, Transform> & getPoses() const {return _poses;}
|
||||
const std::multimap<int, Link> & getConstraints() const {return _constraints;}
|
||||
const std::map<int, int> & getMapIds() const {return _mapIds;}
|
||||
const std::map<int, std::string> & getLabels() const {return _labels;}
|
||||
|
||||
virtual std::string getClassName() const {return std::string("RtabmapEvent3DMap");}
|
||||
|
||||
@@ -170,6 +173,7 @@ private:
|
||||
std::map<int, Transform> _poses;
|
||||
std::multimap<int, Link> _constraints;
|
||||
std::map<int, int> _mapIds;
|
||||
std::map<int, std::string> _labels;
|
||||
};
|
||||
|
||||
} // namespace rtabmap
|
||||
|
||||
@@ -128,6 +128,7 @@ public:
|
||||
void setLocalLoopClosureId(int localLoopClosureId) {_localLoopClosureId = localLoopClosureId;}
|
||||
|
||||
void setMapIds(const std::map<int, int> & mapIds) {_mapIds = mapIds;}
|
||||
void setLabels(const std::map<int, std::string> & labels) {_labels = labels;}
|
||||
void setSignature(const Signature & s) {_signature = s;}
|
||||
|
||||
void setPoses(const std::map<int, Transform> & poses) {_poses = poses;}
|
||||
@@ -147,6 +148,7 @@ public:
|
||||
int localLoopClosureId() const {return _localLoopClosureId;}
|
||||
|
||||
const std::map<int, int> & getMapIds() const {return _mapIds;}
|
||||
const std::map<int, std::string> & getLabels() const {return _labels;}
|
||||
const Signature & getSignature() const {return _signature;}
|
||||
|
||||
const std::map<int, Transform> & poses() const {return _poses;}
|
||||
@@ -170,6 +172,7 @@ private:
|
||||
|
||||
// extended data start here...
|
||||
std::map<int, int> _mapIds;
|
||||
std::map<int, std::string> _labels;
|
||||
|
||||
// Signature data
|
||||
Signature _signature;
|
||||
|
||||
Reference in New Issue
Block a user