Get higher rate IME data through Mavros

I am aware that it is a question which is coming back on a regular issue but I all the proposed answers without success so I am posting with the hope that I can get some answers.

My setup
PX4 1.13.2 running on a Pixhawk 6X Mini
The Pixhawk is connected to a Intel NUC through a USB-TTL P1202 Chip
The USB port assigned by Ubuntu is /dev/ttyUSB0
Ubuntu 20.04

When I check the frequency at which I received the imu/data, I can see that it is roughly 10Hz

fabrice@fabrice-NUC:~/Fast-Drone$ rostopic hz /mavros/imu/data
subscribed to [/mavros/imu/data]
average rate: 11.904
min: 0.080s max: 0.090s std dev: 0.00458s window: 12
average rate: 11.886

I checked /dev/ttyUSB0, looks fine

fabrice@fabrice-NUC:~/Fast-Drone$ stty -F /dev/ttyUSB0
speed 921600 baud; line = 0;
min = 1; time = 0;
-brkint -icrnl -imaxbel
-opost
-isig -icanon -iexten -echo

I tried to use the following command
rosrun mavros mavsys rate --all 50

But it did not change the rate

I used the trick to write on the SD (/etc/extras.txt ):

mavlink stream -d /dev/ttyUSB0 -s ATTITUDE_QUATERNION -r 100
mavlink stream -d /dev/ttyUSB0 -s HIGHRES_IMU -r 100

But it did not work either

On the other hand, I got an old Pixhawk 2 mini and I noticed that without doing nothing, I can get the IMU data at 50Hz, although I was not able to increase the rate as well…

After reading some articles I am wondering whether the last version of PX4 is intentionally limiting the frequency at 10Hz? And if so, is it possible to change it, i.e PX4 parameters becaus with Mavros I cannot do it so far?

Is it related to the USB port, I mean /dev/ttyACM0 is often mentioned as the referenced port?

Hi @FaboNo , on the PX4 side, are you using one of the TELEM ports right? Which is the value of the assciated MAV_*_MODE , MAV_*_RATE and SER_*_BAUD?

  • SER_*_BAUD should be as high as you can go with your USB-TTL adapter.
  • MAV_*_MODE should be Onboard
  • MAV_*_RATE should be 0

see the parameter reference for mavlink and serial.

@Benja thank you for your message,
On the Pixhawk 6X mini there is only one serial port which is SER1
indeed MAV_0_RATE was set to 1200 B/s - I did not checked that parameter before
So now I am back to a frequency of 50Hz but I cannot get a higher rate so far