EasyNav Gridmap Stack
Loading...
Searching...
No Matches
GridmapMapsManager.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 sh0rt)
4// licensed under the GNU General Public License v3.0.
5// See <http://www.gnu.org/licenses/> for details.
6//
7// Easy Navigation program is free software: you can redistribute it and/or modify
8// it under the terms of the GNU General Public License as published by
9// the Free Software Foundation, either version 3 of the License, or
10// (at your option) any later version.
11//
12// This program is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15// GNU General Public License for more details.
16//
17// You should have received a copy of the GNU General Public License
18// along with this program. If not, see <http://www.gnu.org/licenses/>.
19
22
23#ifndef EASYNAV_GRIDMAP_MAPS_MANAGER__GRIDMAPMAPSMANAGER_HPP_
24#define EASYNAV_GRIDMAP_MAPS_MANAGER__GRIDMAPMAPSMANAGER_HPP_
25
26#include "grid_map_msgs/msg/grid_map.hpp"
27#include "std_srvs/srv/trigger.hpp"
28
29#include "grid_map_ros/grid_map_ros.hpp"
30
31#include "easynav_core/MapsManagerBase.hpp"
32
33#include "yaets/tracing.hpp"
34
35namespace easynav
36{
37
38
44class GridmapMapsManager : public easynav::MapsManagerBase
45{
46public:
51
56
64 virtual std::expected<void, std::string> on_initialize() override;
65
74 virtual void update(NavState & nav_state) override;
75
76protected:
80 std::string map_path_;
81
82private:
86 grid_map::GridMap map_;
87
91 rclcpp::Publisher<grid_map_msgs::msg::GridMap>::SharedPtr gridmap_pub_;
92
96 rclcpp::Subscription<grid_map_msgs::msg::GridMap>::SharedPtr incoming_map_sub_;
97
101 rclcpp::Service<std_srvs::srv::Trigger>::SharedPtr savemap_srv_;
102
106 grid_map_msgs::msg::GridMap gridmap_msg_;
107
108 bool map_need_update_ {false};
109};
110
111} // namespace easynav
112
113#endif // EASYNAV_GRIDMAP_MAPS_MANAGER__GRIDMAPMAPSBUILDERNODE_HPP_
GridmapMapsManager()
Default constructor.
Definition GridmapMapsManager.cpp:40
virtual void update(NavState &nav_state) override
Updates the internal maps using the current navigation state.
Definition GridmapMapsManager.cpp:135
~GridmapMapsManager()
Destructor.
Definition GridmapMapsManager.cpp:52
virtual std::expected< void, std::string > on_initialize() override
Initializes the maps manager.
Definition GridmapMapsManager.cpp:58
std::string map_path_
Full path to the map file.
Definition GridmapMapsManager.hpp:80
Definition GridMapAStarPlanner.hpp:41