16#ifndef EASYFLEET_MISSION_MANAGER__FLEET_SESSION_HPP_
17#define EASYFLEET_MISSION_MANAGER__FLEET_SESSION_HPP_
27#include "rclcpp/rclcpp.hpp"
29#include "easyfleet_interfaces/msg/capability_status.hpp"
31#include "easyfleet_mission_manager/robot_handle.hpp"
32#include "easyfleet_mission_manager/status_markers.hpp"
93 const std::vector<std::reference_wrapper<RobotHandle>> &
robots()
const noexcept;
100 std::optional<std::reference_wrapper<RobotHandle>>
find_robot(
101 const std::string & name)
const noexcept;
124 void spin_for(std::chrono::milliseconds duration);
129 rclcpp::Node::SharedPtr
node()
const noexcept;
137 friend class RobotHandle;
144 rclcpp::Node::SharedPtr node_;
145 rclcpp::executors::SingleThreadedExecutor executor_;
146 std::thread spin_thread_;
147 std::vector<std::reference_wrapper<RobotHandle>> robots_;
148 std::unique_ptr<easyfleet_mission_manager::StatusMarkerPublisher> status_;
149 rclcpp::Subscription<easyfleet_interfaces::msg::CapabilityStatus>::SharedPtr
150 capability_status_sub_;
158#include "easyfleet_mission_manager/detail/robot_handle_impl.hpp"
void discover_capabilities(std::chrono::milliseconds window=std::chrono::milliseconds(2500))
Runs exactly one discovery scan (see today's easyfleet_mission_manager::discover_capabilities(),...
Definition fleet_session.cpp:83
std::optional< std::reference_wrapper< RobotHandle > > find_robot(const std::string &name) const noexcept
Looks up a robot added so far by RobotHandle::name().
Definition fleet_session.cpp:71
rclcpp::Node::SharedPtr node() const noexcept
Underlying node, for anything not yet covered by RobotHandle (matches today's escape hatch of reachin...
Definition fleet_session.cpp:119
void shutdown()
Cancels the executor, joins its background thread, and calls rclcpp::shutdown() – the mission-side mi...
Definition fleet_session.cpp:129
void spin_for(std::chrono::milliseconds duration)
Blocks for exactly duration, still spinning underneath (equivalent to a bounded spin_some() loop) – f...
Definition fleet_session.cpp:111
void spin_some()
One non-blocking spin of the underlying executor's queued work – call this in a while (robot....
Definition fleet_session.cpp:97
void add_robot(RobotHandle &robot)
Adds robot to this session, attaching it so it can be discovered and commanded.
Definition fleet_session.cpp:60
const std::vector< std::reference_wrapper< RobotHandle > > & robots() const noexcept
Every robot added so far, in add_robot() order – for code that needs to enumerate the fleet rather th...
Definition fleet_session.cpp:66
Publishes a floating TEXT_VIEW_FACING marker above each robot's own base_link, showing a short,...
Definition status_markers.hpp:47