-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Camera uptilt AHI compensation #6616
Conversation
@avsaase Do you intend to mix it with the applied elevator stick input? Reminds me of when I integrated a camera gimbal that used accelerometer tilt compensation. To always keep the camera facing forwards, no matter the tilt angle of the quad. |
@Jetrell No this is just to keep the AHI somewhat aligned with the horizon. Right now when I pitch forward to get the camera level and fly straight ahead, the AHI completely moves out of view on the top side of the screen. |
I must have made a mistake with flashing this morning because now it works as expected. |
Why not using the existing setting : osd_horizon_offset ? |
I expected you to comment on this 😅 . Do you mean |
Yep it moves the crossair, but all the AHI and sidebars and hud POIs etc are positionned relative to the crossair, so in the end it moves the whole thing as a block
Then the AHI in osd.c at line 1715 |
Yeah okay, but I'm not trying to move the elements, just trying to compensate the AHI for the camera uptilt. This PR does that in a much more straightforward way. |
ce8f4e0
to
33f340f
Compare
I quite like this so can I merge it? |
@OlivierC-FR LOL |
I also could not fly with the AHI "wrong" relative to the crosshair, but that's personal taste. |
yes we have 2 options currently but osd_ahi_vertical_offset will ONLY affect Pixel OSD. On classic OSD i use the crosshair offset that will also move the AHI up or down, to align with the physical horizon. |
On a quad, I would like to have the artificial horizon in the middle of the osd when the camera is level with the ground, not when the quad is level. I'm actually surprised this feature doesn't already exist.
This PR uses the existing
osd_camera_uptilt
cli command from the HUD feature to shift the AHI according to camera uptilt. However, it doesn't work yet. Increasingosd_camera_uptilt
correctly shifts down the AHI, but far from enough. I can probably figure it out eventually, but if someone can point me in the right direction then that would be great.