Files
sunnypilot/selfdrive/controls/lib/lateral_mpc/SConscript
HaraldSchafer c6d9b9565a Mpc rework2 (#19660)
* start again

* need that too

* this actually works

* not needed

* do properly

* still works

* still works

* still good

* all G without ll

* still works

* all still good

* cleanup building

* cleanup sconscript

* new lane planner

* how on earth is this silent too....

* update

* add rotation radius

* update

* pathplanner first pass

* misc fixes

* fix

* need deep_interp

* local again

* fix

* fix test

* very old

* new replay

* interp properly

* correct length

* another horrible silent bug

* like master

* fix that

* do doubles

* different delay compensation

* make robust to empty msg

* make pass with hack for now

* add some extra

* update ref for increased leg

* test cpu usage on this pr

* tiny bit faster

* purge numpy

* update ref

* not needed

* ready for merge

* try again after recompile

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 158210cde8
2021-01-14 18:43:50 -08:00

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 = ["lateral_mpc.c"] + generated_c
env.SharedLibrary('mpc', mpc_files, LIBS=['m', 'qpoases'], LIBPATH=['lib_qp'], CPPPATH=cpp_path)