Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
- Loading branch information
Showing
14 changed files
with
586 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
generator | ||
lib_qp/ | ||
acados_ocp_lead.json | ||
c_generated_code/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,58 @@ | ||
Import('env', 'arch') | ||
|
||
gen = "c_generated_code" | ||
|
||
cpp_path = [ | ||
"#phonelibs/acado/include", | ||
"#phonelibs/acado/include/acado", | ||
"#phonelibs/qpoases/INCLUDE", | ||
"#phonelibs/qpoases/INCLUDE/EXTRAS", | ||
"#phonelibs/qpoases/SRC/", | ||
"#phonelibs/qpoases", | ||
"lib_mpc_export", | ||
casadi_model = [ | ||
f'{gen}/lead_model/lead_expl_ode_fun.c', | ||
f'{gen}/lead_model/lead_expl_vde_forw.c', | ||
] | ||
|
||
generated_c = [ | ||
'lib_mpc_export/acado_auxiliary_functions.c', | ||
'lib_mpc_export/acado_qpoases_interface.cpp', | ||
'lib_mpc_export/acado_integrator.c', | ||
'lib_mpc_export/acado_solver.c', | ||
casadi_cost_y = [ | ||
f'{gen}/lead_cost/lead_cost_y_fun.c', | ||
f'{gen}/lead_cost/lead_cost_y_fun_jac_ut_xt.c', | ||
f'{gen}/lead_cost/lead_cost_y_hess.c', | ||
] | ||
|
||
generated_h = [ | ||
'lib_mpc_export/acado_common.h', | ||
'lib_mpc_export/acado_auxiliary_functions.h', | ||
'lib_mpc_export/acado_qpoases_interface.hpp', | ||
casadi_cost_e = [ | ||
f'{gen}/lead_cost/lead_cost_y_e_fun.c', | ||
f'{gen}/lead_cost/lead_cost_y_e_fun_jac_ut_xt.c', | ||
f'{gen}/lead_cost/lead_cost_y_e_hess.c', | ||
] | ||
|
||
casadi_cost_0 = [ | ||
f'{gen}/lead_cost/lead_cost_y_0_fun.c', | ||
f'{gen}/lead_cost/lead_cost_y_0_fun_jac_ut_xt.c', | ||
f'{gen}/lead_cost/lead_cost_y_0_hess.c', | ||
] | ||
|
||
interface_dir = Dir('lib_mpc_export') | ||
build_files = [f'{gen}/acados_solver_lead.c'] + casadi_model + casadi_cost_y + casadi_cost_e + casadi_cost_0 | ||
|
||
SConscript(['#phonelibs/qpoases/SConscript'], variant_dir='lib_qp', exports=['interface_dir']) | ||
# extra generated files used to trigger a rebuild | ||
generated_files = [ | ||
f'{gen}/Makefile', | ||
|
||
if GetOption('mpc_generate'): | ||
generator_cpp = File('generator.cpp') | ||
f'{gen}/main_lead.c', | ||
f'{gen}/acados_solver_lead.h', | ||
|
||
acado_libs = [File(f"#phonelibs/acado/{arch}/lib/libacado_toolkit.a"), | ||
File(f"#phonelibs/acado/{arch}/lib/libacado_casadi.a"), | ||
File(f"#phonelibs/acado/{arch}/lib/libacado_csparse.a")] | ||
f'{gen}/lead_model/lead_expl_vde_adj.c', | ||
|
||
generator = env.Program('generator', generator_cpp, LIBS=acado_libs, CPPPATH=cpp_path, | ||
CCFLAGS=env['CCFLAGS'] + ["-Wno-deprecated", "-Wno-overloaded-shift-op-parentheses"]) | ||
f'{gen}/lead_model/lead_model.h', | ||
f'{gen}/lead_cost/lead_cost_y_fun.h', | ||
f'{gen}/lead_cost/lead_cost_y_e_fun.h', | ||
f'{gen}/lead_cost/lead_cost_y_0_fun.h', | ||
] + build_files | ||
|
||
cmd = f"cd {Dir('.').get_abspath()} && {generator[0].get_abspath()}" | ||
env.Command(generated_c + generated_h, generator, cmd) | ||
lenv = env.Clone() | ||
lenv.Clean(generated_files, Dir(gen)) | ||
|
||
lenv.Command(generated_files, | ||
["lead_mpc.py"], | ||
f"cd {Dir('.').abspath} && python lead_mpc.py") | ||
|
||
mpc_files = ["longitudinal_mpc.c"] + generated_c | ||
env.SharedLibrary('mpc0', mpc_files, LIBS=['m', 'qpoases'], LIBPATH=['lib_qp'], CPPPATH=cpp_path) | ||
env.SharedLibrary('mpc1', mpc_files, LIBS=['m', 'qpoases'], LIBPATH=['lib_qp'], CPPPATH=cpp_path) | ||
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_lead", | ||
build_files, | ||
LIBS=['m', 'acados', 'hpipm', 'blasfeo', 'qpOASES_e']) |
Oops, something went wrong.