EasyNav Plugins
Loading...
Searching...
No Matches
SimpleMapsManager.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 "nav_msgs/msg/occupancy_grid.hpp"
23#include "std_srvs/srv/trigger.hpp"
24
25#include "easynav_core/MapsManagerBase.hpp"
27
28namespace easynav
29{
30
39class SimpleMapsManager : public easynav::MapsManagerBase
40{
41public:
46
51
59 virtual void on_initialize() override;
60
69 virtual void update(NavState & nav_state) override;
70
76 void set_static_map(const SimpleMap & new_map);
77
83 void set_dynamic_map(const SimpleMap & new_map);
84
85protected:
89 std::string map_path_;
90
91private:
95 SimpleMap static_map_;
96
100 SimpleMap dynamic_map_;
101
105 rclcpp::Publisher<nav_msgs::msg::OccupancyGrid>::SharedPtr static_occ_pub_;
106
110 rclcpp::Publisher<nav_msgs::msg::OccupancyGrid>::SharedPtr dynamic_occ_pub_;
111
115 rclcpp::Subscription<nav_msgs::msg::OccupancyGrid>::SharedPtr incoming_map_sub_;
116
120 rclcpp::Service<std_srvs::srv::Trigger>::SharedPtr savemap_srv_;
121
125 nav_msgs::msg::OccupancyGrid static_grid_msg_;
126
130 nav_msgs::msg::OccupancyGrid dynamic_grid_msg_;
131};
132
133} // namespace easynav
134
135#endif // EASYNAV_PLANNER__SIMPLEMAPMANAGER_HPP_
Declaration of the SimpleMap type.
Simple 2D uint8_t grid using basic C++ types, with full metric conversion support.
Definition SimpleMap.hpp:38
void set_dynamic_map(const SimpleMap &new_map)
Replaces the current dynamic map.
Definition SimpleMapsManager.cpp:129
virtual void update(NavState &nav_state) override
Updates the internal maps using the current navigation state.
Definition SimpleMapsManager.cpp:135
~SimpleMapsManager()
Destructor.
Definition SimpleMapsManager.cpp:43
void set_static_map(const SimpleMap &new_map)
Replaces the current static map.
Definition SimpleMapsManager.cpp:123
SimpleMapsManager()
Default constructor.
Definition SimpleMapsManager.cpp:32
std::string map_path_
Full path to the map file.
Definition SimpleMapsManager.hpp:89
virtual void on_initialize() override
Initializes the maps manager.
Definition SimpleMapsManager.cpp:49
Provides a mapping for often used cost values.
Definition cost_values.hpp:41