Commit Graph

297 Commits (master)

Author SHA1 Message Date
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
Adeeb Shihadeh 0a1aaaa74c
Take camera snapshot using VisionIPC (#22070)
* vipc snapshot

* front and rear need to go

* remove SEND_*

* cleanup

* put that back

* fix duplicate code

* dont start camerad on pc

* fix rgb stride

Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Willem Melching <willem.melching@gmail.com>
2021-11-17 15:24:50 +01:00
Dean Lee 3d0246eed5
camera_qcom2: cleanup camera_open (#22085)
* cleanup camera_open

* remove static

* apply review
2021-11-17 12:18:14 +01:00
Willem Melching 45c506bb17 wshadow: fix comma three build 2021-11-02 17:27:34 +01:00
Mayfield 5246f0231e
enable wshadow (#22756)
* enable wshadow (#22714)

* fix replay

* more build fixes

Co-authored-by: Willem Melching <willem.melching@gmail.com>
2021-11-02 17:08:53 +01:00
Dean Lee 2b4a477fbc
replay: improve segment download and merge (#22654)
* no-cache mode

* fix test cases build error

* space

* don't create cache dir in no-cache mode

* fix errors in test cases

* no_local_cache_

* set the number of connections by chunk_size

* use size_t instead of int64_t

* add test case for no-cache mode

* rename variables

* fix SIGSEGV

* cleanup

* faster decompressBZ2

* always decompress bz2

* add test cases

* prepare for python interface

* fix test cases build error

* continue

* camera_replay: cache remote file

* protected inheritance

* single option name

* TODO

* test_case for LogReader&FrameReader

* fix wrong require

* test case for FileReader

* cleanup test

* test:fix wrong filename

* check cached file's checksum

* fix mkdir permissions err

cleanup filereader

* remove initialize libav network libraries.

dd

* abort all loading if one failed

* cleanup tests

* use threadpool to limit concurrent downloads

* cache more segments

* merge 3 segments for replay

* one segment uses about 100M of memory

* use segments_need_merge.size()

* shutdown

* fix stuck if exit replay  before keyboard thread started

* load one segment at a time

* small cleanup

* cleanup filereader

* space

* tiny cleanup

* merge master

* cleanup test cases

* use util:create_directories

* cleanup framereader
2021-11-01 11:55:56 +01:00
Dean Lee f7461ed9fc
camera_common: new class Debayer (#21854)
* new class Debayer

* merge master

* pass in cl_event

* needs define, class is not the same

* match clEnqueueCopyBuffer api

Co-authored-by: Willem Melching <willem.melching@gmail.com>
2021-10-29 16:48:08 +02:00
Dean Lee b8be692c1a
config_isp: remove hardcoded buffer size (#22119) 2021-10-29 16:05:19 +02:00
Dean Lee 921600b95c
framereader: use swscale to handle the YUV conversion (#22710) 2021-10-29 12:14:14 +02:00
Adeeb Shihadeh 5b331fd6f5
don't set core affinity on PC (#22706) 2021-10-26 21:51:46 -07:00
Willem Melching 89f311714c
loggerd: set encodeIdx.valid if frame id is correct (#22634)
* loggerd: set encodeIdx.valid if frame id is correct

* check valid flag in test

* test cleanup

* bump cereal
2021-10-26 16:00:43 +02:00
Adeeb Shihadeh cd5bc565d3
camerad: allow core affinity setting to fail while offroad (#22664)
Co-authored-by: Comma Device <device@comma.ai>
2021-10-22 20:57:21 -07:00
Adeeb Shihadeh 76bd932cf5
loggerd: always run encoders (#22649)
* loggerd: always run encoders

* fix raw logger

* bump loggerd cpu usage
2021-10-21 16:37:03 -07:00
Adeeb Shihadeh e9cb2104e6
fix snapshot camerad crash due to core affinity setting (#22648)
Co-authored-by: Comma Device <device@comma.ai>
2021-10-21 00:26:01 -07:00
Dean Lee 0189a19b8e
replay: refactor FrameReader (#22438)
* decode from the previous keyframe after seek

* less memory

* some stream seems to contian no keyframes

* test random seek

* merge master

* continue

update test_cases

use fr

* merge master
2021-10-18 14:19:23 -07:00
Adeeb Shihadeh 84de248fa7
tici: affine loggerd to efficiency cores (#22581) 2021-10-18 13:21:24 -07:00
Dean Lee 1eb79d7a59
c++ replay: publish all frames in CameraServer (#22378)
* cameraserver

* support yuv

* init camera server in start()

* trigger ci
2021-10-04 16:45:28 +02:00
Dean Lee ae9305e7ff
fix yuv420_to_jpeg: thumbnail_width & thumbnail_height must be aliged with 16 pixel. (#22287)
* aligned by 16px

* make buf big enough

* comment

* add comment

* comment
2021-09-23 13:20:10 -07:00
Dean Lee 5f9e0f7869
webcam: add /usr/include/opencv4 to CPPPATH (#22320) 2021-09-23 11:43:51 -07:00
Willem Melching 8a836b7e1e
Script to extract thumbnails from segment (#22294)
* Script to extract thumnails from segment

* fix name

* whitespace
2021-09-21 10:14:16 -07:00
Dean Lee 9b302488f9
camerad: added replay camera (#21241)
* start refactor

* remove camera_frame_stream from files_common

* rename camera_pc to camera_replay

* continue

* loop one segment

* rename cam_frame_id to stream_frame_id

* apply review

* continue

* more

* publish camera state

* cleanup

* cleanup

* better comment

* delete s->pm in cameras_close()

* add function getFrameCount

* refactor loop

* fix typo

* restore freame stream

* disable roadcam

* dd

* move file

* merge master

* fix test case

* add todo

* white space

* remove from release files

* add files back to relase

* move framereader back to ui/replay

* merge master

test_replay
2021-09-19 14:43:54 -07:00
Dean Lee e0b5b4573e
camerad: use the YUV buffer to create the jpeg thumbnail (#21936)
* yuv420_to_jpeg

continue

* add comments

* cleanup

* return ky::array
2021-09-17 17:00:21 -07:00
Dean Lee f02c8d0e2c
Handle EINTR for all syscalls that can return it (#21948) 2021-08-31 16:22:56 -07:00