EasyNav Plugins
Loading...
Searching...
No Matches
NavMapMapsManager.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_NAVMAP_MAPS_MANAGER__NAVMAP_MAPS_MANAGER_HPP_
20#define EASYNAV_NAVMAP_MAPS_MANAGER__NAVMAP_MAPS_MANAGER_HPP_
21
22#include <vector>
23
24#include "nav_msgs/msg/occupancy_grid.hpp"
25#include "navmap_ros_interfaces/msg/nav_map.hpp"
26#include "navmap_ros_interfaces/msg/nav_map_layer.hpp"
27#include "std_srvs/srv/trigger.hpp"
28#include "sensor_msgs/msg/point_cloud2.hpp"
29
30#include "easynav_core/MapsManagerBase.hpp"
31#include "navmap_core/NavMap.hpp"
32
34#include "pluginlib/class_loader.hpp"
35
36namespace easynav
37{
38namespace navmap
39{
40
49class NavMapMapsManager : public easynav::MapsManagerBase
50{
51public:
56
61
69 virtual void on_initialize() override;
70
79 virtual void update(::easynav::NavState & nav_state) override;
80
86 void set_static_map(const ::navmap::NavMap & new_map);
87
88protected:
92 std::string map_path_;
93
94private:
98 ::navmap::NavMap navmap_;
99
103 rclcpp::Publisher<navmap_ros_interfaces::msg::NavMap>::SharedPtr navmap_pub_;
104
108 rclcpp::Publisher<navmap_ros_interfaces::msg::NavMapLayer>::SharedPtr layer_updates_pub_;
109
113 rclcpp::Subscription<nav_msgs::msg::OccupancyGrid>::SharedPtr incoming_occ_map_sub_;
114
118 rclcpp::Subscription<sensor_msgs::msg::PointCloud2>::SharedPtr incoming_pc2_map_sub_;
119
123 rclcpp::Service<std_srvs::srv::Trigger>::SharedPtr savemap_srv_;
124
128 navmap_ros_interfaces::msg::NavMap navmap_msg_;
129
130 std::unique_ptr<pluginlib::ClassLoader<NavMapFilter>> navmap_filters_loader_;
131
132 std::vector<std::shared_ptr<NavMapFilter>> navmap_filters_;
133
134 double resolution_ {1.0};
135};
136
137} // namespace navmap
138} // namespace easynav
139#endif // EASYNAV_NAVMAP_MAPS_MANAGER__NAVMAP_MAPS_MANAGER_HPP_
void set_static_map(const ::navmap::NavMap &new_map)
Replaces the current static map.
Definition NavMapMapsManager.cpp:207
NavMapMapsManager()
Default constructor.
Definition NavMapMapsManager.cpp:39
std::string map_path_
Full path to the map file.
Definition NavMapMapsManager.hpp:92
~NavMapMapsManager()
Destructor.
Definition NavMapMapsManager.cpp:60
virtual void on_initialize() override
Initializes the maps manager.
Definition NavMapMapsManager.cpp:63
virtual void update(::easynav::NavState &nav_state) override
Updates the internal maps using the current navigation state.
Definition NavMapMapsManager.cpp:213
Definition AMCLLocalizer.hpp:41
Provides a mapping for often used cost values.
Definition cost_values.hpp:41