Struct ros2_client::action::ActionClient
source · pub struct ActionClient<A>where
A: ActionTypes,
A::GoalType: Message + Clone,
A::ResultType: Message + Clone,
A::FeedbackType: Message,{ /* private fields */ }
Implementations§
source§impl<A> ActionClient<A>where
A: ActionTypes,
A::GoalType: Message + Clone,
A::ResultType: Message + Clone,
A::FeedbackType: Message,
impl<A> ActionClient<A>where
A: ActionTypes,
A::GoalType: Message + Clone,
A::ResultType: Message + Clone,
A::FeedbackType: Message,
pub fn name(&self) -> &Name
pub fn goal_client( &mut self ) -> &mut Client<AService<SendGoalRequest<A::GoalType>, SendGoalResponse>>
pub fn cancel_client( &mut self ) -> &mut Client<AService<CancelGoalRequest, CancelGoalResponse>>
pub fn result_client( &mut self ) -> &mut Client<AService<GetResultRequest, GetResultResponse<A::ResultType>>>
pub fn feedback_subscription( &mut self ) -> &mut Subscription<FeedbackMessage<A::FeedbackType>>
pub fn status_subscription(&mut self) -> &mut Subscription<GoalStatusArray>
sourcepub fn send_goal(
&self,
goal: A::GoalType
) -> WriteResult<(RmwRequestId, GoalId), ()>where
<A as ActionTypes>::GoalType: 'static,
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.
sourcepub fn receive_goal_response(
&self,
req_id: RmwRequestId
) -> ReadResult<Option<SendGoalResponse>>where
<A as ActionTypes>::GoalType: 'static,
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
pub async fn async_send_goal(
&self,
goal: A::GoalType
) -> Result<(GoalId, SendGoalResponse), CallServiceError<()>>where
<A as ActionTypes>::GoalType: 'static,
pub fn cancel_goal(&self, goal_id: GoalId) -> WriteResult<RmwRequestId, ()>
pub fn cancel_all_goals_before( &self, timestamp: Time ) -> WriteResult<RmwRequestId, ()>
pub fn cancel_all_goals(&self) -> WriteResult<RmwRequestId, ()>
pub fn receive_cancel_response( &self, cancel_request_id: RmwRequestId ) -> ReadResult<Option<CancelGoalResponse>>
pub fn async_cancel_goal( &self, goal_id: GoalId, timestamp: Time ) -> impl Future<Output = Result<CancelGoalResponse, CallServiceError<()>>> + '_
pub fn request_result(&self, goal_id: GoalId) -> WriteResult<RmwRequestId, ()>where
<A as ActionTypes>::ResultType: 'static,
pub fn receive_result(
&self,
result_request_id: RmwRequestId
) -> ReadResult<Option<(GoalStatusEnum, A::ResultType)>>where
<A as ActionTypes>::ResultType: 'static,
sourcepub async fn async_request_result(
&self,
goal_id: GoalId
) -> Result<(GoalStatusEnum, A::ResultType), CallServiceError<()>>where
<A as ActionTypes>::ResultType: 'static,
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.
pub fn receive_feedback(
&self,
goal_id: GoalId
) -> ReadResult<Option<A::FeedbackType>>where
<A as ActionTypes>::FeedbackType: 'static,
sourcepub fn feedback_stream(
&self,
goal_id: GoalId
) -> impl FusedStream<Item = ReadResult<A::FeedbackType>> + '_where
<A as ActionTypes>::FeedbackType: 'static,
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.
sourcepub fn receive_status(&self) -> ReadResult<Option<GoalStatusArray>>
pub fn receive_status(&self) -> ReadResult<Option<GoalStatusArray>>
Note: This does not take GoalId and will therefore report status of all Goals.
pub async fn async_receive_status(&self) -> ReadResult<GoalStatusArray>
sourcepub fn all_statuses_stream(
&self
) -> impl FusedStream<Item = ReadResult<GoalStatusArray>> + '_
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.
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more