TransformHelper.h
Go to the documentation of this file.
1
/*
2
* This file is part of ArmarX.
3
*
4
* ArmarX is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation.
7
*
8
* ArmarX is distributed in the hope that it will be useful, but
9
* WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
15
*
16
* @author Fabian Reister ( fabian dot reister at kit dot edu )
17
* @date 2021
18
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
19
* GNU General Public License
20
*/
21
22
#pragma once
23
24
#include <optional>
25
#include <vector>
26
27
#include <Eigen/Core>
28
#include <Eigen/Geometry>
29
30
#include <
RobotAPI/libraries/armem/core/forward_declarations.h
>
31
#include <
RobotAPI/libraries/armem_robot_state/common/localization/types.h
>
32
33
namespace
armarx::armem::robot_state::localization
34
{
35
using
armarx::armem::robot_state::localization::TransformQuery
;
36
using
armarx::armem::robot_state::localization::TransformResult
;
37
38
class
TransformHelper
39
{
40
public
:
41
static
TransformResult
42
lookupTransform
(
const
armem::wm::CoreSegment
&
localizationCoreSegment
,
43
const
TransformQuery
& query);
44
45
static
TransformResult
46
lookupTransform
(
const
armem::server::wm::CoreSegment
&
localizationCoreSegment
,
47
const
TransformQuery
& query);
48
49
50
static
TransformChainResult
51
lookupTransformChain
(
const
armem::wm::CoreSegment
&
localizationCoreSegment
,
52
const
TransformQuery
& query);
53
54
static
TransformChainResult
55
lookupTransformChain
(
const
armem::server::wm::CoreSegment
&
localizationCoreSegment
,
56
const
TransformQuery
& query);
57
58
59
private
:
60
template
<
class
... Args>
61
static
TransformResult
62
_lookupTransform(
const
armem::base::CoreSegmentBase<Args...>
&
localizationCoreSegment
,
63
const
TransformQuery
& query);
64
65
66
template
<
class
... Args>
67
static
TransformChainResult
68
_lookupTransformChain(
const
armem::base::CoreSegmentBase<Args...>
&
localizationCoreSegment
,
69
const
TransformQuery
& query);
70
71
72
template
<
class
... Args>
73
static
std::vector<std::string>
74
_buildTransformChain(
const
armem::base::CoreSegmentBase<Args...>
&
localizationCoreSegment
,
75
const
TransformQuery
& query);
76
77
78
template
<
class
... Args>
79
static
std::vector<Eigen::Isometry3f>
80
_obtainTransforms(
const
armem::base::CoreSegmentBase<Args...>
&
localizationCoreSegment
,
81
const
std::vector<std::string>& tfChain,
82
const
std::string& agent,
83
const
armem::Time
& timestamp);
84
85
86
template
<
class
... Args>
87
static
Eigen::Isometry3f
88
_obtainTransform(
const
std::string& entityName,
89
const
armem::base::ProviderSegmentBase<Args...>
& agentProviderSegment,
90
const
armem::Time
& timestamp);
91
92
template
<
class
... Args>
93
static
std::optional<armarx::core::time::DateTime>
94
_obtainTimestamp(
const
armem::base::CoreSegmentBase<Args...>
&
localizationCoreSegment
,
95
const
armem::Time
& timestamp);
96
97
static
Eigen::Isometry3f _interpolateTransform(
98
const
std::vector<::armarx::armem::robot_state::localization::Transform>& queue,
99
armem::Time
timestamp);
100
101
static ::armarx::armem::robot_state::localization::Transform
102
_convertEntityToTransform(
const
armem::wm::EntityInstance
& item);
103
};
104
}
// namespace armarx::armem::robot_state::localization
armarx::armem::base::ProviderSegmentBase
Data of a provider segment containing multiple entities.
Definition:
ProviderSegmentBase.h:22
armarx::armem::robot_state::localization
Definition:
aron_conversions.cpp:11
armarx::armem::wm::EntityInstance
Client-side working entity instance.
Definition:
memory_definitions.h:32
forward_declarations.h
types.h
armarx::armem::robot_state::localization::TransformHelper::lookupTransformChain
static TransformChainResult lookupTransformChain(const armem::wm::CoreSegment &localizationCoreSegment, const TransformQuery &query)
Definition:
TransformHelper.cpp:418
armarx::armem::robot_state::localization::TransformQuery
Definition:
types.h:74
armarx::armem::base::CoreSegmentBase
Data of a core segment containing multiple provider segments.
Definition:
CoreSegmentBase.h:22
armarx::armem::wm::CoreSegment
Client-side working memory core segment.
Definition:
memory_definitions.h:119
armarx::armem::robot_state::localization::TransformChainResult
Definition:
types.h:53
armarx::armem::robot_state::localization::TransformHelper::lookupTransform
static TransformResult lookupTransform(const armem::wm::CoreSegment &localizationCoreSegment, const TransformQuery &query)
Definition:
TransformHelper.cpp:404
armarx::armem::robot_state::localization::TransformHelper
Definition:
TransformHelper.h:38
armarx::armem::server::wm::CoreSegment
base::CoreSegmentBase
Definition:
memory_definitions.h:86
armarx::core::time::DateTime
Represents a point in time.
Definition:
DateTime.h:24
armarx::armem::robot_state::localization::TransformResult
Definition:
types.h:33
armarx::armem::robot_state::constants::localizationCoreSegment
const std::string localizationCoreSegment
Definition:
constants.h:29
RobotAPI
libraries
armem_robot_state
common
localization
TransformHelper.h
Generated on Sat Oct 12 2024 09:14:09 for armarx_documentation by
1.8.17