Replies: 4 comments 2 replies
-
Hi! I don't know exactly what your software stack looks like, but I'd assume you can just set up TinyMPC as a module with a light ROS wrapper around it. The inputs are just goal pose for each time step in the horizon (this can be a lot of data if you have a long horizon or a short time step) and the output is pretty much whatever you want from the solution TinyMPC gives you. You might want to publish the entire resulting solution, which would consist of a pose and controls for each time step, but that might be a lot of data to send depending on your node's publishing frequency, so it's up to you. For our tests with the crazyflie we just returned the first control input in the trajectory, and unless you want to do more analysis or processing on the rest of the solution, that's generally all you need to do. I would recommend forking the repo and basically remaking our drone tracking example in the examples folder while using ROS to do all the communication. Don't forget to replace the linearized A and B matrices with a dynamics model of your vehicle. Good luck! |
Beta Was this translation helpful? Give feedback.
-
It is just a solver's solving method, and how is it related to the A and B matrices?
…---- Replied Message ----
| From | ***@***.***> |
| Date | 06/18/2024 18:05 |
| To | TinyMPC/TinyMPC ***@***.***> |
| Cc | t-Dargon ***@***.***>,
Author ***@***.***> |
| Subject | Re: [TinyMPC/TinyMPC] How to use TinyMPC in the field of autonomous driving? (Discussion #16) |
But the vehicle model's A and B are variable, and A and B are a fixed matrix in your sample, so Pinf, Kinf, C1,C2 need only be requested once. But the changing ones need to be asked all the time, and the value of preprocessing is lost.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I think this is all also related to https://github.com/orgs/TinyMPC/discussions/26. In short, our approach leverages the fact that since we can use only one A/B matrix we can cache one K/P offline but for varying A/B you'd need to solve for a number of Ks and Ps to solve online. |
Beta Was this translation helpful? Give feedback.
-
TinyMPC only optimizes the solver part. Regardless of this optimization, as the A and B matrices change, the K/P matrices still need to be computed online.
在 2024-06-18 21:58:38,"Brian Plancher" ***@***.***> 写道:
I think this is all also related to #26. In short, our approach leverages the fact that since we can use only one A/B matrix we can cache one K/P offline but for varying A/B you'd need to solve for a number of Ks and Ps to solve online.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hello, I want to implement TinyMPC in an autonomous driving project with Ubuntu 18.04 and ROS1. Could you please guide me on how to achieve this? I have already set up the environment for traditional MPC and it runs successfully. What part of the traditional MPC code should be modified to implement TinyMPC?
Beta Was this translation helpful? Give feedback.
All reactions