EasyFleet
A simple-by-default framework for multi-robot, multi-capability fleets built on ROS 2
Loading...
Searching...
No Matches
RobotNavigationWatcher Class Reference

Watches one robot's planned path and can pause/resume its navigation. More...

#include <robot_navigation_watcher.hpp>

Public Member Functions

 RobotNavigationWatcher (rclcpp::Node &node, const std::string &robot_id, const std::string &planner_plugin_key)
const std::string & robot_id () const
 Robot namespace this watcher was constructed for.
const nav_msgs::msg::Path & get_latest_path () const
 Most recently received planned path.
void pause ()
 Ask this robot's GoalManager to pause its navigation.
void resume ()
 Ask this robot's GoalManager to resume its navigation.
bool is_paused () const
 Whether this robot's navigation is currently paused, per the last PAUSED/RESUMED confirmation received.

Detailed Description

Watches one robot's planned path and can pause/resume its navigation.

Deliberately does not own a separate rclcpp::Node or easynav::GoalManagerClient: those are designed for "one process talks to one robot" (a fixed node namespace resolves the relative "easynav_control"/"path" topic names), which doesn't fit NavigationManagerNode watching many robots from a single process. Instead, this class creates its publisher/subscriptions directly on the given node – once, in the constructor – using each robot's fully-qualified topic names (e.g. "/robot_1/easynav_control"), and reimplements just the PAUSE/RESUME subset of GoalManager's control protocol (see GoalManager.cpp's PAUSE/RESUME handling in easynav_system): the SEND_GOAL/CANCEL machinery isn't needed here, this class never sends a goal.

node ends up being serviced by whichever single executor the caller spins it with – no dedicated executor or thread of its own, and (since every callback then runs on that one thread) no locking either.

Constructor & Destructor Documentation

◆ RobotNavigationWatcher()

RobotNavigationWatcher ( rclcpp::Node & node,
const std::string & robot_id,
const std::string & planner_plugin_key )
Parameters
nodeNode to create the publisher/subscriptions on. Must outlive this watcher.
robot_idRobot namespace, without a leading slash (e.g. "robot_1").
planner_plugin_keyThe planner_types entry name configured on that robot's PlannerNode (e.g. "simple") – determines the path topic to subscribe to.

Member Function Documentation

◆ get_latest_path()

const nav_msgs::msg::Path & get_latest_path ( ) const
inlinenodiscard

Most recently received planned path.

Empty (default-constructed nav_msgs::msg::Path) if none has arrived yet.


The documentation for this class was generated from the following files:
  • easyfleet_navigation_manager/include/easyfleet_navigation_manager/robot_navigation_watcher.hpp
  • easyfleet_navigation_manager/src/easyfleet_navigation_manager/robot_navigation_watcher.cpp