Skip to content

Conversation

@nanwanuser
Copy link

  • Avoid double-close of transport fd on deinit
  • Reduce loop latency and drain inbound bursts
  • Batch best-effort output flush and handle buffer-full
  • Lower default uORB->DDS poll interval to allow higher /fmu/out rates

Solved Problem

Relates to #26160

High-rate ROS 2 -> PX4 traffic over Ethernet/UDP (uXRCE-DDS) can cause uxrce_dds_client to stall:

  • /fmu/out/* topics stop publishing
  • uxrce_dds_client status stops updating (counters frozen)
  • PX4 stops sending UDP data and does not recover after stopping ROS 2 publishers (reboot required in my tests)

This PR is primarily intended to surface the issue upstream and contribute one mitigation/fix approach I tested on PX4 v1.16.0.

Solution

  • Avoid potential double-close of the transport fd in deinit() (let the transport close its own fd)
  • Configure UDP socket as non-blocking (FIONBIO) to prevent blocking send() under heavy inbound load
  • Reduce loop latency (short uORB poll timeout; avoid blocking when transport has pending data)
  • Drain inbound bursts by running uxr_run_session_timeout() multiple times per loop while data is pending
  • In DDS topic bridge, batch best-effort flush and retry once on UXR_INVALID_REQUEST_ID to handle output buffer full
  • Lower default uORB->DDS poll interval to 4 ms (~250 Hz) to raise the default /fmu/out/* forwarding rate ceiling.
    Rationale: the system already supports high-rate /fmu/out/* publishing, but the previous default poll/forwarding interval (10 ms) effectively capped the default forwarding rate; reducing it increases the maximum forwarding rate available out of the box and helps keep /fmu/out/* rates stable under high
    inbound /fmu/in/* load.

Changelog Entry

For release notes:

Bugfix: uxrce_dds_client: avoid stalls under high UDP load and improve throughput under bursts

Alternatives

  • Reduce ROS 2 publish rate / add throttling on application level
  • Increase XRCE stream buffer sizes (if feasible on target)

Test coverage

  • PX4 v1.16.0: build succeeded and the stall was mitigated in my setup.
  • main: make px4_fmu-v6x (note: current main hits FLASH overflow in my environment; this change adds ~136 bytes in .text).
  • Bench test:
    • board: px4_fmu-v6x
    • ROS 2: Humble
    • publish set: /fmu/in/actuator_motors
    • rate: 1200 Hz
    • result: no stall and /fmu/out/* rates stable

Context

- Avoid double-close of transport fd on deinit\n- Reduce loop latency and drain inbound bursts\n- Batch best-effort output flush and handle buffer-full\n- Lower default uORB->DDS poll interval to allow higher /fmu/out rates
@beniaminopozzan beniaminopozzan self-requested a review December 21, 2025 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant