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

Try to init MSP OVERRIDE frame with correct default values #13524

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

yrik
Copy link
Contributor

@yrik yrik commented Apr 13, 2024

There is a problem with default values in MSP override init frame, it makes the drone spin like crazy. In this PR the idea is to provide typical default values for ROLL, PITCH, and YAW like in betaflight configurator interface. I'm not sure if it's the best way to handle it and how to take into account that user can configure channel mapping (e.g. AETR, et).

In the previous version of the code (v4.4) it seems that default behavior was to return proper default values. The drones are crashing only with 4.5 and not with 4.4.

Looks like the issue was introduced in #13352
Before that change, in a moment between MSP_OVERRIDE is ON and the first MSP packet is received, the drone was not receiving new commands. But with this change, the drone receives commands that consist of 885, 885, 885... It makes the drone unstable within a fraction of a second, and eventually, it falls down.

The correct behavior would be to keep previous values or at least to have correct default values.

Copy link

Do you want to test this code? You can flash it directly from Betaflight Configurator:

  • Simply put #13524 (this pull request number) in the Select commit field of the Configurator firmware flasher tab (you need to Enable expert mode, Show release candidates and Development).

WARNING: It may be unstable. Use only for testing!

@ledvinap
Copy link
Contributor

@yrik: IMO correct wayt is to prevent MSP override until first data are received.

Simple and possibly useful way is to test for rxMspReadRawRC(...)==0 and return RC channel in that case. It will also allow specifying 'use RC' values over MSP (possibly after removing some range checks).

And when you are at it, can you please fix rxMspReadRawRC to use floats (probably in separate PR)?

@haslinghuis haslinghuis added this to the 4.5 milestone Apr 14, 2024
Copy link
Contributor

@ledvinap ledvinap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just workaround, actual fix would be better

@haslinghuis haslinghuis modified the milestones: 4.5, 4.6 Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants