30#include "rtabmap/core/rtabmap_core_export.h"
32#include <pcl/point_types.h>
33#include <opencv2/core/core.hpp>
34#if CV_MAJOR_VERSION < 5
35#include <opencv2/features2d/features2d.hpp>
37#include <opencv2/features.hpp>
39#include <opencv2/imgproc/imgproc.hpp>
45#include <rtabmap/core/Transform.h>
46#include <rtabmap/core/SensorData.h>
47#include <rtabmap/core/Link.h>
116 const std::string & label = std::string(),
168 int id()
const {
return _id;}
189 void setWeight(
int weight) {_modified=_modified || _weight!=weight;_weight = weight;}
208 void setLabel(
const std::string & label) {_modified=_modified || _label.compare(label)!=0;_label = label;}
214 const std::string &
getLabel()
const {
return _label;}
359 void setModified(
bool modified) {_modified = modified; _linksModified = modified;}
365 const std::multimap<int, Link> &
getLinks()
const {
return _links;}
380 bool isModified()
const {
return _modified || _linksModified;}
426 void setWords(
const std::multimap<int, int> & words,
const std::vector<cv::KeyPoint> & keypoints,
const std::vector<cv::Point3f> & words3,
const cv::Mat & descriptors);
452 const std::multimap<int, int> &
getWords()
const {
return _words;}
458 const std::vector<cv::KeyPoint> &
getWordsKpts()
const {
return _wordsKpts;}
544 void setVelocity(
float vx,
float vy,
float vz,
float vroll,
float vpitch,
float vyaw) {
545 _velocity = std::vector<float>(6,0);
562 const std::vector<cv::Point3f> &
getWords3()
const {
return _words3;}
591 const std::vector<float> &
getVelocity()
const {
return _velocity;}
620 std::multimap<int, Link> _links;
621 std::map<int, Link> _landmarks;
635 std::multimap<int, int> _words;
636 std::vector<cv::KeyPoint> _wordsKpts;
637 std::vector<cv::Point3f> _words3;
638 cv::Mat _wordsDescriptors;
639 std::map<int, int> _wordsChanged;
641 int _invalidWordsCount;
645 std::vector<float> _velocity;
Directed constraint between two nodes in RTAB-Map's pose graph.
Type
Link category and filter sentinels.
Container class for all sensor data captured at a specific time.
Represents a node in RTAB-Map's pose graph.
unsigned long getMemoryUsed(bool withSensorData=true) const
Computes the memory usage of this signature.
const std::map< int, int > & getWordsChanged() const
Returns the word ID change mapping.
void setSaved(bool saved)
Sets whether this signature has been saved to the database.
bool isSaved() const
Checks if this signature has been saved to the database.
const SensorData & sensorData() const
Returns const access to the sensor data.
void changeWordsRef(int oldWordId, int activeWordId)
Changes visual word references from one word ID to another.
void changeLinkIds(int idFrom, int idTo)
Changes all link target IDs from one value to another.
const std::multimap< int, Link > & getLinks() const
Returns all links from this signature.
void setVelocity(float vx, float vy, float vz, float vroll, float vpitch, float vyaw)
Sets the velocity of this signature.
const cv::Mat & getWordsDescriptors() const
Returns the feature descriptors for visual words.
const std::map< int, Link > & getLandmarks() const
Returns all landmark observations.
void setModified(bool modified)
Sets the modification flag for this signature.
SensorData & sensorData()
Returns mutable access to the sensor data.
void setWeight(int weight)
Sets the weight/importance of this signature.
int id() const
Returns the signature ID.
void removeVirtualLinks()
Removes all virtual links from this signature.
bool isEnabled() const
Checks if this signature is enabled.
void addLink(const Link &link)
Adds a single link to this signature.
const std::vector< cv::KeyPoint > & getWordsKpts() const
Returns the keypoints associated with visual words.
const Transform & getPose() const
Returns the pose of this signature.
void setEnabled(bool enabled)
Sets whether this signature is enabled.
const Transform & getGroundTruthPose() const
Returns the ground truth pose.
virtual ~Signature()
Virtual destructor.
const std::multimap< int, int > & getWords() const
Returns the visual words map.
bool isBadSignature() const
Checks if this signature is considered "bad".
void setWords(const std::multimap< int, int > &words, const std::vector< cv::KeyPoint > &keypoints, const std::vector< cv::Point3f > &words3, const cv::Mat &descriptors)
Sets all visual words for this signature.
void removeLandmark(int landmarkId)
Removes a specific landmark observation.
int getWeight() const
Returns the weight/importance of this signature.
void addLandmark(const Link &landmark)
Adds a landmark observation to this signature.
const std::string & getLabel() const
Returns the label/name of this signature.
void setWordsDescriptors(const cv::Mat &descriptors)
Sets the feature descriptors for visual words.
void removeLinks(bool keepSelfReferringLinks=false)
Removes all links from this signature.
Signature()
Default constructor.
bool isLinksModified() const
Checks if the links have been modified.
Signature(int id, int mapId=-1, int weight=0, double stamp=0.0, const std::string &label=std::string(), const Transform &pose=Transform(), const Transform &groundTruthPose=Transform(), const SensorData &sensorData=SensorData())
Constructor with explicit parameters.
void removeLandmarks()
Removes all landmark observations.
void setLabel(const std::string &label)
Sets a label/name for this signature.
void addLinks(const std::list< Link > &links)
Adds multiple links from a list.
void setGroundTruthPose(const Transform &pose)
Sets the ground truth pose for evaluation.
double getStamp() const
Returns the timestamp of this signature.
void removeAllWords()
Removes all visual words from this signature.
bool isModified() const
Checks if this signature has been modified.
const std::vector< cv::Point3f > & getWords3() const
Returns the 3D points of visual words.
void removeLink(int idTo)
Removes a specific link to a target signature.
float compareTo(const Signature &signature) const
Compares this signature to another signature.
int getInvalidWordsCount() const
Returns the count of invalid visual words.
int mapId() const
Returns the map ID.
void setPose(const Transform &pose)
Sets the pose of this signature.
bool hasLink(int idTo, Link::Type type=Link::kUndef) const
Checks if this signature has a link to a target signature.
const std::vector< float > & getVelocity() const
Returns the velocity of this signature.
Signature(const SensorData &data)
Constructor from sensor data.
void addLinks(const std::map< int, Link > &links)
Adds multiple links from a map.
cv::Mat getPoseCovariance() const
Gets the pose covariance matrix.