Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers/optical_flow/paw3902: backup scheduling to fetch 0 flow #22086

Merged
merged 3 commits into from
Sep 18, 2023

Conversation

dagar
Copy link
Member

@dagar dagar commented Sep 15, 2023

  • this sensor provides a MOTION interrupt used for default scheduling, but we also need to publish zero flow information if it's valid

The core issue here is that if there isn't motion we don't have a mechanism to know if the current 0 flow readings aren't stale.

@AlexKlimaj
Copy link
Member

Do we need to update the PAA3905 driver to match?

@dagar
Copy link
Member Author

dagar commented Sep 15, 2023

Do we need to update the PAA3905 driver to match?

Yes if this checks out.

@AlexKlimaj
Copy link
Member

AlexKlimaj commented Sep 15, 2023

Hard to tell if its better. It was always slowly yawing to the north.
https://review.px4.io/plot_app?log=9b65dc13-87f4-44e3-84ea-285e25a9a017

Did a mag cal and this is slightly better. Still has the bug where it slowly descends until it lands.
https://review.px4.io/plot_app?log=26a34e80-6518-4130-9456-0fd60d24b7e3

I can see it now will publish 0,0 pixel flow.

AlexKlimaj
AlexKlimaj previously approved these changes Sep 15, 2023
@dagar dagar force-pushed the pr-paw3902_fallback_zero_flow branch 2 times, most recently from 2a8093d to be92142 Compare September 15, 2023 18:58
@dagar dagar marked this pull request as ready for review September 15, 2023 18:59
@dagar dagar force-pushed the pr-paw3902_fallback_zero_flow branch from be92142 to cf20203 Compare September 15, 2023 19:15
 - this sensor provides a MOTION interrupt used for default scheduling, but we also need to publish
   zero flow information
 - this sensor provides a MOTION interrupt used for default scheduling, but we also need to publish
   zero flow information
@dagar dagar force-pushed the pr-paw3902_fallback_zero_flow branch from cf20203 to 105318e Compare September 15, 2023 19:28
@AlexKlimaj
Copy link
Member

AlexKlimaj commented Sep 15, 2023

This is definitely better. This PR on the FC and ARK Flow. EKF_HGT_REF set to baro.
https://review.px4.io/plot_app?log=4c2f02a3-dcba-481d-bde7-60952adc7158

There are times in a hover where the gyro noise causes a 0 flow value to have a compensated velocity. I wonder if we want to ignore the gyro when the pixel flow is 0?
image
image
image

@AlexKlimaj
Copy link
Member

Added logic to only compensate when pixel flow if non zero and it flies great. I'm current doing it if either pixel flow value is non zero to compensate both axis. But it might be better to do it per axis?
https://review.px4.io/plot_app?log=19493eb4-0c0f-44a9-a17e-06bbb7af9f83

@bresch
Copy link
Member

bresch commented Sep 18, 2023

Great, that much better than before, the position is now rock solid while hovering.
Tested indoors on a QAV250: https://logs.px4.io/plot_app?log=ffa07b2c-fd47-4a0e-89c1-71f5d348ed2f

@bresch
Copy link
Member

bresch commented Sep 18, 2023

@AlexKlimaj I'm not sure if adding this logic is really necessary, the gyro noise should be centered around 0 so it isn't an issue. Did you see an improvement by adding that conditional gyro compensation? (I flew with it and it worked well, but I didn't try without)

bresch
bresch previously approved these changes Sep 18, 2023
@dagar dagar force-pushed the pr-paw3902_fallback_zero_flow branch from b6e0fad to 105318e Compare September 18, 2023 15:23
@dagar dagar merged commit d351f16 into main Sep 18, 2023
171 checks passed
@dagar dagar deleted the pr-paw3902_fallback_zero_flow branch September 18, 2023 16:46
@DronecodeBot
Copy link

This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:

https://discuss.px4.io/t/optical-flow-oscillating-position/34470/2

@DronecodeBot
Copy link

This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:

https://discuss.px4.io/t/holybro-optical-flow-sensor-thoneflow-oscillations-on-main/34768/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants