I plan to write a 6-DOF controller for the BlueROV2 as my master thesis. For this I have the following setup: A BlueROV2, heavy configuration, with the pixhawk flight controller (3DR Pixhawk 1 · PX4 v1.9.0 User Guide) and a topside computer running ROS2 humble and communicating with ArduSub via Mavros.
Now, I wish to evaluate the IMU in the pixhawk, to get a grip of the quality of the estimated orientation. Since the pixhawk contains multiple accelerometers and gyroscopes, I would like to know which one I’m using and whether I can choose between them.
Mavros publishes several IMU related topics, the ones related to inertial sensors are /imu/data, /imu/data_raw and /imu/mag. I traced those back to their corresponding MAVlink messages (Messages (common) · MAVLink Developer Guide) and found the following connections:
However, I have not yet been able to determine to which sensors these MAVlink messages are linked. Do you have any Information on this, or can point me to literature on this topic? I would be grateful for every hint.
Another question, that arose, regards the frequency at which Mavros publishes the IMU messages. This is currently at about 10 Hz, which is quite slow. To me, it seems that a message is published as soon as a MAVlink message is received, so I was wondering how I could increase the frequency of the MAVlink messages.
I hope my problems are formulated clearly, if you have any questions please don’t hesitate to reach out to me.
This function gets the data from AP::ahrs(), which is a singleton that manages the AHRS system and the underlying EKF cores (also called “lanes”). So, we can infer that this data comes from the output of the currently running EKF core, not the IMU inputs.
You’ll need to look at how the EKF cores are set up via the various EK2_* and EK3_* parameters to see how they are configured. Typically there is a core for each IMU on the system, and a Pixhawk flight controller has 2 IMUs, so there will be 2 cores. Only 1 core will be active at a time. This document is a bit old, but a good backgrounder: Extended Kalman Filter (EKF) — Copter documentation
As for message frequency, messages are bundled into stream groups, and the GCS (e.g., QGroundControl) can control the frequency of the various stream groups. MAVLink Support | ArduSub
If you want the raw IMU data you can get that (after the flight is over) by looking at the dataflash logs recorded on the Pixhawk SD card. Take a look at this description: Onboard Log Messages | ArduSub I have not looked at this data closely, but IIRC it is logged at 20Hz.