On an hexacopter with Pixhawk V2 and Copter V3.6.0-rc6 firmware I have installed and configured two range finders (I2C Maxbotix and serial Benewake TFMini) as documented in:
Maxbotic I2C Sonar Rangefinder (RNGFND on I2C)
Benewake TFmini lidar (RNGFND2 on SERIAL4)
Since they are respectively ultrasonic and infrared, I understand they can coexist peacefully without interfering one to the other.
Testing at home (no GPS) elevating the copter around 1.5m and plotting RFND.Dist1 and RFND.Dist2 this is the almost reasonable result:
So it seems that both are recognized and their data are captured, but there is a glitch on the I2C one. The glitch message and those from points before and after on the log are:
RFND, 154122132, 1.07, 25, 1.07, 25
RFND, 154173252, 4.12, 25, 1.08, 25 (glitch)
RFND, 154424391, 1.15, 25, 1.13, 25
Also appears nearby:
In the log:
EV, 154459056, 62
ERR, 154459132, 24, 1
MSG, 154459159, EKF primary changed:1
EV, 154568531, 62
ERR, 154568551, 24, 0
MSG, 154568578, EKF primary changed:0
Apart from this, I can’t find anything having happened in parallel with the glitch in the log, such as big vibrations. Nothing strange in copter handling was noticed in this short flight.
-Any reason for the glitch (such as being indoors)?
-Does the program consider the data from both range finders, and filter them or whatever?
-What will the program do in case of a glitch like this? Height cannot change abruptly.
-What about those “EKF primary changed” messages?