Open3D (C++ API)
PoseGraph.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - Open3D: www.open3d.org -
3 // ----------------------------------------------------------------------------
4 // The MIT License (MIT)
5 //
6 // Copyright (c) 2018 www.open3d.org
7 //
8 // Permission is hereby granted, free of charge, to any person obtaining a copy
9 // of this software and associated documentation files (the "Software"), to deal
10 // in the Software without restriction, including without limitation the rights
11 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 // copies of the Software, and to permit persons to whom the Software is
13 // furnished to do so, subject to the following conditions:
14 //
15 // The above copyright notice and this permission notice shall be included in
16 // all copies or substantial portions of the Software.
17 //
18 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24 // IN THE SOFTWARE.
25 // ----------------------------------------------------------------------------
26 
27 #pragma once
28 
29 #include <memory>
30 #include <vector>
31 
32 #include "Open3D/Utility/Eigen.h"
34 
35 namespace open3d {
36 namespace registration {
37 
42 public:
44  PoseGraphNode(const Eigen::Matrix4d &pose = Eigen::Matrix4d::Identity())
45  : pose_(pose) {}
47 
48 public:
49  bool ConvertToJsonValue(Json::Value &value) const override;
50  bool ConvertFromJsonValue(const Json::Value &value) override;
51 
52 public:
54 };
55 
60 public:
70  int source_node_id = -1,
71  int target_node_id = -1,
72  const Eigen::Matrix4d &transformation = Eigen::Matrix4d::Identity(),
73  const Eigen::Matrix6d &information = Eigen::Matrix6d::Identity(),
74  bool uncertain = false,
75  double confidence = 1.0)
76  : source_node_id_(source_node_id),
77  target_node_id_(target_node_id),
78  transformation_(transformation),
79  information_(information),
80  uncertain_(uncertain),
81  confidence_(confidence) {}
82  ~PoseGraphEdge();
83 
84 public:
85  bool ConvertToJsonValue(Json::Value &value) const override;
86  bool ConvertFromJsonValue(const Json::Value &value) override;
87 
88 public:
108  double confidence_;
109 };
110 
115 public:
117  PoseGraph();
118  ~PoseGraph() override;
119 
120 public:
121  bool ConvertToJsonValue(Json::Value &value) const override;
122  bool ConvertFromJsonValue(const Json::Value &value) override;
123 
124 public:
126  std::vector<PoseGraphNode> nodes_;
128  std::vector<PoseGraphEdge> edges_;
129 };
130 
131 } // namespace registration
132 } // namespace open3d
bool ConvertToJsonValue(Json::Value &value) const override
Definition: PoseGraph.cpp:38
Eigen::Matrix6d_u information_
Information matrix.
Definition: PoseGraph.h:96
std::vector< PoseGraphEdge > edges_
List of PoseGraphEdge.
Definition: PoseGraph.h:128
double confidence_
Confidence value of the edge.
Definition: PoseGraph.h:108
PoseGraphNode(const Eigen::Matrix4d &pose=Eigen::Matrix4d::Identity())
Default Constructor.
Definition: PoseGraph.h:44
Edge of PoseGraph.
Definition: PoseGraph.h:59
Eigen::Matrix4d_u pose_
Definition: PoseGraph.h:53
int source_node_id_
Source PoseGraphNode id.
Definition: PoseGraph.h:90
~PoseGraphNode()
Definition: PoseGraph.cpp:36
int target_node_id_
Target PoseGraphNode id.
Definition: PoseGraph.h:92
std::vector< PoseGraphNode > nodes_
List of PoseGraphNode.
Definition: PoseGraph.h:126
Data structure defining the pose graph.
Definition: PoseGraph.h:114
bool uncertain_
Whether the edge is uncertain.
Definition: PoseGraph.h:101
Definition: Open3DViewer.h:29
Node of PoseGraph.
Definition: PoseGraph.h:41
PoseGraphEdge(int source_node_id=-1, int target_node_id=-1, const Eigen::Matrix4d &transformation=Eigen::Matrix4d::Identity(), const Eigen::Matrix6d &information=Eigen::Matrix6d::Identity(), bool uncertain=false, double confidence=1.0)
Parameterized Constructor.
Definition: PoseGraph.h:69
Eigen::Matrix< double, 6, 6, Eigen::DontAlign > Matrix6d_u
Definition: Eigen.h:42
bool ConvertFromJsonValue(const Json::Value &value) override
Definition: PoseGraph.cpp:51
Eigen::Matrix< double, 4, 4, Eigen::DontAlign > Matrix4d_u
Definition: Eigen.h:43
Eigen::Matrix4d_u transformation_
Transformation matrix.
Definition: PoseGraph.h:94
Definition: IJsonConvertible.h:42
Eigen::Matrix< double, 6, 6 > Matrix6d
Extending Eigen namespace by adding frequently used matrix type.
Definition: Eigen.h:37