Skip to content

Real-time scheduling and QoS tuning for the driver #34

Description

@ebarnett3

Three independent tuning changes that share one goal: make the driver behave correctly under load on a real-time kernel.

  1. Modbus background thread at SCHED_FIFO priority 70 — above controller_manager, so the comm loop never blocks on lower-priority work.
  2. controller_manager update thread at SCHED_FIFO priority 90 — the usual convention for hard real-time control loops.
  3. /joint_states QoS overridden to BEST_EFFORT / VOLATILE / KEEP_LAST(1) — the sensor_data profile. Replaces the inherited RELIABLE / TRANSIENT_LOCAL default, which is wrong for a high-rate stream and costs unnecessary DDS bookkeeping.

Measured effect

On PREEMPT_RT (6.12.89-rt18) the SCHED_FIFO 70 setting trims ~190 µs per Modbus cycle (2.98 ms → 2.79 ms mean), measured end-to-end with modbus_cli against a 2F-85.

On a stock (non-RT) kernel the changes are harmless no-ops; PREEMPT_RT is the regime where they pay off.

Acceptance

  • modbus_cli --baud 230400 --period 2 --rt-priority 70 sustains ≥350 Hz with 100% successful cycles over a 10 s steady-state window on PREEMPT_RT.
  • colcon test --packages-select robotiq_driver robotiq_hardware_tests passes (host build, no hardware needed for the unit tests; --ctest-args -L hardware opts into the end-to-end ones).

No public API change — all of it is internal scheduling and QoS profile configuration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions