g2o
Toggle main menu visibility
Loading...
Searching...
No Matches
g2o
types
slam3d_addons
vertex_plane.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_PLANE_H_
28
#define G2O_VERTEX_PLANE_H_
29
30
#include "g2o/config.h"
31
#include "
g2o/core/base_vertex.h
"
32
#include "
g2o/core/hyper_graph_action.h
"
33
#include "
g2o_types_slam3d_addons_api.h
"
34
#include "
plane3d.h
"
35
36
namespace
g2o
{
37
38
class
G2O_TYPES_SLAM3D_ADDONS_API
VertexPlane
:
public
BaseVertex
<3, Plane3D> {
39
public
:
40
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
;
41
VertexPlane
();
42
43
virtual
bool
read
(std::istream& is);
44
virtual
bool
write
(std::ostream& os)
const
;
45
46
virtual
void
setToOriginImpl
() {
_estimate
=
Plane3D
(); }
47
48
virtual
void
oplusImpl
(
const
double
* update_) {
49
Eigen::Map<const Vector3> update(update_);
50
_estimate
.oplus(update);
51
}
52
53
virtual
bool
setEstimateDataImpl
(
const
double
* est) {
54
Eigen::Map<const Vector4> _est(est);
55
_estimate
.fromVector(_est);
56
return
true
;
57
}
58
59
virtual
bool
getEstimateData
(
double
* est)
const
{
60
Eigen::Map<Vector4> _est(est);
61
_est =
_estimate
.toVector();
62
return
true
;
63
}
64
65
virtual
int
estimateDimension
()
const
{
return
4; }
66
67
Vector3
color
;
68
};
69
70
#ifdef G2O_HAVE_OPENGL
71
class
VertexPlaneDrawAction :
public
DrawAction
{
72
public
:
73
VertexPlaneDrawAction();
74
virtual
HyperGraphElementAction
* operator()(
75
HyperGraph::HyperGraphElement
* element,
76
HyperGraphElementAction::Parameters
* params_);
77
78
protected
:
79
virtual
bool
refreshPropertyPtrs(
80
HyperGraphElementAction::Parameters
* params_);
81
FloatProperty
*_planeWidth, *_planeHeight;
82
};
83
#endif
84
85
}
// namespace g2o
86
#endif
base_vertex.h
g2o::BaseVertex< 3, Plane3D >::BaseVertex
BaseVertex()
Definition
base_vertex.h:29
g2o::BaseVertex< 3, Plane3D >::_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::Plane3D
Definition
plane3d.h:38
g2o::VertexPlane::setToOriginImpl
virtual void setToOriginImpl()
sets the node to the origin (used in the multilevel stuff)
Definition
vertex_plane.h:46
g2o::VertexPlane::read
virtual bool read(std::istream &is)
read the vertex from a stream, i.e., the internal state of the vertex
Definition
vertex_plane.cpp:35
g2o::VertexPlane::EIGEN_MAKE_ALIGNED_OPERATOR_NEW
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
Definition
vertex_plane.h:40
g2o::VertexPlane::estimateDimension
virtual int estimateDimension() const
Definition
vertex_plane.h:65
g2o::VertexPlane::setEstimateDataImpl
virtual bool setEstimateDataImpl(const double *est)
Definition
vertex_plane.h:53
g2o::VertexPlane::VertexPlane
VertexPlane()
Definition
vertex_plane.cpp:33
g2o::VertexPlane::color
Vector3 color
Definition
vertex_plane.h:67
g2o::VertexPlane::write
virtual bool write(std::ostream &os) const
write the vertex to a stream
Definition
vertex_plane.cpp:43
g2o::VertexPlane::oplusImpl
virtual void oplusImpl(const double *update_)
Definition
vertex_plane.h:48
g2o::VertexPlane::getEstimateData
virtual bool getEstimateData(double *est) const
Definition
vertex_plane.h:59
g2o_types_slam3d_addons_api.h
G2O_TYPES_SLAM3D_ADDONS_API
#define G2O_TYPES_SLAM3D_ADDONS_API
Definition
g2o_types_slam3d_addons_api.h:46
hyper_graph_action.h
g2o
Definition
dl_wrapper.cpp:55
g2o::Vector3
VectorN< 3 > Vector3
Definition
eigen_types.h:51
g2o::FloatProperty
Property< float > FloatProperty
Definition
property.h:150
plane3d.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