EasyNav Plugins
Loading...
Searching...
No Matches
CostmapMapsManager.hpp
Go to the documentation of this file.
1// Copyright 2025 Intelligent Robotics Lab
2//
3// This file is part of the project Easy Navigation (EasyNav in short)
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
18
19#ifndef EASYNAV_PLANNER__SIMPLEMAPMANAGER_HPP_
20#define EASYNAV_PLANNER__SIMPLEMAPMANAGER_HPP_
21
22#include <vector>
23
24#include "nav_msgs/msg/occupancy_grid.hpp"
25#include "std_srvs/srv/trigger.hpp"
26
27#include "easynav_core/MapsManagerBase.hpp"
29
31#include "pluginlib/class_loader.hpp"
32
33namespace easynav
34{
35
44class CostmapMapsManager : public easynav::MapsManagerBase
45{
46public:
51
56
64 virtual void on_initialize() override;
65
74 virtual void update(NavState & nav_state) override;
75
81 void set_static_map(const Costmap2D & new_map);
82
83protected:
87 std::string map_path_;
88
89private:
93 Costmap2D static_map_;
94
98 std::shared_ptr<Costmap2D> dynamic_map_;
99
103 rclcpp::Publisher<nav_msgs::msg::OccupancyGrid>::SharedPtr static_occ_pub_;
104
108 rclcpp::Publisher<nav_msgs::msg::OccupancyGrid>::SharedPtr dynamic_occ_pub_;
109
113 rclcpp::Subscription<nav_msgs::msg::OccupancyGrid>::SharedPtr incoming_map_sub_;
114
118 rclcpp::Service<std_srvs::srv::Trigger>::SharedPtr savemap_srv_;
119
123 nav_msgs::msg::OccupancyGrid static_grid_msg_;
124
128 nav_msgs::msg::OccupancyGrid dynamic_grid_msg_;
129
130 std::unique_ptr<pluginlib::ClassLoader<CostmapFilter>> costmap_filters_loader_;
131
132 std::vector<std::shared_ptr<CostmapFilter>> costmap_filters_;
133};
134
135} // namespace easynav
136
137#endif // EASYNAV_PLANNER__SIMPLEMAPMANAGER_HPP_
A 2D costmap provides a mapping between points in the world and their associated "costs".
Definition costmap_2d.hpp:66
virtual void update(NavState &nav_state) override
Updates the internal maps using the current navigation state.
Definition CostmapMapsManager.cpp:178
CostmapMapsManager()
Default constructor.
Definition CostmapMapsManager.cpp:35
void set_static_map(const Costmap2D &new_map)
Replaces the current static map.
Definition CostmapMapsManager.cpp:171
~CostmapMapsManager()
Destructor.
Definition CostmapMapsManager.cpp:49
std::string map_path_
Full path to the map file.
Definition CostmapMapsManager.hpp:87
virtual void on_initialize() override
Initializes the maps manager.
Definition CostmapMapsManager.cpp:52
Provides a mapping for often used cost values.
Definition cost_values.hpp:41