Raspberry Pi ACADOS problem

Hello there,

I am working on running acados on a Raspberry Pi (2 Model B). I succeeded to run acados, however not its python interface. In particular, there is a problem with casadi, which I compiled and installed according to the documentation, but when executing the following command:

pip3 install <acados_root>/interfaces/acados_template

acados states that it cannot find casadi:

    pi@raspberrypi:~/acados $ pip3 install ~/acados/interfaces/acados_template/ Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
    Processing ./interfaces/acados_template
    Collecting casadi==3.5.1 (from acados-template==0.1)
    Could not find a version that satisfies the requirement casadi==3.5.1 (from acados-template==0.1) (from versions: )
No matching distribution found for casadi==3.5.1 (from acados-template==0.1)

I would apprectiate your help.

Dominik

Hi Dominik,

CasADi for Python should be downloaded through pip, just as you tried it. However, CasADi binaries for ARM architectures seem to be not well supported (yet).

I guess the better workflow for you now is to design your controller on a PC/Laptop and only run the generated Code on the RaspberryPi.
Let us know if you have problems with this workflow.

An alternative is to compile CasADi Python for ARM yourself, which will probably quite complicated.

Best,
Jonathan

1 Like

Thank you for your reply,

Could you please describe in more detail how to design the controller on PC and only run the generated code on the RPi platform?

Dominik

You can install CasADi on a Raspberry Pi by just compiling it. The instructions to do so are basically the same as when using a PC, just run ‘make -j1’ after running the cmake.

You can look at the official guide here [1] and I am writing a very, very rough tutorial on how to do so here [2]

Hope it helps!

[1] https://github.com/casadi/casadi/wiki/InstallationLinux
[2] https://gmsanchez.github.io/2019/12/04/installing-casadi-on-a-raspberry-pi/

Thanks @gmsanchez, it seems like compiling CasADi Python for the Raspberry Pi seems less complicated then I thought.
I guess if you install CasADi Python as described by @gmsanchez, the pip installation should find it automatically, right?

What I was suggesting was to play around with your OCP formulation on a Laptop/PC in a simulation or whatever framework you have.

The Python interface is based on C templates, when running an example you create a folder c_generated_code, you can put copy this folder to your RPi and compile & run it from there. This way you wouldnt need CasADi Python on your RPi.

Best,
Jonathan

Thank you @FreyJo, after following your advice it worked and I was able to run the example.

2 Likes

Thank you for the suggestion. I plan to work with Matlab, can a c_generated_code folder also be created there?

Best, Julio

Hi Julio,

yes, you can check the Simulink examples.
The .generate() Fucntion generates such a folder.

Hi @xzatkalik , may I ask how the workflow was?
Thanks!