Skip to main content

Module action_frame

Module action_frame 

Source
Expand description

issue 2014 – the wire framing of action messages: one spelling of every payload offset. Wire framing of the action messages an action CLIENT takes off the wire — the ONE place their payload offsets are spelled (issue 2014).

The producer side (action_core::write_get_result_header, publish_feedback_raw) writes these frames with a CdrWriter, so its offsets fall out of align() and are never written down. Every CONSUMER used to spell them itself — the arena dispatch, the typed dispatch, the C and C++ polling paths, the C++ PollingActionClient header — and they disagreed: the header skipped 5 bytes of a get_result reply whose payload starts at 8, and the C poll path handed feedback fields to a callback with no encapsulation header while the arena handed it one.

Frames (all little-endian CDR, top-level encapsulation header first):

  • SendGoal reply: [encap 4][accepted u8][stamp …]
  • GetResult reply: [encap 4][status i8][pad to 4 → byte 8][result fields]
  • FeedbackMessage: [encap 4][GoalUuid.uuid 16][feedback fields]
  • SendGoal request (server side): [encap 4][GoalUuid.uuid 16][goal fields]
  • CancelGoal reply: [encap 4][return_code i8][pad to 4 → byte 8][count u32] [GoalInfo { uuid 16, stamp.sec i32, stamp.nanosec u32 } × count]

The payload fields arrive WITHOUT an encapsulation header of their own on every backend (RFC-0069 / issue 0418), and every deserializer reads with new_with_header, so a consumer splices the frame’s own top-level header in front of them. That is the shape every callback receives.

Constants§

CANCEL_GOALS_COUNT_OFFSET
Byte holding the goals_canceling sequence length of a CancelGoal reply: the i8 return code, then CDR alignment to 4 (issue 2027).
CANCEL_GOALS_OFFSET
First GoalInfo of a CancelGoal reply’s goals_canceling.
CDR_HEADER_LEN
Length of a CDR encapsulation header.
FEEDBACK_PAYLOAD_OFFSET
First byte of the feedback fields in a FeedbackMessage: the GoalUuid UUID (uint8[16], no length prefix since 233.6) follows the header.
GOAL_INFO_LEN
One action_msgs/msg/GoalInfo on the wire: the UUID (uint8[16]), then builtin_interfaces/Time (int32 sec, uint32 nanosec, 4-aligned, which 16 bytes in already is).
GOAL_REQUEST_PAYLOAD_OFFSET
First byte of the goal fields in a SendGoal request — the same framing as feedback: the GoalUuid follows the header.
REPLY_STATUS_OFFSET
Byte holding the accepted flag of a SendGoal reply and the status of a GetResult reply — the first field after the encapsulation header.
RESULT_PAYLOAD_OFFSET
First byte of the result fields in a GetResult reply: the i8 status, then CDR alignment to 4 (stream position 4 = byte 8).

Functions§

cancel_goal_info
The i-th GoalInfo of a CancelGoal reply’s goals_canceling: the goal and its acceptance stamp (sec, nanosec). None past the count (or on a short frame).
cancel_goals_count
How many goals a CancelGoal reply says are canceling — issue 2027. None when the frame is too short to hold the count, or the count names more GoalInfos than the frame carries (a truncation is not “none”).
cancel_return_code
The return_code of a CancelGoal reply (None for a short frame).
feedback_fields
The feedback fields of a FeedbackMessage, without any header. None when the frame carries no fields at all — an empty feedback is not delivered, which is what every consumer did before this helper existed.
feedback_goal_id
The goal UUID a FeedbackMessage names (None for a short frame).
goal_accepted
The accepted flag of a SendGoal reply (false for a short frame).
goal_request_fields
The goal fields of a SendGoal request, without any header (None when the frame carries no fields).
result_fields
The result fields of a GetResult reply, without any header (None when the frame is shorter than RESULT_PAYLOAD_OFFSET).
result_status
The terminal status of a GetResult reply, or None when the frame is too short to hold a result (shorter than RESULT_PAYLOAD_OFFSET). Anything but Succeeded / Canceled / Aborted reads as Unknown.
splice
Write frame’s own encapsulation header followed by fields into out, truncating fields to what fits. Returns the bytes written, or None when frame has no header or out cannot hold one.
splice_feedback
A FeedbackMessage’s feedback, header-framed for a deserializer.
splice_goal_request
A SendGoal request’s goal, header-framed for a deserializer.
splice_result
A GetResult reply’s result, header-framed for a deserializer.