Skip to content

Robust capabilities and missions, fleet-aware navigation manager and BT capability nodes - #5

Merged
fmrico merged 3 commits into
rollingfrom
fleet_robustness
Oct 25, 2026
Merged

fmrico merged 3 commits into
rollingfrom
fleet_robustness

Conversation

@fmrico

@fmrico fmrico commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

Two commits.

1. Robust capabilities and missions, conflict monitor fixes, TF relay and fleet obstacles

  • Capabilities (easyfleet_core): ActionServerBase accepts goals only while the capability is ACTIVE (enable_goals()/disable_goals()), and subclasses call stop() in their destructor so the worker is joined before they go. Without preemption a queued goal counts as busy; exceptions from the goal/cancel callbacks reject the goal; a canceled queued goal ends CANCELED.
  • ActionClient: send_goal_and_wait() cancels the goal when it times out and returns SERVER_UNAVAILABLE when the server stays away longer than default_server_timeout (it could block forever); cancel_all_goals() cancels only this client's goals, also those still waiting for acceptance; no throw or hang once the context is shut down.
  • Deployment: try_add_capabilities_from_parameters() and try_start() return false (rolling back to UNCONFIGURED) instead of exiting.
  • Mission side (easyfleet_mission_manager, C++ and Python): FleetSession keeps a live capability registry (capabilities that appear, restart or die after discovery); explicit robot lifetime (RobotHandle detaches on destruction); a goal on a capability that stops its heartbeats ends UNREACHABLE, and one whose cancel is never answered ends TIMEOUT after 5 s. Python gets ActionServerBase and Capability.
    API changes: RobotHandle::capabilities() returns by value; check_timeout(bool alive); the outcome helpers are templated on the outcome enum.
  • Navigate BT node: response_timeout port; a goal set while EasyNav still has to answer the previous one is sent later instead of lost.
  • Navigation manager:
    • conflicts only between robots navigating with a recent path (conflict.path_timeout_sec), from where they are (conflict.pose_timeout_sec);
    • conflict.resume_hysteresis_factor; no deadlock with both robots paused; priority after conflict.max_pause_sec; PAUSE re-sent after a new goal without flooding; operator pauses left alone;
    • absolute map/routes paths, routes.save_path_file for RViz edits (instead of writing into the installed share), each RViz click applied once;
    • robots.relay_tf*: each robot's TF under /<robot>/tf, only selected frames relayed to /tf for a fleet view;
    • robots.share_obstacles*: each robot gets the other robots as a PointCloud2 on /<robot>/fleet_obstacles (a Kobuki's lidar barely sees another Kobuki); never an empty cloud;
    • no abort when publishing while the middleware shuts down.
  • CI builds and tests every package; copyright and cpplint enabled everywhere.

2. easyfleet_bt_nodes

CallNavigation, CallPerception and CallManipulation run one goal of /<robot>/navigation, /perception or /manipulation from any BehaviorTree.CPP tree, e.g. the actions of a PlanSys2 plan:

  • the robot comes from an input port ({arg0} in a PlanSys2 action), the action name from /<robot>/<type> or action_name;
  • halting or destroying the node cancels the goal; perception succeeds after min_detections and stops the capability;
  • navigation (from distance_remaining) and manipulation (progress) report their progress as the blackboard's completion, which PlanSys2 shows as the action's.

Tests: every point above adds or extends tests (test_action_client_server_loss, test_deployment_no_capabilities, Python test_action_server_base/test_capability, fleet_obstacles_tests, +750 lines in test_navigation_manager, 18 cases in easyfleet_bt_nodes). All pass locally (easyfleet_bt_nodes 30 times in a row), except test_action_client_server_loss with Fast DDS on this machine: its cross-process discovery on localhost is broken here today (demo talker/listener do not talk either); it passes with Zenoh in 1.3 s.

Four Kobukis in a 200 x 200 m warehouse ran a PlanSys2 mission on these (EasyNavigation/easyfleet_example_deployments, warehouse PR).

…d fleet obstacles

- ActionServerBase/Capability: goals only while ACTIVE (enable/disable_goals, stop());
  a queued goal counts as busy without preemption; exceptions from the callbacks
  reject the goal; a canceled queued goal ends CANCELED.
- ActionClient: send_goal_and_wait cancels on timeout and returns SERVER_UNAVAILABLE
  when the server goes away; cancel_all_goals cancels only this client's goals;
  no throw or hang after the context shuts down.
- Deployment: try_add_capabilities_from_parameters() and try_start(), which roll back
  instead of exiting.
- FleetSession/RobotHandle (C++ and Python): a live capability registry, explicit
  robot lifetime; run outcomes when a capability dies (UNREACHABLE) or ignores a
  cancel (TIMEOUT); Python ActionServerBase/Capability.
- Navigate BT node: response_timeout, and goals sent while the client still waits for
  an answer are no longer lost.
- Navigation manager: conflicts only for robots navigating with a recent path, paths
  trimmed to the robot, hysteresis, no deadlock with both robots paused, priority
  after max_pause_sec, re-pause without flooding, operator pauses left alone;
  absolute map/routes paths and routes.save_path_file; RViz route edits applied once;
  TF relay of each robot's frames (robots.relay_tf*) and the other robots shared as
  obstacles (robots.share_obstacles*); no throw when publishing during shutdown.
- CI builds and tests every package; copyright and cpplint enabled everywhere.

Signed-off-by: Francisco Martín Rico <[email protected]>
CallNavigation, CallPerception and CallManipulation run one goal of
/<robot>/navigation, /perception or /manipulation from any BehaviorTree.CPP
tree, e.g. the actions of a PlanSys2 plan; halting the node cancels the goal,
and navigation and manipulation report their progress as completion.

Signed-off-by: Francisco Martín Rico <[email protected]>
Without it colcon tests them with unittest, which finds none of their
pytest tests: 'NO TESTS RAN' failed the CI.

Signed-off-by: Francisco Martín Rico <[email protected]>
@fmrico
fmrico merged commit 6d56b6e into rolling Oct 25, 2026
1 check passed
@fmrico
fmrico deleted the fleet_robustness branch October 25, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant