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

Wls update #2484

Merged
merged 2 commits into from
Jan 29, 2020
Merged

Wls update #2484

merged 2 commits into from
Jan 29, 2020

Conversation

EwoudSmeur
Copy link
Member

I wrote a test for the WLS control allocation and found a mistake with the initialization of one of the arrays. The fix gives the correct result in the test, but is not flight tested.

Something else, but related:
I also realized that the use of Variable Length Arrays (VLA) leads to a lot more assembly code than fixed size arrays, and in this case it is not really needed if you call the algorithm with arguments of the same size. (Usage example: https://github.com/paparazzi/paparazzi/blob/master/sw/airborne/firmwares/rotorcraft/stabilization/wls/wls_alloc.c#L109)
I think that only if you would have two constrained least squares problems of different size to solve it could make sense to do it like this. Should we restrict it to 'single use' in order to make it faster?

@noether
Copy link
Member

noether commented Jan 28, 2020

@EwoudSmeur it looks good to me. May you make happy Travis and his semaphore? :P

Copy link
Member

@gautierhattenberger gautierhattenberger left a comment

Choose a reason for hiding this comment

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

looks good

@gautierhattenberger
Copy link
Member

Do we use variable length arrays in airborne code ?

@gautierhattenberger gautierhattenberger merged commit d93adeb into paparazzi:master Jan 29, 2020
@EwoudSmeur
Copy link
Member Author

Thanks!

@gautierhattenberger Yes so maybe I wasn't completely clear, I was only talking about the WLS code. Some years ago I replaced the use of real dynamic memory in the WLS code with these VLA's, but now I think it is better not to use them, especially because it is not strictly needed. Judging from your comment you would agree? :)

@gautierhattenberger
Copy link
Member

indeed, if you can use fixed size arrays, it is better

@EwoudSmeur EwoudSmeur deleted the wls_update branch March 14, 2020 14:36
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.

None yet

3 participants