corelib
include
rtabmap
core
Link.h
Go to the documentation of this file.
1
/*
2
Copyright (c) 2010-2016, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
3
All rights reserved.
4
5
Redistribution and use in source and binary forms, with or without
6
modification, are permitted provided that the following conditions are met:
7
* Redistributions of source code must retain the above copyright
8
notice, this list of conditions and the following disclaimer.
9
* Redistributions in binary form must reproduce the above copyright
10
notice, this list of conditions and the following disclaimer in the
11
documentation and/or other materials provided with the distribution.
12
* Neither the name of the Universite de Sherbrooke nor the
13
names of its contributors may be used to endorse or promote products
14
derived from this software without specific prior written permission.
15
16
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
20
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
*/
27
28
#ifndef LINK_H_
29
#define LINK_H_
30
31
#include "rtabmap/core/rtabmap_core_export.h"
// DLL export/import defines
32
33
#include <
rtabmap/core/Transform.h
>
34
#include <opencv2/core/core.hpp>
35
36
namespace
rtabmap
{
37
38
class
RTABMAP_CORE_EXPORT
Link
39
{
40
public
:
41
enum
Type
{
42
kNeighbor
,
43
kGlobalClosure
,
44
kLocalSpaceClosure
,
45
kLocalTimeClosure
,
46
kUserClosure
,
47
kVirtualClosure
,
48
kNeighborMerged
,
49
kPosePrior
,
// Absolute pose in /world frame, From == To
50
kLandmark
,
// Transform /base_link -> /landmark, "From" is node observing the landmark "To" (landmark is negative id)
51
kGravity
,
// Orientation of the base frame accordingly to gravity (From == To)
52
kEnd
,
53
kSelfRefLink = 97,
// Include kPosePrior and kGravity (all links where From=To)
54
kAllWithLandmarks = 98,
55
kAllWithoutLandmarks = 99,
56
kUndef = 99};
57
static
std::string typeName(
Type
type
);
58
59
Link
();
60
Link
(
int
from,
61
int
to,
62
Type
type
,
63
const
Transform
& transform,
64
const
cv::Mat & infMatrix = cv::Mat::eye(6,6,CV_64FC1),
// information matrix: inverse of covariance matrix
65
const
cv::Mat & userData = cv::Mat());
66
67
bool
isValid
()
const
{
return
from_ != 0 && to_ != 0 && !
transform_
.isNull() && type_!=kUndef;}
68
69
int
from
()
const
{
return
from_;}
70
int
to
()
const
{
return
to_;}
71
const
Transform
&
transform
()
const
{
return
transform_
;}
72
Type
type
()
const
{
return
type_;}
73
std::string
typeName
()
const
{
return
typeName
(type_);}
74
const
cv::Mat &
infMatrix
()
const
{
return
infMatrix_;}
75
double
rotVariance(
bool
minimum =
true
)
const
;
76
double
transVariance(
bool
minimum =
true
)
const
;
77
78
void
setFrom
(
int
from) {from_ = from;}
79
void
setTo
(
int
to) {to_ = to;}
80
void
setTransform
(
const
Transform
& transform) {
transform_
=
transform
;}
81
void
setType
(
Type
type
) {type_ =
type
;}
82
void
setInfMatrix(
const
cv::Mat & infMatrix);
83
84
const
cv::Mat &
userDataRaw
()
const
{
return
_userDataRaw;}
85
const
cv::Mat &
userDataCompressed
()
const
{
return
_userDataCompressed;}
86
void
uncompressUserData();
87
cv::Mat uncompressUserDataConst()
const
;
88
89
Link
merge(
const
Link
& link,
Type
outputType)
const
;
90
Link
inverse
()
const
;
91
92
private
:
93
int
from_
;
94
int
to_
;
95
Transform
transform_
;
96
Type
type_
;
97
cv::Mat
infMatrix_
;
// Information matrix = covariance matrix ^ -1
98
99
// user data
100
cv::Mat
_userDataCompressed
;
// compressed data
101
cv::Mat
_userDataRaw
;
102
};
103
104
}
105
106
107
#endif
/* LINK_H_ */
rtabmap::Link::kNeighborMerged
@ kNeighborMerged
Definition:
Link.h:48
rtabmap::Link::kEnd
@ kEnd
Definition:
Link.h:52
rtabmap::Link::kUserClosure
@ kUserClosure
Definition:
Link.h:46
rtabmap::Link::to_
int to_
Definition:
Link.h:94
rtabmap::Link
Definition:
Link.h:38
Transform.h
rtabmap::Link::kGlobalClosure
@ kGlobalClosure
Definition:
Link.h:43
type
rtabmap::Link::kLandmark
@ kLandmark
Definition:
Link.h:50
transform_
OrientedPlane3 transform_(const OrientedPlane3 &plane, const Pose3 &xr)
rtabmap::Link::kLocalTimeClosure
@ kLocalTimeClosure
Definition:
Link.h:45
rtabmap::Link::to
int to() const
Definition:
Link.h:70
rtabmap::Link::transform_
Transform transform_
Definition:
Link.h:95
rtabmap::Link::kPosePrior
@ kPosePrior
Definition:
Link.h:49
rtabmap::Link::kNeighbor
@ kNeighbor
Definition:
Link.h:42
rtabmap::Link::from
int from() const
Definition:
Link.h:69
rtabmap::Link::kVirtualClosure
@ kVirtualClosure
Definition:
Link.h:47
rtabmap::Link::setTo
void setTo(int to)
Definition:
Link.h:79
rtabmap::Link::kLocalSpaceClosure
@ kLocalSpaceClosure
Definition:
Link.h:44
Type
rtabmap::Link::_userDataRaw
cv::Mat _userDataRaw
Definition:
Link.h:101
rtabmap::Link::infMatrix
const cv::Mat & infMatrix() const
Definition:
Link.h:74
rtabmap::Link::type
Type type() const
Definition:
Link.h:72
rtabmap::Link::isValid
bool isValid() const
Definition:
Link.h:67
rtabmap::Link::transform
const Transform & transform() const
Definition:
Link.h:71
rtabmap::Link::setFrom
void setFrom(int from)
Definition:
Link.h:78
rtabmap::Transform
Definition:
Transform.h:41
rtabmap::Link::setTransform
void setTransform(const Transform &transform)
Definition:
Link.h:80
rtabmap::Link::type_
Type type_
Definition:
Link.h:96
rtabmap::Link::_userDataCompressed
cv::Mat _userDataCompressed
Definition:
Link.h:100
rtabmap::Link::typeName
std::string typeName() const
Definition:
Link.h:73
transform
EIGEN_DONT_INLINE void transform(const Quaternion< Scalar > &t, Data &data)
rtabmap::Link::kGravity
@ kGravity
Definition:
Link.h:51
rtabmap
Definition:
CameraARCore.cpp:35
rtabmap::Link::from_
int from_
Definition:
Link.h:93
glm::inverse
GLM_FUNC_DECL matType< T, P > inverse(matType< T, P > const &m)
rtabmap::Link::userDataCompressed
const cv::Mat & userDataCompressed() const
Definition:
Link.h:85
rtabmap::Link::infMatrix_
cv::Mat infMatrix_
Definition:
Link.h:97
rtabmap::Link::setType
void setType(Type type)
Definition:
Link.h:81
rtabmap::Link::userDataRaw
const cv::Mat & userDataRaw() const
Definition:
Link.h:84
rtabmap
Author(s): Mathieu Labbe
autogenerated on Thu Jul 25 2024 02:50:11