Skip to content

Introduce ROS2 Actions task executor architecture#329

Merged
andrewjong merged 9 commits into
mainfrom
aj/tasks
Apr 6, 2026
Merged

Introduce ROS2 Actions task executor architecture#329
andrewjong merged 9 commits into
mainfrom
aj/tasks

Conversation

@andrewjong
Copy link
Copy Markdown
Member

@andrewjong andrewjong commented Apr 6, 2026

What does this pull request do?

We want users to be able to specify task parameters at run time. E.g. we want to get to supporting tasks like CoverageTask, LanguageTask, NavigateTask, TakeoffTask, etc. This redesigns the architecture to start supporting *Task.action messages.

Introduces a task executor architecture for the AirStack autonomy stack. Task executors are ROS 2 action servers that carry out discrete, goal-directed missions (exploration, navigation) on demand, as opposed to perpetual nodes that run continuously.

The key addition is a two-level cascade:

behavior_executive → ExplorationTask → random_walk_planner
                                            ↓
                                      NavigateTask
                                            ↓
                               droan_gl / droan_local_planner
                                            ↓
                                  trajectory_controller

How did you implement it?

  • task_msgs package — new shared message package defining 7 task action types: NavigateTask, ExplorationTask, CoverageTask, ObjectSearchTask, ObjectCountingTask, FixedTrajectoryTask, SemanticSearchTask
  • random_walk_planner — converted from a perpetual topic-driven node to an ExplorationTask action server; internally sends NavigateTask goals to the local planner for each waypoint segment
  • droan_gl — added NavigateTask action server; accepts a nav_msgs/Path goal, enables ADD_SEGMENT mode on the trajectory controller, and monitors goal distance; renamed expand.cppdroan_gl_node.cpp
  • droan_local_planner — added NavigateTask action server with the same interface as droan_gl
  • behavior_executive — replaced the old global_planner_toggle service call with an ExplorationTask action client; dispatches an exploration goal when the "Follow Global Plan" behavior tree action fires
  • Bringup launch files — added topic remaps for all new action servers to /{robot_name}/tasks/{name} in behavior.launch.xml, global.launch.xml, and local.launch.xml
  • Bug fixes — changed TF lookups in droan_gl to tf2::TimePointZero to eliminate extrapolation errors in simulation

Testing

How do you run the tests?

  1. Start the robot stack: AUTOLAUNCH=false airstack up robot-desktop
  2. Launch autonomy: trigger the "Follow Global Plan" action from the behavior tree GUI
  3. Monitor the action cascade:
ros2 action list                              # should show /robot_1/tasks/exploration and /robot_1/tasks/navigate
ros2 action send_goal /robot_1/tasks/exploration task_msgs/action/ExplorationTask \
  '{min_altitude_agl: 3.0, max_altitude_agl: 8.0, min_flight_speed: 1.0, max_flight_speed: 3.0, time_limit_sec: 30.0}' \
  --feedback

What do the tests do?

End-to-end validation of the full cascade: behavior_executive dispatches an ExplorationTask to random_walk_planner, which generates waypoints and sends NavigateTask goals to droan_gl, which feeds trajectory segments to the trajectory controller.

What are the expected results of the tests?

  • random_walk_planner logs: "Sent NavigateTask goal (N waypoints)"
  • droan_gl logs: "Waypoint reached, planning next segment"
  • Drone follows an exploratory flight path in simulation with local obstacle avoidance active

Did you update the docs (and where)?

  • docs/robot/autonomy/system_architecture.md — new "Node Types: Perpetual vs Task Executor" section with comparison table, lifecycle diagram, and task cascade diagram
  • docs/robot/autonomy/tasks.md — new page documenting all 7 task action types with goal/feedback/result field tables
  • docs/robot/autonomy/integration_checklist.md — new "Step 0: Module Type" decision guide, task executor checklist section (2b), testing items, common issue, and updated references
  • mkdocs.yml — added Tasks page to navigation
  • random_walk/README.md, droan_gl/README.md, droan_local_planner/README.md — each updated with a "Task Executor" section describing the action interface, cascade, and CLI test commands
  • .agents/skills/add-task-executor/SKILL.md — new agent skill documenting how to implement a task executor

🤖 Generated with Claude Code

@andrewjong andrewjong requested a review from krrishj18 April 6, 2026 21:13
Add a cascaded task executor paradigm: ExplorationTask (random_walk) →
NavigateTask (droan_gl / droan_local_planner) → trajectory_controller.
Each layer is activated on demand via ROS2 action goals rather than
continuous timers or toggle services.

Key changes:
- task_msgs: add NavigateTask.action (global_plan + goal_tolerance_m →
  success/distance feedback)
- random_walk: convert to ExplorationTask action server; replace
  publish_plan() with async NavigateTask client; remove stall detection
  (DROAN's rewind_monitor handles recovery); remap exploration_task and
  navigate_task in global bringup
- droan_gl / droan_local_planner: add NavigateTask action server;
  ownership of trajectory mode (ADD_SEGMENT on goal start, TRACK on
  goal end); switch to MultiThreadedExecutor; remap navigate_task and
  set_trajectory_mode in local bringup
- behavior_executive: remove global_planner_toggle_client and
  ADD_SEGMENT logic from global_plan_action handler — now just signals
  success to the BT, since DROAN owns trajectory mode
…in droan to use latest data instead of timestamped to reduce warnings
@andrewjong andrewjong merged commit cd6084d into main Apr 6, 2026
1 check passed
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