tf2  master
tf2 maintains the relationship between coordinate frames in a tree structure buffered in time, and lets the user transform points, vectors, etc between any two coordinate frames at any desired point in time.
utils.h
Go to the documentation of this file.
1 // Copyright 2014 Open Source Robotics Foundation, Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef TF2__UTILS_H_
16 #define TF2__UTILS_H_
17 
20 #include <tf2/impl/utils.h>
21 #include <tf2/visibility_control.h>
22 
23 namespace tf2
24 {
32 template<class A>
33 void getEulerYPR(const A & a, double & yaw, double & pitch, double & roll)
34 {
36  impl::getEulerYPR(q, yaw, pitch, roll);
37 }
38 
46 template<class A>
47 double getYaw(const A & a)
48 {
50  return impl::getYaw(q);
51 }
52 
56 template<class A>
58 {
60  t.setIdentity();
61  A a;
62  convert(t, a);
63  return a;
64 }
65 } // namespace tf2
66 #endif // TF2__UTILS_H_
tf2::convert
void convert(const A &a, B &b)
Function that converts any type to any type (messages or not). Matching toMsg and from Msg conversion...
Definition: convert.h:148
tf2::getYaw
double getYaw(const A &a)
Definition: utils.h:47
tf2::getTransformIdentity
A getTransformIdentity()
Definition: utils.h:57
Transform.h
tf2::impl::toQuaternion
tf2::Quaternion toQuaternion(const tf2::Quaternion &q)
Definition: utils.h:32
tf2::Transform
The Transform class supports rigid transforms with only translation and rotation and no scaling/shear...
Definition: Transform.h:33
Quaternion.h
tf2::getEulerYPR
void getEulerYPR(const A &a, double &yaw, double &pitch, double &roll)
Definition: utils.h:33
visibility_control.h
tf2::impl::getEulerYPR
void getEulerYPR(const tf2::Quaternion &q, double &yaw, double &pitch, double &roll)
Definition: utils.h:95
tf2::impl::getYaw
double getYaw(const tf2::Quaternion &q)
Definition: utils.h:133
utils.h
tf2
Definition: buffer_core.h:53
tf2::Quaternion
The Quaternion implements quaternion to perform linear algebra rotations in combination with Matrix3x...
Definition: Quaternion.h:29
tf2::Transform::setIdentity
void setIdentity()
Set this transformation to the identity.
Definition: Transform.h:177