Struct AsyncActionServer

Source
pub struct AsyncActionServer<A>{ /* private fields */ }
Expand description

ROS 2 Action Server - Asynchronous version.

Implementations§

Source§

impl<A> AsyncActionServer<A>

Source

pub fn new(actionserver: ActionServer<A>) -> Self

Source

pub fn get_new_goal( &self, handle: NewGoalHandle<A::GoalType>, ) -> Option<A::GoalType>

Source

pub async fn receive_new_goal(&self) -> ReadResult<NewGoalHandle<A::GoalType>>
where <A as ActionTypes>::GoalType: 'static,

Receive a new goal from an action client. Server should immediately either accept or reject the goal.

Source

pub async fn accept_goal( &self, handle: NewGoalHandle<A::GoalType>, ) -> Result<AcceptedGoalHandle<A::GoalType>, GoalError<()>>
where A::GoalType: 'static,

Convert a newly received goal into a accepted goal, i.e. accept it for execution later. Client will be notified of acceptance. Note: Once the goal is accepted, the server must eventually call .send_result_response() even if the goal is canceled or aborted.

Source

pub async fn reject_goal( &self, handle: NewGoalHandle<A::GoalType>, ) -> Result<(), GoalError<()>>
where A::GoalType: 'static,

Reject a received goal. Client will be notified of rejection. Server should not process the goal further.

Source

pub async fn start_executing_goal( &self, handle: AcceptedGoalHandle<A::GoalType>, ) -> Result<ExecutingGoalHandle<A::GoalType>, GoalError<()>>

Convert an accepted goal into a expecting goal, i.e. start the execution. Executing goal can publish feedback.

Source

pub async fn publish_feedback( &self, handle: ExecutingGoalHandle<A::GoalType>, feedback: A::FeedbackType, ) -> Result<(), GoalError<FeedbackMessage<A::FeedbackType>>>

Publish feedback on how the execution is proceeding.

Source

pub async fn send_result_response( &self, handle: ExecutingGoalHandle<A::GoalType>, result_status: GoalEndStatus, result: A::ResultType, ) -> Result<(), GoalError<()>>
where A::ResultType: 'static,

Notify Client that a goal end state was reached and what was the result of the action. This async will not resolve until the action client has requested for the result, but the client should request the result as soon as server accepts the goal.

Source

pub async fn abort_executing_goal( &self, handle: ExecutingGoalHandle<A::GoalType>, ) -> Result<(), GoalError<()>>

Abort goal execution, because action server has determined it cannot continue execution.

Source

pub async fn abort_accepted_goal( &self, handle: AcceptedGoalHandle<A::GoalType>, ) -> Result<(), GoalError<()>>

Source

pub async fn receive_cancel_request(&self) -> ReadResult<CancelHandle>

Receive a set of cancel requests from the action client. The server should now respond either by accepting (some of) the cancel requests or rejecting all of them. The GoalIds that are requested to be cancelled can be currently at either accepted or executing state.

Source

pub async fn respond_to_cancel_requests( &self, cancel_handle: &CancelHandle, goals_to_cancel: impl Iterator<Item = GoalId>, ) -> WriteResult<(), ()>

Respond to action client’s cancel requests. The iterator of goals should list those GoalIds that will start canceling. For the other GoalIds, the cancel is not accepted and they do not change their state.

Auto Trait Implementations§

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more