Using LOITER with optical flow sensor - EK3_SRC_OPTIONS

Regarding using an optical flow sensor, in the wiki about the FlowHold flight mode, it states that by using a rangefinder, better performance can be used with the Loiter flight mode.

The wiki about Loiter has no info about using Loiter with and optical flow sensor and rangefinder - and without a GPS.

In fact - the wiki on Loiter says a GPS lock is required to use Loiter.

Does this mean you can use an optical flow sensor in Loiter - but only if a GPS is available too?

I recall having the ability to add optical flow data to help Loiter improve its position stability. I can’t seem to find a reference to that now - except maybe for this option in EK3_SRC_OPTIONS - which is not mentioned on the parameter list.

Regardless, this doesn’t address using Loiter flight mode with optical flow only - and no GPS.

Can someone please provide some information about this topic?

Thanks!

No, it objective is to cater for indoor loiter flying.

example of using a RC switch to select which flying navigation sensors.

You need GPS under loiter to help do the inflight optical flow calibration. Once done, you can remove the GPS. IF you have coupled with a long range external lidar sensor, you can fly it outdoor loiter without GPS.

Thank you for your comment.

I’m familiar with all the things you bring up - but I appreciate knowing that I’ve covered the right materials.

I still need guidance on the requirements for using LOITER when GPS is not in use.

Also - the copters for this project will have GPS - but they must not be used indoors to avoid bad GPS data. What is the proper procedure to disable GPS data in ArduPilot navigation and the LOITER flight mode?

Thank you for your help!

Is just the reverse, how you added the GPS in, just revert it.

Reverse? I did nothing to enable GPS - other than install it.

I’ve seen several things that might work - but as they are different, I’m trying to find out what’s recommended.

As an example, I believe setting GPS_TYPE=0 might do it. The problem is that I’d like to have the GPS active to record what ever data it can - so I can analyze it in the BIN file data.

Alternately, I can change the EK3_SRC_xxx parameters that refer to GPS to “0”. But I don’t know if that’s sufficient - and it’s a bit messy.

Maybe there are other options too.

And then there’s still the matter of using Loiter without GPS - as the wiki explicitly says Loiter requires GPS.

I hope you didn’t mix up compass and GPS. I think most users have to do something to enable GPS and configure it to work well with Ardupilot and GPS manufacturer requirements. For example.

If you just plugged in the GPS and it works, then reverse, unplug it.

No. Most boards get a default set of parameters that allow for simply plugging a serial GPS into the primary port and having it “just work.”

Read here for GPS to non-GPS transitions:
https://ardupilot.org/copter/docs/common-non-gps-to-gps.html

It’s my understanding that Loiter mode simply requires a position source. If the EKF origin is set, then optical flow + a rangefinder should provide that.

Beyond that, you’ll need another expert, as non-GPS stuff isn’t really where I focus.

1 Like

I think I agree with most of th4e comments above especially @Yuri_Rage 's latest.

Loiter (and all other modes that control position) requires a position estimate. That is most often a GPS but it can be an optical flow sensor.

It sounds like the page Yuri’s provided re GPS/Non-GPS transition is what’s required. In particular on that page it has a link to the ahrs-source-gps-optflow.lua script which can automatically switch between GPS and optical flow. It’s better to test switching manually though before using the automatic switching.

1 Like