Skip to content
Permalink
Browse files

Kalman filter compilation cleanup (#1080)

* start cleanup

* create generated dir if not exist

* tests pass!

* everything works again

* also convert live_kf to new structure

* Remove sympy helpers from file list

* Add laika to docker container

* Only build models that are present
  • Loading branch information
pd0wm committed Feb 12, 2020
1 parent a790892 commit 47fd50ca60da419b34469dbc293f1a7f0d3d46a9
Showing with 1,454 additions and 1,448 deletions.
  1. +2 −0 Dockerfile.openpilot
  2. +1 −0 SConstruct
  3. +0 −1 release/files_common
  4. +1 −5 selfdrive/locationd/kalman/.gitignore
  5. +30 −0 selfdrive/locationd/kalman/SConscript
  6. +0 −323 selfdrive/locationd/kalman/feature_handler.py
  7. +0 −105 selfdrive/locationd/kalman/gnss_kf.py
  8. +0 −93 selfdrive/locationd/kalman/gnss_model.py
  9. +22 −0 selfdrive/locationd/kalman/{kalman_helpers.py → helpers/__init__.py}
  10. 0 selfdrive/locationd/kalman/{ → helpers}/chi2_lookup.py
  11. BIN selfdrive/locationd/kalman/{ → helpers}/chi2_lookup_table.npy
  12. +16 −13 selfdrive/locationd/kalman/{ → helpers}/ekf_sym.py
  13. +159 −0 selfdrive/locationd/kalman/helpers/feature_handler.py
  14. +177 −0 selfdrive/locationd/kalman/helpers/lst_sq_computer.py
  15. +2 −0 {common → selfdrive/locationd/kalman/helpers}/sympy_helpers.py
  16. +0 −142 selfdrive/locationd/kalman/live_kf.py
  17. +0 −178 selfdrive/locationd/kalman/live_model.py
  18. +0 −323 selfdrive/locationd/kalman/loc_kf.py
  19. +0 −254 selfdrive/locationd/kalman/loc_model.py
  20. 0 selfdrive/locationd/kalman/models/__init__.py
  21. +176 −0 selfdrive/locationd/kalman/models/gnss_kf.py
  22. +293 −0 selfdrive/locationd/kalman/models/live_kf.py
  23. +559 −0 selfdrive/locationd/kalman/models/loc_kf.py
  24. +8 −5 selfdrive/locationd/kalman/{ → templates}/compute_pos.c
  25. 0 selfdrive/locationd/kalman/{ → templates}/ekf_c.c
  26. +6 −4 selfdrive/locationd/kalman/{ → templates}/feature_handler.c
  27. +1 −1 selfdrive/locationd/locationd_yawrate.cc
  28. +1 −1 selfdrive/locationd/locationd_yawrate.h
@@ -81,6 +81,8 @@ COPY ./pyextra /tmp/openpilot/pyextra
COPY ./panda /tmp/openpilot/panda
COPY ./external /tmp/openpilot/external
COPY ./tools /tmp/openpilot/tools
COPY ./laika /tmp/openpilot/laika
COPY ./laika_repo /tmp/openpilot/laika_repo

COPY SConstruct /tmp/openpilot/SConstruct

@@ -228,5 +228,6 @@ if arch == "aarch64":
SConscript(['selfdrive/clocksd/SConscript'])

SConscript(['selfdrive/locationd/SConscript'])
SConscript(['selfdrive/locationd/kalman/SConscript'])

# TODO: finish cereal, dbcbuilder, MPC
@@ -28,7 +28,6 @@ common/profiler.py
common/testing.py
common/basedir.py
common/filter_simple.py
common/sympy_helpers.py
common/stat_live.py
common/spinner.py
common/cython_hacks.py
@@ -1,5 +1 @@
lane.cpp
gnss.cpp
loc*.cpp
live.cpp
pos_computer*.cpp
generated/
@@ -0,0 +1,30 @@
Import('env')

templates = Glob('templates/*')
sympy_helpers = "helpers/sympy_helpers.py"
ekf_sym = "helpers/ekf_sym.py"

to_build = {
'pos_computer_4': 'helpers/lst_sq_computer.py',
'feature_handler_5': 'helpers/feature_handler.py',
'gnss': 'models/gnss_kf.py',
'loc_4': 'models/loc_kf.py',
'live': 'models/live_kf.py',
'lane': '#xx/pipeline/lib/ekf/lane_kf.py',
}

found = {}

for target, command in to_build.items():
if File(command).exists():
found[target] = command

for target, command in found.items():
target_files = File([f'generated/{target}.cpp', f'generated/{target}.h'])
command_file = File(command)
env.Command(target_files,
[templates, command_file, sympy_helpers, ekf_sym],
command_file.get_abspath()
)

env.SharedLibrary('generated/' + target, target_files[0])

This file was deleted.

0 comments on commit 47fd50c

Please sign in to comment.
You can’t perform that action at this time.