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>
impl<const GOAL_BUF: usize, const RESULT_BUF: usize, const FEEDBACK_BUF: usize> ActionClientCore<GOAL_BUF, RESULT_BUF, FEEDBACK_BUF>
Sourcepub fn start_server_discovery(
&mut self,
timeout_ms: u32,
) -> Result<(), TransportError>
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.
Sourcepub fn poll_server_discovery(&mut self) -> Result<Option<bool>, TransportError>
pub fn poll_server_discovery(&mut self) -> Result<Option<bool>, TransportError>
Poll the in-flight server-discovery probe started by
start_server_discovery.
Sourcepub fn is_server_ready(&self) -> bool
pub fn is_server_ready(&self) -> bool
Latched “is server visible” snapshot. See
ActionClient::action_server_is_ready for the semantic.
Sourcepub 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>
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.
Sourcepub fn send_goal_raw(&mut self, goal_cdr: &[u8]) -> Result<GoalId, NodeError>
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.
Sourcepub fn send_goal_blocking(
&mut self,
goal_cdr: &[u8],
) -> Result<(GoalId, bool), NodeError>
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.
Sourcepub fn try_recv_feedback_raw(
&mut self,
) -> Result<Option<(GoalId, usize)>, NodeError>
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.
Sourcepub fn send_cancel_request(&mut self, goal_id: &GoalId) -> Result<(), NodeError>
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.
Sourcepub fn send_get_result_request(
&mut self,
goal_id: &GoalId,
) -> Result<(), NodeError>
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.
Sourcepub fn register_goal_response_waker(&self, waker: &Waker)
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.
Sourcepub fn register_cancel_response_waker(&self, waker: &Waker)
pub fn register_cancel_response_waker(&self, waker: &Waker)
Phase 122.3.c.6.e — register a Waker for cancel-RPC replies.
Sourcepub fn register_result_waker(&self, waker: &Waker)
pub fn register_result_waker(&self, waker: &Waker)
Phase 122.3.c.6.e — register a Waker for get_result replies.
Sourcepub fn register_feedback_waker(&self, waker: &Waker)
pub fn register_feedback_waker(&self, waker: &Waker)
Phase 122.3.c.6.e — register a Waker for feedback messages.
Sourcepub fn try_recv_cancel_reply(&mut self) -> Result<Option<usize>, NodeError>
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.
Sourcepub fn try_recv_get_result_reply(&mut self) -> Result<Option<usize>, NodeError>
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.
Sourcepub fn try_recv_send_goal_reply(&mut self) -> Result<Option<usize>, NodeError>
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).
Sourcepub fn get_result_blocking(
&mut self,
goal_id: &GoalId,
) -> Result<usize, NodeError>
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).
Sourcepub fn result_buffer_ref(&self) -> &[u8] ⓘ
pub fn result_buffer_ref(&self) -> &[u8] ⓘ
Read-only access to the result buffer (after polling a reply).
Sourcepub fn feedback_buffer_ref(&self) -> &[u8] ⓘ
pub fn feedback_buffer_ref(&self) -> &[u8] ⓘ
Read-only access to the feedback buffer (after receiving feedback).
Sourcepub fn goal_counter(&self) -> u64
pub fn goal_counter(&self) -> u64
Get the current goal counter (used to reconstruct the last goal ID).