g2o
Loading...
Searching...
No Matches
vertex_cam.h
Go to the documentation of this file.
1// g2o - General Graph Optimization
2// Copyright (C) 2011 Kurt Konolige
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_SBA_VERTEX_CAM_H
28#define G2O_SBA_VERTEX_CAM_H
29
31#include "g2o_types_sba_api.h"
32#include "sbacam.h"
33
34namespace g2o {
35
43class G2O_TYPES_SBA_API VertexCam : public BaseVertex<6, SBACam> {
44 public:
46 VertexCam();
47
48 virtual bool read(std::istream& is);
49 virtual bool write(std::ostream& os) const;
50
51 virtual void setToOriginImpl() { _estimate = SBACam(); }
52
53 virtual void setEstimate(const SBACam& cam) {
55 _estimate.setTransform();
56 _estimate.setProjection();
57 _estimate.setDr();
58 }
59
60 virtual void oplusImpl(const double* update) {
61 Eigen::Map<const Vector6> v(update);
62 _estimate.update(v);
63 _estimate.setTransform();
64 _estimate.setProjection();
65 _estimate.setDr();
66 }
67
68 virtual bool setEstimateDataImpl(const double* est) {
69 Eigen::Map<const Vector7> v(est);
70 _estimate.fromVector(v);
71 return true;
72 }
73
74 virtual bool getEstimateData(double* est) const {
75 Eigen::Map<Vector7> v(est);
76 v = estimate().toVector();
77 return true;
78 }
79
80 virtual int estimateDimension() const { return 7; }
81
82 virtual bool setMinimalEstimateDataImpl(const double* est) {
83 Eigen::Map<const Vector6> v(est);
84 _estimate.fromMinimalVector(v);
85 return true;
86 }
87
88 virtual bool getMinimalEstimateData(double* est) const {
89 Eigen::Map<Vector6> v(est);
90 v = _estimate.toMinimalVector();
91 return true;
92 }
93
94 virtual int minimalEstimateDimension() const { return 6; }
95};
96} // namespace g2o
97
98#endif
Templatized BaseVertex.
Definition base_vertex.h:51
SBACam Vertex, (x,y,z,qw,qx,qy,qz) the parameterization for the increments constructed is a 6d vector...
Definition vertex_cam.h:43
virtual int minimalEstimateDimension() const
Definition vertex_cam.h:94
virtual void setToOriginImpl()
sets the node to the origin (used in the multilevel stuff)
Definition vertex_cam.h:51
virtual bool setMinimalEstimateDataImpl(const double *est)
Definition vertex_cam.h:82
virtual void setEstimate(const SBACam &cam)
Definition vertex_cam.h:53
virtual bool getEstimateData(double *est) const
Definition vertex_cam.h:74
virtual bool setEstimateDataImpl(const double *est)
Definition vertex_cam.h:68
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
Definition vertex_cam.h:45
virtual bool getMinimalEstimateData(double *est) const
Definition vertex_cam.h:88
virtual void oplusImpl(const double *update)
Definition vertex_cam.h:60
virtual int estimateDimension() const
Definition vertex_cam.h:80
#define G2O_TYPES_SBA_API