Closed TomJanssen00 closed 2 months ago
@TomJanssen00 How did you install acados? I did not have the need to install qpoases separately.
@Jaeyoung-Lim First I installed acados using https://docs.acados.org/installation/index.html using cmake
Then installed the python interface using: https://docs.acados.org/python_interface/index.html
@TomJanssen00 Could you share the result of
cmake -DACADOS_WITH_QPOASES=ON ..
?
@Jaeyoung-Lim here you go
-- Build type is Release
-- ACADOS_WITH_OPENMP: OFF
-- Using linear algebra: HIGH_PERFORMANCE
-- Using matrix format: PANELMAJ
-- Using external BLAS: 0
-- Testing target X64_INTEL_HASWELL: assembly compilation [success]
-- Testing target X64_INTEL_HASWELL: assembly run [success]
-- Testing target X64_INTEL_HASWELL: intrinsic compilation [success]
-- Testing target X64_INTEL_HASWELL: intrinsic run [success]
-- Detected target X64_INTEL_HASWELL
-- Using BLASFEO path:
-- Installation directory: /home/tom/PythonPackages/acados
--
-- Target: BLASFEO is X64_AUTOMATIC, HPIPM is X64_AUTOMATIC
-- Linear algebra: HIGH_PERFORMANCE
-- Matlab MEX (OFF)
-- Octave MEX (OFF)
-- Octave Templates ()
-- System name:version Linux:5.15.0-91-generic
-- Build type is Release
-- Installation directory is /home/tom/PythonPackages/acados
-- OpenMP parallelization is OFF
--
-- Configuring done
-- Generating done
-- Build files have been written to: /home/tom/PythonPackages/acados/build
@TomJanssen00 It is likely that the problem is in this step in the installation instruction.
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"<acados_root>/lib"
export ACADOS_SOURCE_DIR="<acados_root>"
libqpOASES_e.so exists in the lib
folder on my system.
~/dev/acados/lib$ ls
libacados.so libhpipm.so libqpOASES_e.so.3.1
libblasfeo.so libqpOASES_e.so link_libs.json
Could you check if the library files exist there?
@Jaeyoung-Lim It seems that I have the same output there:
~/PythonPackages/acados/lib$ ls
libacados.so libhpipm.so libqpOASES_e.so.3.1
libblasfeo.so libqpOASES_e.so link_libs.json
@TomJanssen00 Right, but then if you have configured LD_LIBRARY_PATH
and ACADOS_SOURCE_DIR
, it should be linked properly. I think the problem might be that you installed qpoases separately.
Can you echo LD_LIBRARY_PATH
and ACADOS_SOURCE_DIR
?
@Jaeyoung-Lim It returns as follows
$ echo $LD_LIBRARY_PATH
/opt/ros/noetic/lib
$ echo $ACADOS_SOURCE_DIR
/home/tom/PythonPackages/acados/
ACADOS_SOURCE_DIR
somehow did not return anything initially, so I added the path as described in the instruction by
export ACADOS_SOURCE_DIR=~/PythonPackages/acados/
But I still get the same error
$ echo $LD_LIBRARY_PATH
/opt/ros/noetic/lib
@TomJanssen00 This explains the problem?
The installation instruction says you need to map
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"<acados_root>/lib"
@Jaeyoung-Lim I ran
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"<acados_root>/lib"
Now it returns
$ echo $LD_LIBRARY_PATH
/opt/ros/noetic/lib:~/PythonPackages/acados/lib
That should be good right?
When I try to run an example script now from acados_python I run into a different issue that I encountered yesterday as well, but resolved at some point. It had to do with setting up Tera renderer. I am looking into that now.
@Jaeyoung-Lim Now I run into the following issue
acados_solver_pendulum_ode.c:37:10: fatal error: acados_c/ocp_nlp_interface.h: No such file or directory
37 | #include "acados_c/ocp_nlp_interface.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [<builtin>: acados_solver_pendulum_ode.o] Error 1
Traceback (most recent call last):
File "minimal_example_ocp.py", line 104, in <module>
main()
File "minimal_example_ocp.py", line 83, in main
ocp_solver = AcadosOcpSolver(ocp, json_file = 'acados_ocp.json')
File "/home/tom/PythonPackages/acados/interfaces/acados_template/acados_template/acados_ocp_solver.py", line 451, in __init__
self.__acados_lib = DllLoader(libacados_filepath)
File "/usr/lib/python3.8/ctypes/__init__.py", line 373, in __init__
self._handle = _dlopen(self._name, mode)
OSError: ~/PythonPackages/acados/lib/../lib/libacados.so: cannot open shared object file: No such file or directory
However, acados_c/ocp_nlp_interface.h
seems to exist in acados/interfaces
. Do you know how to fix this?
Btw. I did not make a virtualenv. Do you think this could affect it?
@TomJanssen00 Are you sure you have ACADOS_SOURCE_DIR
configured properly?
Btw. I did not make a virtualenv. Do you think this could affect it?
I also didn't configure a virtualenv. It should work without.
In the log:
OSError: ~/PythonPackages/acados/lib/../lib/libacados.so: cannot open shared object file: No such file or directory
You can check if this file exists. and if not how you can create it.(by building acados I presume?)
@Jaeyoung-Lim I reconfigured ACADOS_SOURCE_DIR
and LD_LIBRARY_PATH
and replaced ~/PythonPa...
with /home/tom/PythonPa...
and now it works... so I think this fixed the issue.
Your code is now also working! (sitl not yet as I have not installed px4 yet)
Thanks a lot for helping me fix the issue!
@TomJanssen00 Awesome!
When running
I get the following error message
This error (OSError:...) also appears when I run
minimal_example_ocp.py
fromacados/examples/acados_python/getting_started
:I have installed qpOASES using this manual. The example script as described in chapter 2.1, point 5 seems to be working correctly.
Any idea how I can fix this problem?