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

Publishes a floating TEXT_VIEW_FACING marker above each robot's own base_link, showing a short, human-readable line of what that robot is currently doing (which capability, what state/result) – so watching the mission in RViz alone (no terminal) is enough for a non-expert to follow along. More...

#include <status_markers.hpp>

Public Member Functions

 StatusMarkerPublisher (rclcpp::Node &node, const std::string &topic="mission_status_markers", double height=0.75, double text_size=0.25)
 Constructs the marker publisher.
void set_status (const std::string &robot, const std::string &text)
 Sets robot's current status text and publishes it immediately (the background refresh timer then keeps republishing it, and every other robot's last known text, with a fresh timestamp).

Detailed Description

Publishes a floating TEXT_VIEW_FACING marker above each robot's own base_link, showing a short, human-readable line of what that robot is currently doing (which capability, what state/result) – so watching the mission in RViz alone (no terminal) is enough for a non-expert to follow along.

Meant to be driven from mission control, not from a capability itself: it has no notion of why a robot is doing something, only whatever text the mission script hands it at each meaningful transition.

One marker per robot, keyed by name (e.g. "robot_1"): each set_status() call replaces that robot's previous text (same marker id), it never accumulates markers. The marker's frame_id is "<robot>/base_link" (a relative TF frame id, exactly matching how easyfleet_core::Capability itself derives a robot's identity from its own namespace elsewhere in this project) with the text positioned at that frame's origin plus a fixed height, so it rides along with the robot as it moves and turns.

Constructor & Destructor Documentation

◆ StatusMarkerPublisher()

StatusMarkerPublisher ( rclcpp::Node & node,
const std::string & topic = "mission_status_markers",
double height = 0.75,
double text_size = 0.25 )
inlineexplicit

Constructs the marker publisher.

Parameters
nodeNode the marker publisher is created on. Kept as a reference for this object's whole life (used later by the refresh timer callback), so node must outlive this StatusMarkerPublisher – never null, unlike a pointer.
topicTopic the MarkerArray is published on.
heightHeight (m) above each robot's base_link the text floats at.
text_sizeMarker scale.z: character height, in world-space meters, like every other marker dimension – not a screen-space font size. How large it looks on screen is therefore also a function of camera distance in RViz's 3D view, same as the robot model itself: viewed close up (as this project's own Kobuki-sized robots tend to be, being small), even a modest value here can fill much of the view. Tune to taste for your own camera distance/robot size; the default here favors staying legibly sized next to a Kobuki at a typical close-in RViz view over matching some absolute "normal" text size.

Member Function Documentation

◆ set_status()

void set_status ( const std::string & robot,
const std::string & text )
inline

Sets robot's current status text and publishes it immediately (the background refresh timer then keeps republishing it, and every other robot's last known text, with a fresh timestamp).

Safe to call from multiple threads (e.g. one per robot, as a mission script's own parallel phases do).

Parameters
robotRobot identity the marker is shown above.
textStatus text to display.

The documentation for this class was generated from the following file: