Skip to main content

ActionClientCore

Struct ActionClientCore 

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

Type-agnostic action client core handling the raw-bytes protocol.

The typed ActionClient wraps this and adds serialization/deserialization at the boundary.

Implementations§

Source§

impl<const GOAL_BUF: usize, const RESULT_BUF: usize, const FEEDBACK_BUF: usize> ActionClientCore<GOAL_BUF, RESULT_BUF, FEEDBACK_BUF>

Source

pub fn start_server_discovery( &mut self, timeout_ms: u32, ) -> Result<(), TransportError>

Begin a server-discovery probe on the underlying send_goal service client. Used by the C action-client wrapper (nros_action_client_wait_for_action_server) to keep send_goal_client private while still exposing the discovery surface from ServiceClientTrait.

Source

pub fn poll_server_discovery(&mut self) -> Result<Option<bool>, TransportError>

Poll the in-flight server-discovery probe started by start_server_discovery.

Source

pub fn is_server_ready(&self) -> bool

Latched “is server visible” snapshot. See ActionClient::action_server_is_ready for the semantic.

Source

pub fn new( send_goal_client: <CffiSession as Session>::ServiceClientHandle, cancel_goal_client: <CffiSession as Session>::ServiceClientHandle, get_result_client: <CffiSession as Session>::ServiceClientHandle, feedback_subscriber: <CffiSession as Session>::SubscriberHandle, ) -> ActionClientCore<GOAL_BUF, RESULT_BUF, FEEDBACK_BUF>

Create a new action client core from the raw transport handles.

Source

pub fn send_goal_raw(&mut self, goal_cdr: &[u8]) -> Result<GoalId, NodeError>

Send a goal with raw CDR bytes. Returns the generated GoalId.

The goal_cdr bytes are the serialized goal data (without GoalId framing). This writes GoalId + goal_cdr into the goal buffer and sends the request.

After calling, use send_goal_client and result_buffer to construct a Promise for the acceptance reply.

Source

pub fn send_goal_blocking( &mut self, goal_cdr: &[u8], ) -> Result<(GoalId, bool), NodeError>

Send a goal (blocking). Returns the GoalId and whether it was accepted.

Uses the blocking call_raw path (like service calls) so the send_goal z_get is fully consumed before returning. This avoids leaving a pending get slot that could interfere with subsequent blocking calls.

Source

pub fn try_recv_feedback_raw( &mut self, ) -> Result<Option<(GoalId, usize)>, NodeError>

Try to receive feedback (non-blocking, raw bytes).

Returns the GoalId and total data length. The full CDR data (including GoalId) is in feedback_buffer.

Source

pub fn send_cancel_request(&mut self, goal_id: &GoalId) -> Result<(), NodeError>

Cancel a goal (non-blocking). Sends the cancel request.

After calling, use cancel_goal_client and result_buffer to construct a Promise for the cancel response.

Source

pub fn send_get_result_request( &mut self, goal_id: &GoalId, ) -> Result<(), NodeError>

Send a get_result request.

After calling, use get_result_client and result_buffer to construct a Promise for the result response.

Source

pub fn register_goal_response_waker(&self, waker: &Waker)

Phase 122.3.c.6.e — register a Waker that fires when the send_goal RPC reply lands.

Source

pub fn register_cancel_response_waker(&self, waker: &Waker)

Phase 122.3.c.6.e — register a Waker for cancel-RPC replies.

Source

pub fn register_result_waker(&self, waker: &Waker)

Phase 122.3.c.6.e — register a Waker for get_result replies.

Source

pub fn register_feedback_waker(&self, waker: &Waker)

Phase 122.3.c.6.e — register a Waker for feedback messages.

Source

pub fn try_recv_cancel_reply(&mut self) -> Result<Option<usize>, NodeError>

Phase 122.3.c.6.c — poll for a cancel reply (non-blocking, raw bytes). Returns Ok(Some(len)) when a reply landed; the CDR payload is in result_buffer_ref()[..len]. Reply layout is action_msgs/srv/CancelGoal_Response wire CDR.

Source

pub fn try_recv_get_result_reply(&mut self) -> Result<Option<usize>, NodeError>

Poll for a get_result reply (non-blocking, raw bytes).

Returns Ok(Some(total_len)) if a reply arrived (data in result buffer), Ok(None) if no reply yet.

After receiving, use result_buffer_ref() to access the raw CDR data. The layout is: CDR header (4) + status byte (1) + result data.

Source

pub fn try_recv_send_goal_reply(&mut self) -> Result<Option<usize>, NodeError>

Poll for the send_goal acceptance reply (non-blocking, raw bytes).

Returns Ok(Some(total_len)) if a reply arrived (data in result buffer), Ok(None) if no reply yet.

The reply CDR contains: header (4) + accepted (u8) + stamp (i32 + u32).

Source

pub fn get_result_blocking( &mut self, goal_id: &GoalId, ) -> Result<usize, NodeError>

Blocking get_result request — sends the request and blocks until a reply is received (or timeout).

Returns the total reply length. Data is stored in result_buffer. This uses the blocking call_raw path which is more reliable on platforms with separate I/O tasks (e.g. FreeRTOS).

Source

pub fn result_buffer_ref(&self) -> &[u8]

Read-only access to the result buffer (after polling a reply).

Source

pub fn feedback_buffer_ref(&self) -> &[u8]

Read-only access to the feedback buffer (after receiving feedback).

Source

pub fn goal_counter(&self) -> u64

Get the current goal counter (used to reconstruct the last goal ID).

Auto Trait Implementations§

§

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

§

impl<const GOAL_BUF: usize, const RESULT_BUF: usize, const FEEDBACK_BUF: usize> RefUnwindSafe for ActionClientCore<GOAL_BUF, RESULT_BUF, FEEDBACK_BUF>

§

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

§

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

§

impl<const GOAL_BUF: usize, const RESULT_BUF: usize, const FEEDBACK_BUF: usize> Unpin for ActionClientCore<GOAL_BUF, RESULT_BUF, FEEDBACK_BUF>

§

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

§

impl<const GOAL_BUF: usize, const RESULT_BUF: usize, const FEEDBACK_BUF: usize> UnwindSafe for ActionClientCore<GOAL_BUF, RESULT_BUF, FEEDBACK_BUF>

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.