Software and Connectivity

What Is a ROS Action? Managing Long-Running Robot Tasks.

By Rodolfo Garcia Calderoni, CFA ·

On this pageWhat Is a ROS Action?Key TakeawaysHow Does a ROS Action Work?What Are the Three Main Parts of an Action?ROS Action vs. ROS ServiceROS Action vs. ROS TopicWhat Happens When an Action Fails?Frequently Asked QuestionsThe Bottom LineSourcesRelated terms

What Is a ROS Action?

A ROS action is a communication interface used to manage tasks that take time to complete and may need progress feedback or cancellation.

In ROS 2, actions allow one software component to send a goal to another component responsible for performing the task.

For example, a mobile robot's task manager may request that its navigation system drive to a particular location.

The navigation system can report progress, accept cancellation requests, and provide a final result.

Key Takeaways

  • ROS actions are designed for longer-running tasks rather than continuous sensor streams or quick queries.
  • They organize communication around a goal, feedback, and a result.
  • Actions can support cancellation, but the action server determines how requests are handled.

How Does a ROS Action Work?

Imagine a warehouse robot assigned to travel to a packing station.

A task-management node sends a navigation goal to an action server.

The goal describes the destination.

The navigation server begins working toward that goal.

While the robot moves, it can publish feedback such as its progress or remaining distance.

When the task finishes, the server returns a result indicating the outcome.

If the operating conditions change, the client can request cancellation.

The action server then processes that request according to its implementation.

What Are the Three Main Parts of an Action?

Goal: Describes the task being requested.

Feedback: Provides information about progress while the task is underway.

Result: Reports the final outcome after the task finishes.

For example, a robot navigation action may receive a destination, provide movement-related feedback, and return a completion status.

These parts are described using an action interface definition.

ROS Action vs. ROS Service

A ROS service is intended for a relatively short request-response interaction.

A ROS action is designed for a task that takes longer and may need ongoing progress updates.

For example, asking a node to return a configuration value is a suitable service operation.

Requesting that a robot drive to a distant waypoint is better suited to an action.

The destination task may require several seconds or minutes and could need cancellation.

ROS Action vs. ROS Topic

A topic distributes messages through publish-subscribe communication.

An action manages a particular goal and its lifecycle.

For example, a camera node may publish images continuously through a topic.

The navigation system may use an action to manage a destination request.

The two interfaces can operate simultaneously within the same robot.

What Happens When an Action Fails?

The action server can report a result indicating that the requested task did not succeed.

For example, a navigation goal may fail because the destination is unreachable.

The action's result and status can help the requesting application determine the next step.

That might involve retrying, selecting another destination, or requesting human assistance.

However, the higher-level application must define that response.

Frequently Asked Questions

Can a ROS action be canceled?

Yes. ROS actions support cancellation requests, but the actual response depends on the server and task.

Can several action goals run simultaneously?

Some action servers support concurrent goals. Others may reject, defer, or replace requests according to their implementation.

The Bottom Line

ROS actions provide a structured way to manage robot tasks that take time, report progress, and may need interruption. They are particularly useful for navigation, manipulation, and other goal-oriented activities.

Sources

  1. ROS 2 — Actions Documentation
  2. ROS 2 — Working With Actions

Black Scarab Weekly

Follow the physical AI economy

Get Black Scarab news, deep research, and practical analysis in one clear Thursday briefing.

Weekly reporting and deep dives. Unsubscribe anytime. See our privacy notice.