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