Commit Graph
5 Commits
Author SHA1 Message Date
Jacob DahlandBalduin 791ba46833 refactor(msg): address CDR fields by offset in the generated serializers (#29546)
The generated ucdr_serialize/ucdr_deserialize functions advanced
buf.iterator and buf.offset after every field. Because the memcpy
through buf.iterator may alias the ucdrBuffer itself, the compiler had
to reload the iterator, store it back and update the offset in memory
for each field: four extra instructions per field, in every topic
forwarded by uxrce_dds_client.

Compute the CDR offset of each field in the generator instead, copy
relative to the position at entry, and advance the buffer once by the
topic size. The wire format and the final buffer state are unchanged; a
host test serializing and deserializing random data for all 259 topics
with the old and new headers gives identical bytes, structs and buffer
positions.

px4_fmu-v6x_default: 1929304 -> 1919176 bytes of text, -10128 B.

Assisted-by: Claude:claude-fable-5-1

Co-authored-by: Balduin <balduin@auterion.com>
2026-10-31 12:12:55 -06:00
Beat Küng f513c40d62 ucdr/msg.h.em: static inline the (de-)serialization methods
to avoid multiple definitions when using them from different places.
2023-11-15 13:18:58 +01:00
Beat Küng d4c7ea74ef refactor uxrce_dds_client: reduce amount of generated code for SendTopicsSubs
Reduces flash usage by ~4KB for current set of topics.
2023-08-21 20:56:08 -04:00
Daniel Agar 74130d7f71 ucdr msg template add timestamp protections
- if timestamp (or timestamp_sample) unpopulated fill it with current hrt_absolute_time()
 - if using provided timestamp don't allow it to exceed current hrt_absolute_time()
2023-03-02 09:52:53 -05:00
Daniel Agar cea185268e msg ROS2 compatibility, microdds_client improvements (timesync, reduced code size, added topics, etc), fastrtps purge
- update all msgs to be directly compatible with ROS2
 - microdds_client improvements
   - timesync
   - reduced code size
   - add to most default builds if we can afford it
   - lots of other little changes
 - purge fastrtps (I tried to save this multiple times, but kept hitting roadblocks)
2022-10-19 19:36:47 -04:00