Good day @Hugo,
From my understanding an optical flow camera (pointed downwards) gives you an estimate of the lateral movement via image processing (do take into account I personally haven't worked with them).
It does look like the tool for the job is the optical flow sensor, however the Erle Brain 3 doesn't support the optical flow sensors we worked with previously (I'm told there where some issues with the voltage at one of the pins).
My guess is @anasarrak's suggestion's objective is to give a workaround, using lidars or rangefinders horizontally to detect walls (as you were speaking about indoor autonomous flight) to detect movement in this regard and be (kind of) able to account for that drift. It is nothing more than a workaround, and not the intended purpose of these sensors, so some tinkering would be necessary.
You have to take into account that our copters simply aren't thought out for indoor flight, nor for precision-critical tasks (our products have been focused on hobbyist and tinkerers). You'll always have some amount of horizontal drift, specially if you can't make use of a GPS.
As of now, the PX4Flow is not supported by the EB3, nor are there any short term plans on working on it. About alternatives on this, I'm sorry to say we can't really help you out.
However we would be interested on a workaround for this, if nothing out of curiosity. Please do keep us posted.
My apologies and good luck.