15 #ifndef NAV2_UTIL__COSTMAP_HPP_
16 #define NAV2_UTIL__COSTMAP_HPP_
21 #include "nav2_ros_common/lifecycle_node.hpp"
22 #include "nav2_msgs/msg/costmap.hpp"
23 #include "nav2_msgs/msg/costmap_meta_data.hpp"
24 #include "nav_msgs/msg/occupancy_grid.hpp"
29 enum class TestCostmap
47 typedef uint8_t CostValue;
59 int lethal_threshold = 100,
int unknown_cost_value = -1);
67 void set_static_map(
const nav_msgs::msg::OccupancyGrid & occupancy_grid);
80 nav2_msgs::msg::Costmap
get_costmap(
const nav2_msgs::msg::CostmapMetaData & specifications);
86 nav2_msgs::msg::CostmapMetaData
get_properties() {
return costmap_properties_;}
92 bool is_free(
const unsigned int x_coordinate,
const unsigned int y_coordinate)
const;
98 bool is_free(
const unsigned int index)
const;
101 static const CostValue no_information;
102 static const CostValue lethal_obstacle;
103 static const CostValue inscribed_inflated_obstacle;
104 static const CostValue medium_cost;
105 static const CostValue free_space;
112 std::vector<uint8_t> get_test_data(
const TestCostmap configuration);
118 uint8_t interpret_value(
const int8_t value)
const;
124 nav2_msgs::msg::CostmapMetaData costmap_properties_;
125 std::vector<uint8_t> costs_;
128 bool trinary_costmap_;
129 bool track_unknown_space_;
130 int lethal_threshold_;
131 int unknown_cost_value_;
135 bool using_test_map_;
A lifecycle node wrapper to enable common Nav2 needs such as manipulating parameters.
Class for a single layered costmap initialized from an occupancy grid representing the map.
nav2_msgs::msg::CostmapMetaData get_properties()
Get a metadata message from this object.
bool is_free(const unsigned int x_coordinate, const unsigned int y_coordinate) const
Get whether some coordinates are free.
void set_static_map(const nav_msgs::msg::OccupancyGrid &occupancy_grid)
Set the static map of this costmap.
void set_test_costmap(const TestCostmap &testCostmapType)
Set the test costmap type of this costmap.
nav2_msgs::msg::Costmap get_costmap(const nav2_msgs::msg::CostmapMetaData &specifications)
Get a costmap message from this object.