Receive IMU Data on Companion Computer while using SITL_Gazebo

Hello,

I am developing a vision based landing target estimator on a companion computer. So far the companion computer can communicate with PX4 using the MAVLink interface. I would like to do a small sensor fusion on the companion as well, for which I need the IMU data.
To achieve this, I would like to forward

  1. HIL_SENSOR
  2. SCALED_IMU

messages to the companion.

So far I tried to use mavlink_msg_hil_sensor_send_struct from mavlink_msg_hil_sensor.h on every HIL_SENSOR message, that is received from the gazebo simulation, but this does not compile, as it relies on a compile flag #define MAVLINK_USE_CONVENIENCE_FUNCTIONS.

Can anyone please point me in the right direction ?

Regards,
Stefan

Solved. I added the mavlink stream for the SCALED_IMU topic to the init script

You could also use MAVSDK for that :wink: