NASA Astrobee Robot Software  0.19.1
Flight software for the Astrobee robots operating inside the International Space Station.
conversion.h
Go to the documentation of this file.
1 /* Copyright (c) 2017, United States Government, as represented by the
2  * Administrator of the National Aeronautics and Space Administration.
3  *
4  * All rights reserved.
5  *
6  * The Astrobee platform is licensed under the Apache License, Version 2.0
7  * (the "License"); you may not use this file except in compliance with the
8  * License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15  * License for the specific language governing permissions and limitations
16  * under the License.
17  */
18 
19 #ifndef FF_UTIL_CONVERSION_H_
20 #define FF_UTIL_CONVERSION_H_
21 
22 #include <tf2_geometry_msgs/tf2_geometry_msgs.h>
23 #include <geometry_msgs/Quaternion.h>
24 #include <geometry_msgs/Vector3.h>
25 #include <geometry_msgs/Point.h>
26 
27 namespace ff_util {
28 
29 class Conversion {
30  public:
31  static void Convert(const geometry_msgs::Point &in, tf2::Vector3 &out) {
32  out = tf2::Vector3(in.x, in.y, in.z);
33  }
34  static void Convert(const geometry_msgs::Vector3 &in, tf2::Vector3 &out) {
35  out = tf2::Vector3(in.x, in.y, in.z);
36  }
37  static void Convert(const geometry_msgs::Quaternion &in, tf2::Quaternion &out) {
38  out = tf2::Quaternion(in.x, in.y, in.z, in.w);
39  }
40  static void Convert(const tf2::Vector3 &in, geometry_msgs::Point &out) {
41  out.x = in.x();
42  out.y = in.y();
43  out.z = in.z();
44  }
45  static void Convert(const tf2::Vector3 &in, geometry_msgs::Vector3 &out) {
46  out.x = in.x();
47  out.y = in.y();
48  out.z = in.z();
49  }
50  static void Convert(const tf2::Quaternion &in, geometry_msgs::Quaternion &out) {
51  out.w = in.w();
52  out.x = in.x();
53  out.y = in.y();
54  out.z = in.z();
55  }
56 };
57 
58 } // namespace ff_util
59 
60 #endif // FF_UTIL_CONVERSION_H_
ff_util::Conversion::Convert
static void Convert(const tf2::Vector3 &in, geometry_msgs::Vector3 &out)
Definition: conversion.h:45
ff_util::Conversion::Convert
static void Convert(const tf2::Quaternion &in, geometry_msgs::Quaternion &out)
Definition: conversion.h:50
ff_util::Conversion::Convert
static void Convert(const geometry_msgs::Vector3 &in, tf2::Vector3 &out)
Definition: conversion.h:34
ff_util::Conversion::Convert
static void Convert(const tf2::Vector3 &in, geometry_msgs::Point &out)
Definition: conversion.h:40
ff_util::Conversion::Convert
static void Convert(const geometry_msgs::Point &in, tf2::Vector3 &out)
Definition: conversion.h:31
ff_util::Conversion
Definition: conversion.h:29
ff_util
Definition: config_client.h:31
ff_util::Conversion::Convert
static void Convert(const geometry_msgs::Quaternion &in, tf2::Quaternion &out)
Definition: conversion.h:37