Commit Graph

232 Commits

Author SHA1 Message Date
Adeeb Shihadeh 4d0543d92d 100 yuv buffers for all
old-commit-hash: 4c0caf7f7ea3a0127e6b573a78850004aab8e187
2021-07-26 14:02:49 -07:00
Willem Melching d479b9a5de Revert AE changes (#21682)
* Revert AE changes

* keep YUV buffer count
old-commit-hash: b6b0393e2dc3aba054d55884fcfef192b2a28694
2021-07-22 11:22:19 -07:00
Willem Melching 7a9659a9f7 AE: revert changes to min grey target (#21648)
old-commit-hash: b35f6871cb9ed2049ce1f31fcaeb1914677b8177
2021-07-19 10:37:43 +02:00
Willem Melching afd96fb083 only 100 yuv buffers on C2 (#21622)
old-commit-hash: 0d9e7ad24149217cf9e5e215cc5b60a60a77231c
2021-07-16 11:59:30 +02:00
Willem Melching 6dc20d7c75 tici: AE sane default values (#21610)
* tici: AE sane default values

* set exposure time

* remove comment

* set dc gain variable

* whitespace
old-commit-hash: 3ad40963cc5d30d4afd9693653d1f10a9bee61e8
2021-07-15 16:11:27 +02:00
Willem Melching 7198224cf2 tici: improve AE (#21493)
* simplify histogram calculation

* add debug prints

* faster AE

* revert that

* lower log level

* use minimum recomended gains from datasheet

* use define

* fix min gain

* dynamic grey target

* fix build

* add low pass

* more stable rounding

* increase max gain

* always enable HCG

* correctly set min ev

* fix analog gain

* remove unused variable

* fix build

* move recomended gain into cost function

* tweak cost function a bit

* small LPF on desired ev

* fix typo

* lower ts

* clean up defines

* that was used in common

* add cast

* less cost is fine

* fix tests

* whitespace

* filtering is broken

* put back

* clip gain changes instead

* cost function tweaking

* Only go below recomended gain when absolutely necessary

* small penalty on changing gains
old-commit-hash: 63c9b5606358c435b7291a1b35ee4faf6a7870ba
2021-07-13 23:33:50 +02:00
Adeeb Shihadeh 92e236e7ad increase yuv buffer count to hold 5s (#21528)
* increase yuv buffer count to hold 5s

* bump cereal
old-commit-hash: 4738fe0e45a9fded16333b08d27538aeedf044cf
2021-07-10 14:46:20 -07:00
Willem Melching e0378d41cb Refactor camerad exposure logging (#21506)
* simplify gain logging

* clean up metadata

* log grey fractions

* those are not used

* set grey fracs in message

* fix qcom
old-commit-hash: 47be6c751ec69d2f8957c9a1c6f7776a8bde4f7e
2021-07-08 15:22:00 +02:00
Willem Melching 3c5a97251f tici: Switch to 1D dead pixel correction (#21467)
old-commit-hash: 8d075048b30ea00a9d202165f63445d389426814
2021-07-02 14:01:43 +02:00
Dean Lee def897a2c7 fix webcam crash when failed to read video frame (#21272)
old-commit-hash: 73d741b7be4337b4e8dd39e150ee253b62b86153
2021-06-15 12:25:05 +02:00
Dean Lee 147b355dde add space after function name and if statement (#21225)
old-commit-hash: e4e669bb0fc1a919dfb38800099f8e3ad52346f1
2021-06-11 10:17:52 +02:00
Maxime Desroches 426df0435b Convert C++ while loops from int to bool (#21214)
old-commit-hash: 03df1b08bbe6b4156e9aa0bfbc5a85717094c877
2021-06-09 21:09:21 -07:00
Adeeb Shihadeh edd2f1c1a6 fix qcom and qcom2 builds
old-commit-hash: 9e94fb17cfd95dfc5ad85534e50748d5e4225dac
2021-06-08 16:44:05 -07:00
Dean Lee f70a79b838 Use C++ header files instead of C header files. (#21192)
* use cstring instead of string.h

* use cstdio instead of stdio.h

* remove inttypes.h

* use cstdlib instead of stdlib.h

* use cstdint instead of stdint.h

* #include <cstddef>

* cstdlib

* use cmath

* remove stddef.h

* use cassert

* use csignal

* use ctime

* use cerror

* rebase master
old-commit-hash: c53cb5d570adb82bc454fcabab458d7e7f09738c
2021-06-08 13:46:22 -07:00
Dean Lee 3a698faadc Use full include path (#21194)
old-commit-hash: b06b3ecb60c651dacf079513635f7d9d99228783
2021-06-08 12:09:30 -07:00
Dean Lee 497472932a Cleanup util.h (#20849)
* cleanup util.h

* fix build error:omx_encoder.cc:408: undefined reference to do_exit

* fix build error

* rebase master

* move helper functions back to util

* ExitHandleHelper->ExitHandlerHelper

* std::clamp

* struct ExitHandlerHelper to class

* rebase master

* cleanup

* restore ExitHandler

* prefer cassert
old-commit-hash: 65e0b1e699092355bfcb1f588a5a2ec949a34b77
2021-06-01 16:53:12 +02:00
Adeeb Shihadeh c7c49e8e35 fix up model tests + tools (#21071)
* unlogger: send yuv stream

* fix up model test tools

* fix unlogger

* rename model replay

* bump cereal

* test in actions

* no ci for now
old-commit-hash: cf6d133638caac0d974209f92be9c200cdbcbf3f
2021-05-28 23:08:08 -07:00
Adeeb Shihadeh 39d83ba32c remove oneplus camera params (#21047)
* remove oneplus camera params

* align
old-commit-hash: 8fdbbdef73809d69622a1046c693c144167e5b9a
2021-05-26 17:46:43 -07:00
ShaneSmiskol 75b1c7c4ba Improve focus when using snapshot (#21031)
old-commit-hash: a4571443578d53d414ebc3384414e8502ee3c528
2021-05-26 17:17:04 -07:00
George Hotz 6922150ede Move MCLK from 24 -> 19.2 mhz + Add accuracy in sidebar (#20960)
* wip

* one day i'll flip that right

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: f43671c9878e2babc7c524a6f1476c571e8b900a
2021-05-18 22:37:33 -07:00
Dean Lee 5609f32cee Cleanup includes (#20925)
* remove #include <pthread.h>

* remove #include<stdbool.h> for cc files

* remove #include<iostream>
old-commit-hash: 0495426535490e7d8d503af35ace7a20dc70a7bb
2021-05-17 10:31:31 +02:00
Dean Lee e333e4f189 Cleanup selfdrive/ includes (#20822)
* cleanup include path

* continue

* format includes

* fix testraw.cc

* remove include path from SConstruct

* regroup

* rebase master

* almost done

* apply review

* rename FileReader.xx to filereader.xx

* rename Unlogger.x->unlogger.x

* rename FrameReader.xx -> framereader.xx

* apply reviews

* ui.h

* continue

* fix framebuffer.cc build error:mv util.h up

* full path to msm_media_info

* fix qcom2 camerad

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 7222d0f20dc8edfe0d2f3417d1ce7c84fbd32805
2021-05-08 22:15:17 -07:00
Willem Melching 78bf4f5867 Replace ifdef with hw abstraction layer (#20843)
* Replace ifdefs with hardware abstraction layer (#20801)

* add type to class hadwareXXX

* replace ifdefs with hardware layer

* continue

* continue

* new function get_driver_view_transform

* full path to hw.h

* fix build error setup.cc

* apply review

* fix typo

* fix deprecated error:replace deprecated fromPath with new

* fix build error

* Fixes after ifdef clenaup (#20842)

* inheritance doesnt work with static

* fix debayer

* small cleanup

* Update selfdrive/camerad/cameras/camera_common.cc

* Update selfdrive/ui/qt/offroad/settings.cc

* Update selfdrive/common/modeldata.h

* flip conditions

* fix comment

Co-authored-by: Dean Lee <deanlee3@gmail.com>
old-commit-hash: ab319d4f54a53e1a0aa1c2c0d94d56a9acef8362
2021-05-06 14:39:05 +02:00
Willem Melching 39c18d4c5a Revert "Replace ifdefs with hardware abstraction layer (#20801)"
This reverts commit 9f2ad462f39f4c880f283b71bffbc9248a2b577d.

old-commit-hash: 3a95d3ccaae7168073410cd7d392a9564d9d45ba
2021-05-06 12:29:30 +02:00
Dean Lee e0282ced49 Replace ifdefs with hardware abstraction layer (#20801)
* add type to class hadwareXXX

* replace ifdefs with hardware layer

* continue

* continue

* new function get_driver_view_transform

* full path to hw.h

* fix build error setup.cc

* apply review

* fix typo

* fix deprecated error:replace deprecated fromPath with new

* fix build error
old-commit-hash: 757d2923d2bfcda620b252e21a348ac3f87f3a63
2021-05-06 11:41:46 +02:00
Adeeb Shihadeh 532d19427c bump cereal
old-commit-hash: 8a280fbb8eb433fbfe0fc43254c9cbdaceedbab6
2021-05-03 20:47:11 -07:00
iejMac 4abd8988e4 cereal: SubMaster refactor, update is now void (#20730)
* cereal: SubMaster refactor, update is now void

* bump cereal

* mistake

* update void

* checks

* semicolon

* Update selfdrive/camerad/cameras/camera_frame_stream.cc

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

* check sensorEvent

* update cereal

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 4866a39244c59f540895ad64103e13f7c41a3cc8
2021-04-22 22:13:32 -07:00
Dean Lee 2db11515bd camerad: SubMaster never updated (#20651)
* fix sm has not been updated

* update submaster in processing driver cam thread

* move Subbmaster to driver camera thread

* cleanup

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: f0a1a6e4d6256d7ec2319288695c5fece51c8f66
2021-04-13 15:26:24 -07:00
Dean Lee 3339cc01a6 camerad: refactor RGBToYUVState into a class (#20310)
* struct RGBToYUVState to class Rgb2Yuv

* clFinish

* blank line

* rebase master

* use event
old-commit-hash: 5a3c22d804155da72339b0dafbb567caffbc1721
2021-04-12 22:42:53 -07:00
Dean Lee 7d5a53ccbe Use std::size for element counts (#20654)
old-commit-hash: cf8067536928aca45aea850698e085d3170be7a6
2021-04-12 12:22:22 +02:00
Adeeb Shihadeh d339348895 Revert "CameraBuf: avoid busy waiting on safe_queue (#20643)"
This reverts commit e7db6f827d41b8c75579ccbfc2db20f93bd3f6c0.

old-commit-hash: 4e03e3738170f0c9cfb7377e4f41d4760b1505d8
2021-04-11 17:56:38 -07:00
Dean Lee 56d306c03b CameraBuf: avoid busy waiting on safe_queue (#20643)
* 20ms timeout

* Update camera_common.cc

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: e562a69a4d6e1669aebdc24386f170a5a27b5f95
2021-04-11 16:49:38 -07:00
Willem Melching 8f4a445171 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
old-commit-hash: ae094042ade44815fdba50196c15ba552bbf33d7
2021-04-07 15:36:37 +02:00
Willem Melching 932df57c38 snapshot.py only broadcast front frame when necessary (#20612)
* snapshot.py only broadcast front frame when necessary

* whitespace
old-commit-hash: dfedf9d0de6c5e2a2c7909f2a692aadef6488441
2021-04-07 14:58:38 +02:00
Dean Lee fa799ef42c 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
old-commit-hash: d40891739fa72e0ed658c2beca15f303def08681
2021-04-05 17:04:37 -07:00
Dean Lee 42b4cb6c29 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
old-commit-hash: 9b9bdd3da54e78b5de65a25724b63e210e0935c4
2021-04-02 21:17:42 -07:00
Dean Lee cc749a73fc camerad_qcom: init sensors with array (#20275)
Co-authored-by: ZwX1616 <zwx1616@gmail.com>
old-commit-hash: 26fa6e1644855bed5463e6c98bb11bf29cec3495
2021-04-02 21:13:37 -07:00
Dean Lee 18a8424e92 init frame_length in camera_init (#20261)
old-commit-hash: 540b853c9f7e7a6a8db808bd2b1f000d6168cc4d
2021-04-02 21:10:48 -07:00
Dean Lee 9d1af2f91e camera_qcom: added new function cam_ioctl (#20184)
* added new function cam_ioctl

* static
old-commit-hash: dd54c18bb7b8de1b90ef556b87df66a479b5a7ce
2021-04-02 20:52:08 -07:00
Dean Lee 2a535eed7e refactor set_driver_exposure_target (#20327)
* driver_cam_set_exp_target

* rebase master

* rebase master

* rename to driver_cam_auto_exposure
old-commit-hash: 4e68bab6f6e84ba9a0d4d30696372d1d7e7cc2ab
2021-04-02 20:47:46 -07:00
Dean Lee f8e04b7cf1 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>
old-commit-hash: 5e6e9df407a782be8fe58b29a5908d30045b396c
2021-03-30 19:43:09 -07:00
Dean Lee 405df8b165 Params: python-like interface (#20506)
* rebase master

* delete outdated test_params.c

* putBool & more robust getBool

* putBool(SshEnabled)
old-commit-hash: 98e55996f67aaaf715c941d417ae4d3b0187f388
2021-03-30 12:54:59 +02:00
ZwX1616 40b1877c04 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>
old-commit-hash: 97133a8facf848d5fc709a0ab98ab2c26690ee19
2021-03-26 13:23:18 -07:00
ZwX1616 57ed33ca52 update line length (#20391)
Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 3f221bd5abadaffff807f650db39f84eca3d9ebf
2021-03-17 17:35:11 -07:00
Dean Lee d4986abd9b CameraBuf: remove class variable yuv_metas (#20376)
old-commit-hash: dd4fa036e9bd35e7dec8421ad71ee760d8cdf2bb
2021-03-16 20:50:11 -07:00
Dean Lee b8925e456a CameraBuf::acquire: remove reference frame_data, use cur_frame_data to keep consistency (#20361)
old-commit-hash: 9df3bab96a52ea291a92fa545b30088d26045a7c
2021-03-16 11:11:19 +01:00
Dean Lee 6e820c414b cameras:move cameras_supported to the top (#20370)
* move cameras_supported to the top

* remove extern CameraInfo cameras_supported from camera_common.h
old-commit-hash: 3e663529bdd9077498a9cb4796aa9bc9cd02a77b
2021-03-16 11:09:25 +01:00
Dean Lee 9ef68f2d96 camera_frame_stream.h: remove unused variables (#20340)
old-commit-hash: ecfb9d88d0726d93dc9454d05953352e3d3e5667
2021-03-13 14:30:40 -08:00
Dean Lee 8b0b3074bb camera_qcom2: add std::mutex exp_lock (#20183)
* add std::mutex exp_lock

* auto &meta_data
old-commit-hash: 4c225c6e1d107e4b2c6678625966d7e8e61f0956
2021-03-12 20:03:15 -08:00
Dean Lee bea33f843e 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
old-commit-hash: e654d9ddf9cae61fa5ddc2ba065bff01a2ce20d3
2021-03-12 19:52:04 -08:00