Hi! I am using the C interface in C++ to make a ROS package. When I try to build my package, it only succeeds when I have generated c-code using the HPIPM solver. Other solvers such as OSQP, DAQP, QPOASES result in the build failing:
Errors << ctl_mpc:make /home/jonne/astrobee/log/ctl_mpc/build.make.053.log
/home/jonne/astrobee/src/gnc/ctl_acados_mpc/solver/c_generated_code/acados_solver_astrobee.c: In function ‘astrobee_acados_create_1_set_plan’:
/home/jonne/astrobee/src/gnc/ctl_acados_mpc/solver/c_generated_code/acados_solver_astrobee.c:146:53: error: ‘FULL_CONDENSING_QPOASES’ undeclared (first use in this function); did you mean ‘FULL_CONDENSING_HPIPM’?
146 | nlp_solver_plan->ocp_qp_solver_plan.qp_solver = FULL_CONDENSING_QPOASES;
| ^~~~~~~~~~~~~~~~~~~~~~~
| FULL_CONDENSING_HPIPM
/home/jonne/astrobee/src/gnc/ctl_acados_mpc/solver/c_generated_code/acados_solver_astrobee.c:146:53: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [CMakeFiles/ctl_mpc_lib.dir/build.make:356: CMakeFiles/ctl_mpc_lib.dir/solver/c_generated_code/acados_solver_astrobee.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:2193: CMakeFiles/ctl_mpc_lib.dir/all] Error 2
make: *** [Makefile:146: all] Error 2
I did install acados with these solvers, they also show up in acados/build/external. Therefore, my best guess that I might not be linking these solvers correctly in my CMakeLists:
set(acados_include ${PROJECT_SOURCE_DIR}/acados/include)
set(acados_lib ${PROJECT_SOURCE_DIR}/acados/lib)
set(solver_code ${PROJECT_SOURCE_DIR}/solver/c_generated_code)
catkin_package(
INCLUDE_DIRS
${acados_include}/blasfeo/include/
${acados_include}/hpipm/include/
${acados_include}/
${acados_include}/daqp/
${acados_include}/qpOASES_e/
${acados_include}/osqp/
${acados_include}/../
${solver_code}
${catkin_INCLUDE_DIRS}
CATKIN_DEPENDS
roscpp
ff_msgs
ff_util
)
include_directories(
# include
${acados_include}/blasfeo/include/
${acados_include}/hpipm/include/
${acados_include}/
${acados_include}/daqp/
${acados_include}/qpOASES_e/
${acados_include}/osqp/
${acados_include}/../
${solver_code}
${catkin_INCLUDE_DIRS}
)
link_directories(
${acados_lib}
)
But I did the same here for HPIPM as for the other solvers. Any idea what could be causing this issue? The full structure of the package can be found here: https://github.com/DISCOWER/ctl_acados_mpc
Thanks!