Set EK3_FLOW_DELAY depending on your optical flow sensor
Set EK3_SRC1_POSXY = 3 (Primary horizontal position from GPS, set this to 0 to only use the optical flow sensor)
Set EK3_SRC1_VELXY = 5 (Primary horizontal velocity from OpticalFlow)
Set EK3_SRC1_POSZ = 1 (Primary vertical position from barometer)
Set EK3_SRC1_VELZ = 0 (No primary vertical velocity sensor)
Set EK3_SRC1_YAW = 1 (Primary yaw/heading from compass)
a) In loiter mode, the behavior is that: with a reliable gps signal it uses gps and in gps denial environment it switches to optical flow automatically?
e) how I bypass the prearm: need position estimate in loiter mode, with gps denial enviroment and no groundstation to set EKF origin? (for flights in a well lit indoor area)
Thanks for the feedback. The optical flow setup page is not very clear so I’ll try and improve it.
There are basically 3 setups to choose from:
optical flow only
optical flow <-> GPS transitions (one one or the other is used at any moment)
optical flow + GPS at the same time
The setup that you’re describing (and which is described on the wiki) is option 3 which I don’t recommend. I suspect if you’re looking to also use GPS then option 2 is probably better.
The idea behind option 3 was that it would give a more stable horizontal position at low altitudes (compared to using only GPS) and Paul Riseborough has a video on his youtube channel of this but it was made many years ago before we supported transitions.
Hi, i am looking for the option 1 : optical flow only. I have hex here optical flow and lidar lite v3. They can work separately, i don’t know how to use them together. Meanwhile i have to be at non gps mode. Can you make suggestions ? If you know a source about it or a discusson can you let me know ?
Ηι @rmackay9
I have a more clean log from a calm day.
and the original from the other post is
to sum up:
a)If I power on with the switch to optical flow only and try to takeoff, I can climb up to an altitude (this varies from 40cm to 2m) and then it stops like it had an altitude fence. This happens both at loiter and alt-hold.
b)If I switch to GPS source I can fly normally
c)If I have a takeoff with gps source and then switch to optical flow only, I still can fly normally.
Any help is greatly appreciated, as with this behavior I cannot start the drone to a GPS denial environment, which is my intention.
a) While using optical flow at non gps mode which flight mode should i use ? I searched and saw althold is the best mode for this but i want the drone to fly autonomously.
b) And for your third explanation did lidar lite v3 and the hex here optical flow sensor work at the same time ? While getting data from optical flow sensor for x-axis, I want to get data from lidar for height from ground.
a) alt hold does not use optical flow. You normally use loiter as far as hereflow is calibrated correctly and as far I understand, auto mode too
b) you use both sensor. XY axis with optical flow z axis (height) with barometer, colerated with the lidar
c) flowhold is just a degraded loiter without the use of lidar. It is selected only when you do not have lidar istalled.
OK, so from looking at the smaller log it seems to be working OK.
Because there is a lidar attached the vehicle will do surface tracking while in Loiter mode. This can be disabled by setting the SURFTRAK_MODE = 0
So below we can see the DSalt (desired “sonar” alt) in blue and SAlt (actual “sonar” alt) and they are tracking reasonably well. There is a bit of overshoot but this is a known issue that we will hopefully fix in a future release.
Hi @rmackay9
from the same log please look at the screenshots
Taking off with optical flow. You can see that after reaching about 2m the climb rate descends even if throttle is above 1500ms. Two tries (one small, one larger) of rising the throttle again, goes nearly nothing to climb DCRt. After a small commanded descent and try to climb again, copter still reaches 2,XX meters and climb rate goes down again.
In this part, I landed, flipped the switch to GPS and takeoff again. You can see that climb rate is by far following strictly the throttle up to 4m. (after that I command descent)
I am concern also, that these are Desired altitudes and climp rate, the actuals also follow the desired ones.
I do not want to set EKF origin, as I want to be independent from ground station and fly loiter only indoors.
Nevertheless I tried setting the EKF origin also in another flight and same behavior.