aron_conversions.cpp
Go to the documentation of this file.
1
#include "
aron_conversions.h
"
2
3
#include <
armarx/navigation/conversions/eigen.h
>
4
#include <armarx/navigation/human/aron/Human.aron.generated.h>
5
#include <
armarx/navigation/human/types.h
>
6
7
#include <range/v3/range/conversion.hpp>
8
#include <range/v3/view/transform.hpp>
9
10
namespace
armarx::navigation::human
11
{
12
void
13
toAron
(arondto::Human& dto,
const
Human
& bo)
14
{
15
dto.pose =
conv::to3D
(bo.
pose
).matrix();
16
dto.linearVelocity =
conv::to3D
(bo.
linearVelocity
);
17
dto.detectionTime = bo.
detectionTime
;
18
}
19
20
void
21
fromAron
(
const
arondto::Human& dto,
Human
& bo)
22
{
23
bo.
pose
=
conv::to2D
(
core::Pose
(dto.pose));
24
bo.
linearVelocity
=
conv::to2D
(dto.linearVelocity);
25
bo.
detectionTime
= dto.detectionTime;
26
}
27
28
void
29
toAron
(arondto::HumanGroup& dto,
const
HumanGroup
& bo)
30
{
31
dto.shape = bo.
shape
.
vertices
|
32
ranges::views::transform([](
const
Eigen::Vector2f& boVer) -> Eigen::Vector3f
33
{
return
conv::to3D
(boVer); }) |
34
ranges::to_vector;
35
36
dto.humans = bo.
humans
|
37
ranges::views::transform(
38
[](
const
Human
& boHuman) -> arondto::Human
39
{
40
arondto::Human dtoHuman;
41
toAron
(dtoHuman, boHuman);
42
return
dtoHuman;
43
}) |
44
ranges::to_vector;
45
dto.detectionTime = bo.
detectionTime
;
46
}
47
48
void
49
fromAron
(
const
arondto::HumanGroup& dto,
HumanGroup
& bo)
50
{
51
bo.
shape
.
vertices
=
52
dto.shape |
53
ranges::views::transform([](
const
Eigen::Vector3f& dtoVer) -> Eigen::Vector2f
54
{
return
conv::to2D
(dtoVer); }) |
55
ranges::to_vector;
56
57
bo.
humans
= dto.humans |
58
ranges::views::transform(
59
[](
const
arondto::Human& dtoHuman) ->
Human
60
{
61
Human
boHuman;
62
fromAron
(dtoHuman, boHuman);
63
return
boHuman;
64
}) |
65
ranges::to_vector;
66
bo.
detectionTime
= dto.detectionTime;
67
}
68
69
}
// namespace armarx::navigation::human
armarx::navigation::conv::to2D
std::vector< Eigen::Vector2f > to2D(const std::vector< Eigen::Vector3f > &v)
Definition
eigen.cpp:29
armarx::navigation::conv::to3D
std::vector< Eigen::Vector3f > to3D(const std::vector< Eigen::Vector2f > &v)
Definition
eigen.cpp:14
armarx::navigation::core::Pose
Eigen::Isometry3f Pose
Definition
basic_types.h:31
armarx::navigation::human
This file is part of ArmarX.
Definition
aron_conversions.cpp:11
armarx::navigation::human::toAron
void toAron(arondto::Human &dto, const Human &bo)
Definition
aron_conversions.cpp:13
armarx::navigation::human::fromAron
void fromAron(const arondto::Human &dto, Human &bo)
Definition
aron_conversions.cpp:21
eigen.h
aron_conversions.h
types.h
armarx::navigation::human::HumanGroup
Definition
types.h:51
armarx::navigation::human::HumanGroup::detectionTime
DateTime detectionTime
Definition
types.h:54
armarx::navigation::human::HumanGroup::humans
Humans humans
Definition
types.h:53
armarx::navigation::human::HumanGroup::shape
shapes::Polygon shape
Definition
types.h:52
armarx::navigation::human::Human
Definition
types.h:37
armarx::navigation::human::Human::detectionTime
DateTime detectionTime
Definition
types.h:40
armarx::navigation::human::Human::linearVelocity
Eigen::Vector2f linearVelocity
Definition
types.h:39
armarx::navigation::human::Human::pose
core::Pose2D pose
Definition
types.h:38
armarx::navigation::human::shapes::Polygon::vertices
std::vector< Eigen::Vector2f > vertices
Definition
shapes.h:45
armarx
navigation
human
aron_conversions.cpp
Generated by
1.13.2