framed.cpp
Go to the documentation of this file.
1 #include "framed.h"
2 
3 #include <RobotAPI/libraries/aron/common/aron/framed.aron.generated.h>
4 
6 {
7  void
9  {
10  bo.frame = dto.header.frame;
11  bo.agent = dto.header.agent;
12  bo.x = dto.position.x();
13  bo.y = dto.position.y();
14  bo.z = dto.position.z();
15  }
16 
17  void
19  {
20  dto.header.frame = bo.frame;
21  dto.header.agent = bo.agent;
22  dto.position.x() = bo.x;
23  dto.position.y() = bo.y;
24  dto.position.z() = bo.z;
25  }
26 
27  void
29  {
30  bo.frame = dto.header.frame;
31  bo.agent = dto.header.agent;
32  bo.x = dto.direction.x();
33  bo.y = dto.direction.y();
34  bo.z = dto.direction.z();
35  }
36 
37  void
39  {
40  dto.header.frame = bo.frame;
41  dto.header.agent = bo.agent;
42  dto.direction.x() = bo.x;
43  dto.direction.y() = bo.y;
44  dto.direction.z() = bo.z;
45  }
46 
47  void
49  {
50  bo.frame = dto.header.frame;
51  bo.agent = dto.header.agent;
52  bo.qw = dto.orientation.w();
53  bo.qx = dto.orientation.x();
54  bo.qy = dto.orientation.y();
55  bo.qz = dto.orientation.z();
56  }
57 
58  void
60  {
61  dto.header.frame = bo.frame;
62  dto.header.agent = bo.agent;
63  dto.orientation.w() = bo.qw;
64  dto.orientation.x() = bo.qx;
65  dto.orientation.y() = bo.qy;
66  dto.orientation.z() = bo.qz;
67  }
68 
69  void
71  {
72  bo.frame = dto.header.frame;
73  bo.agent = dto.header.agent;
74  auto vec = Eigen::Vector3f(dto.pose.block<3, 1>(0, 3));
75  bo.position->x = vec.x();
76  bo.position->y = vec.y();
77  bo.position->z = vec.z();
78  auto quat = Eigen::Quaternionf(dto.pose.block<3, 3>(0, 0));
79  bo.orientation->qw = quat.w();
80  bo.orientation->qx = quat.x();
81  bo.orientation->qy = quat.y();
82  bo.orientation->qz = quat.z();
83  }
84 
85  void
87  {
88  dto.header.frame = bo.frame;
89  dto.header.agent = bo.agent;
90  dto.pose = Eigen::Matrix4f::Identity();
91  Eigen::Vector3f vec;
92  vec.x() = bo.position->x;
93  vec.y() = bo.position->y;
94  vec.z() = bo.position->z;
95  Eigen::Quaternionf quat;
96  quat.w() = bo.orientation->qw;
97  quat.x() = bo.orientation->qx;
98  quat.y() = bo.orientation->qy;
99  quat.z() = bo.orientation->qz;
100  dto.pose.block<3, 1>(0, 3) = vec;
101  dto.pose.block<3, 3>(0, 0) = quat.toRotationMatrix();
102  }
103 } // namespace armarx::aron::framed
framed.h
armarx::FramedPose
The FramedPose class.
Definition: FramedPose.h:258
armarx::VariantType::FramedPose
const VariantTypeId FramedPose
Definition: FramedPose.h:37
armarx::aron::framed::toAron
void toAron(arondto::FramedPosition &dto, const armarx::FramedPosition &bo)
Definition: framed.cpp:18
armarx::aron::framed::fromAron
void fromAron(const arondto::FramedPosition &dto, armarx::FramedPosition &bo)
Definition: framed.cpp:8
armarx::aron::framed
Definition: framed.cpp:5
GfxTL::Identity
void Identity(MatrixXX< N, N, T > *a)
Definition: MatrixXX.h:523
armarx::FramedPosition
The FramedPosition class.
Definition: FramedPose.h:142
Eigen::Quaternionf
Quaternion< float, 0 > Quaternionf
Definition: EigenForwardDeclarations.h:61
armarx::FramedOrientation
The FramedOrientation class.
Definition: FramedPose.h:199
armarx::VariantType::FramedOrientation
const VariantTypeId FramedOrientation
Definition: FramedPose.h:40
armarx::FramedDirection
FramedDirection is a 3 dimensional direction vector with a reference frame. The reference frame can b...
Definition: FramedPose.h:83
armarx::VariantType::FramedDirection
const VariantTypeId FramedDirection
Definition: FramedPose.h:38
armarx::Quaternion< float, 0 >
armarx::VariantType::FramedPosition
const VariantTypeId FramedPosition
Definition: FramedPose.h:39
armarx::aron::bo
const std::optional< BoT > & bo
Definition: aron_conversions.h:168