Skip to main content

ActionClient

Struct ActionClient 

Source
pub struct ActionClient<A, const GOAL_BUF: usize = nros_node::::executor::handles::ActionClient::{constant#0}, const RESULT_BUF: usize = nros_node::::executor::handles::ActionClient::{constant#1}, const FEEDBACK_BUF: usize = nros_node::::executor::handles::ActionClient::{constant#2}>
where A: RosAction,
{ /* private fields */ }
Expand description

Typed action client handle.

Wraps ActionClientCore for raw-bytes protocol handling, adding typed goal/feedback/result serialization at the boundary.

Implementations§

Source§

impl<A, const GOAL_BUF: usize, const RESULT_BUF: usize, const FEEDBACK_BUF: usize> ActionClient<A, GOAL_BUF, RESULT_BUF, FEEDBACK_BUF>
where A: RosAction,

Source

pub fn send_goal( &mut self, goal: &<A as RosAction>::Goal, ) -> Result<(GoalId, Promise<'_, bool>), NodeError>

Send a goal (non-blocking). Returns the goal ID and a Promise for acceptance.

The promise resolves to true if accepted, false if rejected.

Source

pub fn try_recv_feedback( &mut self, ) -> Result<Option<(GoalId, <A as RosAction>::Feedback)>, NodeError>

Try to receive feedback (non-blocking).

Source

pub fn cancel_goal( &mut self, goal_id: &GoalId, ) -> Result<Promise<'_, CancelResponse>, NodeError>

Cancel a goal (non-blocking). Returns a Promise for the cancel response.

Source

pub fn get_result( &mut self, goal_id: &GoalId, ) -> Result<Promise<'_, (GoalStatus, <A as RosAction>::Result)>, NodeError>

Get the result of a completed goal (non-blocking). Returns a Promise.

Source

pub fn reset_send_goal_in_flight(&mut self)

Explicitly clear the “send_goal reply in flight” flag (Phase 84.D3).

Source

pub fn wait_for_action_server( &mut self, executor: &mut Executor, timeout: Duration, ) -> Result<bool, NodeError>

Block until the action server’s send-goal queryable is discoverable on the network, or timeout elapses.

Returns Ok(true) on discovery, Ok(false) on timeout. Mirrors rclcpp_action::Client::wait_for_action_server.

Implementation: probes the action’s send_goal service-server liveliness keyexpr via the same primitive as [Client::wait_for_service]. Once that service is reachable the remaining four action entities (cancel queryable + feedback / status / result publishers) are also reachable in practice — they were declared by the same server in one batch.

Source

pub fn action_server_is_ready(&self) -> bool

Snapshot whether the action server is currently visible. Mirrors rclcpp_action::Client::action_server_is_ready.

Source

pub fn reset_cancel_in_flight(&mut self)

Explicitly clear the “cancel reply in flight” flag (Phase 84.D3).

Source

pub fn reset_get_result_in_flight(&mut self)

Explicitly clear the “get_result reply in flight” flag (Phase 84.D3).

Source

pub fn feedback_stream( &mut self, ) -> FeedbackStream<'_, A, GOAL_BUF, RESULT_BUF, FEEDBACK_BUF>

Create a feedback stream (receives feedback for all goals).

The stream borrows &mut self exclusively. Drop it before calling get_result() or cancel_goal().

Source

pub fn feedback_stream_for( &mut self, goal_id: GoalId, ) -> GoalFeedbackStream<'_, A, GOAL_BUF, RESULT_BUF, FEEDBACK_BUF>

Create a goal-filtered feedback stream.

Only yields feedback for the given goal_id, returning A::Feedback directly (without the GoalId wrapper).

Auto Trait Implementations§

§

impl<A, const GOAL_BUF: usize, const RESULT_BUF: usize, const FEEDBACK_BUF: usize> Freeze for ActionClient<A, GOAL_BUF, RESULT_BUF, FEEDBACK_BUF>

§

impl<A, const GOAL_BUF: usize, const RESULT_BUF: usize, const FEEDBACK_BUF: usize> RefUnwindSafe for ActionClient<A, GOAL_BUF, RESULT_BUF, FEEDBACK_BUF>
where A: RefUnwindSafe,

§

impl<A, const GOAL_BUF: usize = nros_node::::executor::handles::ActionClient::{constant#0}, const RESULT_BUF: usize = nros_node::::executor::handles::ActionClient::{constant#1}, const FEEDBACK_BUF: usize = nros_node::::executor::handles::ActionClient::{constant#2}> !Send for ActionClient<A, GOAL_BUF, RESULT_BUF, FEEDBACK_BUF>

§

impl<A, const GOAL_BUF: usize = nros_node::::executor::handles::ActionClient::{constant#0}, const RESULT_BUF: usize = nros_node::::executor::handles::ActionClient::{constant#1}, const FEEDBACK_BUF: usize = nros_node::::executor::handles::ActionClient::{constant#2}> !Sync for ActionClient<A, GOAL_BUF, RESULT_BUF, FEEDBACK_BUF>

§

impl<A, const GOAL_BUF: usize, const RESULT_BUF: usize, const FEEDBACK_BUF: usize> Unpin for ActionClient<A, GOAL_BUF, RESULT_BUF, FEEDBACK_BUF>
where A: Unpin,

§

impl<A, const GOAL_BUF: usize, const RESULT_BUF: usize, const FEEDBACK_BUF: usize> UnsafeUnpin for ActionClient<A, GOAL_BUF, RESULT_BUF, FEEDBACK_BUF>

§

impl<A, const GOAL_BUF: usize, const RESULT_BUF: usize, const FEEDBACK_BUF: usize> UnwindSafe for ActionClient<A, GOAL_BUF, RESULT_BUF, FEEDBACK_BUF>
where A: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.