From d86c7b7d1585fdcce4b9837a4387e852aba01904 Mon Sep 17 00:00:00 2001 From: George Hotz Date: Thu, 13 Feb 2020 16:13:05 -0800 Subject: [PATCH] build lst_sq_computer 4 and 5 --- selfdrive/locationd/kalman/SConscript | 3 ++- selfdrive/locationd/kalman/helpers/lst_sq_computer.py | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/selfdrive/locationd/kalman/SConscript b/selfdrive/locationd/kalman/SConscript index 1fca255c3c..2a67ad64fe 100644 --- a/selfdrive/locationd/kalman/SConscript +++ b/selfdrive/locationd/kalman/SConscript @@ -6,6 +6,7 @@ ekf_sym = "helpers/ekf_sym.py" to_build = { 'pos_computer_4': 'helpers/lst_sq_computer.py', + 'pos_computer_5': 'helpers/lst_sq_computer.py', 'feature_handler_5': 'helpers/feature_handler.py', 'gnss': 'models/gnss_kf.py', 'loc_4': 'models/loc_kf.py', @@ -24,7 +25,7 @@ for target, command in found.items(): command_file = File(command) env.Command(target_files, [templates, command_file, sympy_helpers, ekf_sym], - command_file.get_abspath() + command_file.get_abspath()+" "+target ) env.SharedLibrary('generated/' + target, target_files[0]) diff --git a/selfdrive/locationd/kalman/helpers/lst_sq_computer.py b/selfdrive/locationd/kalman/helpers/lst_sq_computer.py index 3f46a7c07c..485458900a 100755 --- a/selfdrive/locationd/kalman/helpers/lst_sq_computer.py +++ b/selfdrive/locationd/kalman/helpers/lst_sq_computer.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 - import os +import sys import numpy as np import sympy as sp @@ -174,5 +174,6 @@ def project(poses, ecef_pos): if __name__ == "__main__": - # TODO: get K from argparse - LstSqComputer.generate_code() + K = int(sys.argv[1].split("_")[-1]) + LstSqComputer.generate_code(K=K) +