Commit Graph

319 Commits

Author SHA1 Message Date
Joost Wooning 40ae0b8604 debayering: code cleanup (#24507)
* debayering: code cleanup

* some more cleanup
2022-05-12 19:12:59 +02:00
George Hotz 01ab99d416 simplify and fix clamp (#24479)
Co-authored-by: Comma Device <device@comma.ai>
2022-05-10 14:21:22 -07:00
ZwX1616 4354f7cd28 clean up gamma variable names (#24476) 2022-05-09 13:38:39 -07:00
Joost Wooning 49e10dc773 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>
2022-05-06 18:27:41 +02:00
Willem Melching 95fa6b1df8 camerad: get embedded statistics and data by embedding in pixel data (#24353)
* camerad: AR0231 read embedded data and statistics

* reorder

* remove unrelated camera config
2022-05-06 11:47:14 +02:00
Joost Wooning d8c0cf5d55 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
2022-05-05 17:38:39 +02:00
Joost Wooning 1f9907122a make debayering consistent at edges (#24437) 2022-05-05 13:06:13 +02:00
Joost Wooning 05f606c812 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>
2022-05-03 17:30:22 +02:00
Willem Melching 6e0c25d654 camerad: cleanup DM exposure and move into camera_qcom2.cc (#24391)
* camerad: cleanup DM exposure and move into camera_qcom2.cc

* remove include
2022-05-02 12:04:23 +02:00
George Hotz b7ddce8bac 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>
2022-04-29 18:09:12 +02:00
George Hotz 5ddd2000b2 Revert "camerad: don't remap everything every time (#24334)" (#24370)
This reverts commit fb7d84875b.
2022-04-29 07:59:03 -07:00
George Hotz fb7d84875b 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>
2022-04-28 11:32:32 -07:00
Lukas Petersson 397bd25e97 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>
2022-04-19 14:29:24 -07:00
George Hotz 1795a2ac03 C2: remove some dead code (#24256)
* remove some dead code

* still needed

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

* cleanup release files

* little more

* more libs

* no more gralloc

* add snpe back
2022-04-18 17:55:23 -07:00
George Hotz 10d4766f76 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>
2022-04-07 10:43:14 -07:00
Willem Melching 03257bb0d8 camera processing time: float -> double 2022-04-06 10:08:44 -07:00
Lukas Petersson 65fca83abe 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>
2022-04-05 21:05:45 -07:00
Willem Melching 67d6847039 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
2022-04-05 08:10:53 -07:00
George Hotz ab9c017311 add more logging to camera sensor probe 2022-03-31 16:58:07 -07:00
Willem Melching 94b8a3f08b sensor2_i2c.h: remove unusedc B context (#24092) 2022-03-31 16:28:06 +02:00
Comma Device a688811aa8 camerad: improve DEBUG_FRAMES message 2022-03-30 14:28:22 -07:00
Adeeb Shihadeh 8af20af66d pylint: enforce indentation (W0311) (#24039)
* pylint: enforce indentation (W0311)

* few more
2022-03-24 23:23:29 -07:00
Adeeb Shihadeh 7cd8575c74 Revert "camerad: set QCOM CL perf hint (#23791)"
This reverts commit b079475ad3.
2022-03-22 11:11:15 -07:00
Adeeb Shihadeh b079475ad3 camerad: set QCOM CL perf hint (#23791)
Co-authored-by: Comma Device <device@comma.ai>
2022-03-21 20:32:28 -07:00
George Hotz 5a11101bcf 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>
2022-03-18 15:21:51 -07:00
Gijs Koning 57b6fdc17a 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>
2022-03-14 14:03:54 -07:00
George Hotz a9b7f3bdd8 12bit only (#23953)
Co-authored-by: Comma Device <device@comma.ai>
2022-03-13 21:43:38 -07:00
George Hotz 0adfef0b34 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>
2022-03-11 13:37:29 -08:00
Willem Melching aabd9a0dff camerad: log debayer + yuv processing time (#23894)
* camerad: log debayer + yuv processing time

* bump cereal
2022-03-02 13:56:00 +01:00
George Hotz 51767c037b camerad: use open_v4l_by_name_and_index on c2 also (#23794)
* use open_v4l_by_name_and_index on c2 also

* remove open_v4l_by_name_and_index from qcom2
2022-02-19 13:31:11 -08:00
George Hotz 92e9823cc0 camerad: fast debayer on c2 cameras (#23795)
* fast debayer on c2 dcam

* add casts

* 128 local worksize on HDR debayer, 8 ms -> 3.5 ms

* width instead of saving rgb_width

Co-authored-by: Comma Device <device@comma.ai>
2022-02-18 20:15:20 -08:00
Adeeb Shihadeh c6e0f1d841 camerad: adjust CL priority on comma three (#23790)
Co-authored-by: Comma Device <device@comma.ai>
2022-02-17 19:49:10 -08:00
George Hotz cb6a68373b Prepare for using the ISP (#23621)
* parse out isp packet with structs

* dsp mode

* support only driver / comments for yuv

* minor touchups

* DEBUG_FRAMES

Co-authored-by: Comma Device <device@comma.ai>
2022-01-26 19:25:05 -08:00
Dean Lee 61383dcc42 camerad: cleanup main.cc (#23593)
* cleanup main.cc

* fix  ae_gray_test build errors
2022-01-21 16:19:50 -08:00
Dean Lee e6a73e400c camerad: return 0 from main() (#23565) 2022-01-18 14:21:30 +01:00
George Hotz 7e83d9a618 camerad: Out of bounds memory write (#23534)
* parens were totally wrong

* cleaner
2022-01-14 15:22:28 -08:00
Ewout ter Hoeven 55390d273f Convert format strings strings to f-strings (#23241)
* Convert all text strings to f-strings

Reformats all the text from the old "%-formatted" and .format(...) format to the newer f-string format, as defined in PEP 498. This requires Python 3.6+.

Flynt 0.69 was used to reformat the strings. 120 f-strings were created in 51 files.

F-strings are in general more readable, concise and performant. See also: https://www.python.org/dev/peps/pep-0498/#rationale

* revert pyextra changes

* revert ublox.py

Co-authored-by: Willem Melching <willem.melching@gmail.com>
2021-12-16 14:58:17 +01:00
Willem Melching 36db473bab comma two: remove lens sag compensation (#23113) 2021-12-14 13:29:59 +01:00
Dean Lee b519acd37b LapConv: remove hardcoded FULL_STRIDE_X (#23200)
* fix wroing stride_x

* remove hardcoded rgb_stride
2021-12-13 15:53:44 +01:00
Dean Lee 5c6229f3df common_process_driver_camera: same parameters as process_thread_cb (#23202) 2021-12-13 15:07:31 +01:00
Dean Lee 9decd3d8a2 util: move all functions into util namespace (#23203) 2021-12-12 14:42:23 -08:00
Dean Lee 480fb54926 move struct LogCameraInfo into loggerd.h (#23129) 2021-12-04 21:08:55 -08:00
grekiki 6951b3271d Python: Replace more lists with generators (#23116)
* Replace lists with generators v2

* Replace set with {}

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

* Replace more set() with {}

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-12-03 22:57:19 -08:00
Dean Lee 348d2d2b0d rename yuv streams (#23071)
* rename yuv streams

* bump cereal

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-11-29 18:14:59 -08:00
Dean Lee dbec761941 logreader: support reading from corrupt log (#23050)
* catch exception outside loop

* print decompress error

* add test case for corrupt log

* fix decompressbz2 stuck if log is corrupt

* recovered from corrupt data

* add output

* ass space

* std::endl

* override load(), load from buffer

* override FrameReader::load to load from the buffer

* replace NULL with nullptr

* fix test case for corrupt log

* Trigger Build

* check bzerror too

Co-authored-by: Willem Melching <willem.melching@gmail.com>
2021-11-29 14:10:24 +01:00
Adeeb Shihadeh 8160cf3c1b camerad: remove camera frame stream (#23045)
* camerad: remove camera frame stream

* fix release files
2021-11-27 21:58:21 -08:00
Dean Lee 5ae5174509 framereader: replace swscale with libyuv, reduce cpu usage by half (#22992)
* use libyuv

* cleanup
2021-11-26 14:41:14 +01:00
Willem Melching 5069852573 navd: render map into VisionIPC (#22800)
* navd: render simple map

* render route

* offscreen rendering

* cleanup

* more cleanup

* render into visionIPC

* rename class

* split position update from route update

* stop broadcast if not active

* gate vipc server behind flag

* add python library

* faster

* no vipc from python

* put behind extras

* only send when loaded

* add glFlush just to be sure

* cleanup settings into helper function

* function ordering

* broadcast thumbnails

* put behind param

* adjust zoom level

* add route to python bindings

* revert that freq change

* add logging if map rendering is enabled

* use rlogs if available

* bump cereal
2021-11-26 14:38:02 +01:00
Adeeb Shihadeh 20d5c0c1cb camerad: lower YUV vipc buffer count to 40 on tici 2021-11-22 16:53:59 -08:00