transform_helpers.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2015 Aldebaran
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 
18 
19 #ifndef TRANSFORM_HELPERS_HPP
20 #define TRANSFORM_HELPERS_HPP
21 
22 #include <geometry_msgs/Transform.h>
23 #include <geometry_msgs/Pose.h>
25 
26 namespace naoqi
27 {
28 namespace helpers
29 {
30 namespace transform
31 {
32 
33 inline double getYaw(const geometry_msgs::Pose& pose)
34 {
35  double yaw, _pitch, _roll;
36  tf2::Matrix3x3(tf2::Quaternion(pose.orientation.x, pose.orientation.y,
37  pose.orientation.z, pose.orientation.w)).getEulerYPR(yaw, _pitch, _roll);
38  return yaw;
39 }
40 
41 inline double getYaw( const geometry_msgs::Transform& pose)
42 {
43  double yaw, _pitch, _roll;
44  tf2::Matrix3x3(tf2::Quaternion(pose.rotation.x, pose.rotation.y, pose.rotation.z, pose.rotation.w)).getEulerYPR(yaw, _pitch, _roll);
45  return yaw;
46 }
47 
48 } //transform
49 } //helpers
50 } // naoqi
51 
52 #endif
double getYaw(const geometry_msgs::Pose &pose)
void getEulerYPR(tf2Scalar &yaw, tf2Scalar &pitch, tf2Scalar &roll, unsigned int solution_number=1) const


naoqi_driver
Author(s): Karsten Knese
autogenerated on Sat Feb 15 2020 03:24:26