Commit Graph

69 Commits

Author SHA1 Message Date
Adeeb Shihadeh
9a45a3b99b Move selfdrive/hardware/ to system/ (#24725)
* move hardware to system/

* fix mypy
old-commit-hash: 1139fe507b
2022-06-11 16:38:24 -07:00
ZwX1616
c73d4e5fc6 Revert fullframe DM model (#24812)
* Revert "fullframe DM: flip RHD yaw to use matching thresholds"

This reverts commit ce7daabc8847d18ba46e5d1879f5a6958d04ccc7.

* Revert "fullframe DM model (#24762)"

This reverts commit 817be81fb19004f4873881f6b29dcdfffbe7e3a8.

* revert cereal
old-commit-hash: c646eeee0a
2022-06-10 16:16:46 -07:00
ZwX1616
02f0f39b52 fullframe DM model (#24762)
* get log

* simplify two nonsense

* not needed

* libyuv is a joke

* clean up

* try small

* fast but not bad

* working

* clean up driverview

* simplified

* thats mirrored

* smol

* tweak

* ref is screen

* w/ ee

* update camera model

* no if TICI

* start

* update pose thresh

* less cpu more dsp

* new libyuv

* new snpe

* add files

* test

* should be fast

* update out len

* trigger test

* use master snpe

* add cereal

* update cereal

* refactor parsing

* missing ;

* get

* wrong type

* test model

* use driver data

* 10829278-72fe-4283-a118-2cef959ce174/1550

* no pf

* adapt driverview

* ;

* rhd learner

* update libyuv buildi x64

* ad4337ea

* remove blink slack

* test

* no

* use toggle

* b16

* fix for nv12

* 5b02cff5 both

* update test

* update cereal

* update cereal

* update cereal

* v2 packets

* revert libyuv

* no /

* update snpemodel

* ;

* memcpy

* fix test

* use toggle in driverview

* update power

* update replay

* Revert "update replay"

This reverts commit 1d0979ca59dbc89bc5890656e9501e83f0556d50.

* update model ref

* halve cpu

* fake 8bit onnx runner

* same thresh as report

* cereal master

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: d6c07a6b15
2022-06-08 20:13:46 -07:00
Willem Melching
753045c73d less TICI when not needed (#24698)
* less TICI when not needed

* fix process replay

* move reading voltages into hw abstraction layer

* Update selfdrive/hardware/tici/hardware.h

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

* Update selfdrive/hardware/hw.h

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

* Update selfdrive/hardware/base.h

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

* rename init function

* Update selfdrive/athena/athenad.py

Co-authored-by: Robbe Derks <robbe.derks@gmail.com>

* Update selfdrive/boardd/boardd.cc

* Apply suggestions from code review

* Update selfdrive/thermald/thermald.py

* update ref

* fix alert width if all cameras are bad

* add ecam to test_loggerd

* bump cereal

* bump cereal

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Robbe Derks <robbe.derks@gmail.com>
old-commit-hash: f49a9c9fd2
2022-06-02 15:20:51 +02:00
George Hotz
2a6ffaf71d nv12: encoderd avoids a full frame copy (#24519)
* rgb to nv12

* nv12 works (w memcpy)

* correct now

* no copy

* fix nv12 with fast debayer

* reverts of unused stuff

* ui use nv12

* comment out thumbnails for now

* rebase fix

* dm read nv12

* model read nv12

* fix ffmpeg encoder

* thumbnails from nv12

* replay to nv12

* python framereader support nv12

* remove hardcoded frame/buffer sizes

* fix build

* ffmpeg encoder fix buffers

* small cleanup

* reduce power usage test

* fix cpu usage test

* fix snapshot

* fix loggerd test

* bump cereal

Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Joost Wooning <jwooning@gmail.com>
old-commit-hash: ea5b8cdfb1
2022-06-01 17:18:28 +02:00
Adeeb Shihadeh
f4675fc260 Merge common/ and selfdrive/common (#24556)
* Merge common/ and selfdrive/common

* fix that

* fix version

* fix unit tests
old-commit-hash: cb8885cffb
2022-05-18 14:11:57 -07:00
Adeeb Shihadeh
39de4d80b4 move models to selfdrive/modeld/ (#24539)
* move models to selfdrive/modeld/

* two more refs
old-commit-hash: 319f3d1475
2022-05-15 17:29:09 -07:00
ZwX1616
e8a8e37185 DM: more precision running on DSP + e2e outputs (#23900)
* update cereal

* run but not use

* log distraction type

* regression scaling

* clean up naming

* add calib buf

* add to header

* fake model

* no calib model

* adjust threshs

* 018a305f

* fix bn

* tweak1

* tweak2

* 0ff2/666

* tweak3

* t4

* t5

* fix out of bound

* skip when replaying old segments

* update ref

* fix onnxmodel

* get calib

* update model replay refs

* up ref
old-commit-hash: de4031c98e
2022-03-15 19:02:21 -07:00
Willem Melching
ad5ccabce3 bigmodel (#23684)
* Added wide cam vipc client and bigmodel transform logic

* Added wide_frame to ModelState, should still work normally

* Refactored image input into addImage method, should still work normally

* Updated thneed/compile.cc

* Bigmodel, untested: 44f83118-b375-4d4c-ae12-2017124f0cf4/200

* Have to initialize extra buffer in SNPEModel

* Default paramater value in the wrong place I think

* Move USE_EXTRA to SConscript

* New model: 6c34d59a-acc3-4877-84bd-904c10745ba6/250

* move use extra check to runtime, not on C2

* this is always true

* more C2 checks

* log if frames are out of sync

* more logging on no frame

* store in pointer

* print sof

* add sync logic

* log based on sof difference as well

* keep both models

* less assumptions

* define above thneed

* typo

* simplify

* no need for second client is main is already wide

* more comments update

* no optional reference

* more logging to debug lags

* add to release files

* both defines

* New model: 6831a77f-2574-4bfb-8077-79b0972a2771/950

* Path offset no longer relevant

* Remove duplicate execute

* Moved bigmodel back to big_supercombo.dlc

* add wide vipc stream

* Tici must be tici

* Needs state too

* add wide cam support to model replay

* handle syncing better

* ugh, c2

* print that

* handle ecam lag

* skip first one

* so close

* update refs

Co-authored-by: mitchellgoffpc <mitchellgoffpc@gmail.com>
Co-authored-by: Harald Schafer <harald.the.engineer@gmail.com>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 85efde269d
2022-02-19 16:06:31 -08:00
Dean Lee
ad8ab75ede commonmodel.h: move global model size into class ModelFrame (#23193)
* move to class ModelFrame

* remove defines in dmonitoring as well

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 13ad02bc06
2021-12-13 14:58:21 +01:00
Willem Melching
bc267926ce dmonitoring/DriverView: get crop_rect & transform by video size (#23169)
* dmonitoring/DriverView: get crop_rect & transform by video size (#23014)

* keep rounding the same

Co-authored-by: Dean Lee <deanlee3@gmail.com>
old-commit-hash: f93d89b888
2021-12-09 16:20:50 +01:00
Willem Melching
f44ac2a806 Revert "dmonitoring/DriverView: get crop_rect & transform by video size (#23014)"
This reverts commit e312313d5c75a3914cdabc6e1382df602b005c84.

old-commit-hash: b5fdf646ff
2021-12-08 19:13:38 +01:00
Dean Lee
1e45fe1ee7 dmonitoring/DriverView: get crop_rect & transform by video size (#23014)
old-commit-hash: 1af715d6a2
2021-12-08 17:51:56 +01:00
ZwX1616
fc1954492b dmonitoringmodeld: fix black padding not black after libyuv.I420Scale (#22971)
* true black

* set black once

* move def

* add commnet

* Update selfdrive/modeld/models/dmonitoring.cc

* Update selfdrive/modeld/models/dmonitoring.cc

* Update selfdrive/modeld/models/dmonitoring.cc

* Update selfdrive/modeld/models/dmonitoring.cc

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 80940b9844
2021-11-19 12:16:23 -08:00
ZwX1616
d4cbef299b wider FOV DM on comma three (#22286)
* c3 is straightforward

* c2 transform

* c3 preview

* alpha model

* Revert "alpha model": wrong quantization data

This reverts commit b50e5739735b30d960aca22bcf3cbe23b0121e13.

* yuv looks good

* a55b

* const int

* block top deadzone

* new box alpha curve

* update k

* fix debug

* rhd use same offset

* box shift for rhd

* 7e3e

* set new thresh

* update ref

* explain

* remove e2e

* same metric thresh

* process isocc

* model

* cancel extra policy

* update numbers

* new model

* update cereal

* up cereal

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 8574e79fec
2021-10-13 17:00:46 -07:00
Dean Lee
a02ecc02c4 ONNXModel: use the actual model file name (#22084)
* use the actual file name

* use macro

* fix typo

* continue

* Apply suggestions from code review

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 7db04ab0c5
2021-09-02 14:21:15 -07:00
Dean Lee
0b185aea54 dmonitoring: improve yuvframe2tensor (#21996)
* use Y,U,V

* use a pre-calculated table

* add variable use_snpe_model

* .dlc

* remove if
old-commit-hash: 784b3a2ac9
2021-08-30 21:23:01 -07:00
HaraldSchafer
d529ce9f5b Revert DM model change (#21442)
* Revert "tici patch"

This reverts commit 99c27ca8c5942c009fe5b74ac9ea4911c20c596c.

* Revert "dm e2e outputs added (#21210)"

This reverts commit eb26cd0e0ca5a82fb1e8b0e787497193b40fa5c2.

* Revert "improved dm model (#21113)"

This reverts commit 66818291b1813420801b601137ffa3b323aa7cbd.
old-commit-hash: 70f0059be4
2021-06-29 21:29:06 -07:00
Adeeb Shihadeh
d31397b84b segment regen (#21148)
* start seg regen

* send vipc

* fix up some paths

* set fp

* fix no entries

* engages

* seperate camera procs

* send real frames

* regen test routes

* nice argparser

* fix valgrind test

* move that

* fix that
old-commit-hash: 4a1aec27ef
2021-06-28 21:44:40 -07:00
Dean Lee
147b355dde add space after function name and if statement (#21225)
old-commit-hash: e4e669bb0f
2021-06-11 10:17:52 +02:00
ZwX1616
4b72ef3da3 dm e2e outputs added (#21210)
* try this

* use e2e only

* add new outputs

* Revert "use e2e only"

This reverts commit 423dd8e29b88d892074f6f6a0e103681147ff6cc.

* send new

* fix batchnorm
old-commit-hash: 46e3f4528f
2021-06-09 16:18:14 -07:00
Adeeb Shihadeh
edd2f1c1a6 fix qcom and qcom2 builds
old-commit-hash: 9e94fb17cf
2021-06-08 16:44:05 -07:00
Dean Lee
f70a79b838 Use C++ header files instead of C header files. (#21192)
* use cstring instead of string.h

* use cstdio instead of stdio.h

* remove inttypes.h

* use cstdlib instead of stdlib.h

* use cstdint instead of stdint.h

* #include <cstddef>

* cstdlib

* use cmath

* remove stddef.h

* use cassert

* use csignal

* use ctime

* use cerror

* rebase master
old-commit-hash: c53cb5d570
2021-06-08 13:46:22 -07:00
Dean Lee
3a698faadc Use full include path (#21194)
old-commit-hash: b06b3ecb60
2021-06-08 12:09:30 -07:00
Comma Device
07e1c76eeb fix dmonitoring build after include cleanup
old-commit-hash: 6ffc183359
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: 7222d0f20d
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: ab319d4f54
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: 3a95d3ccaa
2021-05-06 12:29:30 +02:00
Willem Melching
f8608d2e7b Revert "Fixes after ifdef clenaup (#20842)"
This reverts commit 59c31bac9a340f120ff40ed541ee377c31e7e85e.

old-commit-hash: d34647bbf7
2021-05-06 12:29:19 +02:00
Willem Melching
3cc799ecd8 Fixes after ifdef clenaup (#20842)
old-commit-hash: fd7c2b4adf
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: 757d2923d2
2021-05-06 11:41:46 +02:00
Dean Lee
f0565ee578 dmoniitoring: new function crop_yuv (#20344)
* crop_yuv

* shorten variables name

* space
old-commit-hash: fb37af00d4
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: 98e55996f6
2021-03-30 12:54:59 +02: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: 000bd226aa
2021-02-03 19:57:30 -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: 2d0c249f40
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: 8605ba8ab9
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: 8bb3c41cfd
2021-01-27 14:30:12 -08:00
Dean Lee
898c93dcbf dmonitoring_init: use &s->output[0] instead of &s->output (#19918)
old-commit-hash: 4bfed95071
2021-01-26 16:07:57 +01:00
ZwX1616
744d263288 compensate for tilt
old-commit-hash: 78cd373c4b
2021-01-14 21:23:52 -08:00
Comma Device
25dbb18f73 fix rounding error
old-commit-hash: 451d4590cf
2021-01-14 21:59:26 +00:00
ZwX1616
fa97a4c7be fix tici dm
old-commit-hash: 9eb7688dfe
2021-01-12 21:17:54 -08:00
Dean Lee
5561bb058d dmonitoringd: add helper function get_yuv_buf (#19590)
old-commit-hash: d39d737ae0
2021-01-08 15:30:06 -08:00
Adeeb Shihadeh
8809fc68e7 log DSP execution time (#2723)
* log dsp execution time

* don't need that
old-commit-hash: b3fd759fe8
2020-12-08 17:28:47 -08:00
HoverB_SN_11
3ea014d35d too wide
old-commit-hash: 18c9e42520
2020-12-08 19:31:38 +00: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: f30d15ea24
2020-12-02 18:46:12 -08:00
Dean Lee
df9e0b2cb4 simplify building capnp messages with arrays (#2617)
old-commit-hash: bd4f6650fa
2020-11-30 12:08:52 +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: bdb1b766d0
2020-11-30 11:21:06 +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: 327aa123f4
2020-11-23 17:42:01 -08:00
Adeeb Shihadeh
1a99d77746 log DM model execution time (#2589)
old-commit-hash: 580589b250
2020-11-20 13:38:31 -08:00
Comma Device
51711af7ff fix some lack of cache awareness in yuvframe2tensor
old-commit-hash: 826c21b045
2020-11-20 18:03:06 +00:00