g2o
Toggle main menu visibility
Loading...
Searching...
No Matches
g2o
types
data
vertex_ellipse.h
Go to the documentation of this file.
1
// g2o - General Graph Optimization
2
// Copyright (C) 2011 R. Kuemmerle, G. Grisetti, W. Burgard
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
7
// met:
8
//
9
// * Redistributions of source code must retain the above copyright notice,
10
// this list of conditions and the following disclaimer.
11
// * Redistributions in binary form must reproduce the above copyright
12
// notice, this list of conditions and the following disclaimer in the
13
// documentation and/or other materials provided with the distribution.
14
//
15
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
16
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
17
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
18
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19
// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
21
// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
24
// 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
#ifndef G2O_VERTEX_ELLIPSE_H
28
#define G2O_VERTEX_ELLIPSE_H
29
30
#include "
g2o/core/hyper_graph_action.h
"
31
#include "
g2o_types_data_api.h
"
32
#include "
robot_data.h
"
33
34
namespace
g2o
{
35
39
class
G2O_TYPES_DATA_API
VertexEllipse
:
public
RobotData
{
40
public
:
41
using
myVector2fVector
= std::vector<Vector2F>;
42
43
public
:
44
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
;
45
VertexEllipse
();
46
~VertexEllipse
();
47
48
virtual
bool
write
(std::ostream& os)
const
;
49
virtual
bool
read
(std::istream& is);
50
51
const
Matrix3F
&
covariance
() {
return
_covariance
; }
52
void
setCovariance
(
Matrix3F
& c) {
53
_covariance
= c;
54
_updateSVD
();
55
}
56
const
Matrix2F
&
U
() {
return
_UMatrix
; }
57
const
Vector2F
&
singularValues
() {
return
_singularValues
; }
58
59
const
myVector2fVector
&
matchingVertices
() {
return
_matchingVertices
; }
60
void
addMatchingVertex
(
float
x,
float
y) {
61
Vector2F
v(x, y);
62
_matchingVertices
.push_back(v);
63
}
64
65
void
clearMatchingVertices
() {
_matchingVertices
.clear(); }
66
67
const
std::vector<int>&
matchingVerticesIDs
() {
return
_matchingVerticesIDs
; }
68
void
addMatchingVertexID
(
int
id
) {
_matchingVerticesIDs
.push_back(
id
); }
69
void
clearMatchingVerticesIDs
() {
_matchingVerticesIDs
.clear(); }
70
71
protected
:
72
void
_updateSVD()
const
;
73
Matrix3F
_covariance
;
74
mutable
Matrix2F
_UMatrix
;
75
mutable
Vector2F
_singularValues
;
76
std::vector<int>
_matchingVerticesIDs
;
77
myVector2fVector
_matchingVertices
;
78
};
79
80
#ifdef G2O_HAVE_OPENGL
81
class
G2O_TYPES_DATA_API
VertexEllipseDrawAction :
public
DrawAction
{
82
public
:
83
VertexEllipseDrawAction();
84
virtual
HyperGraphElementAction
* operator()(
85
HyperGraph::HyperGraphElement
* element,
86
HyperGraphElementAction::Parameters
* params_);
87
88
protected
:
89
virtual
bool
refreshPropertyPtrs(
90
HyperGraphElementAction::Parameters
* params_);
91
DoubleProperty
* _scaleFactor;
92
};
93
#endif
94
95
}
// namespace g2o
96
97
#endif
g2o::DrawAction
draw actions
Definition
hyper_graph_action.h:201
g2o::HyperGraphElementAction
Abstract action that operates on a graph entity.
Definition
hyper_graph_action.h:74
g2o::RobotData::RobotData
RobotData()
Definition
robot_data.cpp:31
g2o::VertexEllipse::_matchingVerticesIDs
std::vector< int > _matchingVerticesIDs
Definition
vertex_ellipse.h:76
g2o::VertexEllipse::write
virtual bool write(std::ostream &os) const
write the data to a stream
Definition
vertex_ellipse.cpp:86
g2o::VertexEllipse::addMatchingVertexID
void addMatchingVertexID(int id)
Definition
vertex_ellipse.h:68
g2o::VertexEllipse::_UMatrix
Matrix2F _UMatrix
Definition
vertex_ellipse.h:74
g2o::VertexEllipse::setCovariance
void setCovariance(Matrix3F &c)
Definition
vertex_ellipse.h:52
g2o::VertexEllipse::matchingVerticesIDs
const std::vector< int > & matchingVerticesIDs()
Definition
vertex_ellipse.h:67
g2o::VertexEllipse::_singularValues
Vector2F _singularValues
Definition
vertex_ellipse.h:75
g2o::VertexEllipse::_updateSVD
void _updateSVD() const
Definition
vertex_ellipse.cpp:53
g2o::VertexEllipse::EIGEN_MAKE_ALIGNED_OPERATOR_NEW
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
Definition
vertex_ellipse.h:44
g2o::VertexEllipse::read
virtual bool read(std::istream &is)
read the data from a stream
Definition
vertex_ellipse.cpp:60
g2o::VertexEllipse::clearMatchingVerticesIDs
void clearMatchingVerticesIDs()
Definition
vertex_ellipse.h:69
g2o::VertexEllipse::matchingVertices
const myVector2fVector & matchingVertices()
Definition
vertex_ellipse.h:59
g2o::VertexEllipse::addMatchingVertex
void addMatchingVertex(float x, float y)
Definition
vertex_ellipse.h:60
g2o::VertexEllipse::clearMatchingVertices
void clearMatchingVertices()
Definition
vertex_ellipse.h:65
g2o::VertexEllipse::singularValues
const Vector2F & singularValues()
Definition
vertex_ellipse.h:57
g2o::VertexEllipse::covariance
const Matrix3F & covariance()
Definition
vertex_ellipse.h:51
g2o::VertexEllipse::_matchingVertices
myVector2fVector _matchingVertices
Definition
vertex_ellipse.h:77
g2o::VertexEllipse::_covariance
Matrix3F _covariance
Definition
vertex_ellipse.h:73
g2o::VertexEllipse::U
const Matrix2F & U()
Definition
vertex_ellipse.h:56
g2o::VertexEllipse::myVector2fVector
std::vector< Vector2F > myVector2fVector
Definition
vertex_ellipse.h:41
g2o::VertexEllipse::VertexEllipse
VertexEllipse()
Definition
vertex_ellipse.cpp:45
g2o_types_data_api.h
G2O_TYPES_DATA_API
#define G2O_TYPES_DATA_API
Definition
g2o_types_data_api.h:55
hyper_graph_action.h
g2o
Definition
dl_wrapper.cpp:55
g2o::Vector2F
Eigen::Matrix< float, 2, 1, Eigen::ColMajor > Vector2F
Definition
eigen_types.h:43
g2o::Matrix2F
Eigen::Matrix< float, 2, 2, Eigen::ColMajor > Matrix2F
Definition
eigen_types.h:63
g2o::Matrix3F
Eigen::Matrix< float, 3, 3, Eigen::ColMajor > Matrix3F
Definition
eigen_types.h:64
g2o::DoubleProperty
Property< double > DoubleProperty
Definition
property.h:151
robot_data.h
g2o::HyperGraphElementAction::Parameters
Definition
hyper_graph_action.h:76
g2o::HyperGraph::HyperGraphElement
Definition
hyper_graph.h:80
Generated on
for g2o by
1.17.0