nicolapiccinelli / libmpc

libmpc++ is a C++ header-only library to solve linear and non-linear MPC

Home Page:https://altairlab.gitlab.io/optcontrol/libmpc/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is this lab able to support output reference has ten sets of different value in each steps? If so, which file should I refer to? Thanks

ZhYGu opened this issue · comments

commented

I'd like to make a path planning with your lib. However, in your examples, it only has a constant output reference. However in my case, each step should has differenct values for output. Could you please help me to figure out how to do it?

commented

For example, I have a desired path for each step as [x y z]T, and for each step it is differenct, I want the output in each prediction horizon approach to the desired output value. So the output value is not constant, how can I set the output reference and how to edit the constrain or objective function? Is there any option I can choose to realize it?

Hi @ZhYGu are you talking about the linear MPC module? If so, I can add it or if you wish you can open a pull on this and contribute to the lib.

commented
commented

I will answer both your questions here:

  1. Regarding the possibility of having different reference at each prediction horizon there is not a limit in the solver. As it is now it's just a matter of adding a new API in the LMPC class and then rework a bit the internal mechanism to provide the full reference to the optimizer instead of just copying the reference to all steps.
  2. In this case I would have a new API to retrive the optimal sequence, since generally in the MPC we apply just the first optimal command in the sequence. Anyway, this could be useful in some cases.

Now the options are: I can take in charge of adding these functionalities to the current code base but it will take about 1 week, or if you feel confident enough you can take in charge of doing that (maybe just one of them) and then we can review your solution

@ZhYGu I’m working on the first point, probably tomorrow I will give a look into the retrieval of the optimal sequence. Unfortunately, there will be breaking changes in the LMPC api.

commented

@ZhYGu version 0.1.0 released, cheers!

commented