Commit Graph

343 Commits

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

* fix mypy
old-commit-hash: 1139fe507b01f34de9714c99228f411558b44231
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: c646eeee0ac54925db5afc51b95c5d869d6dba68
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: d6c07a6b158595c1ab10256dc6eee4fbdf902379
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: f49a9c9fd2100a4f1401a93d88064ddbbbd935c1
2022-06-02 15:20:51 +02:00
Adeeb Shihadeh 11b41511c9 remove unused visionimg
old-commit-hash: c677c6b164fc8e642ca75809213eca0678cf86ac
2022-06-01 14:42:32 -07: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: ea5b8cdfb10686c972d8d2bc1778e6e6567e45a9
2022-06-01 17:18:28 +02:00
Adeeb Shihadeh 3e8625e50b visionipc python shim (#24660)
old-commit-hash: 32a9ccfc37d97e6692435153ac9f0fe72feb1e9f
2022-05-25 20:49:56 -07:00
George Hotz 3ece7be044 camerad: pixclk 88mhz but frame time the same (#24587)
* pixclk 88mhz but frame time the same

* scale integration time

* 22.8 ms

* 15.18 ms

* fix exposure

* fix glitching, 18.9 ms

* set both to min

* faster pixclk = more power

* should pass CI

Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 7c74ab8992ef32277deaf02312a9bbf272ba581a
2022-05-24 09:54:46 -07:00
Adeeb Shihadeh 748cdcf76e remove that too
old-commit-hash: 370fc2d352f7cff33be1108d8f61bef94c2d369c
2022-05-18 16:43:23 -07:00
Adeeb Shihadeh 67d71f693c camerad: remove webcam + replay cameras (#24554)
* camerad: remove replay camera

* remove webcam + fix AE tests
old-commit-hash: b4091847dfe67374d673ae3bf2dd2607068260f7
2022-05-18 15:12:48 -07: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: cb8885cffb313bea258c012c3026461a22bf8135
2022-05-18 14:11:57 -07:00
George Hotz 3ee5b1bf07 make debayer faster (#24557)
* remove local caching

* remove local caching

* reduce camerad power

* break stupid imx390 black level support

* handle edges

* now 13ms, vignetting is 'slightly' less correct

* halfs->floats and inlines, down to 12.9ms

* oops, fix float

* val from 12 is ushort

* don't decide vignetting in the debayer kernel

* 7.77 ms

* adding back black level support was free

* Revert "adding back black level support was free"

This reverts commit a841d17727886807a040dcf856ab22480fa93eff.

* minor

* rip out unused gain and black level, remove print

* save 150mW

* fix replay test

* fix top/bottom rows

* lame left right edge fix

Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Joost Wooning <jwooning@gmail.com>
old-commit-hash: 72b52f8b7d74bf3ea6fe8bd4d59af1c44c83afdb
2022-05-17 10:18:36 -07:00
Comma Device 619af7f5c3 Revert "remove local caching"
This reverts commit f2df7b5b81e5846ca0a6b007e7d4ef47e67639a5.

old-commit-hash: 5612c4f22cdf302f49bfb7b75e9a543e8b3d87c9
2022-05-16 17:10:38 -07:00
Comma Device d9a47a6599 remove local caching
old-commit-hash: 51d441ad789a74179dab0f56c5c85d5a670dcfce
2022-05-16 17:09:42 -07:00
Willem Melching 599d52ded2 camerad: improve error logging (#24550)
old-commit-hash: 8811142787a0690499237e1b449e0d524dc81f35
2022-05-16 16:31:14 +02:00
Joost Wooning fb32a313a1 debayering: fix divide for reading 12 bit values (#24546)
old-commit-hash: 8f9ba7540b4549b4a57312129b8ff678d045f70f
2022-05-16 13:19:22 +02:00
Willem Melching 3dcf2ab4f1 camerad: sanity check register data before parsing (#24547)
old-commit-hash: 1dcd5096baecf072ee576d19b2622105ffc167e7
2022-05-16 13:19:06 +02:00
Adeeb Shihadeh 5659b6e6ce more comma two cleanup (#24300)
* more comma two cleanup

* fix up power monitoring
old-commit-hash: 6a48a7acef483907990e34e040deee70c689e700
2022-05-15 17:55:22 -07:00
Adeeb Shihadeh 29a516bed8 replay: cleanup unused RGB buffers (#24537)
* replay: cleanup unused RGB buffers

* update replay cam

* little more
old-commit-hash: ab75c53792718d32e51d34336be3fae568051d2b
2022-05-14 19:55:12 -07:00
Joost Wooning da6d0d878a camerad: combine debayering and rgb_to_yuv opencl kernels (#24452)
* camerad: combine debayering and rgb_to_yuv opencl kernels

* fix border

* fix snapshot

* rename function

* update camerad cpu usage

* update camerad power draw

* vignetting equal to previously

* test other local worksize

* use less floats

* reduce amount of code

* move barrier back

* make faster

* fix corners

* cleanup

* cleanup

* allow more jitter on driverState timing

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 489fbb74b0f532c738cf8c06afe1a5f9ce1e1651
2022-05-13 16:49:31 +02:00
Joost Wooning 4e1ff7b16b debayering: code cleanup (#24507)
* debayering: code cleanup

* some more cleanup
old-commit-hash: 40ae0b8604d84950fb3794943d2aaa75d9a4a7c9
2022-05-12 19:12:59 +02:00
George Hotz fe87234aa2 simplify and fix clamp (#24479)
Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 01ab99d416ffa6fb5f96ebd2091be94a3dc6c6bf
2022-05-10 14:21:22 -07:00
ZwX1616 24c44bf192 clean up gamma variable names (#24476)
old-commit-hash: 4354f7cd28168466faf5b338c1e86f8845c23e63
2022-05-09 13:38:39 -07:00
Joost Wooning 9ffe2ceb0e debayering: fill outer image borders (#24441)
* debayering: fill outer image borders

* correct conditions

* try something else

* remove global check

* update ref

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 49e10dc773780884f2aab309b7dc2436fe6f473a
2022-05-06 18:27:41 +02:00
Willem Melching 171915797a camerad: get embedded statistics and data by embedding in pixel data (#24353)
* camerad: AR0231 read embedded data and statistics

* reorder

* remove unrelated camera config
old-commit-hash: 95fa6b1df86b62d98e14319f5bd5cbb1621214a2
2022-05-06 11:47:14 +02:00
Joost Wooning fd4ecc78b5 debayering: typedef half as float to run on pc (#24439)
* debayering: typedef half as float to run on pc

* add casts to literals

* define existing half type

* remove test code
old-commit-hash: d8c0cf5d55890cc46aff51f1fe1345e339863000
2022-05-05 17:38:39 +02:00
Joost Wooning 1f1bcb246e make debayering consistent at edges (#24437)
old-commit-hash: 1f9907122a9bda9279d73f698addaa0e22796059
2022-05-05 13:06:13 +02:00
Joost Wooning d4579132d4 camerad: allow to log raw camera frames (#24393)
* camerad: log raw camera frames with env var

* dont qlog

* cleaner

* only road camera

* use vision buf len

* use static counter to handle frame skips

* we already have cnt

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 05f606c8121c89990225ff873c2779fcb3790ead
2022-05-03 17:30:22 +02:00
Willem Melching 4f495c36b5 camerad: cleanup DM exposure and move into camera_qcom2.cc (#24391)
* camerad: cleanup DM exposure and move into camera_qcom2.cc

* remove include
old-commit-hash: 6e0c25d654771ad13cd276481fc652989f681c2c
2022-05-02 12:04:23 +02:00
George Hotz 3a6a5485f2 camerad: less ioctls try 2 (#24371)
* premap the buffers

* memory manager

* free buffers properly, alignment seems okay

* update camerad CPU usage

* cam_sync_fd

* useless line, and use the define

* cheap prereqs for multistream

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: b7ddce8bacde6de2f708af0b70ea8a20d61396f2
2022-04-29 18:09:12 +02:00
George Hotz e7aac92b21 Revert "camerad: don't remap everything every time (#24334)" (#24370)
This reverts commit 30e9a8aab8337d6b5661f4acdb0f2cf8c1421504.
old-commit-hash: 5ddd2000b23ca3fc3c67a5a29331a28cffaa2a9e
2022-04-29 07:59:03 -07:00
George Hotz 0c2a527b3e camerad: don't remap everything every time (#24334)
* premap the buffers

* memory manager

* free buffers properly, alignment seems okay

* update camerad CPU usage

* cam_sync_fd

* useless line, and use the define

* cheap prereqs for multistream

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: fb7d84875bc993beaf75645a7e4b311704742f02
2022-04-28 11:32:32 -07:00
Lukas Petersson 544375abcf Disambiguate frame id in latencylogger (#24164)
* add tools to disambiguate frame id

* Update selfdrive/camerad/cameras/camera_qcom2.cc

Co-authored-by: Gijs Koning <gijs-koning@live.nl>

* bug fix

* remove duplicate code

* PR comments

* bug fix

Co-authored-by: Gijs Koning <gijs-koning@live.nl>
Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 397bd25e971abf5c32276cbd0c48c61d7b1eae30
2022-04-19 14:29:24 -07:00
George Hotz d73af8d298 C2: remove some dead code (#24256)
* remove some dead code

* still needed

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 1795a2ac03d2707deeb6f17b4b5eb287284b9cef
2022-04-18 20:38:03 -07:00
Adeeb Shihadeh 5a9644261f remove comma two support (#24248)
* remove comma two support

* cleanup release files

* little more

* more libs

* no more gralloc

* add snpe back
old-commit-hash: 5c48e7bc86a621dd35f4ff25da7a26ee506bac76
2022-04-18 17:55:23 -07:00
George Hotz b19c75d189 camerad: cleanups, support running only one camera (#24157)
* support disabling the cameras

* disable instead of only. reduce camera startup time

* cleanups

* make all disables work

* add more logging to buffer creation

* make disable work

* disable on sensor probe failed

* tested, fix print

* tolerate sensor failure onroad

* enables should be honored in public methods only

* comments and whitespace

* debug starting sensor

* bring clear_req_queue into c++, add logging for error cases

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 10d4766f76ae841b702ad88680bc3e5b7e4bf9e5
2022-04-07 10:43:14 -07:00
Willem Melching d8ade5e21c camera processing time: float -> double
old-commit-hash: 03257bb0d8cfb04e4e8c00ab7f430178415be867
2022-04-06 10:08:44 -07:00
Lukas Petersson df8476118b Latency logging 2 (#24058)
* msg_order and gantt

* frameId in long/lat planner

* track frame id

* controls frame id

* graph tracked events

* graph json

* cloudlog timestamp

* c++ cloudlog

* add frame id

* bug fixes

* bug fixes

* frame id visionicp

* bug fixes and debug level

* timestamp log placement

* print timestamps in table

* translate events

* more logging

* bug fixes

* daemon boardd

* print logs with boardd

* more timestamp logs

* cleanup

* remove publish logs

* bug fix

* timestamp received

* timestamp received

* bug fixes

* use json lib

* ignore driver camera

* prep for new timestamp pipeline

* bug fix

* read new pipeline unfinnished

* read new pipeline

* bug fix

* add frame to controlsstate

* remove controlsstate

* print

* cleanup

* more cleanup + bug fix

* clock build issue

* remove unused imports

* format durations

* increase speed

* pr comments fixes

* conflicts

* set MANAGER_DAEMON for boardd

* clean script code

* bug fix + argparse

* remove rcv time

* bug fixes

* print without tabulate

* fix pre-commits

* plot gnatt

* color bug fix

* read without timestampextra

* bump panda

* mono time instead of frame id

* finnish script

* clean unused

* clean unused logging

* monotonic + json fixes

* del test

* remove whilelines

* bump laika

* cleanup

* remove deps

* logs nicer strings

* remove plotting from scirpt

* reset pipfile

* reset pipfile

* nicer strings

* bug fix

* bug fix

* pr comments cleaning

* remove plotting

* bug fix

* new demo route

* bump opendbc and panda

* cereal master

* cereal master

* script less komplex

* assertions

* matplotlib

* readme

* Update README.md

* graph html

* design fixes

* more code design

* Update common/logging_extra.py

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

* whitespace

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

* Update tools/latency_logger/latency_logger.py

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

* pr comments

* bug fix

* readme + env once

* clean swaglog

* bug fix

* Update tools/latencylogger/README.md

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

* revert

* revert

* clean swaglog with error

* remove typo file

* revert graph

* cereal

* submodules

* whitespaces

* update refs

Co-authored-by: Bruce Wayne <batman@workstation-openpilot2.internal>
Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 65fca83abed98f32993286dc5a66e3e583f06172
2022-04-05 21:05:45 -07:00
Willem Melching 410557490f camera_qcom2: target 40ms acquisition time, use register wizard (#24093)
* register values from wizard

* target 25fps to leave some room for timing jitter

* update max lines in ui
old-commit-hash: 67d6847039ecc65186b39382d38a63dfffc0a9b2
2022-04-05 08:10:53 -07:00
George Hotz 4b6cb2e9f3 add more logging to camera sensor probe
old-commit-hash: ab9c0173113e2eb058d9940a675d93c6a1090667
2022-03-31 16:58:07 -07:00
Willem Melching 7541553c4e sensor2_i2c.h: remove unusedc B context (#24092)
old-commit-hash: 94b8a3f08bf649f750c824e12a88e5c947c6ddf1
2022-03-31 16:28:06 +02:00
Comma Device 75069b1ece camerad: improve DEBUG_FRAMES message
old-commit-hash: a688811aa8aab10ea0d50a9b53961c8244731092
2022-03-30 14:28:22 -07:00
Adeeb Shihadeh bd71c594a2 pylint: enforce indentation (W0311) (#24039)
* pylint: enforce indentation (W0311)

* few more
old-commit-hash: 8af20af66ddaa6bc06d7f72f9134aa9afeed3ed8
2022-03-24 23:23:29 -07:00
Adeeb Shihadeh b20ee9c4aa Revert "camerad: set QCOM CL perf hint (#23791)"
This reverts commit 18cb65b8ef34dfecbd1ac6da1155886188307479.

old-commit-hash: 7cd8575c745d9f28213a73f75b99b2245a592362
2022-03-22 11:11:15 -07:00
Adeeb Shihadeh 1e4a874da0 camerad: set QCOM CL perf hint (#23791)
Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: b079475ad3045300b26db54924f0c3db3e2e06d8
2022-03-21 20:32:28 -07:00
George Hotz 41c71e87dd camerad: imx390 support (#23966)
* something is output

* min stuff

* visible picture

* pics look good

* maybe

* whole sensor

* fix all cameras

* support both cameras

* autoexposure for imx390

* fix imx390 blacklevel

* touchups

* put gain in db scale

* inline and fix max exposure

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 5a11101bcf38d34b5e2c50f79d458d2b913aa0b5
2022-03-18 15:21:51 -07:00
Gijs Koning cedd8abc05 Rename RGB vision streams to match YUV streams (#23961)
* Renaming VISION_STREAM_RGB_.. to match yuv names like VISION_STREAM_ROAD
VISION_STREAM_RGB_BACK -> VISION_STREAM_RGB_ROAD
VISION_STREAM_RGB_FRONT -> VISION_STREAM_RGB_DRIVER

* little more

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 57b6fdc17a1f84ec922647c044da5df3cafc0ddc
2022-03-14 14:03:54 -07:00
George Hotz 37bec7bf11 12bit only (#23953)
Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: a9b7f3bdd8a1a3137c8a04570b6ec5cc03dc6476
2022-03-13 21:43:38 -07:00
George Hotz c0145ae709 camera_qcom2 refactor (#23946)
* convert camerastate to a class

* more refactor

* do the refactor in file

* put that one back

* those changes can wait

* very minor

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 0adfef0b3423291101520424b3bb2c3a1b39dc6c
2022-03-11 13:37:29 -08:00
Willem Melching dfd521325d camerad: log debayer + yuv processing time (#23894)
* camerad: log debayer + yuv processing time

* bump cereal
old-commit-hash: aabd9a0dff9240fdf2beb2b83b9b35ec0d1bb0b6
2022-03-02 13:56:00 +01:00