Commit Graph

30 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
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
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 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 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
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
Willem Melching 25de93d133
C3 AE improvements (#21698)
* AE improvements

* boardd: also use gain to compute IR brightness

* use default rect for DM autoexposure

* more smooth

* whitespace

* camerad cpu usage

* hcg on is slightly better for noise

* hysteris around high conversion gain

* improve i2c timing

* use AB contexts

* HCG default off

* run at 10 hz

* stay in context A for now

* remove ae thread

* wait till next frame is started before sending i2c

* back at 20fps

* add comment and filter across 3 evs

* remove context switch code

* tuning

* recomened without HCG is 0.8x
2021-08-05 16:34:36 +02:00
Willem Melching b6b0393e2d
Revert AE changes (#21682)
* Revert AE changes

* keep YUV buffer count
2021-07-22 11:22:19 -07:00
Willem Melching 63c9b56063
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
2021-07-13 23:33:50 +02:00
Dean Lee 65e0b1e699
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
2021-06-01 16:53:12 +02:00
Dean Lee 7222d0f20d
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>
2021-05-08 22:15:17 -07: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 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 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
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
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
Adeeb Shihadeh 8674b023ba
HW abstraction layer (#19530)
* start hw refactor

* move that

* pins

* put that back
2020-12-16 21:30:23 -08: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 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
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
Dean Lee f3fb406eee
camerad: protect concurrent access to shared variables and avoid race conditions (#1966)
* Protect concurrent access for shared resources

* fix
2020-08-11 11:40:11 -07:00
Adeeb Shihadeh efd5dffb1e enable flake8 E231: missing whitespace after comma 2020-05-31 12:49:11 -07:00
Adeeb 6051061ff8
Flake8 E22X (#1607)
* e221

* e225

* bump opendbc
2020-05-31 00:48:47 -07:00
Adeeb d9bf9f0a40
Enable more flake8 checks (#1602)
* enable some more flake8 checks

* some more quick ones

* bump opendbc

* e401

* e711 e712

* e115 e116

* e222

* e301

* remove that

* e129

* e701 e702

* e125 e131

* e227

* e306

* e262

* W503

* e713

* e704

* e731

* bump opendbc

* fix some e722
2020-05-30 20:14:58 -07:00
Willem Melching ba2ac1207a
Running pre-commit in CI (#1590)
* Running pre-commit in CI

* fix dockerfile syntax

* dont run on submodule repo folders

* Fix some import errors in ci

* more stuff

* That should be the last one
2020-05-28 15:40:48 -07:00
Willem Melching 29aaa44740
flake8 in pre-commit(#1583) 2020-05-27 20:33:05 -07:00
Shane Smiskol 6ff881f789
initialize all messages in 1 line (#1206) 2020-03-05 17:32:52 -08:00
George Hotz 84560ccd55 selfdrive/camerad 2020-01-17 10:52:42 -08:00