g2o
Loading...
Searching...
No Matches
vertex_ellipse.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_ELLIPSE_H
28#define G2O_VERTEX_ELLIPSE_H
29
31#include "g2o_types_data_api.h"
32#include "robot_data.h"
33
34namespace g2o {
35
40 public:
41 using myVector2fVector = std::vector<Vector2F>;
42
43 public:
47
48 virtual bool write(std::ostream& os) const;
49 virtual bool read(std::istream& is);
50
51 const Matrix3F& covariance() { return _covariance; }
53 _covariance = c;
54 _updateSVD();
55 }
56 const Matrix2F& U() { return _UMatrix; }
57 const Vector2F& singularValues() { return _singularValues; }
58
59 const myVector2fVector& matchingVertices() { return _matchingVertices; }
60 void addMatchingVertex(float x, float y) {
61 Vector2F v(x, y);
62 _matchingVertices.push_back(v);
63 }
64
65 void clearMatchingVertices() { _matchingVertices.clear(); }
66
67 const std::vector<int>& matchingVerticesIDs() { return _matchingVerticesIDs; }
68 void addMatchingVertexID(int id) { _matchingVerticesIDs.push_back(id); }
69 void clearMatchingVerticesIDs() { _matchingVerticesIDs.clear(); }
70
71 protected:
72 void _updateSVD() const;
76 std::vector<int> _matchingVerticesIDs;
78};
79
80#ifdef G2O_HAVE_OPENGL
81class G2O_TYPES_DATA_API VertexEllipseDrawAction : public DrawAction {
82 public:
83 VertexEllipseDrawAction();
84 virtual HyperGraphElementAction* operator()(
87
88 protected:
89 virtual bool refreshPropertyPtrs(
91 DoubleProperty* _scaleFactor;
92};
93#endif
94
95} // namespace g2o
96
97#endif
Abstract action that operates on a graph entity.
data recorded by the robot
Definition robot_data.h:41
string ellipse to be attached to a vertex
std::vector< int > _matchingVerticesIDs
void addMatchingVertexID(int id)
void setCovariance(Matrix3F &c)
const std::vector< int > & matchingVerticesIDs()
void clearMatchingVerticesIDs()
const myVector2fVector & matchingVertices()
void addMatchingVertex(float x, float y)
const Vector2F & singularValues()
const Matrix3F & covariance()
myVector2fVector _matchingVertices
const Matrix2F & U()
std::vector< Vector2F > myVector2fVector
#define G2O_TYPES_DATA_API
Eigen::Matrix< float, 3, 3, Eigen::ColMajor > Matrix3F
Definition eigen_types.h:64
Eigen::Matrix< float, 2, 2, Eigen::ColMajor > Matrix2F
Definition eigen_types.h:63
Eigen::Matrix< float, 2, 1, Eigen::ColMajor > Vector2F
Definition eigen_types.h:43