Rebuild acado and add scons command to regenerate mpc (#19685)
* rebuild acado and add scons command to regenerate mpc * update scons helpalbatross
parent
61cf81502e
commit
7c43a60bda
|
@ -7,11 +7,11 @@
|
|||
*.ipynb filter=nbstripout -diff
|
||||
external/ffmpeg/bin/ffmpeg_cuda filter=lfs diff=lfs merge=lfs -text
|
||||
models/segnet.keras filter=lfs diff=lfs merge=lfs -text
|
||||
phonelibs/acado/x64/lib/libacado_toolkit.a filter=lfs diff=lfs merge=lfs -text
|
||||
phonelibs/acado/x64/lib/libacado_toolkit_s.so.1.2.2beta filter=lfs diff=lfs merge=lfs -text
|
||||
phonelibs/acado/x64/lib/libacado_casadi.a filter=lfs diff=lfs merge=lfs -text
|
||||
phonelibs/acado/x64/lib/libacado_csparse.a filter=lfs diff=lfs merge=lfs -text
|
||||
phonelibs/acado/x64/lib/libacado_qpoases.a filter=lfs diff=lfs merge=lfs -text
|
||||
phonelibs/acado/x86_64/lib/libacado_toolkit.a filter=lfs diff=lfs merge=lfs -text
|
||||
phonelibs/acado/x86_64/lib/libacado_toolkit_s.so.1.2.2beta filter=lfs diff=lfs merge=lfs -text
|
||||
phonelibs/acado/x86_64/lib/libacado_casadi.a filter=lfs diff=lfs merge=lfs -text
|
||||
phonelibs/acado/x86_64/lib/libacado_csparse.a filter=lfs diff=lfs merge=lfs -text
|
||||
phonelibs/acado/x86_64/lib/libacado_qpoases.a filter=lfs diff=lfs merge=lfs -text
|
||||
phonelibs/acado/aarch64/lib/libacado_toolkit.a filter=lfs diff=lfs merge=lfs -text
|
||||
phonelibs/acado/aarch64/lib/libacado_toolkit_s.so.1.2.2beta filter=lfs diff=lfs merge=lfs -text
|
||||
phonelibs/acado/aarch64/lib/libacado_casadi.a filter=lfs diff=lfs merge=lfs -text
|
||||
|
|
|
@ -25,6 +25,10 @@ AddOption('--compile_db',
|
|||
action='store_true',
|
||||
help='build clang compilation database')
|
||||
|
||||
AddOption('--mpc-generate',
|
||||
action='store_true',
|
||||
help='regenerates the mpc sources')
|
||||
|
||||
real_arch = arch = subprocess.check_output(["uname", "-m"], encoding='utf8').rstrip()
|
||||
if platform.system() == "Darwin":
|
||||
arch = "Darwin"
|
||||
|
|
BIN
phonelibs/acado/aarch64/lib/libacado_casadi.a (Stored with Git LFS)
BIN
phonelibs/acado/aarch64/lib/libacado_casadi.a (Stored with Git LFS)
Binary file not shown.
BIN
phonelibs/acado/aarch64/lib/libacado_csparse.a (Stored with Git LFS)
BIN
phonelibs/acado/aarch64/lib/libacado_csparse.a (Stored with Git LFS)
Binary file not shown.
BIN
phonelibs/acado/aarch64/lib/libacado_qpoases.a (Stored with Git LFS)
BIN
phonelibs/acado/aarch64/lib/libacado_qpoases.a (Stored with Git LFS)
Binary file not shown.
BIN
phonelibs/acado/aarch64/lib/libacado_toolkit.a (Stored with Git LFS)
BIN
phonelibs/acado/aarch64/lib/libacado_toolkit.a (Stored with Git LFS)
Binary file not shown.
|
@ -1 +0,0 @@
|
|||
libacado_toolkit_s.so.1
|
BIN
phonelibs/acado/aarch64/lib/libacado_toolkit_s.so.1.2.2beta (Stored with Git LFS)
BIN
phonelibs/acado/aarch64/lib/libacado_toolkit_s.so.1.2.2beta (Stored with Git LFS)
Binary file not shown.
|
@ -0,0 +1,29 @@
|
|||
#!/usr/bin/env sh
|
||||
set -e
|
||||
|
||||
rm -rf acado
|
||||
git clone https://github.com/acado/acado.git
|
||||
cd acado
|
||||
git reset --hard 5adb8cbcff5a5464706a48eaf073218ac87c9044
|
||||
|
||||
# Clang 8 fixes
|
||||
git apply ../01.patch
|
||||
sed -i '100d' cmake/CompilerOptions.cmake
|
||||
sed -i '100d' cmake/CompilerOptions.cmake
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DACADO_WITH_EXAMPLES=OFF -DACADO_BUILD_STATIC=ON -DCMAKE_INSTALL_PREFIX="$HOME/openpilot/phonelibs/acado" ..
|
||||
make -j$(nproc)
|
||||
make install
|
||||
|
||||
cd ..
|
||||
cd ..
|
||||
|
||||
rm -r x86_64
|
||||
mkdir x86_64
|
||||
mv lib x86_64/lib
|
||||
cp acado/build/lib/* x86_64/lib/
|
||||
|
||||
rm -rf acado
|
||||
rm -r share
|
|
@ -1,16 +0,0 @@
|
|||
git clone https://github.com/acado/acado.git
|
||||
cd acado
|
||||
git reset --hard 5adb8cbcff5a5464706a48eaf073218ac87c9044
|
||||
|
||||
|
||||
# Clang 8 fixes
|
||||
# git apply 01.patch
|
||||
# sed -i '100d' cmake/CompilerOptions.cmake
|
||||
# sed -i '100d' cmake/CompilerOptions.cmake
|
||||
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DACADO_WITH_EXAMPLES=OFF -DACADO_BUILD_STATIC=ON -DCMAKE_INSTALL_PREFIX="$HOME/one/phonelibs/acado" ..
|
||||
make -j4
|
||||
make install
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef ACADO_TOOLKIT_TEMPLATES_HPP
|
||||
#define ACADO_TOOLKIT_TEMPLATES_HPP
|
||||
|
||||
#define TEMPLATE_PATHS "/home/batman/tmpbld/acado/acado/code_generation/templates;/home/batman/one/phonelibs/acado/include/acado/code_generation/templates;/data/data/com.termux/files/home/one/phonelibs/acado/include/acado/code_generation/templates"
|
||||
#define TEMPLATE_PATHS "/home/batman/openpilot/phonelibs/acado/acado/acado/code_generation/templates;/home/batman/openpilot/phonelibs/acado/include/acado/code_generation/templates"
|
||||
|
||||
#define INTEGRATOR_MEX_TEMPLATE "integrator_mex.c.in"
|
||||
#define RHS_MEX_TEMPLATE "rhs_mex.c.in"
|
||||
|
|
BIN
phonelibs/acado/x64/lib/libacado_casadi.a (Stored with Git LFS)
BIN
phonelibs/acado/x64/lib/libacado_casadi.a (Stored with Git LFS)
Binary file not shown.
BIN
phonelibs/acado/x64/lib/libacado_csparse.a (Stored with Git LFS)
BIN
phonelibs/acado/x64/lib/libacado_csparse.a (Stored with Git LFS)
Binary file not shown.
BIN
phonelibs/acado/x64/lib/libacado_qpoases.a (Stored with Git LFS)
BIN
phonelibs/acado/x64/lib/libacado_qpoases.a (Stored with Git LFS)
Binary file not shown.
BIN
phonelibs/acado/x64/lib/libacado_toolkit.a (Stored with Git LFS)
BIN
phonelibs/acado/x64/lib/libacado_toolkit.a (Stored with Git LFS)
Binary file not shown.
|
@ -1 +0,0 @@
|
|||
libacado_toolkit_s.so.1
|
|
@ -1 +0,0 @@
|
|||
libacado_toolkit_s.so.1.2.2beta
|
BIN
phonelibs/acado/x64/lib/libacado_toolkit_s.so.1.2.2beta (Stored with Git LFS)
BIN
phonelibs/acado/x64/lib/libacado_toolkit_s.so.1.2.2beta (Stored with Git LFS)
Binary file not shown.
Binary file not shown.
|
@ -7,23 +7,40 @@ cpp_path = [
|
|||
"#phonelibs/qpoases/INCLUDE/EXTRAS",
|
||||
"#phonelibs/qpoases/SRC/",
|
||||
"#phonelibs/qpoases",
|
||||
"lib_mpc_export"
|
||||
|
||||
"lib_mpc_export",
|
||||
]
|
||||
|
||||
mpc_files = [
|
||||
"lateral_mpc.c",
|
||||
Glob("lib_mpc_export/*.c"),
|
||||
Glob("lib_mpc_export/*.cpp"),
|
||||
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)
|
||||
# if arch != "aarch64":
|
||||
# acado_libs = [File("#phonelibs/acado/x64/lib/libacado_toolkit.a"),
|
||||
# File("#phonelibs/acado/x64/lib/libacado_casadi.a"),
|
||||
# File("#phonelibs/acado/x64/lib/libacado_csparse.a")]
|
||||
# env.Program('generator', 'generator.cpp', LIBS=acado_libs, CPPPATH=cpp_path)
|
||||
|
|
|
@ -8,25 +8,41 @@ cpp_path = [
|
|||
"#phonelibs/qpoases/INCLUDE/EXTRAS",
|
||||
"#phonelibs/qpoases/SRC/",
|
||||
"#phonelibs/qpoases",
|
||||
"lib_mpc_export"
|
||||
|
||||
"lib_mpc_export",
|
||||
]
|
||||
|
||||
mpc_files = [
|
||||
"longitudinal_mpc.c",
|
||||
Glob("lib_mpc_export/*.c"),
|
||||
Glob("lib_mpc_export/*.cpp"),
|
||||
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('mpc1', mpc_files, LIBS=['m', 'qpoases'], LIBPATH=['lib_qp'], CPPPATH=cpp_path)
|
||||
env.SharedLibrary('mpc2', mpc_files, LIBS=['m', 'qpoases'], LIBPATH=['lib_qp'], CPPPATH=cpp_path)
|
||||
|
||||
# if arch != "aarch64":
|
||||
# acado_libs = [File("#phonelibs/acado/x64/lib/libacado_toolkit.a"),
|
||||
# File("#phonelibs/acado/x64/lib/libacado_casadi.a"),
|
||||
# File("#phonelibs/acado/x64/lib/libacado_csparse.a")]
|
||||
# env.Program('generator', 'generator.cpp', LIBS=acado_libs, CPPPATH=cpp_path)
|
||||
|
|
Loading…
Reference in New Issue