Vtol mag/baro questions

good afternoon,

I am trying to enable standard VTOL HITL sim in gazebo classic. I am running on voxl2 by modalai in their provided gazebo docker, so I understand that it is a niche setup question. However, I have been getting constant timeout errors for MAG#0 and BARO#0. This makes the vehicle freak out. Notably, when I launch the simulator for a multicopter frame with identical parameters on my PX4, the error does not come up.

I am trying to narrow down the possible cause of the problem and I wonder if there is some difference in how PX4 handles baro/mag data for vtol frame vs quad frame. If not, is there something about standard gazebo classic that differs when running vtol vs multicopter frame?

Some of the things I have looked into so far:

  • publication rates for mag/baro by gazebo are 80Hz and 40Hz respectively for both vtol and multicopter frame.
  • PX4 logs show “sensor_mag” data at 1Hz and “vehicle_magnetometer” at 2Hz for both vtol and multi copter frames. Not sure why such inconsistency.
  • tried enabling and disabling vtol modules on PX4. Specifically, fw_att_control,fw_pos_control, fw_rate_control, vtol_att_control. This seems to have no influence on the data flow and the timeout error. Only the airframe type loaded in gazebo seems to be affecting.
  • I tried changing EKF2_MAG_DELAY and EKF2_MAG_CHECK params - no effect.
  • Tried adjusting baud rate at which gazebo is communicating mag/baro data to 200Hz/100HZ respcetfully - no effect.
  • Lastly, tried adjusting mavlink communication rate on the voxl2 - also no effect.

Some of the next steps I am planning to take:

  • try ethernet connection
  • if I find how to increase timeout threshold in px4 sourcecode I will try rebuilding my px4 firmware with greater timeout tolerance

Some logs just in case:

My original exchange with modalai developers with some extra screenshots and command line prompts:

If you spot anything unusual please let me know and thank you in advance for your help

little update, using ethernet cable for communication did not help the issue

another update: I have noticed that the trouble is probably on the gazebo side. When running vtol model gazebo’s performance drops dramatically (real time factor drops to ~0.5), while on the multicopter it is consistently at real time factor of 1. If anyone knows how to allocate more resources to gazebo/ speed it up - I would appreciate the hint