EasyNav Plugins
Loading...
Searching...
No Matches
OctomapMapsManager.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_OCTOMAP_MAPS_MANAGER__OCTOMAP_MAPS_MANAGER_HPP_
20#define EASYNAV_OCTOMAP_MAPS_MANAGER__OCTOMAP_MAPS_MANAGER_HPP_
21
22#include <vector>
23
24#include "nav_msgs/msg/occupancy_grid.hpp"
25#include "octomap_msgs/msg/octomap.hpp"
26#include "std_srvs/srv/trigger.hpp"
27#include "sensor_msgs/msg/point_cloud2.hpp"
28
29#include "easynav_core/MapsManagerBase.hpp"
30#include "octomap/octomap.h"
31
33#include "pluginlib/class_loader.hpp"
34
35namespace easynav
36{
37namespace octomap
38{
39
48class OctomapMapsManager : public easynav::MapsManagerBase
49{
50public:
55
60
68 virtual void on_initialize() override;
69
78 virtual void update(::easynav::NavState & nav_state) override;
79
80protected:
84 std::string map_path_;
85
86private:
90 std::shared_ptr<::octomap::OcTree> octomap_;
91
95 rclcpp::Publisher<octomap_msgs::msg::Octomap>::SharedPtr octomap_pub_;
96
100 rclcpp::Subscription<nav_msgs::msg::OccupancyGrid>::SharedPtr incoming_occ_map_sub_;
101
105 rclcpp::Subscription<sensor_msgs::msg::PointCloud2>::SharedPtr incoming_pc2_map_sub_;
106
110 rclcpp::Service<std_srvs::srv::Trigger>::SharedPtr savemap_srv_;
111
115 octomap_msgs::msg::Octomap octomap_msg_;
116
117 std::unique_ptr<pluginlib::ClassLoader<OctomapFilter>> octomap_filters_loader_;
118
119 std::vector<std::shared_ptr<OctomapFilter>> octomap_filters_;
120
121 double resolution_ {1.0};
122};
123
124} // namespace octomap
125} // namespace easynav
126#endif // EASYNAV_OCTOMAP_MAPS_MANAGER__OCTOMAP_MAPS_MANAGER_HPP_
~OctomapMapsManager()
Destructor.
Definition OctomapMapsManager.cpp:56
std::string map_path_
Full path to the map file.
Definition OctomapMapsManager.hpp:84
virtual void on_initialize() override
Initializes the maps manager.
Definition OctomapMapsManager.cpp:59
OctomapMapsManager()
Default constructor.
Definition OctomapMapsManager.cpp:42
virtual void update(::easynav::NavState &nav_state) override
Updates the internal maps using the current navigation state.
Definition OctomapMapsManager.cpp:249
Definition InflationFilter.hpp:32
Provides a mapping for often used cost values.
Definition cost_values.hpp:41