EasyNav Plugins
Loading...
Searching...
No Matches
BonxaiMapsManager.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_BONXAI_MAPS_MANAGER__BONXAI_MAPS_MANAGER_HPP_
20#define EASYNAV_BONXAI_MAPS_MANAGER__BONXAI_MAPS_MANAGER_HPP_
21
23
24#include "nav_msgs/msg/occupancy_grid.hpp"
25#include "std_srvs/srv/trigger.hpp"
26#include "sensor_msgs/msg/point_cloud2.hpp"
27
28#include "easynav_core/MapsManagerBase.hpp"
29
31{
32
33
42class BonxaiMapsManager : public easynav::MapsManagerBase
43{
44public:
49
54
62 virtual void on_initialize() override;
63
72 virtual void update(::easynav::NavState & nav_state) override;
73
74protected:
78 std::string map_path_;
79
80private:
84 std::shared_ptr<Bonxai::ProbabilisticMap> bonxai_map_;
85
89 rclcpp::Publisher<sensor_msgs::msg::PointCloud2>::SharedPtr bonxai_pub_;
90
94 rclcpp::Subscription<nav_msgs::msg::OccupancyGrid>::SharedPtr incoming_occ_map_sub_;
95
99 rclcpp::Subscription<sensor_msgs::msg::PointCloud2>::SharedPtr incoming_pc2_map_sub_;
100
104 rclcpp::Service<std_srvs::srv::Trigger>::SharedPtr savemap_srv_;
105
109 sensor_msgs::msg::PointCloud2 bonxai_msg_;
110
111 void update_from_pc2(const sensor_msgs::msg::PointCloud2 & pc2);
112 void update_from_occ(const nav_msgs::msg::OccupancyGrid & occ);
113 void publish_map();
114
115 double resolution_ {0.3};
116 double height_with_occ_ {1.0};
117};
118
119} // namespace easynav_bonxai
120#endif // EASYNAV_BONXAI_MAPS_MANAGER__BONXAI_MAPS_MANAGER_HPP_
BonxaiMapsManager()
Default constructor.
Definition BonxaiMapsManager.cpp:38
std::string map_path_
Full path to the map file.
Definition BonxaiMapsManager.hpp:78
virtual void on_initialize() override
Initializes the maps manager.
Definition BonxaiMapsManager.cpp:52
virtual void update(::easynav::NavState &nav_state) override
Updates the internal maps using the current navigation state.
Definition BonxaiMapsManager.cpp:160
~BonxaiMapsManager()
Destructor.
Definition BonxaiMapsManager.cpp:49
Definition BonxaiMapsManager.hpp:31