/home/runner/work/beluga/beluga/beluga_ros/include/beluga_ros/tf2_eigen.hpp Source File

/home/runner/work/beluga/beluga/beluga_ros/include/beluga_ros/tf2_eigen.hpp Source File#

Beluga ROS: /home/runner/work/beluga/beluga/beluga_ros/include/beluga_ros/tf2_eigen.hpp Source File
Beluga ROS
tf2_eigen.hpp
Go to the documentation of this file.
1 // Copyright 2024 Ekumen, 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 BELUGA_ROS_TF2_EIGEN_HPP
16 #define BELUGA_ROS_TF2_EIGEN_HPP
17 
18 #include <tf2_eigen/tf2_eigen.hpp>
19 #include <tf2_geometry_msgs/tf2_geometry_msgs.hpp>
20 
21 #include <geometry_msgs/msg/point.hpp>
22 
23 #include <Eigen/Core>
24 
31 namespace tf2 {
32 
34 
38 template <class Scalar>
39 inline geometry_msgs::msg::Point toMsg(const Eigen::Matrix<Scalar, 2, 1>& in) {
40  geometry_msgs::msg::Point out;
41  out.x = static_cast<double>(in.x());
42  out.y = static_cast<double>(in.y());
43  return out;
44 }
45 
46 } // namespace tf2
47 
48 #endif // BELUGA_ROS_TF2_EIGEN_HPP
tf2 namespace extension for message conversion overload resolution.
Definition: tf2_eigen.hpp:31
geometry_msgs::msg::Point toMsg(const Eigen::Matrix< Scalar, 2, 1 > &in)
Converts an Eigen Vector2 type to a Point message.
Definition: tf2_eigen.hpp:39