Commit Graph

101 Commits

Author SHA1 Message Date
Comma Device 07e1c76eeb fix dmonitoring build after include cleanup
old-commit-hash: 6ffc183359f4823158f22fa332fb013c2c16795f
2021-05-08 23:30:35 -07:00
Dean Lee e333e4f189 Cleanup selfdrive/ includes (#20822)
* cleanup include path

* continue

* format includes

* fix testraw.cc

* remove include path from SConstruct

* regroup

* rebase master

* almost done

* apply review

* rename FileReader.xx to filereader.xx

* rename Unlogger.x->unlogger.x

* rename FrameReader.xx -> framereader.xx

* apply reviews

* ui.h

* continue

* fix framebuffer.cc build error:mv util.h up

* full path to msm_media_info

* fix qcom2 camerad

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 7222d0f20dc8edfe0d2f3417d1ce7c84fbd32805
2021-05-08 22:15:17 -07:00
Willem Melching 78bf4f5867 Replace ifdef with hw abstraction layer (#20843)
* Replace ifdefs with hardware abstraction layer (#20801)

* add type to class hadwareXXX

* replace ifdefs with hardware layer

* continue

* continue

* new function get_driver_view_transform

* full path to hw.h

* fix build error setup.cc

* apply review

* fix typo

* fix deprecated error:replace deprecated fromPath with new

* fix build error

* Fixes after ifdef clenaup (#20842)

* inheritance doesnt work with static

* fix debayer

* small cleanup

* Update selfdrive/camerad/cameras/camera_common.cc

* Update selfdrive/ui/qt/offroad/settings.cc

* Update selfdrive/common/modeldata.h

* flip conditions

* fix comment

Co-authored-by: Dean Lee <deanlee3@gmail.com>
old-commit-hash: ab319d4f54a53e1a0aa1c2c0d94d56a9acef8362
2021-05-06 14:39:05 +02:00
Willem Melching 39c18d4c5a Revert "Replace ifdefs with hardware abstraction layer (#20801)"
This reverts commit 9f2ad462f39f4c880f283b71bffbc9248a2b577d.

old-commit-hash: 3a95d3ccaae7168073410cd7d392a9564d9d45ba
2021-05-06 12:29:30 +02:00
Willem Melching f8608d2e7b Revert "Fixes after ifdef clenaup (#20842)"
This reverts commit 59c31bac9a340f120ff40ed541ee377c31e7e85e.

old-commit-hash: d34647bbf7f877f56bacaab04a2a0dc8a332fc6a
2021-05-06 12:29:19 +02:00
Willem Melching 3cc799ecd8 Fixes after ifdef clenaup (#20842)
old-commit-hash: fd7c2b4adf3844e8fc15b6b371cedf33438bbc22
2021-05-06 11:58:35 +02:00
Dean Lee e0282ced49 Replace ifdefs with hardware abstraction layer (#20801)
* add type to class hadwareXXX

* replace ifdefs with hardware layer

* continue

* continue

* new function get_driver_view_transform

* full path to hw.h

* fix build error setup.cc

* apply review

* fix typo

* fix deprecated error:replace deprecated fromPath with new

* fix build error
old-commit-hash: 757d2923d2bfcda620b252e21a348ac3f87f3a63
2021-05-06 11:41:46 +02:00
Adeeb Shihadeh 532d19427c bump cereal
old-commit-hash: 8a280fbb8eb433fbfe0fc43254c9cbdaceedbab6
2021-05-03 20:47:11 -07:00
HaraldSchafer 1d36adf351 no heading cost (#20594)
* no heading cost

* live mpc weight config

* need to add stds

* make work on empty data

* no divide by 0

* update refs

* update model replay

* update proc replat

* new model replay ref
old-commit-hash: d72d433ec7a3c9f0bb2f90d196b3826d48d9b1a0
2021-04-06 23:49:29 -07:00
Dean Lee f0565ee578 dmoniitoring: new function crop_yuv (#20344)
* crop_yuv

* shorten variables name

* space
old-commit-hash: fb37af00d422d495bf0460f5a4642404aaa67fdc
2021-03-30 20:11:46 -07:00
Dean Lee 405df8b165 Params: python-like interface (#20506)
* rebase master

* delete outdated test_params.c

* putBool & more robust getBool

* putBool(SshEnabled)
old-commit-hash: 98e55996f67aaaf715c941d417ae4d3b0187f388
2021-03-30 12:54:59 +02:00
Dean Lee e2f9e013a7 driving.h: fix indentation (#20315)
old-commit-hash: d5c17723dae207e446ddf9288ceee14674f4d8d9
2021-03-11 17:00:14 +01:00
Dean Lee 362c98e6ba softmax(): use std::max_element (#20306)
old-commit-hash: bca53f337f5425a017216df3d0804bc5a2be98a7
2021-03-11 15:05:13 +01:00
Adeeb Shihadeh 966945880b Cereal cleanup (#20003)
* start cleanup

* fan speed

* cleanup dm

* fix cereal

* hwType -> pandaType

* update refs

* update refs

* bump cereal

* freeSpacePercent

* cereal master
old-commit-hash: 000bd226aa9902da01e6010bf26762fca2c20df0
2021-02-03 19:57:30 -08:00
Comma Device a63dca4659 fix thneed build
old-commit-hash: dcd4bb4f4eac60439e354686b85a67d99c2b0458
2021-02-01 20:34:21 -08:00
Dean Lee 3f7488b73a model_publish: use kj::ArrayPtr<const float> raw_pred (#19917)
old-commit-hash: 0b7b7241c8fd314775fa2a5b3c7c1846ab3f2776
2021-02-01 19:08:17 -08:00
Dean Lee 04d7c01eda dmonitoring: use the same way as driving to build model output more clearly (#19933)
* Use the same way as driving to build model output more clearly

* rebase master
old-commit-hash: 2d0c249f4048fba02ad12f25a45f26df4742b444
2021-01-30 18:49:44 -08:00
ZwX1616 e961d9b64c pyTorch DM (#19760)
* new model files

* no more rot

* no rot no diag switch

* should be correct and cache aware

* 405d7aeb

* parse new outputs

* change uncertain policy accordingly

* 1bdbd9ed

* adjust

* 0.5 is fine

* 3d4f9cab

* no face prob no loss

* clean up

* clean up test

* update refs

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 8605ba8ab95bfe1edea69c648ccef4ea0c9f911e
2021-01-28 14:02:58 -08:00
Dean Lee 1a29755702 dmonitoring_publish: use kj::ArrayPtr<const float> raw_pred as paramater instead of float (#19916)
old-commit-hash: 8bb3c41cfd8c71d9dd2368da0a980d8f635e2a75
2021-01-27 14:30:12 -08:00
Dean Lee 8c963586f8 model_init: remove memset (#19921)
old-commit-hash: ccf055fd6267bd6bfa0189d2f61d39574548fa80
2021-01-26 16:56:37 +01:00
Dean Lee 898c93dcbf dmonitoring_init: use &s->output[0] instead of &s->output (#19918)
old-commit-hash: 4bfed95071efbde6c8bb29b7b7252665ab73de05
2021-01-26 16:07:57 +01:00
Dean Lee 52e1efffd5 modeld: remove template from fill_meta (#19862)
old-commit-hash: 1e617a3931608d38d37180c19eeb5f6f39b50efd
2021-01-20 20:50:24 -08:00
George Hotz 3484683199 Thneed load/save (#19700)
* start thneed load/save

* compiling

* fix loading

* build thneed model in scons

* don't hardcode /data/openpilot

* release files

* those too

* support for loading/saving binary kernels

* save binaries out of json band

* make binary a command line flag to the compiler

* need include assert

* fix shadowed common in SConscript

* cleanup run.h

* hmm, the recurrent buffer wasn't 0ed

* ugh, unique ptr

* remove power constraint, refactor record

* Revert "remove power constraint, refactor record"

This reverts commit bb6fa52db6df59cd9d6420a6f630430e35af8a5e.

* print on thneed stop

* fingers crossed for this one

* recorded

* just curious

* okay okay, pass tests?

* cleanups

* refactor wait

Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 59fac9fdc630fa78f520fc9a244f9f9cd39fa562
2021-01-19 18:08:31 -08:00
HaraldSchafer 5c2c6691b2 remove old model packet (#19769)
* remove publisher

* move to V2

* radard new model

* fix plant

* change packety

* need hack here too

* change to new

* this has been wrong all along

* no more model msg

* subscribe to new model

* not needed anymore

* make work

* need to ignore that too

* should pass tests, needs car test

* fix process replay

* no more poly

* update refs

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 124100d0fa42485edaf86cb25f77f27e8917eed1
2021-01-19 17:15:16 -08:00
ZwX1616 744d263288 compensate for tilt
old-commit-hash: 78cd373c4bae8190154639f6c5a42171c0f76b19
2021-01-14 21:23:52 -08:00
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: 158210cde8e689daa04bcaa1e502727cf7bfddb6
2021-01-14 18:43:50 -08:00
Comma Device 25dbb18f73 fix rounding error
old-commit-hash: 451d4590cf99d2231e2705005ff05b884887b96c
2021-01-14 21:59:26 +00:00
ZwX1616 fa97a4c7be fix tici dm
old-commit-hash: 9eb7688dfe6c8eea85c0053c235434bd575b8945
2021-01-12 21:17:54 -08:00
Dean Lee 5561bb058d dmonitoringd: add helper function get_yuv_buf (#19590)
old-commit-hash: d39d737ae0e79d9706d829969bff7d56fb2e1b2b
2021-01-08 15:30:06 -08:00
Dean Lee b1b5baf5e9 shorten variable name (#19659)
old-commit-hash: 170ece1ddd28a76ee672becf852defe27287f484
2021-01-05 12:57:31 +01:00
HaraldSchafer 89b03fa2ee Test model refactor (#2720)
* template funcion fill_meta

* add function get_plan_max_idx

* add function get_mdn_max_idx

* remove temp builder variables

* get_mdn_max_idx->get_lead_data

* get_pan_max_idx->get_plan_data

* fill_lane_line

* combine fill_lane_line&fill_path into one function

* fill_lead_vw

* using unique_ptr

* prefer using constexpr

* more constexpr,remove duplicate defined TRAJECTORY_SIZE

* remove suffix _arr from variable name

* misc

* remove extern c

* refactor model_publish

* remove unused paramaters

* traffic_convention to c style array

* c style array:prev_desire&pulse_desire

* fix error&make easy for review

* const mat3 &transform

* move cl_command_queue into ModelState

* use maco LEAD_MHP_SELECTION

* move constexpr from .h to .cc

* remove #define MODEL_NAME

* modeldata.h: contexpr

* remove param temporal from model_init

* helper function get_best_data

* fix probs

* int

Co-authored-by: deanlee <deanlee3@gmail.com>
old-commit-hash: 630c7309a560e573a9398acd77c96aedcb65dfae
2020-12-09 22:48:14 -08:00
Adeeb Shihadeh 8809fc68e7 log DSP execution time (#2723)
* log dsp execution time

* don't need that
old-commit-hash: b3fd759fe83f0adb6be7f5a0d970fe4621cd24ff
2020-12-08 17:28:47 -08:00
HoverB_SN_11 3ea014d35d too wide
old-commit-hash: 18c9e42520fb38c5b121e0b0312c92b0f110b478
2020-12-08 19:31:38 +00:00
Dean Lee fb9298b120 fix fille lead (#2703)
old-commit-hash: 531b85b983f8f737ef71d17bf7b68893effcde3e
2020-12-06 13:02:23 -08:00
ZwX1616 f4bdc2127c raw pred api (#2611)
* send both

* update cereal

* ptr type

* this is fine

* clean up

* v1 and v2

* header

* update cereal

* cereal
old-commit-hash: f30d15ea24c3d122b55c2789dc996725f13d0bd6
2020-12-02 18:46:12 -08:00
Dean Lee df9e0b2cb4 simplify building capnp messages with arrays (#2617)
old-commit-hash: bd4f6650faea8b3c42a99087b4f1ce0560b7d652
2020-11-30 12:08:52 +01:00
Dean Lee 57138a6e0f Error checking macros for opencl (#2615)
* macro CL_CHECK&CL_CHECK_ERR

* trigger checks
old-commit-hash: 42183d913f197fb6f9cc1d90322a1b891d46878a
2020-11-30 12:04:49 +01:00
George Hotz c22f0fc034 Make the DSP work everywhere (#2621)
* Use DSP again

* 20 Hz

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: bdb1b766d03d6f2ffa87a15971f6718f4cdc5e58
2020-11-30 11:21:06 +01:00
Willem Melching 19855c90f1 remove check on frame drop in modeld (#2638)
old-commit-hash: feaecbd615a13a93b9486aeb6777c854ae0b0e6a
2020-11-27 16:13:37 +01:00
George Hotz 7ce6b3e65e Prerotate dmonitoringmodeld input (#2606)
* not tested, but something like this

* more like this

* dl and ur may still be flipped

* they were flipped

* Revert "they were flipped"

This reverts commit fbd477bb4407c9e051fad7d6a3f0825ca3d23c11.

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 327aa123f4265f782fac0e8b29927b8d098a7c39
2020-11-23 17:42:01 -08:00
Adeeb Shihadeh 4be6d905dc update frame drop filter (#2592)
old-commit-hash: d92f923d70712e541de59bf76f23a494dd0c46b4
2020-11-21 14:50:53 -08:00
Adeeb Shihadeh 1a99d77746 log DM model execution time (#2589)
old-commit-hash: 580589b2507bf344cd692a47b52edf85fa7bd784
2020-11-20 13:38:31 -08:00
Comma Device 51711af7ff fix some lack of cache awareness in yuvframe2tensor
old-commit-hash: 826c21b045b09d6e28b313b3c57cd62800febb16
2020-11-20 18:03:06 +00:00
HaraldSchafer 7c8ea30532 fix frame drop percentage (#2578)
* correct, I think

* add model execution time

* remove unused

* token is a file

* this is gonna change

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 7378bc42845a094bbb22fb76154cb40ecb098aaf
2020-11-19 21:05:29 -08:00
HaraldSchafer faad598e29 Minor fixes 08 (#2565)
* correct indexes

* best metrics yet 30231f46-08af-477e-9d30-776593913c24/700

* sometimes x decreases

* update model refs

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 7b216e7cbb30f9a7b164cc17bb66b348d728b65e
2020-11-17 20:04:32 -08:00
HaraldSchafer 008f37c749 Torch model (#2452)
* refactor draw model

* rebase master

* correct valid_len

* rename function

* rename variables

* white space

* rebase to master

* e16c13ac-927d-455e-ae0a-81b482a2c787

* start rewriting

* save proress

* compiles!

* oops

* many fixes

* seems to work

* fix desires

* finally cleaned

* wrong std for ll

* dont pulse none

* compiles!

* ready to test

* WIP does not compile

* compiles

* various fixes

* does something!

* full 3d

* not needed

* draw up to 100m

* fix segfault

* wrong sign

* fix flicker

* add road edges

* finish v2 packet

* Added pytorch supercombo

* fix rebase

* no more keras

* Hacky solution to the NCHW/NHWC incompatibility between SNPE and our frame data

* dont break dmonitoringd, final model 229e3ce1-7259-412b-85e6-cc646d70f1d8/430

* fix hack

* Revert "fix hack"

This reverts commit 5550fc01a7881d065a5eddbbb42dac55ef7ec36c.

* Removed axis permutation hack

* Folded padding layers into conv layers

* Removed the last pad layer from the dlc

* Revert "Removed the last pad layer from the dlc"

This reverts commit b85f24b9e1d04abf64e85901a7ff49e00d82020a.

* Revert "Folded padding layers into conv layers"

This reverts commit b8d1773e4e76dea481acebbfad6a6235fbb58463.

* vision model: 5034ac8b-5703-4a49-948b-11c064d10880/780  temporal model: 229e3ce1-7259-412b-85e6-cc646d70f1d8/430  with permute + pool opt

* fix ui drawing with clips

* ./compile_torch.py 5034ac8b-5703-4a49-948b-11c064d10880/780 dfcd2375-81d8-49df-95bf-1d2d6ad86010/450 with variable history length

* std::clamp

* not sure how this compiled before

* 2895ace6-a296-47ac-86e6-17ea800a74e5/550

* db090195-8810-42de-ab38-bb835d775d87/601

* 5m is very little

* onnx runner

* add onnxruntime to pipfile

* run in real time without using the whole CPU

* bump cereal;

* add stds

* set road edge opacity based on stddev

* don't access the model packet in paint

* convert mat.h to a c++ header file (#2499)

* update tests

* safety first

Co-authored-by: deanlee <deanlee3@gmail.com>
Co-authored-by: mitchell <mitchell@comma.ai>
Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: George Hotz <george@comma.ai>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 08846b5c0ec3a5299c8cb73904da15a18d3aaccf
2020-11-11 20:31:46 -08:00
Willem Melching fc0b6f099f Revert "convert mat.h to a c++ header file (#2499)"
This reverts commit 607866bb60ba1c69c6f777082c5ea787e895a251.

old-commit-hash: f2c8a6122d881fbee5bbdd1cf16f8541ce33260b
2020-11-09 01:41:36 -08:00
Dean Lee 13a25b9e27 convert mat.h to a c++ header file (#2499)
old-commit-hash: 519c043a63c9286f55b5a4325604489da087957a
2020-11-09 01:19:09 -08:00
Willem Melching 498ecbdf3c Params refactor, simplified (#2300)
* always c++

* Create C++ params class

* get works

* tests hang now

* passes tests

* cleanup string formatting

* handle interrupt in blocking read

* fix memory leak

* remove unused constructor

* Use delete_db_value directly

* Rename put -> write_db_value

* filename cleanup

* no semicolons in cython

* Update common/SConscript

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* add std::string version of delete_db_value

* This is handled

* cleanup encoding

* Add clear method to clear all

* add persistent params

* fix android build

* Should be called clear_all

* only import params when needed

* set params path on manager import

* recusrively create directories

* Fix function order

* cleanup mkdirp

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 2e182e5c574ea1468678b5fd8d0597e34ed5898d
2020-10-13 16:23:23 +02:00
Willem Melching a331861873 Remove czmq part 1 (#2332)
* remove czmq

* remove streaming mode from loggerd

* Add include for usleep
old-commit-hash: a4ccfcffe8247bf467bddfb0e6c5b3eb8851e21a
2020-10-13 16:01:07 +02:00