Viam C++ SDK current
Loading...
Searching...
No Matches
pose.hpp
1#pragma once
2
3#include <viam/sdk/common/proto_convert.hpp>
4
5#include <ostream>
6
7namespace viam {
8namespace common {
9namespace v1 {
10
11class Pose;
12class PoseInFrame;
13} // namespace v1
14} // namespace common
15} // namespace viam
16
17namespace viam {
18namespace sdk {
19
21 double x, y, z;
22 friend bool operator==(const coordinates& lhs, const coordinates& rhs);
23};
24
26 double o_x, o_y, o_z;
27 friend bool operator==(const pose_orientation& lhs, const pose_orientation& rhs);
28};
29
30struct pose {
32 pose_orientation orientation;
33 double theta;
34
35 friend bool operator==(const pose& lhs, const pose& rhs);
36 friend std::ostream& operator<<(std::ostream& os, const pose& v);
37};
38
40 pose_in_frame(std::string reference_frame_, struct pose pose_)
41 : reference_frame(std::move(reference_frame_)), pose(std::move(pose_)) {}
42 pose_in_frame() {}
43
44 std::string reference_frame;
45 struct pose pose;
46 friend bool operator==(const pose_in_frame& lhs, const pose_in_frame& rhs);
47 friend std::ostream& operator<<(std::ostream& os, const pose_in_frame& v);
48};
49
50namespace proto_convert_details {
51
52template <>
54 void operator()(const pose&, common::v1::Pose*) const;
55};
56
57template <>
58struct from_proto_impl<common::v1::Pose> {
59 pose operator()(const common::v1::Pose*) const;
60};
61
62template <>
64 void operator()(const pose_in_frame&, common::v1::PoseInFrame*) const;
65};
66
67template <>
68struct from_proto_impl<common::v1::PoseInFrame> {
69 pose_in_frame operator()(const common::v1::PoseInFrame*) const;
70};
71
72} // namespace proto_convert_details
73
74} // namespace sdk
75} // namespace viam
Definition pose.hpp:20
Definition pose.hpp:39
Definition pose.hpp:25
Definition pose.hpp:30