mpc_lib: fix dependencies (#29621)

* Remove common dependency of lateral mpc

* Replace cereal dir dependency with cereal lib in long mpc

* Add missing files to generated sources

* Typo fix

* messaging_python dep
This commit is contained in:
Kacper Rączy 2023-08-25 16:51:57 -07:00 committed by GitHub
parent 24f5a6170d
commit 517499294a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 7 deletions

View File

@ -364,8 +364,9 @@ else:
cereal = [File('#cereal/libcereal.a')]
messaging = [File('#cereal/libmessaging.a')]
visionipc = [File('#cereal/libvisionipc.a')]
messaging_python = [File('#cereal/messaging/messaging_pyx.so')]
Export('cereal', 'messaging', 'visionipc')
Export('cereal', 'messaging', 'messaging_python', 'visionipc')
# Build rednose library and ekf models

View File

@ -1,4 +1,4 @@
Import('env', 'envCython', 'arch', 'common')
Import('env', 'envCython', 'arch')
gen = "c_generated_code"
@ -32,7 +32,10 @@ generated_files = [
f'{gen}/Makefile',
f'{gen}/main_lat.c',
f'{gen}/main_sim_lat.c',
f'{gen}/acados_solver_lat.h',
f'{gen}/acados_sim_solver_lat.h',
f'{gen}/acados_sim_solver_lat.c',
f'{gen}/acados_solver.pxd',
f'{gen}/lat_model/lat_expl_vde_adj.c',
@ -46,7 +49,7 @@ acados_dir = '#third_party/acados'
acados_templates_dir = '#third_party/acados/acados_template/c_templates_tera'
source_list = ['lat_mpc.py',
'#/selfdrive/modeld/constants.py',
'#selfdrive/modeld/constants.py',
f'{acados_dir}/include/acados_c/ocp_nlp_interface.h',
f'{acados_templates_dir}/acados_solver.in.c',
]
@ -57,7 +60,6 @@ lenv.Clean(generated_files, Dir(gen))
generated_lat = lenv.Command(generated_files,
source_list,
f"cd {Dir('.').abspath} && python3 lat_mpc.py")
lenv.Depends(generated_lat, "#common")
lenv["CFLAGS"].append("-DACADOS_WITH_QPOASES")
lenv["CXXFLAGS"].append("-DACADOS_WITH_QPOASES")

View File

@ -1,4 +1,4 @@
Import('env', 'envCython', 'arch', 'common')
Import('env', 'envCython', 'arch', 'messaging_python')
gen = "c_generated_code"
@ -38,7 +38,10 @@ generated_files = [
f'{gen}/Makefile',
f'{gen}/main_long.c',
f'{gen}/main_sim_long.c',
f'{gen}/acados_solver_long.h',
f'{gen}/acados_sim_solver_long.h',
f'{gen}/acados_sim_solver_long.c',
f'{gen}/acados_solver.pxd',
f'{gen}/long_model/long_expl_vde_adj.c',
@ -52,7 +55,7 @@ acados_dir = '#third_party/acados'
acados_templates_dir = '#third_party/acados/acados_template/c_templates_tera'
source_list = ['long_mpc.py',
'#/selfdrive/modeld/constants.py',
'#selfdrive/modeld/constants.py',
f'{acados_dir}/include/acados_c/ocp_nlp_interface.h',
f'{acados_templates_dir}/acados_solver.in.c',
]
@ -63,7 +66,7 @@ lenv.Clean(generated_files, Dir(gen))
generated_long = lenv.Command(generated_files,
source_list,
f"cd {Dir('.').abspath} && python3 long_mpc.py")
lenv.Depends(generated_long, "#cereal")
lenv.Depends(generated_long, messaging_python)
lenv["CFLAGS"].append("-DACADOS_WITH_QPOASES")
lenv["CXXFLAGS"].append("-DACADOS_WITH_QPOASES")