31#include "rtabmap/core/rtabmap_core_export.h"
33#include <rtabmap/core/Transform.h>
34#include <opencv2/core/core.hpp>
54class RTABMAP_CORE_EXPORT
Link
77 kAllWithLandmarks = 98,
78 kAllWithoutLandmarks = 99,
99 const cv::Mat & infMatrix = cv::Mat::eye(6,6,CV_64FC1),
100 const cv::Mat & userData = cv::Mat());
103 bool isValid()
const {
return from_ != 0 && to_ != 0 && !transform_.isNull() && type_!=kUndef;}
105 int from()
const {
return from_;}
106 int to()
const {
return to_;}
107 const Transform & transform()
const {
return transform_;}
108 Type type()
const {
return type_;}
109 std::string typeName()
const {
return typeName(type_);}
110 const cv::Mat & infMatrix()
const {
return infMatrix_;}
124 void setFrom(
int from) {from_ = from;}
125 void setTo(
int to) {to_ = to;}
126 void setTransform(
const Transform & transform) {transform_ = transform;}
127 void setType(Type type) {type_ = type;}
131 const cv::Mat & userDataRaw()
const {
return _userDataRaw;}
132 const cv::Mat & userDataCompressed()
const {
return _userDataCompressed;}
162 cv::Mat _userDataCompressed;
163 cv::Mat _userDataRaw;
Directed constraint between two nodes in RTAB-Map's pose graph.
double rotVariance(bool minimum=true) const
Rotation variance derived from the information matrix diagonal (roll, pitch, yaw).
static std::string typeName(Type type)
Link()
Default constructor; creates an invalid link (kUndef).
void setInfMatrix(const cv::Mat &infMatrix)
Sets the 6x6 information matrix (CV_64FC1); diagonal entries must be positive and finite.
double transVariance(bool minimum=true) const
Translation variance derived from the information matrix diagonal (x, y, z).
Link(int from, int to, Type type, const Transform &transform, const cv::Mat &infMatrix=cv::Mat::eye(6, 6, CV_64FC1), const cv::Mat &userData=cv::Mat())
Constructs a link between two nodes.
Type
Link category and filter sentinels.
Link merge(const Link &link, Type outputType) const
Chains this link (from → to) with link (to → link.to).
cv::Mat uncompressUserDataConst() const
void uncompressUserData()
Decompresses user data into userDataRaw() if compressed data is stored.