You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
2.0 KiB
68 lines
2.0 KiB
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',
|
|
]
|
|
|
|
casadi_constraints = [
|
|
f'{gen}/long_constraints/long_constr_h_fun.c',
|
|
f'{gen}/long_constraints/long_constr_h_fun_jac_uxt_zt.c',
|
|
f'{gen}/long_constraints/long_constr_h_e_fun.c',
|
|
f'{gen}/long_constraints/long_constr_h_e_fun_jac_uxt_zt.c',
|
|
]
|
|
|
|
build_files = [f'{gen}/acados_solver_long.c'] + casadi_model + casadi_cost_y + casadi_cost_e + \
|
|
casadi_cost_0 + casadi_constraints
|
|
|
|
# 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_constraints/long_h_constraint.h',
|
|
f'{gen}/long_constraints/long_h_e_constraint.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'])
|
|
|