meco-group / fatrop

Fatrop is a nonlinear optimal control problem solver that aims to be fast, support a broad class of optimal control problems and achieve a high numerical robustness.
https://meco-group.github.io/fatrop/
GNU Lesser General Public License v3.0
102 stars 11 forks source link

Running Executable RunFatrop.cpp #1

Closed Nabil-Miri closed 6 months ago

Nabil-Miri commented 7 months ago

When I run RunFatrop.cpp file runing vscode I get this error:

*  Executing task: C/C++: gcc build active file 

Starting build...
/usr/bin/gcc -fdiagnostics-color=always -g /home/nabil/fatrop/fatrop/executables/RunFatrop.cpp -o /home/nabil/fatrop/fatrop/executables/RunFatrop
/home/nabil/fatrop/fatrop/executables/RunFatrop.cpp:22:10: fatal error: fatrop/ocp/StageOCPApplication.hpp: No such file or directory
   22 | #include <fatrop/ocp/StageOCPApplication.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

Build finished with error(s).

Should I run anything before?

lvanroye commented 6 months ago

Hi Nabil,

It seems that vscode is not able to determine the right include path. Have you considered using vscode's cmake integration? For me that works well.

Best, Lander

Nabil-Miri commented 6 months ago

Dear Lander, Thanks, it worked. I was using C/C++: Run C/C++ File other thanCMake: Build.

BTW another small question. This link says there is a Fatrop interface with CasADi. Is it used differently than the spectool you created? (if yes is there any example to use it ?)

Best, Nabil

lvanroye commented 6 months ago

Hi Nabil,

@jgillis, one of the CasADi developers, tried to implement fatrop as conic solver. I am not really aware of what the current progress is on that.

Ideally, such interface should also be developed for nonlinear optimal control problems but it is a bit challenging because the (constrained) OCP-multiple shooting structure will have to be detected from a general NLP. It is something I'd really like to have but at this point it's a bit hard to make promises. For now, my recommendation is to use rockit or fatrop::spectool for specifying fatrop problems.

Best, Lander

Nabil-Miri commented 6 months ago

Hi Lander,

Thanks again for your reply and the detailed answer. Noted. So for now, I will use the fatrop::spectool.

Best, Nabil