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_goalservice: Submit a new goalcancel_goalservice: Request cancellationget_resultservice: Retrieve final resultfeedbacktopic: Progress updates during executionstatustopic: 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§
- Action
Client - Action client handle (type-level marker)
- Action
Server - Action server handle (type-level marker)
- GoalId
- Unique identifier for a goal
- Goal
Info - Information about a goal
- Goal
Status Stamped - Goal status with associated goal info
Enums§
- Cancel
Response - Cancel goal response codes
- Goal
Response - Goal accept/reject response codes
- Goal
Status - Goal status states
Traits§
- RosAction
- Trait for ROS 2 action types