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):
SendGoalreply:[encap 4][accepted u8][stamp …]GetResultreply:[encap 4][status i8][pad to 4 → byte 8][result fields]FeedbackMessage:[encap 4][GoalUuid.uuid 16][feedback fields]SendGoalrequest (server side):[encap 4][GoalUuid.uuid 16][goal fields]CancelGoalreply:[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_cancelingsequence length of aCancelGoalreply: thei8return code, then CDR alignment to 4 (issue 2027). - CANCEL_
GOALS_ OFFSET - First
GoalInfoof aCancelGoalreply’sgoals_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/GoalInfoon the wire: the UUID (uint8[16]), thenbuiltin_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
SendGoalrequest — the same framing as feedback: the GoalUuid follows the header. - REPLY_
STATUS_ OFFSET - Byte holding the
acceptedflag of aSendGoalreply and thestatusof aGetResultreply — the first field after the encapsulation header. - RESULT_
PAYLOAD_ OFFSET - First byte of the result fields in a
GetResultreply: thei8status, then CDR alignment to 4 (stream position 4 = byte 8).
Functions§
- cancel_
goal_ info - The
i-thGoalInfoof aCancelGoalreply’sgoals_canceling: the goal and its acceptance stamp(sec, nanosec).Nonepast the count (or on a short frame). - cancel_
goals_ count - How many goals a
CancelGoalreply says are canceling — issue 2027.Nonewhen the frame is too short to hold the count, or the count names moreGoalInfos than the frame carries (a truncation is not “none”). - cancel_
return_ code - The
return_codeof aCancelGoalreply (Nonefor a short frame). - feedback_
fields - The feedback fields of a
FeedbackMessage, without any header.Nonewhen 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
FeedbackMessagenames (Nonefor a short frame). - goal_
accepted - The
acceptedflag of aSendGoalreply (falsefor a short frame). - goal_
request_ fields - The goal fields of a
SendGoalrequest, without any header (Nonewhen the frame carries no fields). - result_
fields - The result fields of a
GetResultreply, without any header (Nonewhen the frame is shorter thanRESULT_PAYLOAD_OFFSET). - result_
status - The terminal status of a
GetResultreply, orNonewhen the frame is too short to hold a result (shorter thanRESULT_PAYLOAD_OFFSET). Anything but Succeeded / Canceled / Aborted reads asUnknown. - splice
- Write
frame’s own encapsulation header followed byfieldsintoout, truncatingfieldsto what fits. Returns the bytes written, orNonewhenframehas no header oroutcannot hold one. - splice_
feedback - A
FeedbackMessage’s feedback, header-framed for a deserializer. - splice_
goal_ request - A
SendGoalrequest’s goal, header-framed for a deserializer. - splice_
result - A
GetResultreply’s result, header-framed for a deserializer.