EasyFleet
A simple-by-default framework for multi-robot, multi-capability fleets built on ROS 2
Loading...
Searching...
No Matches
navigation_manager_node.hpp
1// Copyright 2026 Intelligent Robotics Lab
2//
3// This file is part of the project EasyFleet
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
16#ifndef EASYFLEET_NAVIGATION_MANAGER__NAVIGATION_MANAGER_NODE_HPP_
17#define EASYFLEET_NAVIGATION_MANAGER__NAVIGATION_MANAGER_NODE_HPP_
18
19#include <map>
20#include <memory>
21#include <set>
22#include <string>
23#include <vector>
24
25#include "easyfleet_interfaces/msg/capability_status.hpp"
26#include "easyfleet_navigation_manager/conflict_detector.hpp"
27#include "easyfleet_navigation_manager/map_publisher_base.hpp"
28#include "easyfleet_navigation_manager/robot_navigation_watcher.hpp"
29#include "easyfleet_navigation_manager/routes_publisher.hpp"
30#include "rclcpp/rclcpp.hpp"
31#include "tf2_ros/static_transform_broadcaster.hpp"
32
33namespace easyfleet
34{
35
110class NavigationManagerNode : public rclcpp::Node
111{
112public:
118 explicit NavigationManagerNode(const rclcpp::NodeOptions & options = rclcpp::NodeOptions());
119
121 [[nodiscard]] std::vector<std::string> get_watched_robots() const;
122
123private:
128 void reconcile_watchers();
129
134 void check_conflicts();
135
141 void publish_robot_map_tf(const std::string & robot_id);
142
143 std::unique_ptr<MapPublisherBase> map_publisher_;
144 RoutesPublisher routes_publisher_;
145
146 std::string planner_plugin_key_;
147 ConflictParams conflict_params_;
148 std::vector<std::unique_ptr<RobotNavigationWatcher>> watchers_;
149 std::set<std::string> currently_paused_;
150
151 std::shared_ptr<tf2_ros::StaticTransformBroadcaster> map_tf_broadcaster_;
152
154 rclcpp::Subscription<easyfleet_interfaces::msg::CapabilityStatus>::SharedPtr
155 capabilities_status_sub_;
158 std::map<std::string, rclcpp::Time> last_heartbeat_by_robot_;
159 double robot_staleness_sec_ {5.0};
160
161 rclcpp::TimerBase::SharedPtr reconcile_timer_;
162 rclcpp::TimerBase::SharedPtr conflict_timer_;
163};
164
165} // namespace easyfleet
166
167#endif // EASYFLEET_NAVIGATION_MANAGER__NAVIGATION_MANAGER_NODE_HPP_
std::vector< std::string > get_watched_robots() const
Robots currently being watched (for testing and tools).
Definition navigation_manager_node.cpp:133
NavigationManagerNode(const rclcpp::NodeOptions &options=rclcpp::NodeOptions())
Declares parameters, builds the configured MapPublisherBase, publishes both the map and the routes on...
Definition navigation_manager_node.cpp:52
Publishes a RoutesMap on /global_routes, and keeps it live-editable.
Definition routes_publisher.hpp:81
Tunable geometry for imminent-conflict detection between two robots' planned paths.
Definition conflict_detector.hpp:32