-
Notifications
You must be signed in to change notification settings - Fork 13.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
TinyMPC for PX4 #23820
base: main
Are you sure you want to change the base?
TinyMPC for PX4 #23820
Conversation
@dagar @MaEtUgR Me and @Jaeyoung-Lim think that this could be an interesting addition to the PX4 control stack. Together with @sschoedel we are working on that capability. What do you think is a good way forward? We thought about providing a library (tinympc) and each user can create an MPC for the application in hand. We will most likely start integration on https://github.com/DISCOWER/PX4-Space-Systems before merging it in, but we would like to have a solid baseplate for PX4 compatibility. |
FWIW, integrating this was something I also had on my plate for my application. I'm interested in seeing it integrated in a way that could be used for multiple applications. I believe TinyMPC can be applied for a generalized position controller as a selectable alternative to the existing controllers, but the application of constraints may be platform and application dependent. |
@oursland That's great to hear that there is more interest on the community. Right now we are considering a few options for autogenerating models for application-specific use cases. Would be nice to hear what you think could be a good way forward. Right now the biggest hurdle is compatibility of the existing PID stack vs what an MPC stack would look like. We are starting with providing thrust and attitude setpoints to start with, while we prepare the stack for it. It also would be good to hear what are the community needs and why they can't be met with the existing infrastructure, so that there is a solid case for adding this capability. |
.vscode/settings.json
Outdated
"ros.distro": "humble" | ||
"ros.distro": "humble", | ||
"python.autoComplete.extraPaths": [ | ||
"/home/roque/gz_garden_ws/install/local/lib/python3.10/dist-packages", |
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.
roque?
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.
fixed!
PS: I really need to make sure that my .vscode is always ignored for committing in PX4
Otherwise, this will conflict with the MS5525DSO airspeed sensor. add: tinyMPC feat: ran once, let's make it run stable feat: small changes to position MPC for ifdef compilation
f3772f0
to
5a0b42e
Compare
Looking forward to this! How do you foresee the user being able to switch between PID and MPC? |
Thanks @AlexKlimaj ! This is a big beast to integrate into every possible case, but we are starting in https://github.com/DISCOWER/PX4-Space-Systems/tree/dev-sc_tinympc by using it for a free-flyer platform (satellite-like dynamics), as a position controller that gives attitude setpoints. We are evaluating the best ways to generate models for the supported vehicle platforms (since it is a model-based controller, we can't just use the same MPC for everything), and it will not be the default control stack - that means the user will need to enable the MPC and provide extra parameters like mass, approximate inertia, bounds, etc. This might be integrated neatly in QGC, but I'd say we are far from getting there. For now, we will make sure it sits well within the stack as a library and try setpoint stabilization, followed by trajectory tracking (which will involve re-sampling the generated trajectory according to the controller sampling time). And as always, we are super happy for any help / insights / suggestions we can get. |
Solved Problem
Preliminary support for MPC on PX4 based on TinyMPC, more information here https://tinympc.org/ .
Solution
Changelog Entry
For release notes:
Alternatives
Keep using PID.
Test coverage
Context
More information to follow.