g2o
Loading...
Searching...
No Matches
targetTypes3D.hpp
Go to the documentation of this file.
1#ifndef G2O_TARGET_TYPES_3D_HPP_
2#define G2O_TARGET_TYPES_3D_HPP_
3
6
7#include <Eigen/Core>
8
9// This header file specifies a set of types for the different
10// tracking examples; note that
11
12class VertexPosition3D : public g2o::BaseVertex<3, Eigen::Vector3d> {
13 public:
14 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
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?
31class VertexVelocity3D : public g2o::BaseVertex<3, Eigen::Vector3d> {
32 public:
33 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
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
51 : public g2o::BaseUnaryEdge<3, Eigen::Vector3d, VertexPosition3D> {
52 public:
54
55 void computeError() {
56 const VertexPosition3D* v =
57 static_cast<const VertexPosition3D*>(_vertices[0]);
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__
virtual bool write(std::ostream &) const
write the vertex to a stream
virtual bool read(std::istream &)
read the vertex from a stream, i.e., the internal state of the vertex
virtual void oplusImpl(const double *update)
virtual bool read(std::istream &)
read the vertex from a stream, i.e., the internal state of the vertex
virtual void setToOriginImpl()
sets the node to the origin (used in the multilevel stuff)
virtual bool write(std::ostream &) const
write the vertex to a stream
EIGEN_MAKE_ALIGNED_OPERATOR_NEW VertexPosition3D()
virtual void oplusImpl(const double *update)
EIGEN_MAKE_ALIGNED_OPERATOR_NEW VertexVelocity3D()
virtual bool write(std::ostream &) const
write the vertex to a stream
virtual void setToOriginImpl()
sets the node to the origin (used in the multilevel stuff)
virtual bool read(std::istream &)
read the vertex from a stream, i.e., the internal state of the vertex
Measurement _measurement
the measurement of the edge
Definition base_edge.h:146
ErrorVector _error
Definition base_edge.h:149
Templatized BaseVertex.
Definition base_vertex.h:51
const EstimateType & estimate() const
return the current estimate of the vertex
VertexContainer _vertices