How to adjust the sample rate of distance sensor (rangefinder)

There is the solution !!!
To increase the sampling
The SER_TEL2_BAUD need to be increased. (which was 115200)
The MAV_1_RATE need to be increased.(which was 0)

PX4-autopilot automatically half-size the data, if the communication is too low.


P.S.
In a serial communication system, the data rate is measured in bits per second (baud rate). However, it’s important to note that a byte consists of 8 bits.
At a baud rate of 921,600, the maximum number of bits that can be transmitted per second is 921,600. To determine the number of bytes transferred per second, you need to divide the baud rate by 8 (8 bits per byte).
So, at a baud rate of 921,600, the maximum data transfer rate in bytes per second would be:
921,600 bits/second / 8 bits/byte = 115,200 bytes/second
Therefore, at a baud rate of 921,600, you can transfer a maximum of 115,200 bytes per second.

2 Likes