Commit Graph

297 Commits (master)

Author SHA1 Message Date
Dean Lee e562a69a4d
CameraBuf: avoid busy waiting on safe_queue (#20643)
* 20ms timeout

* Update camera_common.cc

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-04-11 16:49:38 -07:00
Willem Melching ae094042ad
add putBool/getBool wrappers to cython params class (#20611)
* add putBool/getBool wrappers to cython class

* use new API

* some more puts

* fix mockparams arguments

* add get_bool to MockParams

* typo
2021-04-07 15:36:37 +02:00
Willem Melching dfedf9d0de
snapshot.py only broadcast front frame when necessary (#20612)
* snapshot.py only broadcast front frame when necessary

* whitespace
2021-04-07 14:58:38 +02:00
Dean Lee d40891739f
refactor webcam, use common run_camera function (#20555)
* run camera in common function run_camera

continue

remove relase

clEnqueueReadBuffer

cleanup

blank line

remove cideo_cap.release

con tinue

* get camera id from env

* assert
2021-04-05 17:04:37 -07:00
Dean Lee 9b9bdd3da5
Added function power_set_wait, fix munmap invalid pointer error. (#20189)
* added function power_set_wait_cmd

* cleanup

* rename power_set_wait_cmd to power_set_wait

* rename delay to delay_ms
2021-04-02 21:17:42 -07:00
Dean Lee 26fa6e1644
camerad_qcom: init sensors with array (#20275)
Co-authored-by: ZwX1616 <zwx1616@gmail.com>
2021-04-02 21:13:37 -07:00
Dean Lee 540b853c9f
init frame_length in camera_init (#20261) 2021-04-02 21:10:48 -07:00
Dean Lee dd54c18bb7
camera_qcom: added new function cam_ioctl (#20184)
* added new function cam_ioctl

* static
2021-04-02 20:52:08 -07:00
Dean Lee 4e68bab6f6
refactor set_driver_exposure_target (#20327)
* driver_cam_set_exp_target

* rebase master

* rebase master

* rename to driver_cam_auto_exposure
2021-04-02 20:47:46 -07:00
Dean Lee 5e6e9df407
camera_qcom2: move the common file descriptors to MultiCameraState (#20182)
* move the common file descriptors to MultiCameraState

* use unique_fd for file descriptors

* done

* fix build

Co-authored-by: ZwX1616 <zwx1616@gmail.com>
2021-03-30 19:43:09 -07:00
Dean Lee 98e55996f6
Params: python-like interface (#20506)
* rebase master

* delete outdated test_params.c

* putBool & more robust getBool

* putBool(SshEnabled)
2021-03-30 12:54:59 +02:00
ZwX1616 97133a8fac
camerad jenkins box test (#20413)
* separate test

* send

* update test

* snapshot is rgb

* this does not belong here

* clean up

* tici

* no if

* no black frames

* flaky leds

* rename and cleanup

* should be stable and avoid lucky pass

* print

* logical and

* run in jenkins

* source profile on tici

Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-03-26 13:23:18 -07:00
ZwX1616 3f221bd5ab
update line length (#20391)
Co-authored-by: Comma Device <device@comma.ai>
2021-03-17 17:35:11 -07:00
Dean Lee dd4fa036e9
CameraBuf: remove class variable yuv_metas (#20376) 2021-03-16 20:50:11 -07:00
Dean Lee 9df3bab96a
CameraBuf::acquire: remove reference frame_data, use cur_frame_data to keep consistency (#20361) 2021-03-16 11:11:19 +01:00
Dean Lee 3e663529bd
cameras:move cameras_supported to the top (#20370)
* move cameras_supported to the top

* remove extern CameraInfo cameras_supported from camera_common.h
2021-03-16 11:09:25 +01:00
Dean Lee ecfb9d88d0
camera_frame_stream.h: remove unused variables (#20340) 2021-03-13 14:30:40 -08:00
Dean Lee 4c225c6e1d
camera_qcom2: add std::mutex exp_lock (#20183)
* add std::mutex exp_lock

* auto &meta_data
2021-03-12 20:03:15 -08:00
Dean Lee e654d9ddf9
cleanup camera_qcom const structs (#20251)
* move actuator_ringing_params from global to function actuator_move

* remove varaible infinity_dac from CameraState

* static actuator_ringing_params

* continue

* rebase master
2021-03-12 19:52:04 -08:00
ZwX1616 65bb979c34
set_exposure_target test (#20318)
* build

* remove junk

* clean up

* clean up rebase

* new patterns

* add gts

* add to jenkis

* this more useful

* typo

* test only

* Update Jenkinsfile

* test flag

* remove from jenkins

* these should all just be common:wq

* oops

* unigt

* add to unit tests?

* build all is fine

Co-authored-by: Comma Device <device@comma.ai>
2021-03-12 17:40:50 -08:00
Adeeb Shihadeh 90795fc773
reduce log spam (#20330)
* fix big spammers

* my favorite test failure

* remove that one

* went down a bit more
2021-03-12 11:45:29 -08:00
Dean Lee 92e69e8b75
refactor function alloc (#20192) 2021-03-11 17:40:33 -08:00
Dean Lee 8a966de2b6
use loop index (#20307) 2021-03-11 17:24:02 -08:00
ZwX1616 b734647fb7
only destroy if inited (#20317) 2021-03-11 13:53:24 -08:00
Dean Lee 8abc85ea5e
LapConv::Update: use CL_TRUE instead of true (#20311) 2021-03-11 15:01:44 +01:00
Comma Device bcbcc03dc7 revert to divide first 2021-03-08 13:53:24 -08:00
Dean Lee 6e1730a3e8
camera_qcom: better error message for apply exp error (#20265) 2021-03-08 10:42:31 +01:00
Dean Lee 74afec9f15
camera_qcom: change unsigned int to uint32_t (#20262) 2021-03-08 10:41:07 +01:00
Dean Lee e66f816879
cameras_qcom: use macros for actuator moving dir (#20259)
* use macro

* revert change
2021-03-08 10:40:15 +01:00
Dean Lee e0cc95a565
camera_qcom: remove eeprom related stuff (#20254) 2021-03-08 10:19:43 +01:00
Dean Lee 80cc0eefc9
modeldata.h: new function get_model_yuv_transform (#20257) 2021-03-08 10:10:13 +01:00
Dean Lee 59698344a2
camera_qcom: move opencl stuff into class LapConv (#20180)
* class RGB2Gray

* rename Rgb2Grey to LapConv

* rebase master

* rebase master
2021-03-04 20:41:59 -08:00
Dean Lee 2f46ddf779
oneplus cleanup (continue) (#20212)
* cleanup cameras_supported

* use macro

* remove ois_fd

* remove ois_init_settings

* cleanup sensor_i2c.h

* apply_exposure

* better comment

* remove int err

* init apply_exposure in camera_init

* continue

* remove event startupOneplus

* Revert "remove event startupOneplus"

This reverts commit f5b16e864399bcf4dc7c48fc07a43e35c47e7dc2.

* move camera_init after xxx_apply_exposure
2021-03-04 11:25:53 -08:00
Comma Device 0d036de205 better transition 2021-03-04 11:08:52 -08:00
Dean Lee d3a71dcf65
camerad: fix thumbnail cnt (#20236) 2021-03-03 20:14:37 -08:00
ZwX1616 ab87aa1da8
clean up tici camera registers (#20209)
* clean up registers

* clean up more

Co-authored-by: Comma Device <device@comma.ai>
2021-03-03 19:29:08 -08:00
Comma Device a5e9c603bd force same gamma 2021-03-03 14:28:58 -08:00
Dean Lee f5109d9207
cameras_qcom: use std::mutex (#20181) 2021-03-03 11:48:49 +01:00
Dean Lee 824e4531d7
num_cids should be 1 (#20190) 2021-03-03 11:42:49 +01:00
robbederks 491309b639
Tici MIPI config (#20205)
* remove non-default mipi timings and preamble lengths

* actual correct settle count
2021-03-02 14:10:32 +01:00
Adeeb Shihadeh 07ab081a42
oneplus cleanup (#20200)
* start cleanup

* cleanup camerad

* remove unused

* little more

Co-authored-by: Comma Device <device@comma.ai>
2021-03-01 17:14:03 -08:00
ZwX1616 dd2bba0b42
Tici art4 (#20210)
* adjust gamma

* trust that light

* trust that chart

* unsrgb

Co-authored-by: Comma Device <device@comma.ai>
2021-03-01 16:35:43 -08:00
Dean Lee afcbf60cad
camera_qcom.h: regroup variables by usage (#20196) 2021-03-01 14:49:04 +01:00
Dean Lee e6c47916a2
(msm_sensor_power_setting*) type conversions are not required (#20191) 2021-03-01 12:17:30 +01:00
Dean Lee 468dc3f5a4
Move duplicate function declarations to camera_common.h (#20176) 2021-02-26 20:35:21 -08:00
Dean Lee 2f718d28e4
camerad: remove param pix_ptr from set_exposure_target (#20157) 2021-02-26 14:42:27 +01:00
Comma Device e3afd72265 gamma last and only one ccm 2021-02-25 16:37:28 -08:00
Comma Device ab694dbace better gain values 2021-02-25 16:34:15 -08:00
ZwX1616 28b80844c9
tici camerart 3.1 (#20143)
Co-authored-by: Comma Device <device@comma.ai>
2021-02-23 14:05:09 -08:00
ZwX1616 d8ddc1208e
tici camerart III: prehistoric visuals (#20012)
* reworked

* add ref

* f16

* faster

* extended tm

* fix hdr

* Revert "extended tm"

This reverts commit 55ba3ae320.

* reduce static/temporal noise

* split kernels to sync max

* no print

* cleanup qcom2

* optimize

* tune DC

* doesnt work

* minor fix

* adaptive

* smoothen HCG switch

* t

* histogram ceiling

* recalulate params

* group_hold

* less contrast

* recalibrate ccm

* better ae

* better ae revised

* made some changes

* clean up

* midtones

* some improvements

* more

* cleanup

* remove more junk

* lgtm

Co-authored-by: Comma Device <device@comma.ai>
2021-02-21 23:23:40 -08:00
Dean Lee e7906fb446
camerad: rename variables&functions to follow new convention (#20096)
* rename CameraState variables to follow new convention

* continue

* rename camera_process functions

* qcom:rename exposure related variables

* continue

* update commments

* bool real -> bool is_road_cam

* rename sm_front -> sm

* remove paramater tname from start_process_thread

* rename rhd_front to is_rhd

* remove unused varialble name from struct CameraInfo

* rename env_send_xxx

* rename cap_front to cap_driver,cap_rear to cap_road

* rename xxx_camera_process to process_xxx_camera

* update snapshot.py
2021-02-19 13:13:21 -08:00
Dean Lee ad88e62a8d
replace sleep with util::sleep_for (#20108) 2021-02-19 11:27:54 +01:00
Adeeb Shihadeh 312b681a46
cereal cleanup part 2 (#20092)
* car stuff

* thermal

* Revert "car stuff"

This reverts commit 77fd1c65eb.

* panda state

* camera stuff

* start deg

* most is building

* builds

* planner + controls run

* fix up paramsd

* cleanup

* process replay passes

* fix webcam build

* camerad

* no more frame

* thermald

* ui

* paramsd

* camera replay

* fix long tests

* fix camerad tests

* maxSteeringAngle

* bump cereal

* more frame

* cereal master
2021-02-16 21:39:32 -08:00
Dean Lee 139470f033
camera_qcom: cleanup main() (#19805)
* cleanup main

* continue

* remove last_t from CameraState

* cleanup
2021-02-16 16:25:46 -08:00
Willem Melching af8eff4610
camerad fixes for updated agnos kernel (#20062)
* set size

* whitespace

* more cleanup
2021-02-11 23:42:20 -08:00
ZwX1616 8824966aad
tici fcam vignette compensation (#19971)
* simple model

* fix api

* this too
2021-02-01 15:06:15 -08:00
Dean Lee 7f5a1ce02d
get_frame_image: moved the global variables into function static (#19982) 2021-01-31 18:16:12 -08:00
ZwX1616 6d16bfab82
tici dcam AE (#19970)
* tici_ae_front

* not const
2021-01-29 19:11:27 -08:00
ZwX1616 1a95127b0e
camerad frame lag/drop jenkins tests (#19945)
* clean up test

* not needed for now

* this be enough

* comment this out

* clean up

* adjust tolerance

* use sof on tici

Co-authored-by: Comma Device <device@comma.ai>
2021-01-28 14:21:59 -08:00
Dean Lee e6783f4d9f
remove cqueue, use class SafeQueue (#19774)
* class SafeQueue

* cleanup includes

* space

* add timeout

use try_poll

* add function empty() & size()

* class SafeQueue

* add timeout

use try_poll

* add function empty() & size()

* rebase master

* rebase master

* for loop

* fix bug
2021-01-28 15:12:45 +01:00
Dean Lee 064bcbe80b
CameraBuf::acquire : release on failure (#19935) 2021-01-27 12:08:38 +01:00
Dean Lee 80799c7272
fill_frame_data: remove unused paramater cnt (#19936) 2021-01-27 12:03:12 +01:00
Dean Lee cbd08d6f0c
cameras_qcom: fix dangling pointer in fill_frame_image (#19891) 2021-01-26 17:19:06 +01:00
Dean Lee 90994baab0
camera_common: rename create_thumbnail to publish_thumbnail (#19920)
* rename create_thumbnail to publish_thumbnail

* check pm
2021-01-26 17:06:03 +01:00
Dean Lee 6b245b5b0c
camera_webcam: add "thumbnail" to Pubmaster (#19919) 2021-01-25 20:30:02 -08:00
ZwX1616 2b6149572a fill sof 2021-01-22 13:24:51 -08:00
robbederks 5eb16b1193
Change qcom2 fserial and readout timing (#19820)
Co-authored-by: Comma Device <device@comma.ai>
2021-01-20 12:54:20 +01:00
Adeeb Shihadeh eae7a6ed22
camera frame stream cleanup (#19741)
* clean up

* more clean up first
2021-01-19 14:40:47 -08:00
Adeeb Shihadeh 5cb6e69a78 camerad: remove duplicate set_realtime_priority 2021-01-19 14:35:46 -08:00
Dean Lee aaac63689d
CameraBuf: private variables (#19811) 2021-01-19 14:28:40 -08:00
Adeeb Shihadeh 758794dec5 few fixes from LGTM 2021-01-16 14:23:06 -08:00
Dean Lee 2072699719
CameraBuf::acquire : using a scoped lock (#19764)
* Using a scoped lock

* Trigger Build
2021-01-15 12:09:18 +01:00
Dean Lee c804059641
camera_qcom2: simplify camera_process_frame (#19763)
* simplify camera_process_frame

* Trigger Build

* Update selfdrive/camerad/cameras/camera_qcom2.cc

Co-authored-by: Willem Melching <willem.melching@gmail.com>
2021-01-15 12:05:31 +01:00
Dean Lee ea9835f293
fill_frame_image: reduce function parameters (#19736)
* reduce function paramaters

* add assert

* Trigger Build
2021-01-15 11:12:56 +01:00
Dean Lee 1b3c93813d
camerad use std::thread (#19771) 2021-01-15 11:10:52 +01:00
Dean Lee c28ba97e67
CameraBuf: removed unused variables (#19735) 2021-01-14 18:49:52 +01:00
ZwX1616 f0cc78ea92
fix tici debayer GPU page faults 2021-01-12 20:53:51 -08:00
Willem Melching 0b79d0e12d CameraBuf::stop() is not used 2021-01-12 15:28:30 +01:00
Dean Lee 660abb79dc
FIX: It is not safe to call cameras_close before all threads are done. (#19555)
* call cameras_close after all threads exited

* stop buffer before join

* remove buf->stop
2021-01-12 15:27:20 +01:00
Dean Lee 595830135b
merge utilpp.h into util.h (#19710) 2021-01-10 14:57:32 -08:00
Dean Lee cefdca2fd6
create_thumbnail in camera_common (#19553) 2021-01-08 14:31:21 -08:00
Dean Lee 621dcf8aa1
cleanup (#19564) 2021-01-08 14:07:33 -08:00
Willem Melching fb496c692a
VisionIPC 2.0 (#19641)
* Squashed vipc

* Update release files

* Remove else

* add visionipc to release files

* use poller in vipc receive

* opencl framework instead of lib on macos

* Fix camera webcam

* Fix opencl on mac in ui

* more webcam fixes

* typo in ui sconsfile

* Use cur_yuv_buf

* visionbuf c++ class

* Camera qcom was still using visionbuf_allocate

* Turn loggerd back on

* fix snapshot

* No build needed

* update test camerad

* no more release callback

* make encoder c++

* Revert "no more release callback"

This reverts commit e5707b07002fee665d0483d90713154efc2d70d4.

* fix exit handlers

* No need to check errno

* move release callback call

* s/VIPCBufExtra/VisionIpcBufExtra/g

* use non blocking connect

* ui use non blocking connect

* Lower condition variable wait time

* Snapshot cleanup

* bump cereal

* bump cereal
2021-01-08 14:54:25 +01:00
Dean Lee 86fe2d1697
common exit handler (#19661)
* common signal handle

* fix typo

* rename to ExitHandler

* remove include signal.h

* remove include csignal

* rename variable exit to v

* rebase master
2021-01-05 20:19:53 -08:00
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
Dean Lee 9f34d1ff66
camerad: close file descriptors (#2065)
* close file descriptors

* fix struct indent

* add some new lines
2020-09-24 13:39:27 -07:00
ZwX1616 911206fc41
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>
2020-09-18 11:43:41 -07:00
Adeeb Shihadeh 92922ce2ae these should be debug logs 2020-09-17 13:14:18 -07:00
Adeeb Shihadeh ef21b83937
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
2020-09-16 15:33:12 -07:00
Adeeb Shihadeh 0604f194b3 bump max vision clients for tici 2020-09-14 21:29:46 -07:00
Comma Device c9183c11bd fix tbuffer img tearing 2020-09-15 03:32:29 +00:00
ZwX1616 13588e4255
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>
2020-09-14 16:05:57 -07:00
Adeeb Shihadeh 4d5733924a
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>
2020-09-12 21:48:15 -07:00
Comma Device 18884743a6 remove recurrent LOGD and prints 2020-09-01 20:15:39 +00:00
Comma Device 80838f3693 use buffered meta 2020-09-01 18:55:15 +00:00
Adeeb Shihadeh 63436373d2
Remove opencv from phonelibs (#2107)
* remove opencv from phonelibs

* clean that up too
2020-08-30 18:23:23 -07:00
Adeeb Shihadeh 349040d958
driver monitoring cleanup (#2101)
* read rhd from param

* don't need that anymore

* fix build

* bump cereal

* read param from camerad too

* add read_db_bool helper

* bump model replay ref commit, IsRHD wasn't set
2020-08-29 17:16:00 -07:00
Willem Melching 658e9d8316 open by path instead of number 2020-08-27 09:44:52 +00:00
robbederks 37d6472bfa
Tici camerad (#2048)
* fix camera config

* typos

* oops

* more typo

* lambless

* forget to send

* visualize hist

* more typo

* 0xC000

* simple

* data loss prevention, clean up later

* loggerd

* back up code

* backup

* fixed memory leak

* fix vsync

* upload ecam

* WB

* 3stream

* fix OMX crash on loggerd rotation

* rewritten debayer kernel

* update viewer

* improved AE

* no artifact lines/grids

* standard trigger

* cleanups

* CCM

* cleanups

* slight tweak

* upd push sock

* build all these

* update tele fl

* update cereal

* upd viewer

* DualCameraState -> MultiCameraState

* cameras_open

* disable frame zmq push by default

* more cleanup

* no apks

* fix submodule error

* wat

* clean up trash

* remove junk

* only build on qcom2

* no need to check these

* update cereal

* some more minor cleanup

* bump panda

* add todo

* minor typo

* Revert "minor typo"

This reverts commit 9233a1df7c.

* not care

* use consistent hdr

* some cleanup

* Update selfdrive/camerad/main.cc

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

* more cleanups

* remove irrelevant stuff

* this too

* cleanup

* rerun ci

Co-authored-by: ZwX1616 <zwx1616@gmail.com>
Co-authored-by: Tici <robbe@comma.ai>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2020-08-26 19:59:56 -07:00
Dean Lee d158837617
add function cl_get_device_id (#1948)
* add func cl_get_device_id

cleanup

* add fix from review
2020-08-17 11:24:39 +02:00
Adeeb Shihadeh 862259a94b
exit camerad cleanly on PC (#2035) 2020-08-16 16:11:09 -07:00