mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-18 23:33:58 +08:00
* acados long * new ref * SPPEEEEEDDD * less iterations * this shouldn't be so high * reset only essentials * minimal reset for long mpc * more cpu usage plannerd * Use lead mpc even when going to crash * reset to current state * Use open loop speed for lead mpc * 1 iteration is too little for cruise mpc * add whitespace * update refs
59 lines
1.6 KiB
Python
59 lines
1.6 KiB
Python
Import('env', 'arch')
|
|
|
|
gen = "c_generated_code"
|
|
|
|
casadi_model = [
|
|
f'{gen}/long_model/long_expl_ode_fun.c',
|
|
f'{gen}/long_model/long_expl_vde_forw.c',
|
|
]
|
|
|
|
casadi_cost_y = [
|
|
f'{gen}/long_cost/long_cost_y_fun.c',
|
|
f'{gen}/long_cost/long_cost_y_fun_jac_ut_xt.c',
|
|
f'{gen}/long_cost/long_cost_y_hess.c',
|
|
]
|
|
|
|
casadi_cost_e = [
|
|
f'{gen}/long_cost/long_cost_y_e_fun.c',
|
|
f'{gen}/long_cost/long_cost_y_e_fun_jac_ut_xt.c',
|
|
f'{gen}/long_cost/long_cost_y_e_hess.c',
|
|
]
|
|
|
|
casadi_cost_0 = [
|
|
f'{gen}/long_cost/long_cost_y_0_fun.c',
|
|
f'{gen}/long_cost/long_cost_y_0_fun_jac_ut_xt.c',
|
|
f'{gen}/long_cost/long_cost_y_0_hess.c',
|
|
]
|
|
|
|
build_files = [f'{gen}/acados_solver_long.c'] + casadi_model + casadi_cost_y + casadi_cost_e + casadi_cost_0
|
|
|
|
# extra generated files used to trigger a rebuild
|
|
generated_files = [
|
|
f'{gen}/Makefile',
|
|
|
|
f'{gen}/main_long.c',
|
|
f'{gen}/acados_solver_long.h',
|
|
|
|
f'{gen}/long_model/long_expl_vde_adj.c',
|
|
|
|
f'{gen}/long_model/long_model.h',
|
|
f'{gen}/long_cost/long_cost_y_fun.h',
|
|
f'{gen}/long_cost/long_cost_y_e_fun.h',
|
|
f'{gen}/long_cost/long_cost_y_0_fun.h',
|
|
] + build_files
|
|
|
|
lenv = env.Clone()
|
|
lenv.Clean(generated_files, Dir(gen))
|
|
|
|
lenv.Command(generated_files,
|
|
["long_mpc.py"],
|
|
f"cd {Dir('.').abspath} && python long_mpc.py")
|
|
|
|
lenv["CFLAGS"].append("-DACADOS_WITH_QPOASES")
|
|
lenv["CXXFLAGS"].append("-DACADOS_WITH_QPOASES")
|
|
lenv["CCFLAGS"].append("-Wno-unused")
|
|
lenv["LINKFLAGS"].append("-Wl,--disable-new-dtags")
|
|
lenv.SharedLibrary(f"{gen}/acados_ocp_solver_long",
|
|
build_files,
|
|
LIBS=['m', 'acados', 'hpipm', 'blasfeo', 'qpOASES_e'])
|