Viam C++ SDK
current
Loading...
Searching...
No Matches
src
viam
sdk
spatialmath
orientation_types.hpp
1
#pragma once
2
3
#include <tuple>
4
5
#include <viam/sdk/common/proto_convert.hpp>
6
7
namespace
viam {
8
namespace
app {
9
namespace
v1 {
10
11
class
Translation;
12
}
13
}
// namespace app
14
}
// namespace viam
15
16
namespace
viam {
17
namespace
sdk {
18
19
enum
OrientationType {
20
AxisAngles,
21
OrientationVector,
22
OrientationVectorDegrees,
23
EulerAngles,
24
Quaternion,
25
};
26
27
struct
axis_angles
{
28
double
x = 0.0, y = 0.0, z = 0.0, theta = 0.0;
29
30
friend
bool
operator==(
const
axis_angles
& lhs,
const
axis_angles
& rhs) {
31
return
std::tie(lhs.x, lhs.y, lhs.z, lhs.theta) == std::tie(rhs.x, rhs.y, rhs.z, rhs.theta);
32
}
33
};
34
35
struct
euler_angles
{
36
double
yaw = 0.0, roll = 0.0, pitch = 0.0;
37
38
friend
bool
operator==(
const
euler_angles
& lhs,
const
euler_angles
& rhs) {
39
return
std::tie(lhs.yaw, lhs.roll, lhs.pitch) == std::tie(rhs.yaw, rhs.roll, rhs.pitch);
40
}
41
};
42
43
struct
orientation_vector
{
44
double
x = 0.0, y = 0.0, z = 0.0, theta = 0.0;
45
46
friend
bool
operator==(
const
orientation_vector
& lhs,
const
orientation_vector
& rhs) {
47
return
std::tie(lhs.x, lhs.y, lhs.z, lhs.theta) == std::tie(rhs.x, rhs.y, rhs.z, rhs.theta);
48
}
49
};
50
51
struct
orientation_vector_degrees
{
52
double
x = 0.0, y = 0.0, z = 0.0, theta = 0.0;
53
54
friend
bool
operator==(
const
orientation_vector_degrees
& lhs,
55
const
orientation_vector_degrees
& rhs) {
56
return
std::tie(lhs.x, lhs.y, lhs.z, lhs.theta) == std::tie(rhs.x, rhs.y, rhs.z, rhs.theta);
57
}
58
};
59
60
struct
quaternion
{
61
double
x = 0.0, y = 0.0, z = 0.0, w = 0.0;
62
63
friend
bool
operator==(
const
quaternion
& lhs,
const
quaternion
& rhs) {
64
return
std::tie(lhs.x, lhs.y, lhs.z, lhs.w) == std::tie(rhs.x, rhs.y, rhs.z, rhs.w);
65
}
66
};
67
68
struct
translation
{
69
double
x = 0.0, y = 0.0, z = 0.0;
70
71
friend
bool
operator==(
const
translation
& lhs,
const
translation
& rhs) {
72
return
std::tie(lhs.x, lhs.y, lhs.z) == std::tie(rhs.x, rhs.y, rhs.z);
73
}
74
};
75
76
namespace
proto_convert_details {
77
78
template
<>
79
struct
to_proto_impl
<
translation
> {
80
void
operator()(
const
translation
&, app::v1::Translation*)
const
;
81
};
82
83
template
<>
84
struct
from_proto_impl
<app::v1::Translation> {
85
translation
operator()(
const
app::v1::Translation*)
const
;
86
};
87
88
}
// namespace proto_convert_details
89
}
// namespace sdk
90
}
// namespace viam
viam::sdk::axis_angles
Definition
orientation_types.hpp:27
viam::sdk::euler_angles
Definition
orientation_types.hpp:35
viam::sdk::orientation_vector_degrees
Definition
orientation_types.hpp:51
viam::sdk::orientation_vector
Definition
orientation_types.hpp:43
viam::sdk::proto_convert_details::from_proto_impl
Definition
proto_convert.hpp:24
viam::sdk::proto_convert_details::to_proto_impl
Definition
proto_convert.hpp:18
viam::sdk::quaternion
Definition
orientation_types.hpp:60
viam::sdk::translation
Definition
orientation_types.hpp:68
Generated by
1.10.0