Commit Graph

113 Commits (87950eb3127e175f0f2b0bb42440f5350c679369)

Author SHA1 Message Date
Adeeb Shihadeh 87950eb312
setup clang tidy (#19533)
* setup clang tidy

* config

* some cleanup

* little more

* remove that

* fix qcom build
2021-01-05 12:50:23 -08:00
Dean Lee c1cf0882bd
Replace usleep with util::sleep_for (#19643)
* replace usleep with sleep_for

* sleep microseconds

* sleep nanoseconds

* Trigger Build
2021-01-04 18:03:11 +01:00
Dean Lee 06e3b1e445
fix thread safety issue in camera focusing (#19576) 2021-01-04 10:18:10 +01:00
Dean Lee 37826c0032
should not break if poll timeout (#19578) 2021-01-04 10:17:52 +01:00
Adeeb Shihadeh 15cd71707d
camerad: revert tbuffer dispatch change (#19589) 2020-12-25 15:18:00 -08:00
Dean Lee 9890f958d9
cameras: use common transform (#19552) 2020-12-20 17:21:46 -08:00
Dean Lee bc1cfa6d4f
cleanup qcom2 (#19506)
* cleanup qcom2

* define DEBAYER_LOCAL_WORKSIZE in camera_qcom2.h
2020-12-17 11:43:50 -08:00
Robbe Derks 91c760a9e5 Revert MCLK change 2020-12-17 18:08:58 +01:00
robbederks 18ab822213
Move MCLK freq on tici (#19494)
* Move MCLK freq

* change PLL settings to compensate

* messed that up

* undo extclk change, move the internal freq. Does mean pixclk is decreased from 88MHz to 80MHz though

Co-authored-by: Comma Device <device@comma.ai>
2020-12-17 11:29:34 +01:00
Adeeb Shihadeh 8674b023ba
HW abstraction layer (#19530)
* start hw refactor

* move that

* pins

* put that back
2020-12-16 21:30:23 -08:00
Adeeb Shihadeh c57ee16e86
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>
2020-12-15 19:22:03 -08:00
Dean Lee d31a87cd21
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 47612e3a74.

* std::fill_n

* reday for merge

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

This reverts commit 1f8526fb1c.
2020-12-15 16:39:38 -08:00
Comma Device 536a8c5876 fix camerad qcom2 build 2020-12-15 04:52:40 +00:00
Dean Lee c1f3c3b2df
camera_qcom: read SensorEvents in op thread (#2764)
* get acceleration in op thread

* std::atomic last_sag_acc_z

* cleanup
2020-12-14 16:54:49 -08:00
Dean Lee 554ea8f54a
refactor imgproc/utils (#2766)
* refactor imgproc/utils

* const

* space

* return value
2020-12-14 15:33:40 -08:00
George Hotz cb238fd2ee
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>
2020-12-14 13:59:48 -08:00
Dean Lee 3d63b3d414
covert rgb_to_yuv.c to rgb_to_yuv.cc (#2757) 2020-12-12 16:52:15 -08:00
Dean Lee 3c08d0f1f7
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 882e413f22.

* 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
2020-12-11 13:05:32 +01:00
Willem Melching 7b998a7c21 Add thumbnails to camera_frame_stream 2020-12-11 13:02:45 +01:00
Dean Lee f0d240a7e3
camerad: fix memory leak in create_thumbnail (#2743)
* fix memory leak in create_thumbnail

* free memory returned from jpeg_mem_dest

* OMG
2020-12-11 13:02:16 +01:00
Dean Lee 1e9e31d6e1
destroy rgb_to_yuv_state (#2702) 2020-12-10 19:39:46 -08:00
komma zwei fef8d4093f rhd dm AE sign flip 2020-12-10 19:27:45 -08:00
Comma Device 0e84e04539 make qcom2 robust to moving v4l-subdevs 2020-12-10 05:44:59 +00:00
Adeeb Shihadeh 90d7331312 fix camerad exiting on pc 2020-12-08 20:20:42 -08:00
Dean Lee 24a84b2aff
simplify common_camera_process_front (#2470)
* refactor camera_process_front

* improve
2020-12-03 16:28:32 -08:00
ZwX1616 d3387d540a
tici timing improvements (#2613)
* relocate

* impatience

* should be fine without

Co-authored-by: Comma Device <device@comma.ai>
2020-12-02 16:18:31 -08:00
Dean Lee bd4f6650fa
simplify building capnp messages with arrays (#2617) 2020-11-30 12:08:52 +01:00
Dean Lee 42183d913f
Error checking macros for opencl (#2615)
* macro CL_CHECK&CL_CHECK_ERR

* trigger checks
2020-11-30 12:04:49 +01:00
ZwX1616 f244b7c7e1
tici front/wide encodeIdx msgs (#2564)
* different msgs

* also add timestamps

* keep impatient log, remove the other

* meaningless
2020-11-19 16:12:02 -08:00
Comma Device b9b6ed2d52 underflew 2020-11-19 04:03:16 +00:00
ZwX1616 c630cd44da
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>
2020-11-18 13:39:50 -08:00
George Hotz 2f3e42169c
was wasting a ton of GPU on this debayer (#2566)
Co-authored-by: Comma Device <device@comma.ai>
2020-11-17 16:52:06 -08:00
ZwX1616 4954db0381
use different SubMasters for driverState/sensorEvents (#2522)
* use different sms

* rename
2020-11-11 13:53:11 -08:00
Christo Mitov 029be49012
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>
2020-11-03 19:54:29 -08:00
George Hotz 4d5efb5789
Focus Actuator Comments (#2478)
* comments from DW9800W datasheet

* more comments
2020-11-03 07:45:16 -08:00
Dean Lee c21ccccd61
webcam cleanup: remove unused variables (#2450) 2020-10-29 20:30:46 -07:00
ZwX1616 b5617c17c8
just use the same (#2419) 2020-10-28 17:43:16 -07:00
ZwX1616 d7052094c4
restore behavior (#2418) 2020-10-26 14:49:28 -07:00
ZwX1616 efa9180258
camerad AE hotfix (#2371)
* duplicate offset

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

* fix offroad check
2020-10-20 14:04:18 -07:00
Willem Melching 339d1967cb
--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>
2020-10-17 13:33:12 -07:00
ZwX1616 6b020241c9
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>
2020-10-16 21:58:05 -07:00
Adeeb Shihadeh f4e18e0b74
Build openpilot with webcam support in CI (#2070) 2020-10-16 15:16:17 -07:00
Willem Melching 2e182e5c57
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>
2020-10-13 16:23:23 +02:00
Dean Lee 8fc9cfea38
fix webcam build error (#2320) 2020-10-11 22:45:19 -07:00
ZwX1616 cb58e79ee8
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
2020-10-09 16:31:25 -07:00
ZwX1616 00b642146f
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>
2020-10-09 16:26:43 -07:00
ZwX1616 84e83e88a3
Fix dcamera inaccurate fps on OP3T and LP3 (#2305)
* fix op3t pclk

* fix leeco fps
2020-10-09 11:26:32 -07:00
ZwX1616 2b974150c4
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>
2020-10-03 07:56:16 -07:00
Comma Device b94b435387 qcom2 needs cc conversion (#2125) 2020-09-24 22:52:35 +00:00