IceConversions.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <RobotAPI/interface/ArViz/Elements.h>
4 
5 #include <Eigen/Core>
6 #include <Eigen/Geometry>
7 
8 namespace armarx::viz
9 {
10 
11  inline Eigen::Matrix4f toEigen(data::GlobalPose const& pose)
12  {
13  Eigen::Matrix4f result;
14  result.block<3, 3>(0, 0) = Eigen::Quaternionf(pose.qw, pose.qx, pose.qy, pose.qz).toRotationMatrix();
15  result.block<3, 1>(0, 3) = Eigen::Vector3f(pose.x, pose.y, pose.z);
16  result.block<1, 4>(3, 0) = Eigen::Vector4f(0.0f, 0.0f, 0.0f, 1.0f);
17  return result;
18  }
19 
20  inline data::GlobalPose poseToIce(Eigen::Vector3f const& pos, Eigen::Quaternionf const& ori)
21  {
22  data::GlobalPose result;
23  result.x = pos.x();
24  result.y = pos.y();
25  result.z = pos.z();
26  result.qw = ori.w();
27  result.qx = ori.x();
28  result.qy = ori.y();
29  result.qz = ori.z();
30  return result;
31  }
32 
33 }
armarx::viz::toEigen
Eigen::Matrix4f toEigen(data::GlobalPose const &pose)
Definition: Interaction.h:46
GfxTL::Matrix4f
MatrixXX< 4, 4, float > Matrix4f
Definition: MatrixXX.h:601
armarx::Quaternion< float, 0 >
armarx::viz::poseToIce
data::GlobalPose poseToIce(Eigen::Vector3f const &pos, Eigen::Quaternionf const &ori)
Definition: IceConversions.h:20
armarx::viz
This file is part of ArmarX.
Definition: ArVizStorage.cpp:416