EasyFleet
A simple-by-default framework for multi-robot, multi-capability fleets built on ROS 2
Loading...
Searching...
No Matches
robot_navigation_watcher.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__ROBOT_NAVIGATION_WATCHER_HPP_
17#define EASYFLEET_NAVIGATION_MANAGER__ROBOT_NAVIGATION_WATCHER_HPP_
18
19#include <cstdint>
20#include <string>
21
22#include "easynav_interfaces/msg/navigation_control.hpp"
23#include "nav_msgs/msg/path.hpp"
24#include "rclcpp/rclcpp.hpp"
25
26namespace easyfleet
27{
28
50{
51public:
59 rclcpp::Node & node, const std::string & robot_id, const std::string & planner_plugin_key);
60
62 [[nodiscard]] const std::string & robot_id() const {return robot_id_;}
63
66 [[nodiscard]] const nav_msgs::msg::Path & get_latest_path() const {return latest_path_;}
67
69 void pause();
70
72 void resume();
73
76 [[nodiscard]] bool is_paused() const {return paused_;}
77
78private:
79 void send(uint8_t control_type);
80 void on_control(easynav_interfaces::msg::NavigationControl::UniquePtr msg);
81
82 rclcpp::Node & node_;
83 std::string robot_id_;
84 std::string id_;
85 int64_t seq_ {0};
86
87 rclcpp::Publisher<easynav_interfaces::msg::NavigationControl>::SharedPtr control_pub_;
88 rclcpp::Subscription<easynav_interfaces::msg::NavigationControl>::SharedPtr control_sub_;
89 rclcpp::Subscription<nav_msgs::msg::Path>::SharedPtr path_sub_;
90
91 nav_msgs::msg::Path latest_path_;
92 bool paused_ {false};
93};
94
95} // namespace easyfleet
96
97#endif // EASYFLEET_NAVIGATION_MANAGER__ROBOT_NAVIGATION_WATCHER_HPP_
void resume()
Ask this robot's GoalManager to resume its navigation.
Definition robot_navigation_watcher.cpp:66
void pause()
Ask this robot's GoalManager to pause its navigation.
Definition robot_navigation_watcher.cpp:60
RobotNavigationWatcher(rclcpp::Node &node, const std::string &robot_id, const std::string &planner_plugin_key)
Definition robot_navigation_watcher.cpp:21
const std::string & robot_id() const
Robot namespace this watcher was constructed for.
Definition robot_navigation_watcher.hpp:62
bool is_paused() const
Whether this robot's navigation is currently paused, per the last PAUSED/RESUMED confirmation receive...
Definition robot_navigation_watcher.hpp:76
const nav_msgs::msg::Path & get_latest_path() const
Most recently received planned path.
Definition robot_navigation_watcher.hpp:66