conversions.h
Go to the documentation of this file.
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2017, Locus Robotics
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  * * Neither the name of the copyright holder nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  */
34 
35 #ifndef NAV_2D_UTILS_CONVERSIONS_H
36 #define NAV_2D_UTILS_CONVERSIONS_H
37 
38 #include <ros/ros.h>
39 #include <geometry_msgs/Pose.h>
40 #include <geometry_msgs/Twist.h>
41 #include <nav_2d_msgs/Twist2D.h>
42 #include <nav_2d_msgs/Path2D.h>
43 #include <nav_2d_msgs/Pose2DStamped.h>
44 #include <nav_2d_msgs/NavGridInfo.h>
45 #include <nav_2d_msgs/UIntBounds.h>
46 #include <nav_msgs/MapMetaData.h>
47 #include <nav_msgs/Path.h>
48 #include <nav_grid/nav_grid.h>
49 #include <nav_core2/bounds.h>
50 #include <tf/tf.h>
51 #include <vector>
52 #include <string>
53 
54 namespace nav_2d_utils
55 {
56 // Twist Transformations
57 geometry_msgs::Twist twist2Dto3D(const nav_2d_msgs::Twist2D& cmd_vel_2d);
58 nav_2d_msgs::Twist2D twist3Dto2D(const geometry_msgs::Twist& cmd_vel);
59 
60 // Pose Transformations
61 nav_2d_msgs::Pose2DStamped stampedPoseToPose2D(const tf::Stamped<tf::Pose>& pose);
62 nav_2d_msgs::Pose2DStamped poseStampedToPose2D(const geometry_msgs::PoseStamped& pose);
63 geometry_msgs::Pose pose2DToPose(const geometry_msgs::Pose2D& pose2d);
64 geometry_msgs::PoseStamped pose2DToPoseStamped(const nav_2d_msgs::Pose2DStamped& pose2d);
65 geometry_msgs::PoseStamped pose2DToPoseStamped(const geometry_msgs::Pose2D& pose2d,
66  const std::string& frame, const ros::Time& stamp);
67 
68 // Path Transformations
69 nav_2d_msgs::Path2D pathToPath(const nav_msgs::Path& path);
70 nav_msgs::Path posesToPath(const std::vector<geometry_msgs::PoseStamped>& poses);
71 nav_2d_msgs::Path2D posesToPath2D(const std::vector<geometry_msgs::PoseStamped>& poses);
72 nav_msgs::Path poses2DToPath(const std::vector<geometry_msgs::Pose2D>& poses,
73  const std::string& frame, const ros::Time& stamp);
74 nav_msgs::Path pathToPath(const nav_2d_msgs::Path2D& path2d);
75 
76 // Info Transformations
77 nav_2d_msgs::NavGridInfo toMsg(const nav_grid::NavGridInfo& info);
78 nav_grid::NavGridInfo fromMsg(const nav_2d_msgs::NavGridInfo& msg);
79 nav_grid::NavGridInfo infoToInfo(const nav_msgs::MapMetaData& metadata);
80 nav_msgs::MapMetaData infoToInfo(const nav_grid::NavGridInfo & info);
81 
82 // Bounds Transformations
83 nav_2d_msgs::UIntBounds toMsg(const nav_core2::UIntBounds& bounds);
84 nav_core2::UIntBounds fromMsg(const nav_2d_msgs::UIntBounds& msg);
85 
86 } // namespace nav_2d_utils
87 
88 #endif // NAV_2D_UTILS_CONVERSIONS_H
geometry_msgs::Pose pose2DToPose(const geometry_msgs::Pose2D &pose2d)
Definition: conversions.cpp:81
nav_2d_msgs::NavGridInfo toMsg(const nav_grid::NavGridInfo &info)
nav_2d_msgs::Path2D pathToPath(const nav_msgs::Path &path)
nav_grid::NavGridInfo fromMsg(const nav_2d_msgs::NavGridInfo &msg)
geometry_msgs::Twist twist2Dto3D(const nav_2d_msgs::Twist2D &cmd_vel_2d)
Definition: conversions.cpp:41
nav_msgs::Path posesToPath(const std::vector< geometry_msgs::PoseStamped > &poses)
nav_2d_msgs::Path2D posesToPath2D(const std::vector< geometry_msgs::PoseStamped > &poses)
nav_2d_msgs::Pose2DStamped poseStampedToPose2D(const geometry_msgs::PoseStamped &pose)
Definition: conversions.cpp:71
nav_msgs::Path poses2DToPath(const std::vector< geometry_msgs::Pose2D > &poses, const std::string &frame, const ros::Time &stamp)
geometry_msgs::PoseStamped pose2DToPoseStamped(const nav_2d_msgs::Pose2DStamped &pose2d)
Definition: conversions.cpp:90
nav_2d_msgs::Pose2DStamped stampedPoseToPose2D(const tf::Stamped< tf::Pose > &pose)
Definition: conversions.cpp:60
nav_grid::NavGridInfo infoToInfo(const nav_msgs::MapMetaData &metadata)
nav_2d_msgs::Twist2D twist3Dto2D(const geometry_msgs::Twist &cmd_vel)
Definition: conversions.cpp:51


nav_2d_utils
Author(s):
autogenerated on Wed Jun 26 2019 20:06:11