Skip to content
  • Home
  • About the Blog
  • About the Author
  • Sitemap

Abdur Rosyid's Blog

Just a few notes on mechanical engineering and robotics

ROS Action

July 9, 2021 by Abdur Rosyid

Different from ROS service which consists of request and response only, ROS action additionally provides feedback. An action consists off three main parts: request, feedback, and result (which is similar to response in service). While a service is appropriate to be used for a non-progressive task, an action is appropriate to be used for a progressive (long running) task, i.e. a task that needs some progress to achieve the goal. While a service has two parts in its .srv file, an action has three parts in its .action file: 1) goal, 2) result, and 3) feedback. In a dish-washing task, the .action file will look like this:

# Define the goal
uint32 dishwasher_id  # Specify which dishwasher we want to use
---
# Define the result
uint32 total_dishes_cleaned
---
# Define a feedback message
float32 percent_complete

Similar to service, an action also consists of an action server and an action client. The difference is in the communication mechanism between the server and the client. The mechanism in an action is the following:

  • The action client send a goal (request) to the action server.
  • The action server is performing the task requested. However, since the task is progressive, the action server gives feedback to the client on the progress of the task. The action server also sends the current status of the goaal.
  • The action client can cancel the task if it wants.
  • If the task is not cancelled and the task is complete, the action server sends the result to the action client.

The communication between the action client and server keeps running like topic communication until the action server completes the goal and send the result to the client, or the action client cancels its request. Therefore, an action can be seen as multiple topics:

  • goal – Used to send new goals to servers.
  • cancel – Used to send cancel requests to servers.
  • status – Used to notify clients on the current state of every goal in the system.
  • feedback – Used to send clients periodic auxiliary information for a goal.
  • result – Used to send clients one-time auxiliary information upon completion of a goal.

Post navigation

Previous Post:

Creating ROS1 Service in Python

Next Post:

Creating ROS1 Action

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • STEM 101
  • Robotics
  • Kinematics
  • Dynamics
  • Control
  • Robot Operating System (ROS)
  • Robot Operating System (ROS2)
  • Software Development
  • Mechanics of Materials
  • Finite Element Analysis
  • Fluid Mechanics
  • Thermodynamics

Recent Posts

  • Pull Request on Github
  • Basics of Git and Github
  • Conda vs Docker
  • A Conda Cheat Sheet
  • Installing NVIDIA GPU Driver on Ubuntu

Archives

  • June 2025
  • July 2021
  • June 2021
  • March 2021
  • September 2020
  • April 2020
  • January 2015
  • April 2014
  • March 2014
  • March 2012
  • February 2012
  • June 2011
  • March 2008
© 2026 Abdur Rosyid's Blog | WordPress Theme by Superbthemes