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.
		
		
		
		
			
				
					49 lines
				
				1.6 KiB
			
		
		
			
		
	
	
					49 lines
				
				1.6 KiB
			| 
											6 years ago
										 | Import('env', 'arch')
 | ||
|  | 
 | ||
|  | 
 | ||
|  | cpp_path = [
 | ||
|  |     "#phonelibs/acado/include",
 | ||
|  |     "#phonelibs/acado/include/acado",
 | ||
|  |     "#phonelibs/qpoases/INCLUDE",
 | ||
|  |     "#phonelibs/qpoases/INCLUDE/EXTRAS",
 | ||
|  |     "#phonelibs/qpoases/SRC/",
 | ||
|  |     "#phonelibs/qpoases",
 | ||
| 
											5 years ago
										 |     "lib_mpc_export",
 | ||
|  | ]
 | ||
| 
											6 years ago
										 | 
 | ||
| 
											5 years ago
										 | 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',
 | ||
| 
											6 years ago
										 | ]
 | ||
|  | 
 | ||
| 
											5 years ago
										 | generated_h = [
 | ||
|  |     'lib_mpc_export/acado_common.h',
 | ||
|  |     'lib_mpc_export/acado_auxiliary_functions.h',
 | ||
|  |     'lib_mpc_export/acado_qpoases_interface.hpp',
 | ||
| 
											6 years ago
										 | ]
 | ||
|  | 
 | ||
| 
											5 years ago
										 | 
 | ||
| 
											6 years ago
										 | interface_dir = Dir('lib_mpc_export')
 | ||
|  | 
 | ||
|  | SConscript(['#phonelibs/qpoases/SConscript'], variant_dir='lib_qp', exports=['interface_dir'])
 | ||
|  | 
 | ||
| 
											5 years ago
										 | 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
 | ||
| 
											4 years ago
										 | env.SharedLibrary('mpc0', mpc_files, LIBS=['m', 'qpoases'], LIBPATH=['lib_qp'], CPPPATH=cpp_path)
 | ||
| 
											6 years ago
										 | env.SharedLibrary('mpc1', mpc_files, LIBS=['m', 'qpoases'], LIBPATH=['lib_qp'], CPPPATH=cpp_path)
 |