15 #ifndef NAV2_MAP_SERVER__VECTOR_OBJECT_UTILS_HPP_
16 #define NAV2_MAP_SERVER__VECTOR_OBJECT_UTILS_HPP_
18 #include <uuid/uuid.h>
22 #include "nav_msgs/msg/occupancy_grid.hpp"
24 #include "nav2_ros_common/lifecycle_node.hpp"
25 #include "nav2_ros_common/node_utils.hpp"
26 #include "nav2_util/occ_grid_values.hpp"
28 namespace nav2_map_server
38 inline std::string unparseUUID(
const unsigned char * uuid)
41 uuid_unparse(uuid, uuid_str);
42 return std::string(uuid_str);
48 enum class OverlayType : uint8_t
62 inline void processVal(
63 int8_t & map_val,
const int8_t shape_val,
64 const OverlayType overlay_type)
66 switch (overlay_type) {
67 case OverlayType::OVERLAY_SEQ:
70 case OverlayType::OVERLAY_MAX:
71 if (shape_val > map_val) {
75 case OverlayType::OVERLAY_MIN:
76 if ((map_val == nav2_util::OCC_GRID_UNKNOWN || shape_val < map_val) &&
77 shape_val != nav2_util::OCC_GRID_UNKNOWN)
83 throw std::runtime_error{
"Unknown overlay type"};
94 inline void processCell(
95 const nav_msgs::msg::OccupancyGrid::SharedPtr & map,
96 const unsigned int offset,
97 const int8_t shape_val,
98 const OverlayType overlay_type)
100 processVal(map->data[offset], shape_val, overlay_type);
114 nav_msgs::msg::OccupancyGrid::SharedPtr map,
115 int8_t value, OverlayType overlay_type)
130 nav_msgs::msg::OccupancyGrid::SharedPtr
map_;
Functor class used in raytraceLine algorithm.
OverlayType overlay_type_
Overlay type.
void operator()(unsigned int offset)
Map' cell updating operator.
MapAction(nav_msgs::msg::OccupancyGrid::SharedPtr map, int8_t value, OverlayType overlay_type)
MapAction constructor.
nav_msgs::msg::OccupancyGrid::SharedPtr map_
Output map pointer.
int8_t value_
Value to put on map.