g2o
Toggle main menu visibility
Loading...
Searching...
No Matches
g2o
types
slam2d_addons
vertex_segment2d.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_SEGMENT_2D_H
28
#define G2O_VERTEX_SEGMENT_2D_H
29
30
#include <Eigen/Core>
31
32
#include "g2o/config.h"
33
#include "
g2o/core/base_vertex.h
"
34
#include "
g2o/core/hyper_graph_action.h
"
35
#include "
g2o_types_slam2d_addons_api.h
"
36
37
namespace
g2o
{
38
39
class
G2O_TYPES_SLAM2D_ADDONS_API
VertexSegment2D
40
:
public
BaseVertex
<4, Vector4> {
41
public
:
42
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
;
43
VertexSegment2D
();
44
45
Vector2
estimateP1
()
const
{
46
return
Eigen::Map<const Vector2>(&(
_estimate
[0]));
47
}
48
Vector2
estimateP2
()
const
{
49
return
Eigen::Map<const Vector2>(&(
_estimate
[2]));
50
}
51
void
setEstimateP1
(
const
Vector2
& p1) {
52
Eigen::Map<Vector2> v(&
_estimate
[0]);
53
v = p1;
54
}
55
void
setEstimateP2
(
const
Vector2
& p2) {
56
Eigen::Map<Vector2> v(&
_estimate
[2]);
57
v = p2;
58
}
59
60
virtual
void
setToOriginImpl
() {
_estimate
.setZero(); }
61
62
virtual
bool
setEstimateDataImpl
(
const
double
* est) {
63
Eigen::Map<const Vector4> v(est);
64
_estimate
= v;
65
return
true
;
66
}
67
68
virtual
bool
getEstimateData
(
double
* est)
const
{
69
Eigen::Map<Vector4> v(est);
70
v =
_estimate
;
71
return
true
;
72
}
73
74
virtual
int
estimateDimension
()
const
{
return
4; }
75
76
virtual
bool
setMinimalEstimateDataImpl
(
const
double
* est) {
77
return
setEstimateData
(est);
78
}
79
80
virtual
bool
getMinimalEstimateData
(
double
* est)
const
{
81
return
getEstimateData
(est);
82
}
83
84
virtual
int
minimalEstimateDimension
()
const
{
return
4; }
85
86
virtual
void
oplusImpl
(
const
double
* update) {
87
Eigen::Map<const Vector4> upd(update);
88
_estimate
+= upd;
89
}
90
91
virtual
bool
read(std::istream& is);
92
virtual
bool
write(std::ostream& os)
const
;
93
};
94
95
class
G2O_TYPES_SLAM2D_ADDONS_API
VertexSegment2DWriteGnuplotAction
96
:
public
WriteGnuplotAction
{
97
public
:
98
VertexSegment2DWriteGnuplotAction
();
99
virtual
HyperGraphElementAction
*
operator()
(
100
HyperGraph::HyperGraphElement
* element,
101
HyperGraphElementAction::Parameters
* params_);
102
};
103
104
#ifdef G2O_HAVE_OPENGL
105
class
G2O_TYPES_SLAM2D_ADDONS_API
VertexSegment2DDrawAction
106
:
public
DrawAction
{
107
public
:
108
VertexSegment2DDrawAction();
109
virtual
HyperGraphElementAction
* operator()(
110
HyperGraph::HyperGraphElement
* element,
111
HyperGraphElementAction::Parameters
* params_);
112
113
protected
:
114
FloatProperty
* _pointSize;
115
virtual
bool
refreshPropertyPtrs(
116
HyperGraphElementAction::Parameters
* params_);
117
};
118
#endif
119
120
}
// namespace g2o
121
122
#endif
base_vertex.h
g2o::BaseVertex< 4, Vector4 >::BaseVertex
BaseVertex()
Definition
base_vertex.h:29
g2o::BaseVertex< 4, Vector4 >::_estimate
EstimateType _estimate
Definition
base_vertex.h:137
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::OptimizableGraph::Vertex::setEstimateData
bool setEstimateData(const double *estimate)
Definition
optimizable_graph.cpp:83
g2o::VertexSegment2DWriteGnuplotAction::VertexSegment2DWriteGnuplotAction
VertexSegment2DWriteGnuplotAction()
Definition
vertex_segment2d.cpp:51
g2o::VertexSegment2DWriteGnuplotAction::operator()
virtual HyperGraphElementAction * operator()(HyperGraph::HyperGraphElement *element, HyperGraphElementAction::Parameters *params_)
Definition
vertex_segment2d.cpp:54
g2o::VertexSegment2D::VertexSegment2D
VertexSegment2D()
Definition
vertex_segment2d.cpp:39
g2o::VertexSegment2D::setEstimateDataImpl
virtual bool setEstimateDataImpl(const double *est)
Definition
vertex_segment2d.h:62
g2o::VertexSegment2D::oplusImpl
virtual void oplusImpl(const double *update)
Definition
vertex_segment2d.h:86
g2o::VertexSegment2D::minimalEstimateDimension
virtual int minimalEstimateDimension() const
Definition
vertex_segment2d.h:84
g2o::VertexSegment2D::getEstimateData
virtual bool getEstimateData(double *est) const
Definition
vertex_segment2d.h:68
g2o::VertexSegment2D::setEstimateP2
void setEstimateP2(const Vector2 &p2)
Definition
vertex_segment2d.h:55
g2o::VertexSegment2D::estimateP1
Vector2 estimateP1() const
Definition
vertex_segment2d.h:45
g2o::VertexSegment2D::setEstimateP1
void setEstimateP1(const Vector2 &p1)
Definition
vertex_segment2d.h:51
g2o::VertexSegment2D::EIGEN_MAKE_ALIGNED_OPERATOR_NEW
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
Definition
vertex_segment2d.h:42
g2o::VertexSegment2D::setToOriginImpl
virtual void setToOriginImpl()
sets the node to the origin (used in the multilevel stuff)
Definition
vertex_segment2d.h:60
g2o::VertexSegment2D::estimateDimension
virtual int estimateDimension() const
Definition
vertex_segment2d.h:74
g2o::VertexSegment2D::getMinimalEstimateData
virtual bool getMinimalEstimateData(double *est) const
Definition
vertex_segment2d.h:80
g2o::VertexSegment2D::setMinimalEstimateDataImpl
virtual bool setMinimalEstimateDataImpl(const double *est)
Definition
vertex_segment2d.h:76
g2o::VertexSegment2D::estimateP2
Vector2 estimateP2() const
Definition
vertex_segment2d.h:48
g2o::WriteGnuplotAction::WriteGnuplotAction
WriteGnuplotAction(const std::string &typeName_)
Definition
hyper_graph_action.cpp:206
g2o_types_slam2d_addons_api.h
G2O_TYPES_SLAM2D_ADDONS_API
#define G2O_TYPES_SLAM2D_ADDONS_API
Definition
g2o_types_slam2d_addons_api.h:55
hyper_graph_action.h
g2o
Definition
dl_wrapper.cpp:55
g2o::Vector2
VectorN< 2 > Vector2
Definition
eigen_types.h:50
g2o::FloatProperty
Property< float > FloatProperty
Definition
property.h:150
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