Struct ros2_client::action::ActionClient

source ·
pub struct ActionClient<A>{ /* private fields */ }

Implementations§

source§

impl<A> ActionClient<A>

source

pub fn name(&self) -> &Name

source

pub fn goal_client( &mut self ) -> &mut Client<AService<SendGoalRequest<A::GoalType>, SendGoalResponse>>

source

pub fn cancel_client( &mut self ) -> &mut Client<AService<CancelGoalRequest, CancelGoalResponse>>

source

pub fn result_client( &mut self ) -> &mut Client<AService<GetResultRequest, GetResultResponse<A::ResultType>>>

source

pub fn feedback_subscription( &mut self ) -> &mut Subscription<FeedbackMessage<A::FeedbackType>>

source

pub fn status_subscription(&mut self) -> &mut Subscription<GoalStatusArray>

source

pub fn send_goal( &self, goal: A::GoalType ) -> WriteResult<(RmwRequestId, GoalId), ()>
where <A as ActionTypes>::GoalType: 'static,

Returns and id of the Request and id for the Goal. Request id can be used to recognize correct response from Action Server. Goal id is later used to communicate Goal status and result.

source

pub fn receive_goal_response( &self, req_id: RmwRequestId ) -> ReadResult<Option<SendGoalResponse>>
where <A as ActionTypes>::GoalType: 'static,

Receive a response for the specified goal request, or None if response is not yet available

source

pub async fn async_send_goal( &self, goal: A::GoalType ) -> Result<(GoalId, SendGoalResponse), CallServiceError<()>>
where <A as ActionTypes>::GoalType: 'static,

source

pub fn cancel_goal(&self, goal_id: GoalId) -> WriteResult<RmwRequestId, ()>

source

pub fn cancel_all_goals_before( &self, timestamp: Time ) -> WriteResult<RmwRequestId, ()>

source

pub fn cancel_all_goals(&self) -> WriteResult<RmwRequestId, ()>

source

pub fn receive_cancel_response( &self, cancel_request_id: RmwRequestId ) -> ReadResult<Option<CancelGoalResponse>>

source

pub fn async_cancel_goal( &self, goal_id: GoalId, timestamp: Time ) -> impl Future<Output = Result<CancelGoalResponse, CallServiceError<()>>> + '_

source

pub fn request_result(&self, goal_id: GoalId) -> WriteResult<RmwRequestId, ()>
where <A as ActionTypes>::ResultType: 'static,

source

pub fn receive_result( &self, result_request_id: RmwRequestId ) -> ReadResult<Option<(GoalStatusEnum, A::ResultType)>>
where <A as ActionTypes>::ResultType: 'static,

source

pub async fn async_request_result( &self, goal_id: GoalId ) -> Result<(GoalStatusEnum, A::ResultType), CallServiceError<()>>
where <A as ActionTypes>::ResultType: 'static,

Asynchronously request goal result. Result should be requested as soon as a goal is accepted. Result ia actually received only when Server informs that the goal has either Succeeded, or has been Canceled or Aborted.

source

pub fn receive_feedback( &self, goal_id: GoalId ) -> ReadResult<Option<A::FeedbackType>>
where <A as ActionTypes>::FeedbackType: 'static,

source

pub fn feedback_stream( &self, goal_id: GoalId ) -> impl FusedStream<Item = ReadResult<A::FeedbackType>> + '_
where <A as ActionTypes>::FeedbackType: 'static,

Receive asynchronous feedback stream of goal progress.

source

pub fn receive_status(&self) -> ReadResult<Option<GoalStatusArray>>

Note: This does not take GoalId and will therefore report status of all Goals.

source

pub async fn async_receive_status(&self) -> ReadResult<GoalStatusArray>

source

pub fn all_statuses_stream( &self ) -> impl FusedStream<Item = ReadResult<GoalStatusArray>> + '_

Async Stream of status updates Action server send updates containing status of all goals, hence an array.

source

pub fn status_stream( &self, goal_id: GoalId ) -> impl FusedStream<Item = ReadResult<GoalStatus>> + '_

Auto Trait Implementations§

§

impl<A> !Freeze for ActionClient<A>

§

impl<A> !RefUnwindSafe for ActionClient<A>

§

impl<A> Send for ActionClient<A>
where <A as ActionTypes>::FeedbackType: for<'de> Sized + Send, <A as ActionTypes>::ResultType: Sized + Send, <A as ActionTypes>::GoalType: Sized + Send,

§

impl<A> Sync for ActionClient<A>
where <A as ActionTypes>::FeedbackType: for<'de> Sized + Sync, <A as ActionTypes>::ResultType: Sized + Sync, <A as ActionTypes>::GoalType: Sized + Sync,

§

impl<A> Unpin for ActionClient<A>
where <A as ActionTypes>::FeedbackType: for<'de> Sized + Unpin, <A as ActionTypes>::ResultType: Sized + Unpin, <A as ActionTypes>::GoalType: Sized + Unpin,

§

impl<A> !UnwindSafe for ActionClient<A>

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>,

§

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>,

§

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