g2o
Toggle main menu visibility
Loading...
Searching...
No Matches
g2o
examples
target
targetTypes3D.hpp
Go to the documentation of this file.
1
#ifndef G2O_TARGET_TYPES_3D_HPP_
2
#define G2O_TARGET_TYPES_3D_HPP_
3
4
#include <
g2o/core/base_unary_edge.h
>
5
#include <
g2o/core/base_vertex.h
>
6
7
#include <Eigen/Core>
8
9
// This header file specifies a set of types for the different
10
// tracking examples; note that
11
12
class
VertexPosition3D
:
public
g2o::BaseVertex
<3, Eigen::Vector3d> {
13
public
:
14
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
15
VertexPosition3D
() {}
16
17
virtual
void
setToOriginImpl
() {
_estimate
.setZero(); }
18
19
virtual
void
oplusImpl
(
const
double
* update) {
20
_estimate
[0] += update[0];
21
_estimate
[1] += update[1];
22
_estimate
[2] += update[2];
23
}
24
25
virtual
bool
read
(std::istream&
/*is*/
) {
return
false
; }
26
27
virtual
bool
write
(std::ostream&
/*os*/
)
const
{
return
false
; }
28
};
29
30
// Store velocity separately from position?
31
class
VertexVelocity3D
:
public
g2o::BaseVertex
<3, Eigen::Vector3d> {
32
public
:
33
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
34
VertexVelocity3D
() {}
35
36
virtual
void
setToOriginImpl
() {
_estimate
.setZero(); }
37
38
virtual
void
oplusImpl
(
const
double
* update) {
39
_estimate
[0] += update[0];
40
_estimate
[1] += update[1];
41
_estimate
[2] += update[2];
42
}
43
44
virtual
bool
read
(std::istream&
/*is*/
) {
return
false
; }
45
46
virtual
bool
write
(std::ostream&
/*os*/
)
const
{
return
false
; }
47
};
48
49
// The idealised GPS measurement; this is 3D and linear
50
class
GPSObservationPosition3DEdge
51
:
public
g2o::BaseUnaryEdge
<3, Eigen::Vector3d, VertexPosition3D> {
52
public
:
53
GPSObservationPosition3DEdge
() {}
54
55
void
computeError
() {
56
const
VertexPosition3D
* v =
57
static_cast<
const
VertexPosition3D
*
>
(
_vertices
[0]);
58
_error
= v->
estimate
() -
_measurement
;
59
}
60
61
virtual
bool
read
(std::istream&
/*is*/
) {
return
false
; }
62
63
virtual
bool
write
(std::ostream&
/*os*/
)
const
{
return
false
; }
64
};
65
66
#endif
// __TARGET_TYPES_3D_HPP__
base_unary_edge.h
base_vertex.h
GPSObservationPosition3DEdge::write
virtual bool write(std::ostream &) const
write the vertex to a stream
Definition
targetTypes3D.hpp:63
GPSObservationPosition3DEdge::read
virtual bool read(std::istream &)
read the vertex from a stream, i.e., the internal state of the vertex
Definition
targetTypes3D.hpp:61
GPSObservationPosition3DEdge::computeError
void computeError()
Definition
targetTypes3D.hpp:55
GPSObservationPosition3DEdge::GPSObservationPosition3DEdge
GPSObservationPosition3DEdge()
Definition
targetTypes3D.hpp:53
VertexPosition3D
Definition
targetTypes3D.hpp:12
VertexPosition3D::oplusImpl
virtual void oplusImpl(const double *update)
Definition
targetTypes3D.hpp:19
VertexPosition3D::read
virtual bool read(std::istream &)
read the vertex from a stream, i.e., the internal state of the vertex
Definition
targetTypes3D.hpp:25
VertexPosition3D::setToOriginImpl
virtual void setToOriginImpl()
sets the node to the origin (used in the multilevel stuff)
Definition
targetTypes3D.hpp:17
VertexPosition3D::write
virtual bool write(std::ostream &) const
write the vertex to a stream
Definition
targetTypes3D.hpp:27
VertexPosition3D::VertexPosition3D
EIGEN_MAKE_ALIGNED_OPERATOR_NEW VertexPosition3D()
Definition
targetTypes3D.hpp:15
VertexVelocity3D::oplusImpl
virtual void oplusImpl(const double *update)
Definition
targetTypes3D.hpp:38
VertexVelocity3D::VertexVelocity3D
EIGEN_MAKE_ALIGNED_OPERATOR_NEW VertexVelocity3D()
Definition
targetTypes3D.hpp:34
VertexVelocity3D::write
virtual bool write(std::ostream &) const
write the vertex to a stream
Definition
targetTypes3D.hpp:46
VertexVelocity3D::setToOriginImpl
virtual void setToOriginImpl()
sets the node to the origin (used in the multilevel stuff)
Definition
targetTypes3D.hpp:36
VertexVelocity3D::read
virtual bool read(std::istream &)
read the vertex from a stream, i.e., the internal state of the vertex
Definition
targetTypes3D.hpp:44
g2o::BaseEdge< D, Eigen::Vector3d >::_measurement
Measurement _measurement
Definition
base_edge.h:146
g2o::BaseEdge< D, Eigen::Vector3d >::_error
ErrorVector _error
Definition
base_edge.h:149
g2o::BaseUnaryEdge
Definition
base_unary_edge.h:37
g2o::BaseVertex
Templatized BaseVertex.
Definition
base_vertex.h:51
g2o::BaseVertex::estimate
const EstimateType & estimate() const
return the current estimate of the vertex
Definition
base_vertex.h:127
g2o::BaseVertex< 3, Eigen::Vector3d >::_estimate
EstimateType _estimate
Definition
base_vertex.h:137
g2o::HyperGraph::Edge::_vertices
VertexContainer _vertices
Definition
hyper_graph.h:221
Generated on
for g2o by
1.17.0