HereFlow Optical Flow Sensor Testing

excuse me
Asking you how to use Hex HereFlow Optical Flow Sensor indoors for navigation and take off with loiter mode armed.
Because I do calibration according to the teaching website (Optical Flow Sensor Testing and Setup — Copter documentation), but use loiter mode for indoor armed When taking off, the error message “Prearm: Need Position Estimate” will appear.
I also right click the MissionPlanner’s map, and set “Set Origin Here”, but still can’t armed.
Is there anything I’m missing?

Hereflow only help your drone to lock to XY position. use a barometer or rangefinder to lock the height (Z). so, for navigation, it would not work.

Have you done this, manually change between GPS and Optical Flow inflight? Indoor, I recommend PosHold flight mode.

Thanks a lot for your response!
I think I’m missing something, I’ll give it a try.
Thank you for your reminder!

1 Like

We are experiencing significant drift loitering with optical flow as our EK3 xy input. After looking at the logs, we found that the target position (north and east) was continuously changing, and that the quad was trying to follow the target, despite no stick inputs (requesting vehicle to simply hover at the origin). Shouldn’t the target position in loiter remain at the origin and not move around?

This is consistent across loiter tests at 30m, 60m and 100m.

Tests using GPS as xy input do not exhibit this phenomenon (target remains at 0 for both N and E).

Has anyone else experienced this? @rmackay9 @ppoirier any insights on this problem?
bin file from 60m loiter: 2023-08-14 11-10-54 60m loiter.bin - Google Drive

Thanks!

@beng,

I think the target position is being dragged by the actual position. If you look closely at the lines you’ll see that the actual position (PN in green) is leading the target position (TPN in red). I think in Loiter mode we do not allow the target position to be too far from the actual position as a safety measure.

It looks like maybe the inflight calibration hasn’t been done? This should help improve performance but I think it is unlikely to work well at altitudes above 40m. The camera’s field of view is just too wide to provide accurate movements at higher altitudes.

1 Like

Makes sense. Thanks for your input and quick response!

@rmackay9 ,

Thanks again for the feedback on my earlier question regarding target position drift in OF. You wrote: “I think in Loiter mode we do not allow the target position to be too far from the actual position as a safety measure.” But when we take off with a correctly initialized EKF, our target position matches the actual position. Small disturbances due to wind, etc… should be immediately corrected by the position controller. What we see is that the EKF estimates from the OF sensor are actually pretty good, but the copter drifts away because the target position is led away.

Shouldn’t the controller fight to keep the actual position near the target position? From the logs and visual observations, it seems that the copter has plenty of control authority, and starts off with good estimates. But then it softly drifts away due to the target position continuously shifting even with no stick inputs. Why would optical flow flight act this way while GPS enabled flight has no target position drift?

Hi @beng,

What we see is that the EKF estimates from the OF sensor are actually pretty good

No, I don’t think so. When I look at the graph, it looks to me like the position estimate is drifting and the target is being dragged by the position estimate because of the safety feature I mentioned above.

I think the way to look at the graph is to, of course, recognise that time is passing from left to right. Then look at the actual position (in the North axis) which is green. As time passes the green line is moving down. At the same time, the target position (in red) is also moving down but it is consistently higher than the actual position. So this means the target position is lagging behind the actual position.

Later on we see the actual position direction of motion changes, it starts moving up… again the red line is lagging behind.

There is a fundamental concept of Opticalflow you need to understand ; this is not a position controller but a velocity controller.

You cannot expect it to track a flight path it is just used to assist reduce position drift based on the klt filter.

1 Like