Open3D (C++ API)  0.12.0
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 pipelines {
37 namespace registration {
38 
43 public:
45  PoseGraphNode(const Eigen::Matrix4d &pose = Eigen::Matrix4d::Identity())
46  : pose_(pose) {}
48 
49 public:
50  bool ConvertToJsonValue(Json::Value &value) const override;
51  bool ConvertFromJsonValue(const Json::Value &value) override;
52 
53 public:
54  Eigen::Matrix4d_u pose_;
55 };
56 
61 public:
71  int source_node_id = -1,
72  int target_node_id = -1,
73  const Eigen::Matrix4d &transformation = Eigen::Matrix4d::Identity(),
74  const Eigen::Matrix6d &information = Eigen::Matrix6d::Identity(),
75  bool uncertain = false,
76  double confidence = 1.0)
77  : source_node_id_(source_node_id),
78  target_node_id_(target_node_id),
79  transformation_(transformation),
80  information_(information),
81  uncertain_(uncertain),
82  confidence_(confidence) {}
83  ~PoseGraphEdge();
84 
85 public:
86  bool ConvertToJsonValue(Json::Value &value) const override;
87  bool ConvertFromJsonValue(const Json::Value &value) override;
88 
89 public:
95  Eigen::Matrix4d_u transformation_;
97  Eigen::Matrix6d_u information_;
109  double confidence_;
110 };
111 
116 public:
118  PoseGraph();
119  ~PoseGraph() override;
120 
121 public:
122  bool ConvertToJsonValue(Json::Value &value) const override;
123  bool ConvertFromJsonValue(const Json::Value &value) override;
124 
125 public:
127  std::vector<PoseGraphNode> nodes_;
129  std::vector<PoseGraphEdge> edges_;
130 };
131 
132 } // namespace registration
133 } // namespace pipelines
134 } // namespace open3d
int source_node_id_
Source PoseGraphNode id.
Definition: PoseGraph.h:91
bool ConvertToJsonValue(Json::Value &value) const override
Definition: PoseGraph.cpp:39
double confidence_
Confidence value of the edge.
Definition: PoseGraph.h:109
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:70
bool uncertain_
Whether the edge is uncertain.
Definition: PoseGraph.h:102
bool ConvertFromJsonValue(const Json::Value &value) override
Definition: PoseGraph.cpp:52
Eigen::Matrix4d_u pose_
Definition: PoseGraph.h:54
Data structure defining the pose graph.
Definition: PoseGraph.h:115
~PoseGraphNode()
Definition: PoseGraph.cpp:37
std::vector< PoseGraphNode > nodes_
List of PoseGraphNode.
Definition: PoseGraph.h:127
PoseGraphNode(const Eigen::Matrix4d &pose=Eigen::Matrix4d::Identity())
Default Constructor.
Definition: PoseGraph.h:45
Node of PoseGraph.
Definition: PoseGraph.h:42
int target_node_id_
Target PoseGraphNode id.
Definition: PoseGraph.h:93
Edge of PoseGraph.
Definition: PoseGraph.h:60
Definition: PinholeCameraIntrinsic.cpp:35
Eigen::Matrix4d_u transformation_
Transformation matrix.
Definition: PoseGraph.h:95
Eigen::Matrix6d_u information_
Information matrix.
Definition: PoseGraph.h:97
std::vector< PoseGraphEdge > edges_
List of PoseGraphEdge.
Definition: PoseGraph.h:129
Definition: IJsonConvertible.h:44