geometry.hpp
Go to the documentation of this file.
1 
4 /*****************************************************************************
5 ** Ifdefs
6 *****************************************************************************/
7 
8 #ifndef sophus_ros_conversions_GEOMETRY_HPP_
9 #define sophus_ros_conversions_GEOMETRY_HPP_
10 
11 /*****************************************************************************
12 ** Includes
13 *****************************************************************************/
14 
15 #include <geometry_msgs/Pose.h>
16 #include <geometry_msgs/Transform.h>
17 #include <geometry_msgs/Vector3.h>
18 #include <sophus/se3.hpp>
19 #include <tf/transform_listener.h>
20 /*****************************************************************************
21 ** Namespaces
22 *****************************************************************************/
23 
24 namespace sophus_ros_conversions {
25 
26 /*****************************************************************************
27 ** Interfaces
28 *****************************************************************************/
29 
36 void poseMsgToSophus(const geometry_msgs::Pose &p, Sophus::SE3f &s);
37 
43 geometry_msgs::Pose sophusToPoseMsg(const Sophus::SE3f& s);
44 
50 void vector3MsgToSophus(const geometry_msgs::Vector3 &v, Sophus::SE3f::Point &translation);
51 
57 void transformMsgToSophus(const geometry_msgs::Transform &transform, Sophus::SE3f &se3);
58 
59 
65 template<typename T>
66 void stampedTransformToSophus( const tf::StampedTransform & transform, Sophus::SE3Group<T> & se3 )
67 {
68  Eigen::Quaternion<T> q;
69  Eigen::Matrix<T,3,1> t;
70 
71  q.x() = transform.getRotation().getX();
72  q.y() = transform.getRotation().getY();
73  q.z() = transform.getRotation().getZ();
74  q.w() = transform.getRotation().getW();
75  t.x() = transform.getOrigin().getX();
76  t.y() = transform.getOrigin().getY();
77  t.z() = transform.getOrigin().getZ();
78  se3 = Sophus::SE3Group<T>(q,t);
79 }
80 
87 Sophus::SE3f transformMsgToSophus(const geometry_msgs::Transform &transform);
88 
94 geometry_msgs::Transform sophusToTransformMsg(const Sophus::SE3f& se3);
95 
96 
97 /*****************************************************************************
98 ** Trailers
99 *****************************************************************************/
100 
101 } // namespace sophus_ros_conversions
102 
103 #endif /* sophus_ros_conversions_GEOMETRY_HPP_ */
geometry_msgs::Transform sophusToTransformMsg(const Sophus::SE3f &se3)
Definition: geometry.cpp:63
TFSIMD_FORCE_INLINE const tfScalar & getY() const
TFSIMD_FORCE_INLINE const tfScalar & getW() const
TFSIMD_FORCE_INLINE const tfScalar & getZ() const
void transformMsgToSophus(const geometry_msgs::Transform &transform, Sophus::SE3f &se3)
Definition: geometry.cpp:47
geometry_msgs::Pose sophusToPoseMsg(const Sophus::SE3f &s)
Definition: geometry.cpp:31
void stampedTransformToSophus(const tf::StampedTransform &transform, Sophus::SE3Group< T > &se3)
Definition: geometry.hpp:66
TFSIMD_FORCE_INLINE Vector3 & getOrigin()
Quaternion getRotation() const
void poseMsgToSophus(const geometry_msgs::Pose &p, Sophus::SE3f &s)
Definition: geometry.cpp:22
TFSIMD_FORCE_INLINE const tfScalar & getX() const
void vector3MsgToSophus(const geometry_msgs::Vector3 &v, Sophus::SE3f::Point &translation)
Definition: geometry.cpp:41


sophus_ros_conversions
Author(s): Daniel Stonier
autogenerated on Mon Jun 10 2019 15:07:04