How to setup and check Optical flow

Hi ArduPilot community.
I’m trying to setup optical flow but it does not work well.
So I want to check EKF5.meanRng but I could not find it in my copter’s log file.
What should I do ?
I use PixHawk, Copter-3.4.5 and PX4Flow.

Hi Masanori. You can download log file from Misson Planner. Please look into this page.

Hi Jiro.

Thank you for your quick reply.
absolutely I have downloaded log from Mission Planner and I have looked into here.
But I can not find EFK5 tree in my Log Browser.
I attach my screen capture.

Do you have a rangefinder installed ? I dont see a RFND item on the screen above… You need a range finder to get opticalflow working

That is the first warning showned in the WIKI:

I looked into
I have set RNGFND_TYPE = 2 (MaxbotixI2C) because 4 is nothing.
And then rangefinder always show “Bad LiDAR Health” on HUD and “sonarrange” in Flight Data screen’s Status tab is always 0.

You need a separate rangefinder connected to the flight controler. Laser based rangefinder are best

I can not use built-in Maxbotix LZ-EZ4 on PX4FLOW ?

No, please read carefully the wiki

I understood.
By the way, What is your recommended rangefinder ?
I want to buy it.

I am using garmin lidar lite v3, its a good ratio price performance

1 Like

Hi ppoirier.

I have bought same one.

Thanks a lot.

Hi ppoirier

I bought idar lite v3 and I am doing setup it via i2c.
But lidar lite v3 does not work.
My lidar’s label is black and manufacture date is December 2016.
Do you use it via i2c or PWM ?



You need Ardupilot 3.5 and you have to set the Lidar Lite as a type 15 in order to connect to I2C:

1 Like

Thank you for your quick reply.

I’v set the Lidar Lite as a type 15 but My copter is 3.4.6.
I’ll update firmware to 3.5 and try it again.


Hi all.

I have problem when I updated firmware from 3.5.2
Copter-3.4.5 could read opt_m_x, opt_m_y, opt_x, opt_y and opt_qua
But copter-3.5.2 could not read them.
They are always 0.

Why PX4FLOW does not work well on copter-3.5.2?

Did you loaded the OpticalFlow Firmware ?

I loaded px4flow-klt-06Dec2014.px4 when I used copter-3.4.5
Do I have to load OpticalFlow Firmware again ?

If it is enabled it should work ok

1 Like

I could fly my quad to use PX4FLOW and LiDAR light v3 with copter-3.4.5.
I want to fly my quad indoor without compass this is why I want to use copter-3.5.2 and EK3.


Yes release 3.5 can do that.
I guess you mean without GPS … Compass still work indoor, its just less efficient because of magnetic perturbation.