Commit Graph

182 Commits

Author SHA1 Message Date
Willem Melching b5e8c1acdb modeld.cc fix matrix storage order
old-commit-hash: c3931074bfa43b1d7e896b36314f347ae928d38c
2021-03-03 14:48:22 +01:00
Willem Melching fc10bc8091 modeld.cc construct matrix directly from data
old-commit-hash: a27245e6c193624800bee06f9f9cab3b5c95953c
2021-03-03 13:09:14 +01:00
Dean Lee 5e19cdb0d3 move intrinsic_matrix into modeldata.h, removed duplicate definitions. (#20051)
* move intrinsic_matrix into modeldata.h

* def __cplusplus
old-commit-hash: ae72d34a42f23e9b295641e1b0f50515434d6d1f
2021-03-03 11:47:48 +01:00
Adeeb Shihadeh 05eb44115e cereal cleanup part 2 (#20092)
* car stuff

* thermal

* Revert "car stuff"

This reverts commit 77fd1c65ebd01abfa8493ae12c9e6b14f7ada976.

* panda state

* camera stuff

* start deg

* most is building

* builds

* planner + controls run

* fix up paramsd

* cleanup

* process replay passes

* fix webcam build

* camerad

* no more frame

* thermald

* ui

* paramsd

* camera replay

* fix long tests

* fix camerad tests

* maxSteeringAngle

* bump cereal

* more frame

* cereal master
old-commit-hash: 312b681a46b8153314a8420611b6479dd6f70dfc
2021-02-16 21:39:32 -08:00
Adeeb Shihadeh 01d65286f0 make thneed compile more robust
old-commit-hash: 5930749a127cfab11d2e541ad279527645352813
2021-02-05 00:54:57 -08:00
Willem Melching dadeec50dd thneed: lookup dlsym offset at compile time (#20019)
old-commit-hash: 1744076514a9aa5bf9d7e7940ddbd9c431c551bf
2021-02-04 16:41:46 +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
Dean Lee 04adbaf8e1 Don't call function in assert (#19997)
old-commit-hash: 91504176e403ca1bb6bd9491ce9e2075b7f4bae0
2021-02-02 13:18:11 +01: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 2a95f73b84 Thneed::clinit() : use cl_get_device_id helper(#19934)
old-commit-hash: 21f45e3ef49fece453feeefa1c65286c36bfc14b
2021-01-27 12:09:28 +01: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 99a831dd5c replace std::this_thread::sleep_for with util::sleep_fo (#19717)
old-commit-hash: 72bb55247cb82d9a1517b516dab535b9502864c4
2021-01-11 11:59:48 +01:00
Dean Lee 4c1919f41e merge utilpp.h into util.h (#19710)
old-commit-hash: 595830135bb79c8b23eb8339ae768ca7b6a822f8
2021-01-10 14:57:32 -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
Willem Melching 3f950832b9 VisionIPC 2.0 (#19641)
* Squashed vipc

* Update release files

* Remove else

* add visionipc to release files

* use poller in vipc receive

* opencl framework instead of lib on macos

* Fix camera webcam

* Fix opencl on mac in ui

* more webcam fixes

* typo in ui sconsfile

* Use cur_yuv_buf

* visionbuf c++ class

* Camera qcom was still using visionbuf_allocate

* Turn loggerd back on

* fix snapshot

* No build needed

* update test camerad

* no more release callback

* make encoder c++

* Revert "no more release callback"

This reverts commit e5707b07002fee665d0483d90713154efc2d70d4.

* fix exit handlers

* No need to check errno

* move release callback call

* s/VIPCBufExtra/VisionIpcBufExtra/g

* use non blocking connect

* ui use non blocking connect

* Lower condition variable wait time

* Snapshot cleanup

* bump cereal

* bump cereal
old-commit-hash: fb496c692a9ebdcda15069a8d4eb95734b587d68
2021-01-08 14:54:25 +01:00
Dean Lee 5e557ed96d common exit handler (#19661)
* common signal handle

* fix typo

* rename to ExitHandler

* remove include signal.h

* remove include csignal

* rename variable exit to v

* rebase master
old-commit-hash: 86fe2d1697531bebdf5d0d83609e91ed4006f54b
2021-01-05 20:19:53 -08:00
Dean Lee b1b5baf5e9 shorten variable name (#19659)
old-commit-hash: 170ece1ddd28a76ee672becf852defe27287f484
2021-01-05 12:57:31 +01:00
Dean Lee bbfb751d69 Replace usleep with util::sleep_for (#19643)
* replace usleep with sleep_for

* sleep microseconds

* sleep nanoseconds

* Trigger Build
old-commit-hash: c1cf0882bd4e0fce5e1a581536f6a0e7afb640e6
2021-01-04 18:03:11 +01:00
Adeeb Shihadeh 5bbe4f3d52 manager tests + make all processes exit cleanly (#19595)
* manager tests

* logcatd exits cleanly

* sigint

* boardd

* multiple dbus connections hangs for some reason

* clocksd proclogd

* network type from thermal

* fix tests

* fix android logcatd

* fix mac

* fix mac proclogd

* move on device athena tests

* build first

* build first

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: ffa7e0cbdb0859751685caae1321d3ccf732fed9
2020-12-29 22:32:03 -08:00
Adeeb Shihadeh 762eda95cd Set GPU priorities + improved modeld priorities (#2691)
* give gpu threads rt priority

* modeld gets highest prio on core 2

* fix frame stream

* lower prio of cal thread

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: c57ee16e86275820f97631fb79df1685e914d564
2020-12-15 19:22:03 -08:00
George Hotz 02a2f9ca15 Thneed refactors for future functions (#2673)
* delete debug

* thneed updates, but it seems slower

* thneed refactor

* refactor touchups

* add back asserts

* fix uaf

* track the size for local args

* final thneed refactor

* switch kgsl_command_object to avoid memory leak

* comments

* unused includes

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 5fdda8dbd82954c2b9b5af82a19e599d3b4b5ec2
2020-12-14 15:46:49 -08:00
Adeeb Shihadeh c09d84218d model timing benchmark script
old-commit-hash: 5ba7276118a458c0caf377d34d0c82b58db607bc
2020-12-13 19:08:49 -08:00
Dean Lee 75e3d20dac convert loadyuv.c to loadyuv.cc (#2754)
old-commit-hash: d6eead25d0448d11c552d4d56a663e455deae720
2020-12-12 17:10:51 -08:00
Dean Lee 252b63ba15 transform.h: remove extern "C" (#2755)
old-commit-hash: 0fcfb07f1fcc3e6cf6670a400b701888c11a5ada
2020-12-12 00:00:07 -08:00
Dean Lee 9be81a6f99 clutil refactor (#2733)
* cleaup clutil.h

* clutil.c -> clutil.cc

* std::hash

* try simplify functions

* using namespace group help functions

* continue

* add function get_platform_info

* continue

* remove caching

* struct CLContext

* std::cout & CL_ERR_TO_STR

* remove CLU_NO_CACHE

* Revert "struct CLContext"

This reverts commit 882e413f227e4c1ba4bb83f956cc67739a189221.

* cl_get_error_string : remove undefied error codes

* replace all printf with std::cout

* util::read_file

* cleanup

* revert CL_ERR_TO_STR

* simplify

* add macro CL_ERR_TO_STR

* cl_get_error_string: fix undeclared errors

* log_size should not +1

* use std::stirng log

* apply review
old-commit-hash: 3c08d0f1f7e7c9f376fd69fd46067c6f6ff59d39
2020-12-11 13:05:32 +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
Mitchell Goff 711d60239a Added model_replay and fixed some bugs in camera_replay (#2679)
* Added model_replay and fixed some bugs in camera_replay

* Unpack capnp logs on device

* add sync to device

* GPU now also works on PC

* update model ref

* update refs

* dont change this one

* Use pipeline calib instead of rlog calib

* remove that

* update refs

Co-authored-by: Willem Melching <willem.melching@gmail.com>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: bbe9accd4d1436b02281a3e8af2427f1cca5af49
2020-12-08 19:01:59 -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
Comma Device 2bc2c7c9b3 mask out the priority
old-commit-hash: 71930a4b9674037f494b622fb0002904b2e35a2a
2020-11-24 06:05:59 +00:00
Comma Device 8cb58c9d20 give the model GPU context highest priority
old-commit-hash: 5a8c90f32ca62df581053e47e59a35735d07b406
2020-11-24 05:57:34 +00:00
George Hotz 55df5b0ddf More governance work, fix thneed (#2610)
* more governance work

* fix thneed on qcom2

* waste doesn't OOM

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: a14ce090184af790d7e677b1f0a1107c7ade8a34
2020-11-23 17:52:28 -08:00