Offboard Control via target position/attitude setpoints

I’m trying to enable offboard control for a drone using PX4 autopilot by sending target attitude setpoints but need a better understanding of PX4’s underlying urob topic pub/sub structure.

What module handles incoming mavlink commands for setting a target local position and broadcasts it over uorb to the mc position controller? Do uorb topics only hold one data struct at a time? Is the position control loop frequency just causing it to miss the setpoints that get overwritten in that case?

I’ve started flying in offboard mode by sending local position ned targets. It works, but I’m sending trajectory setpoints to the autopilot at 30 Hz and it appears to only get published internally to the position controller at 5 Hz.

Can I control the rates at which trajectory_setpoint and vehicle_local_position get published internally, and if so how?

Right now these appear to be the limits for broadcast frequencies of the following uorb topics:
trajectory_setpoint - 5 Hz (regardless of frequency I send)
vehicle_local_position - 10 Hz
vehicle_attitude - 20 Hz
vehicle_angular_velocity - 50 Hz

Are these expected values? Does this mean that offboard attitude control is limited to 20 Hz?

I don’t think that it’s limited by uorb publishing, loop that receives, processes and publishes messages is 100Hz:

It might be limited by mavlink bandwidth settings.
You can try modifying MAV_0_RATE, or increasing baud rate.

But in any case you should not need higher setpoint frequency. Control signal would be smoothed by PIDs anyways, so in practice there would be no difference in 10Hz vs 30Hz setypoints.

You can check this from the logs – most likely delays of actuators reactions would be because of smoothing, and not because of control frequency.

Thanks for you response! Reading the mavlink_receiver code really helped my understanding of how mavlink messages get parsed and published.

The problem wasn’t actually a problem at all. Turns out I was logging with default settings and I didn’t know default settings limit uorb subscription rates for logged control topics so my assumed control frequencies (calculated from log data) were not the actual ones. My trajectory setpoints were getting through at 30 Hz, I just couldn’t see that in the logs