converter.hpp
Go to the documentation of this file.
1 
14 /*****************************************************************************
15 ** Ifdefs
16 *****************************************************************************/
17 
18 #ifndef cost_map_ros_CONVERTER_HPP_
19 #define cost_map_ros_CONVERTER_HPP_
20 
21 /*****************************************************************************
22 ** Includes
23 *****************************************************************************/
24 
25 // grid maps
30 #include <cost_map_msgs/CostMap.h>
31 #include <cost_map_msgs/GetCostMap.h>
32 
33 // ros
35 #include <nav_msgs/OccupancyGrid.h>
36 
37 // general
38 #include <string>
39 
40 /*****************************************************************************
41 ** Namespaces
42 *****************************************************************************/
43 
44 namespace cost_map {
45 
46 /*****************************************************************************
47 ** CostMap and GridMap
48 *****************************************************************************/
49 
57 
58 /*****************************************************************************
59 ** ROS Messages
60 *****************************************************************************/
61 
67 void toMessage(const cost_map::CostMap& cost_map, cost_map_msgs::CostMap& message);
68 
75 bool fromMessage(const cost_map_msgs::CostMap& message, cost_map::CostMap& cost_map);
76 
77 /*****************************************************************************
78 ** ROS Images
79 *****************************************************************************/
80 
81 bool addLayerFromROSImage(const sensor_msgs::Image& image,
82  const std::string& layer_name,
84  );
85 
86 /*****************************************************************************
87 ** Ros CostMap2D & Occupancy Grids
88 *****************************************************************************/
89 /*
90  * There are various ways we can pull from ros costmaps. Build up a suite
91  * of functions as we need to.
92  */
93 
109  const std::string& layer_name,
111 
129  const cost_map::Length& geometry,
130  const std::string& layer_name,
132 
133 void toOccupancyGrid(const cost_map::CostMap& cost_map, const std::string& layer, nav_msgs::OccupancyGrid& msg);
134 
139 public:
141  const std::string& service_name="get_cost_map");
143  const std::string& service_name="get_cost_map");
144 
145  bool callback(cost_map_msgs::GetCostMap::Request &req,
146  cost_map_msgs::GetCostMap::Response &res);
147 private:
150 };
151 
152 /*****************************************************************************
153 ** Trailers
154 *****************************************************************************/
155 
156 } // namespace cost_map
157 
158 #endif /* cost_map_ros_CONVERTER_HPP_ */
Costmap2DROSServiceProvider(costmap_2d::Costmap2DROS *ros_costmap, const std::string &service_name="get_cost_map")
Definition: converter.cpp:298
void toMessage(const cost_map::CostMap &cost_map, cost_map_msgs::CostMap &message)
Definition: converter.cpp:154
bool callback(cost_map_msgs::GetCostMap::Request &req, cost_map_msgs::GetCostMap::Response &res)
Definition: converter.cpp:314
Provide cost_map::fromROSCostMap2D() as a ros service.
Definition: converter.hpp:138
costmap_2d::Costmap2DROS * ros_costmap
Definition: converter.hpp:148
bool addLayerFromROSImage(const sensor_msgs::Image &image, const std::string &layer_name, cost_map::CostMap &cost_map)
Definition: converter.cpp:37
void toOccupancyGrid(const cost_map::CostMap &cost_map, const std::string &layer, nav_msgs::OccupancyGrid &msg)
Definition: converter.cpp:245
bool fromCostmap2DROS(costmap_2d::Costmap2DROS &ros_costmap, const std::string &layer_name, cost_map::CostMap &cost_map)
Converts a ROS costmap to a costmap object.
Definition: converter.cpp:216
grid_map::Length Length
bool fromCostmap2DROSAtRobotPose(costmap_2d::Costmap2DROS &ros_costmap, const cost_map::Length &geometry, const std::string &layer_name, cost_map::CostMap &cost_map)
Converts a ROS costmap around the robot to a costmap object.
Definition: converter.cpp:229
void toGridMap(const cost_map::CostMap cost_map, grid_map::GridMap &grid_map)
Convert a cost map object into a grid map object.
Definition: converter.cpp:130
bool fromMessage(const cost_map_msgs::CostMap &message, cost_map::CostMap &cost_map)
Definition: converter.cpp:186


cost_map_ros
Author(s): Daniel Stonier
autogenerated on Mon Jun 10 2019 13:03:48