Commit Graph

77 Commits (57b6fdc17a1f84ec922647c044da5df3cafc0ddc)

Author SHA1 Message Date
Gijs Koning 57b6fdc17a
Rename RGB vision streams to match YUV streams (#23961)
* Renaming VISION_STREAM_RGB_.. to match yuv names like VISION_STREAM_ROAD
VISION_STREAM_RGB_BACK -> VISION_STREAM_RGB_ROAD
VISION_STREAM_RGB_FRONT -> VISION_STREAM_RGB_DRIVER

* little more

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-03-14 14:03:54 -07:00
George Hotz 51767c037b
camerad: use open_v4l_by_name_and_index on c2 also (#23794)
* use open_v4l_by_name_and_index on c2 also

* remove open_v4l_by_name_and_index from qcom2
2022-02-19 13:31:11 -08:00
Willem Melching 36db473bab
comma two: remove lens sag compensation (#23113) 2021-12-14 13:29:59 +01:00
Dean Lee b519acd37b
LapConv: remove hardcoded FULL_STRIDE_X (#23200)
* fix wroing stride_x

* remove hardcoded rgb_stride
2021-12-13 15:53:44 +01:00
Dean Lee 5c6229f3df
common_process_driver_camera: same parameters as process_thread_cb (#23202) 2021-12-13 15:07:31 +01:00
Dean Lee 9decd3d8a2
util: move all functions into util namespace (#23203) 2021-12-12 14:42:23 -08:00
Dean Lee 348d2d2b0d
rename yuv streams (#23071)
* rename yuv streams

* bump cereal

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-11-29 18:14:59 -08:00
Dean Lee f02c8d0e2c
Handle EINTR for all syscalls that can return it (#21948) 2021-08-31 16:22:56 -07:00
Dean Lee 31230e5b60
retry ioctls while errno == EINTR (#22054) 2021-08-30 16:07:34 -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
Willem Melching 47be6c751e
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
2021-07-08 15:22:00 +02:00
Dean Lee e4e669bb0f
add space after function name and if statement (#21225) 2021-06-11 10:17:52 +02:00
Dean Lee c53cb5d570
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
2021-06-08 13:46:22 -07:00
Dean Lee 0495426535
Cleanup includes (#20925)
* remove #include <pthread.h>

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

* remove #include<iostream>
2021-05-17 10:31:31 +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
iejMac 4866a39244
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>
2021-04-22 22:13:32 -07:00
Dean Lee cf80675369
Use std::size for element counts (#20654) 2021-04-12 12:22:22 +02: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 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 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 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
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
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
Dean Lee e6c47916a2
(msm_sensor_power_setting*) type conversions are not required (#20191) 2021-03-01 12:17:30 +01:00
Dean Lee 2f718d28e4
camerad: remove param pix_ptr from set_exposure_target (#20157) 2021-02-26 14:42:27 +01: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
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 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 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