-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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
[WIP] lqr controller #19079
base: main
Are you sure you want to change the base?
[WIP] lqr controller #19079
Conversation
@@ -0,0 +1,315 @@ | |||
/**************************************************************************** | |||
* | |||
* Copyright (c) 2018 - 2019 PX4 Development Team. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Copyright (c) 2018 - 2019 PX4 Development Team. All rights reserved. | |
* Copyright (c) 2022 PX4 Development Team. All rights reserved. |
############################################################################ | ||
|
||
px4_add_library(Takeoff | ||
Takeoff.cpp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a direct copy of the existing takeoff helper? If so we can move it under lib
and rename to mc_takeoff
or something.
add_subdirectory(Takeoff) | ||
|
||
px4_add_module( | ||
MODULE modules__mc_lqr_control |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe include something in the name to indicate it's a position controller?
Can you add this to a board and we'll add a parameter to select which modules start at runtime?
|
I'd be up for trying to properly bring in Eigen if you're interested. I think we're now in a much better position to address c++ dependency issues in NuttX. |
@mkolodziejczyk-piap cool! Could you add more details to your PR description like what the cost function is? |
Sorry, this is a bit rough right now. I'll provide more details today and fill missing parts |
No need to rush 😄 |
Is there any plan for this? |
There's always been interest in PX4 community in implementing model-based controllers like LQR, but none of the efforts transformed into actual PR. This PR aims to introduce simple LQR controller for multicopters as an alternative to current PID controllers. There's no intention to replace current PID stack, rather create a reference implementation or an option for researchers. This is most basic LQR version and further enhancement will probably require at least some exteranal lib like Eigen or even a QP solver lib.