GithubHelp home page GithubHelp logo

hybridrobotics / nmpc-dclf-dcbf Goto Github PK

View Code? Open in Web Editor NEW
190.0 7.0 46.0 54.61 MB

A collection of work using nonlinear model predictive control (NMPC) with discrete-time control Lyapunov functions (CLFs) and control barrier functions (CBFs)

License: MIT License

MATLAB 99.70% Objective-C 0.30%
model-predictive-control safety-critical-systems mpc-control obstacle-avoidance-algorithm control-lyapunov-functions control-barrier-functions ipopt matlab quadratic-programming nonlinear-optimization

nmpc-dclf-dcbf's People

Contributors

hesuieins avatar junzengx14 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

nmpc-dclf-dcbf's Issues

Add dependencies

Hi,

I find your work to be very interesting and I'd like to try run your code (ACC 2021 to be specific). However, it seems the optimization with the sdpsettings relies on ipopt solver. The documentation here says it's based on the OPTI Toolbox, which seems to only work on Windows.

Sorry that I'm not a very experienced Matlab user. May I know am I following the correct path to set up the dependency? Is Windows really required?

Bug shooting for Solver Infeasible (ACC2021)

Dear Dr. Zeng
Thanks for sharing this repo and your work in using NMPC, DCBF and DCLF for the safety and stability of non-linear dynamic systems. When I run testGamma.m and testHorizon.m in acc2021 with matlab2021a and Ipopt from https://ww2.mathworks.cn/matlabcentral/fileexchange/53040-ebertolazzi-mexipopt, I have the following problem. Thank you very much for your kind consideration and I am looking forward to your reply.
(1) testGamma.m
Run MPC-CBF with gamma 1.000000
solver time: 0.203114
solver time: 0.173155
solver time: 0.190210
solver time: 0.164076
solver time: 0.187111
solver time: 0.192042
solver time: 0.207878
The dimensions used for matrix multiplication are incorrect. Check to make sure that the number of columns in the first matrix matches the number of rows in the second matrix. To multiply by elements, use '.*'.
error: MPCCBF/sim (line 33)
xk = self.system.A * xk + self.system.B * uk;
error: testGamma (line 50)
controller_mpc_cbf_list{ind}.sim(time_total);
(2) testHorizon.m
Function or variable 'MPC_CBF' is not recognized.
error: testHorizon (line 57)
controller_mpc_cbf_3 = MPC_CBF(x0, system, params);

Incorrect dimensions for matrix multiplication

Thanks for sharing the code with the research community!

The solution proposed by @Highlight123 in #8 seems not to be working for me.

I'm using MATLAB 2023b on Windows 10 Enterprise

  • I have installed YALMIP by downloading the zipped master branch and adding the corresponding folders to the MATLAB path, as explained here
  • I have installed IPOPT by unzipping the content of the windows zip file found in the packages folder and adding it to the MATLAB path as well.

When running the test.m example file, I encounter the following error when the MPC-CBF portion of the code is executed:

Run DCLF-DCBF

******************************************************************************
This program contains Ipopt, a library for large-scale nonlinear optimization.
 Ipopt is released as open source code under the Eclipse Public License (EPL).
         For more information visit http://projects.coin-or.org/Ipopt
******************************************************************************

solver time: 0.047731
solver time: 0.008463
solver time: 0.093812
solver time: 0.023940
solver time: 0.026648
solver time: 0.022985
solver time: 0.024641
solver time: 0.025211
solver time: 0.022818
solver time: 0.023665
solver time: 0.022227
solver time: 0.025823
solver time: 0.022322
solver time: 0.026809
solver time: 0.025507
solver time: 0.023072
solver time: 0.022888
solver time: 0.024795
solver time: 0.022537
solver time: 0.023309
solver time: 0.027679
solver time: 0.041902
solver time: 0.029257
solver time: 0.045835
solver time: 0.044835
solver time: 0.020762
solver time: 0.023178
solver time: 0.018531
solver time: 0.014889
solver time: 0.014883
solver time: 0.019863
solver time: 0.013205
solver time: 0.017712
solver time: 0.016276
solver time: 0.020308
solver time: 0.015621
solver time: 0.019068
solver time: 0.016642
solver time: 0.019565
solver time: 0.016545
solver time: 0.018946
solver time: 0.016591
solver time: 0.016828
solver time: 0.017160
solver time: 0.016907
solver time: 0.017280
solver time: 0.018163
solver time: 0.018101
solver time: 0.018135
solver time: 0.018532
solver time: 0.018296
solver time: 0.023914
solver time: 0.018515
solver time: 0.023602
solver time: 0.018284
solver time: 0.030814
solver time: 0.018128
solver time: 0.028315
solver time: 0.018415
solver time: 0.028239
solver time: 0.018291
solver time: 0.018133
solver time: 0.017463
solver time: 0.018425
solver time: 0.017462
solver time: 0.019470
solver time: 0.020075
solver time: 0.017156
solver time: 0.016994
solver time: 0.022822
solver time: 0.025683
solver time: 0.017895
solver time: 0.024991
solver time: 0.017129
solver time: 0.028229
solver time: 0.014601
solver time: 0.025064
solver time: 0.014364
solver time: 0.020803
solver time: 0.011387
solver time: 0.041871
solver time: 0.013326
solver time: 0.010609
solver time: 0.015937
solver time: 0.012670
solver time: 0.013214
solver time: 0.010542
solver time: 0.012082
solver time: 0.011136
solver time: 0.013361
solver time: 0.011288
solver time: 0.012865
solver time: 0.015118
solver time: 0.017965
solver time: 0.017676
solver time: 0.029309
solver time: 0.018754
solver time: 0.016743
solver time: 0.017627
solver time: 0.018350
solver time: 0.019865
solver time: 0.017784
solver time: 0.015771
solver time: 0.017858
solver time: 0.017445
solver time: 0.017529
solver time: 0.016989
solver time: 0.017326
solver time: 0.016378
solver time: 0.015842
solver time: 0.015983
solver time: 0.016424
solver time: 0.015772
solver time: 0.016275
solver time: 0.018587
solver time: 0.018780
solver time: 0.015130
solver time: 0.015676
solver time: 0.013548
solver time: 0.015363
solver time: 0.015692
solver time: 0.014703
solver time: 0.016040
solver time: 0.015461
solver time: 0.014108
solver time: 0.018002
solver time: 0.014736
solver time: 0.015342
solver time: 0.015623
solver time: 0.014029
solver time: 0.014831
solver time: 0.015464
solver time: 0.014131
solver time: 0.015590
solver time: 0.013597
solver time: 0.013393
solver time: 0.014460
solver time: 0.018404
solver time: 0.017950
solver time: 0.016268
solver time: 0.015683
solver time: 0.015537
solver time: 0.016887
solver time: 0.017083
solver time: 0.016588
solver time: 0.016346
solver time: 0.014546
solver time: 0.014235
solver time: 0.012632
solver time: 0.016101
solver time: 0.017285
Run MPC-CBF
solver time: 0.026445
solver time: 0.024115
solver time: 0.020360
solver time: 0.021547
solver time: 0.024552
solver time: 0.023751
solver time: 0.020647
solver time: 0.022978
solver time: 0.021042
solver time: 0.019102
solver time: 0.030104
solver time: 0.020458
solver time: 0.034109
solver time: 0.026081
solver time: 0.022414
solver time: 0.024533
solver time: 0.021113
solver time: 0.033569
solver time: 0.023680
solver time: 0.021309
solver time: 0.021535
solver time: 0.020313
solver time: 0.149422
solver time: 0.035624
solver time: 0.038381
solver time: 0.023511
solver time: 0.026955
solver time: 0.029792
solver time: 0.047430
solver time: 0.036920
solver time: 0.022587
solver time: 0.035625
solver time: 0.038502
solver time: 0.018121
solver time: 0.040078
solver time: 0.026732
solver time: 0.034052
solver time: 0.021790
solver time: 0.018138
solver time: 0.050003
solver time: 0.022862
solver time: 0.026748
solver time: 0.026580
solver time: 0.032877
Error using  * 
Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in
the second matrix. To operate on each element of the matrix individually, use TIMES (.*) for elementwise multiplication.

Error in MPCCBF/sim (line 33)
                xk = self.system.A * xk + self.system.B * uk;

Error in test (line 115)
    controller_mpc_cbf_one.sim(time_total);

Related documentation

Note that I encounter the same error in any other execution of the other tests:

>> testBenchmark
solver time: 0.022939
Error using  * 
Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in
the second matrix. To operate on each element of the matrix individually, use TIMES (.*) for elementwise multiplication.

Error in MPCCBF/sim (line 33)
                xk = self.system.A * xk + self.system.B * uk;

Error in testBenchmark (line 52)
    controller_mpc_cbf.sim(time_total);

Related documentation
>> testGamma
Run MPC-CBF with gamma 0.100000
solver time: 0.021581
Error using  * 
Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in
the second matrix. To operate on each element of the matrix individually, use TIMES (.*) for elementwise multiplication.

Error in MPCCBF/sim (line 33)
                xk = self.system.A * xk + self.system.B * uk;

Error in testGamma (line 50)
    controller_mpc_cbf_list{ind}.sim(time_total);

Related documentation
>> testHorizon
solver time: 0.030083
Error using  * 
Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in
the second matrix. To operate on each element of the matrix individually, use TIMES (.*) for elementwise multiplication.

Error in MPCCBF/sim (line 33)
               xk = self.system.A * xk + self.system.B * uk;

Error in testHorizon (line 48)
controller_mpc_cbf_1.sim(time_total);

Related documentation

Is there any other place where to look for an IPOPT version that works on Windows?

uk can not calculate the right value

The code is about the paper "safety critical model predictive control with discrete time control barrier function", published in acc2021.

20231102-123243
20231102-123246

Why is it that when I run the program, the uk always cannot solve it? Is it a problem with initial condition setting? I would greatly appreciate it if you could provide an answer.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.