mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-19 01:53:57 +08:00
* refactor * needs casting * tests pass * fix that test * refactor in controls * lets not go crazy * change of names * use constants * better naming * renamed * soft constraints * compile slack variables * rm git conflict * add slack variables * unused * new edition * fcw * fix tests * dividing causes problems * was way too slow * take a step back * byeeee * for another time * bad idxs * little more cpu for cruise mpc * update refs * these limits seem fine * rename * test model timings fails sometimes * add default * save some cpu * Revert "little more cpu for cruise mpc" This reverts commit f0a8163ec90e8dc1eabb3c4a4268ad330d23374d. * Revert "test model timings fails sometimes" This reverts commit d259d845710ed2cbeb28b383e2600476527d4838. * update refs * less cpu * Revert "Revert "test model timings fails sometimes"" This reverts commit e0263050d9929bfc7ee70c9788234541a4a8461c. * Revert "less cpu" This reverts commit 679007472bc2013e7fafb7b17de7a43d6f82359a. * cleanup * not too much until we clean up mpc * more cost on jerk * change ref * add todo * new ref * indentation
48 lines
1.5 KiB
Python
48 lines
1.5 KiB
Python
Import('env', 'arch')
|
|
|
|
cpp_path = [
|
|
"#",
|
|
"#selfdrive",
|
|
"#phonelibs/acado/include",
|
|
"#phonelibs/acado/include/acado",
|
|
"#phonelibs/qpoases/INCLUDE",
|
|
"#phonelibs/qpoases/INCLUDE/EXTRAS",
|
|
"#phonelibs/qpoases/SRC/",
|
|
"#phonelibs/qpoases",
|
|
"lib_mpc_export",
|
|
]
|
|
|
|
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',
|
|
]
|
|
|
|
generated_h = [
|
|
'lib_mpc_export/acado_common.h',
|
|
'lib_mpc_export/acado_auxiliary_functions.h',
|
|
'lib_mpc_export/acado_qpoases_interface.hpp',
|
|
]
|
|
|
|
interface_dir = Dir('lib_mpc_export')
|
|
|
|
SConscript(['#phonelibs/qpoases/SConscript'], variant_dir='lib_qp', exports=['interface_dir'])
|
|
|
|
if GetOption('mpc_generate'):
|
|
generator_cpp = File('generator.cpp')
|
|
|
|
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")]
|
|
|
|
generator = env.Program('generator', generator_cpp, LIBS=acado_libs, CPPPATH=cpp_path,
|
|
CCFLAGS=env['CCFLAGS'] + ["-Wno-deprecated", "-Wno-overloaded-shift-op-parentheses"])
|
|
|
|
cmd = f"cd {Dir('.').get_abspath()} && {generator[0].get_abspath()}"
|
|
env.Command(generated_c + generated_h, generator, cmd)
|
|
|
|
|
|
mpc_files = ["longitudinal_mpc.c"] + generated_c
|
|
env.SharedLibrary('mpc', mpc_files, LIBS=['m', 'qpoases'], LIBPATH=['lib_qp'], CPPPATH=cpp_path)
|