Skip to main content

Module action

Module action 

Source
Expand description

ROS 2 Action types

Actions provide asynchronous goal-based communication with feedback. An action client sends a goal to an action server, which executes the goal and provides feedback during execution and a result upon completion.

§Action Communication Pattern

Actions use 5 underlying communication channels:

  • send_goal service: Submit a new goal
  • cancel_goal service: Request cancellation
  • get_result service: Retrieve final result
  • feedback topic: Progress updates during execution
  • status topic: Goal state transitions

§Example

use nros_core::{RosAction, GoalStatus};

// Define an action type
struct Fibonacci;

impl RosAction for Fibonacci {
    type Goal = FibonacciGoal;
    type Result = FibonacciResult;
    type Feedback = FibonacciFeedback;

    const ACTION_NAME: &'static str = "example_interfaces::action::dds_::Fibonacci_";
    const ACTION_HASH: &'static str = "...";
}

Structs§

ActionClient
Action client handle (type-level marker)
ActionServer
Action server handle (type-level marker)
GoalId
Unique identifier for a goal
GoalInfo
Information about a goal
GoalStatusStamped
Goal status with associated goal info

Enums§

CancelResponse
Cancel goal response codes
GoalResponse
Goal accept/reject response codes
GoalStatus
Goal status states

Traits§

RosAction
Trait for ROS 2 action types