Commit Graph

107 Commits

Author SHA1 Message Date
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
Dean Lee 2865d75739 qcom: make camera_process_frame more readable (#2765)
* more readable

* rgb_addr

* offset

* speed up if statement

* --self_recover

* rgb_addr_offset

* x_offset&y_offset

* static rgb_roi_buf & conv_result

* remove variables from struct

* simplify read sensorEvents

* use i for loop

* split to functions

* make it works

* y_offset should be ROI_Y_MAX-ROY_Y_MIN+1

* std::size is better than ARRAYSIZE

* rebase master

* shorter variable name

* Revert "shorter variable name"

This reverts commit 47612e3a741d8b6ddfd72bccbb5337882b369224.

* std::fill_n

* reday for merge

* Revert "y_offset should be ROI_Y_MAX-ROY_Y_MIN+0"

This reverts commit 1f8526fb1c59c89d747210eb8bf17a2688a4f2bc.
old-commit-hash: d31a87cd218eeeb51193188b72332800d29dca69
2020-12-15 16:39:38 -08:00
Comma Device cfce32acb5 fix camerad qcom2 build
old-commit-hash: 536a8c587643bc4aa046c414b18292bd65b72caf
2020-12-15 04:52:40 +00:00
Dean Lee 6ab28556c8 camera_qcom: read SensorEvents in op thread (#2764)
* get acceleration in op thread

* std::atomic last_sag_acc_z

* cleanup
old-commit-hash: c1f3c3b2df70d7f3fb24f165c2edcf01a1adcde9
2020-12-14 16:54:49 -08:00
Dean Lee 890df06246 refactor imgproc/utils (#2766)
* refactor imgproc/utils

* const

* space

* return value
old-commit-hash: 554ea8f54a699950a9226e1d0808cc41ca4859f0
2020-12-14 15:33:40 -08:00
George Hotz 2cedc8715e Set camerad CL priority to 4 (#2747)
* priority 2 get

* add to files_common

* cl_ext_qcom

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: cb238fd2ee22bcc6c02c3556f96439b3e08d9415
2020-12-14 13:59:48 -08:00
Dean Lee 0066e93b34 covert rgb_to_yuv.c to rgb_to_yuv.cc (#2757)
old-commit-hash: 3d63b3d4149efb1e597d8d97790fddd28abdbde0
2020-12-12 16:52:15 -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
Willem Melching df97d4db04 Add thumbnails to camera_frame_stream
old-commit-hash: 7b998a7c21b6a15fa474df5a2c5a0bbd8a6f930c
2020-12-11 13:02:45 +01:00
Dean Lee fc07703c8f camerad: fix memory leak in create_thumbnail (#2743)
* fix memory leak in create_thumbnail

* free memory returned from jpeg_mem_dest

* OMG
old-commit-hash: f0d240a7e3d1a91a3d0bac1cc9050c531105d87d
2020-12-11 13:02:16 +01:00
Dean Lee 3f999c44a9 destroy rgb_to_yuv_state (#2702)
old-commit-hash: 1e9e31d6e1167e309660aad49986524d445b19d3
2020-12-10 19:39:46 -08:00
komma zwei d365119d74 rhd dm AE sign flip
old-commit-hash: fef8d4093f1ebf6ad91c6bac95c465c83ee7e396
2020-12-10 19:27:45 -08:00
Comma Device d5a6427330 make qcom2 robust to moving v4l-subdevs
old-commit-hash: 0e84e04539e0fdd767196ba3339690b498ef6338
2020-12-10 05:44:59 +00:00
Adeeb Shihadeh 519614d9c0 fix camerad exiting on pc
old-commit-hash: 90d73313125f0ad07481eba79baea0250a28c460
2020-12-08 20:20:42 -08:00
Dean Lee 8fd9523ce9 simplify common_camera_process_front (#2470)
* refactor camera_process_front

* improve
old-commit-hash: 24a84b2aff4b5a772d43b58be99a9618319abb8b
2020-12-03 16:28:32 -08:00
ZwX1616 08cd2dbb86 tici timing improvements (#2613)
* relocate

* impatience

* should be fine without

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: d3387d540acca31eb70b6611f2a1f6cee20063ec
2020-12-02 16:18:31 -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
ZwX1616 deab0f86aa tici front/wide encodeIdx msgs (#2564)
* different msgs

* also add timestamps

* keep impatient log, remove the other

* meaningless
old-commit-hash: f244b7c7e156cd109be13a68ba1096dc2d25f3d0
2020-11-19 16:12:02 -08:00
Comma Device 64b450b43d underflew
old-commit-hash: b9b6ed2d5258b9ac442005b8caa7904c5873ca88
2020-11-19 04:03:16 +00:00
ZwX1616 7af71098b6 send frame in packet on demand (#2567)
* focus lens helper2

* fix

* yes screen

* s

* new/del

* once

* cleanup

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: c630cd44da607c3d2fdd080b493b2e6dc28c3a75
2020-11-18 13:39:50 -08:00
George Hotz aa34cf305b was wasting a ton of GPU on this debayer (#2566)
Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 2f3e42169cbe74e0812d4e6fe1c53f5cca7c7a7a
2020-11-17 16:52:06 -08:00
ZwX1616 ba4c06a566 use different SubMasters for driverState/sensorEvents (#2522)
* use different sms

* rename
old-commit-hash: 4954db0381264b84aa238da4f9d429cff49bcf24
2020-11-11 13:53:11 -08:00
Christo Mitov ac75ea342b switch build flags to use opengl framework rather than gl library for OSX (#2467)
* switch build flags to use opengl framework rather than library for OSX

* little cleaner

* arch

Co-authored-by: thatsaboi <thatsa@boi.com>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 029be4901217ba4aada3a24b5b3d113aee359369
2020-11-03 19:54:29 -08:00
George Hotz c5313f6bcf Focus Actuator Comments (#2478)
* comments from DW9800W datasheet

* more comments
old-commit-hash: 4d5efb57897832373c2af1435c6d953e9212f814
2020-11-03 07:45:16 -08:00
Dean Lee 000595d2fe webcam cleanup: remove unused variables (#2450)
old-commit-hash: c21ccccd613d624b647be447f2377d88d2b43ac0
2020-10-29 20:30:46 -07:00
ZwX1616 8cc8e041c9 just use the same (#2419)
old-commit-hash: b5617c17c8ee75f6ab3667d8515dcdeb82835cdd
2020-10-28 17:43:16 -07:00
ZwX1616 6b46fe6ee0 restore behavior (#2418)
old-commit-hash: d7052094c453220491056abbb8a9155734b71aa4
2020-10-26 14:49:28 -07:00
ZwX1616 9549a604ae camerad AE hotfix (#2371)
* duplicate offset

* use widthx3 instead of stride
old-commit-hash: efa9180258c18efbd2b009de931a518502cf0259
2020-10-20 17:26:05 -07:00
Adeeb Shihadeh 4af9ea276b prevent snapshot while onroad (#2366)
* prevent snapshot while onroad

* fix offroad check
old-commit-hash: 4c4b53bedafb966e813b98ab6522726204e213e7
2020-10-20 14:04:18 -07:00
Willem Melching 651d4ce031 --std=c++17 (#2330)
* switch to c++17

* more 17

* 1z

* use std::clamp

* Fix types in clamp

* bump submodules

* bump laika

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 339d1967cb1e8ca73aeb1f0066a23b0933706ae5
2020-10-17 13:33:12 -07:00
ZwX1616 dae628002f Clean up and test camerad refactor (#2310)
* refactor

add function get_camerabuf_by_type

remove cl_free

use camera_id

move front stuff into frontview_thread

bigger refactor

more

typo

rename camerabuf *c to *b

cleanup header files

remove wideview_thread

camera_qcom.c to c++

fix SConscript

camera_process_buf

space

sendrgb same with before

do autoexposure in processing_thread

correct sendrgb

add camera_common.cc

move yuv_transform to CameraBuf

* use C to keep consitent

* rebase master

* rebase master

* continue refactor

* refactor all camera related data&function out of main

 done

* cleanup

* -use buf.rgb_width&height

* remoe ,

* rebase master

* remove unused std::vector

* add func common_camera_process_front

* fix max

* fix sendrgb

* less crap being logged

* fix indents

* add back thumbnails

* thumbnail fixed on tici

* junk junk junk

* unify api

* fix ptr ref

* lol!

* cleanup

* more simplified

* typos

* remove terminate

* use standard polling

* ops_thread refactor, too much code!

* fix build

* ok

* assert

* listen

* incl more

* wq!

* fix more build

* macos

* fix exp targets

* front is different

* const

* bye

* remath

* remove irrelevant

* do ops in a thread

* fix init

* return null

* QCOM2 ops

* qcom2 build

* missing comma

Co-authored-by: deanlee <deanlee3@gmail.com>
Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 6b020241c986f614e9a1f08b5b870ff225cf7b19
2020-10-16 21:58:05 -07:00
Adeeb Shihadeh fb935fa5f7 Build openpilot with webcam support in CI (#2070)
old-commit-hash: f4e18e0b7408bc73ffa9320c8ce2689b74993430
2020-10-16 15:16:17 -07:00
Willem Melching 498ecbdf3c Params refactor, simplified (#2300)
* always c++

* Create C++ params class

* get works

* tests hang now

* passes tests

* cleanup string formatting

* handle interrupt in blocking read

* fix memory leak

* remove unused constructor

* Use delete_db_value directly

* Rename put -> write_db_value

* filename cleanup

* no semicolons in cython

* Update common/SConscript

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

* add std::string version of delete_db_value

* This is handled

* cleanup encoding

* Add clear method to clear all

* add persistent params

* fix android build

* Should be called clear_all

* only import params when needed

* set params path on manager import

* recusrively create directories

* Fix function order

* cleanup mkdirp

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 2e182e5c574ea1468678b5fd8d0597e34ed5898d
2020-10-13 16:23:23 +02:00
Dean Lee bf08763a3a fix webcam build error (#2320)
old-commit-hash: 8fc9cfea38982cc0d15361e52c248331a18bf7e3
2020-10-11 22:45:19 -07:00
ZwX1616 a54d95fdbb Test camerad in CI (#2297)
* remove unused junk

* check frame pkts

* from magic

* self

* cleanup

* add todo

* no opencv

* run in J

* fix conv

* make 250x faster

* abs

* should be +1

* depends on starting phase

* block on furniture refactor

* fixed

* restart test

* check ex

* need scaling
old-commit-hash: cb58e79ee83c15662a1191a39aeb75f276c7c591
2020-10-09 16:31:25 -07:00
ZwX1616 9fd7cfc95a tici camera art II (#2223)
* protect highlights

* fix modeld scale factor

* rewrite logic for accurate and smooth AE

* fix condition

* tune speed

* move to qcom2

* not exactly 2x

* avoid hunting due to ettr policy

* tune to new curve

* gain kickdowns

* log params

* 4x legroom

* no limit needed here

* simple lowpass

* tweak

* pin to a remote core

* speedup AE and lower night exp

* this curve makes more sense

* tuning from fleet data

* fix ui

* only qcom2

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 00b642146fa24449d36aec322c5972cf718d3958
2020-10-09 16:26:43 -07:00
ZwX1616 fa54bf9be4 Fix dcamera inaccurate fps on OP3T and LP3 (#2305)
* fix op3t pclk

* fix leeco fps
old-commit-hash: 84e83e88a3f0ed694f4a16527621981039c85dd0
2020-10-09 11:26:32 -07:00
ZwX1616 db55c1cca3 Refactor loggerd rotations (#2247)
* loggerd:refactor rotate encoder

* change notify_all to notify_one

* finish

* cancelWait

* start front_encoder_thread on need

* rebase master to resolve conflict

* tici qcam works, but

* ifs are ugly

* synced rotate off frame ids

* only start counting frames after modeld alive

* typo

* fix some bugs

* never over rotate

* works

* missing space

* zero frame count tolerance

* lol

* add back omx race protection

* not need that

* not to confuse different locks

* playing with locks is playing with fire

* tici now has qcam

* size is overrated

* make cppcheck happy

* fall back if no camera

* warn

* missing condition

* first is freestyle

* no stream id before connecting

* wait for increment

* first will be imperfect

* wait is futile

* block frames when writing state

* just log write time

* exit loops when exit

* tici qcamera

* fixed

* add atomics

* incl

Co-authored-by: deanlee <deanlee3@gmail.com>
Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 2b974150c4478f6df69b7fbbc7037548e9e0bbbf
2020-10-03 07:56:16 -07:00
Comma Device 34293f1404 qcom2 needs cc conversion (#2125)
old-commit-hash: b94b4353878094b06946fcbe2b191d7416db55d8
2020-09-24 22:52:35 +00:00
Dean Lee f57c4d3052 camerad: close file descriptors (#2065)
* close file descriptors

* fix struct indent

* add some new lines
old-commit-hash: 9f34d1ff662c7b84ce5e4561247d8751ef57adca
2020-09-24 13:39:27 -07:00
ZwX1616 6045fd3b1c tici camera art (#2188)
* nerf highlights

* prioritize less noise

* no overhead

* make focus easier

* cant finetune under high gain

* add some comments

* inspired by xx mindset

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 911206fc414904962f0543e605c9ee70945c70ff
2020-09-18 11:43:41 -07:00
Adeeb Shihadeh 241ed1b312 these should be debug logs
old-commit-hash: 92922ce2ae0814670d69cdcd460fb6c13d2b7ba2
2020-09-17 13:14:18 -07:00
Adeeb Shihadeh bdf52941c8 Improve realtime performance on NEOS (#2166)
* fix setting core affinity

* dmonitoringd doesn't need rt priority

* android only gets two cores

* model and planner get core 2

* log missed cycle count

* neos update

* prod image

* revert NEOS changes

* still need this
old-commit-hash: ef21b83937d25b824018ac1d07fa7759ae6f8128
2020-09-16 15:33:12 -07:00
Adeeb Shihadeh 0caedb9195 bump max vision clients for tici
old-commit-hash: 0604f194b3d904e4e21b8ce545ccff408e90faba
2020-09-14 21:29:46 -07:00
Comma Device d1c9b43931 fix tbuffer img tearing
old-commit-hash: c9183c11bd583da81aa769d9b9ddaaecd86f6d56
2020-09-15 03:32:29 +00:00
ZwX1616 fb77feccd8 improve tici camerad robustness (#2135)
* equalize performance on three threads

* need to request first

* clean up indexing

* obsolete

* handling skips and drops

* clean up repeated chunks

* use main frame id

* oneshot

* real skip check

* move to test

* should be cropped H here

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 13588e4255e3667459bc5b23068dbccd2fab2a39
2020-09-14 16:05:57 -07:00
Adeeb Shihadeh ac3422fc0f message builder (#2161)
* use custom MessageBuilder from cereal

* use MesageBuilder.toBytes

* bump cereal

* unused

* another one

* fix ui msg

Co-authored-by: deanlee <deanlee3@gmail.com>
old-commit-hash: 4d5733924a2fdd8a3bbaf5f48869ac744b983401
2020-09-12 21:48:15 -07:00
Comma Device c52cafe1a3 remove recurrent LOGD and prints
old-commit-hash: 18884743a64032aa2ef8acc23c0dc84ddec17e67
2020-09-01 20:15:39 +00:00
Comma Device a3cb6cb5a5 use buffered meta
old-commit-hash: 80838f3693a1772ab6c6da9f3652106f2823b5c3
2020-09-01 18:55:15 +00:00