diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
index 6bbbbacb70..b1a14076ea 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.yml
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -22,23 +22,11 @@ body:
validations:
required: true
- - type: dropdown
- id: hw
- attributes:
- label: What hardware does this issue affect?
- multiple: true
- options:
- - comma three
- - comma two
- - EON Gold
- validations:
- required: true
-
- type: input
id: route
attributes:
label: Provide a route where the issue occurs
- description: Ensure the route is fully uploaded at https://useradmin.comma.ai
+ description: Ensure the route is fully uploaded at https://useradmin.comma.ai. We cannot look into issues without routes, or at least a Dongle ID.
placeholder: 77611a1fac303767|2020-05-11--16-37-07
validations:
required: true
diff --git a/.github/ISSUE_TEMPLATE/car_bug_report.yml b/.github/ISSUE_TEMPLATE/car_bug_report.yml
index a48f984192..23527c3a43 100644
--- a/.github/ISSUE_TEMPLATE/car_bug_report.yml
+++ b/.github/ISSUE_TEMPLATE/car_bug_report.yml
@@ -21,18 +21,6 @@ body:
validations:
required: true
- - type: dropdown
- id: hw
- attributes:
- label: What hardware does this issue affect?
- multiple: true
- options:
- - comma three
- - comma two
- - EON Gold
- validations:
- required: true
-
- type: input
id: car
attributes:
diff --git a/Pipfile b/Pipfile
index 473b873077..af3e02f54a 100644
--- a/Pipfile
+++ b/Pipfile
@@ -82,6 +82,7 @@ tqdm = "*"
urllib3 = "*"
utm = "*"
websocket_client = "*"
+hatanaka = "*"
[requires]
python_version = "3.8"
diff --git a/Pipfile.lock b/Pipfile.lock
index 4398c37d29..5ee3f2b031 100644
--- a/Pipfile.lock
+++ b/Pipfile.lock
@@ -1,7 +1,7 @@
{
"_meta": {
"hash": {
- "sha256": "918c8cba5c6a0242dc0f6ea74246176a1c54f0a9395feddf35af2189cc813378"
+ "sha256": "19a7b58f24cd7542ccb9fd386c7716d77fff3c1f87de496f3f42753cf34a5dde"
},
"pipfile-spec": 6,
"requires": {
@@ -281,6 +281,16 @@
"index": "pypi",
"version": "==20.1.0"
},
+ "hatanaka": {
+ "hashes": [
+ "sha256:0e095d35ed4f607eb77ae47ecb310e4c25f5a6267037b703ea258ed03e5c47da",
+ "sha256:84faa953b4f641a6d3cf8187f1775ba7e7f8d815f7bcd48cfb18553b766cbc41",
+ "sha256:ccf8be554deee2fc70be52bd2f1d3d4dd370001caa74333bf041933d69a19023",
+ "sha256:ce1628029c6b50c142a8fc5f15453c4cf2a3fd88a7128075415aeb5c9a2727d0"
+ ],
+ "index": "pypi",
+ "version": "==2.8.0"
+ },
"hexdump": {
"hashes": [
"sha256:d781a43b0c16ace3f9366aade73e8ad3a7bd5137d58f0b45ab2d3f54876f20db"
@@ -304,12 +314,20 @@
"markers": "python_version < '3.10'",
"version": "==4.11.3"
},
+ "importlib-resources": {
+ "hashes": [
+ "sha256:b6062987dfc51f0fcb809187cffbd60f35df7acb4589091f154214af6d0d49d3",
+ "sha256:e447dc01619b1e951286f3929be820029d48c75eb25d265c28b92a16548212b8"
+ ],
+ "markers": "python_version >= '3.7'",
+ "version": "==5.7.1"
+ },
"isort": {
"hashes": [
"sha256:6f62d78e2f89b4500b080fe3a81690850cd254227f27f75c3a0c491a1f351ba7",
"sha256:e8443a5e7a020e9d7f97f1d7d9cd17c88bcb3bc7e218bf9cf5095fe550be2951"
],
- "markers": "python_version < '4.0' and python_full_version >= '3.6.1'",
+ "markers": "python_version < '4' and python_full_version >= '3.6.1'",
"version": "==5.10.1"
},
"itsdangerous": {
@@ -449,6 +467,47 @@
],
"version": "==1.2.1"
},
+ "ncompress": {
+ "hashes": [
+ "sha256:0349d7de11edd70a7efea9ce9dc67f0e47b5774832dd063f7ae68a9e3e36ea31",
+ "sha256:070044eab19586a45d1855c3e50e000ce86d6075b122a5ec8cffd480713dffac",
+ "sha256:13fa26ec8000d786a8079bb265508b5df4b445a4f460481a13549b4bd3c83824",
+ "sha256:15f10fbfa11345ff0af090e3e6ae13a1fe2b52a2bb39d4f2373c2d6aeac75e5d",
+ "sha256:2a104803fbe3ab0a96edb14927fa22c8142be838aabe7e938b4a52a4e82db56e",
+ "sha256:34754041d9bac2d6908ae0d07ba541e4d6d606cca222ddd53f3a57e15f386b0a",
+ "sha256:34c6496168fd4dbc13f1fc0c0fcbadded1957639956f8cbc6894c39999817e36",
+ "sha256:3590e66313041721ae81e72ece06b7048c9293321bb30900358638673608e264",
+ "sha256:393cc3c126b9451fb32fe2bc07773264c90e73afbd37da0df472ac23bfd1a2d5",
+ "sha256:5336a8831a7e587829ce54e9e27d1fb2e04ddbc7d2d983693e35a3a03ac3ce79",
+ "sha256:5a2ae8a9170fa1f45df7efa292eb8c437b18c225b63d4adca4f50f9da0e8e0c7",
+ "sha256:6540556d47670a8fb93878a44d0206bbdc87f32e4c5b57d6fe63691efafbb982",
+ "sha256:66d991155a1655ccd98e8433c4a7e811d63eb649adb55f47d8f9528a30cc4b7a",
+ "sha256:736dbae078107742cf6ac7ccc11ae9c5eab77ef2c02aab3ef64802877bb01cab",
+ "sha256:7608fbda43d04d9f476be2dbf4ef3c96e72d83b9557a48b07fbc9ff3ad29cdd2",
+ "sha256:78674f246878938387b6f82b10d1aa2192e02544d214541943d12ef1a45e66c6",
+ "sha256:8322482e72ac2802d1dca1007ec06aa281a4d5cf1cf9f8c75bb51e917382b756",
+ "sha256:8b9acc46cf36bb998ed215d6e76a94e2bd1e827b9a4cb5362982b7004b5a7620",
+ "sha256:8eb4a55cbeaeb238a3b412952077be6b3f37b3416cd0211cc22776391ff2fef7",
+ "sha256:916671d62167191af58d6b4a17b1c09c647e349dcff1fc0b7d764aa64c3773ee",
+ "sha256:94b3f4e851f5b37e1d4cf2d8da911fa10783a59cba3d7f1f2ae5bd2842558077",
+ "sha256:9cd040ad73a3b0e917e01cdfba507e10e0bb56849daaac3ac3d86382d4d7ad82",
+ "sha256:9d89acf209858e7940223cf35324e1b2effec119bb009a41f039e2ea4db22177",
+ "sha256:9da7c81313aed4b6c6e8020442ed8d03d04bff72947f9380ea1ce2c63ffb8ad1",
+ "sha256:aaa18a509d9fc173b4b47d53c834e43ced1eda63d2aa7d4613dc59b2f802a31a",
+ "sha256:ab9fc62baaa55faf8ed8ac67f2c64a7295fec91d7c1f306ac46aa894ca4edf91",
+ "sha256:af0011bae90e44121f4e4edbff3dccdce7e4c5fc5e354db7eb48410d71f496df",
+ "sha256:b031e06b42037b181e3514261e1e85a9eae4af990c12b9348a9f22b8042201ff",
+ "sha256:d11df815d280985dfa660974df11dbe051a1a18dca2f91f9d30fbd6548237b8f",
+ "sha256:d45ec59a8a3ce00613df0c81e5567854574dbbbf01ecd1a5a0929cd8fb04844d",
+ "sha256:da216a53db7cd4c0247376f87367dd71df457443567e55310f6d3d23a9aff2f2",
+ "sha256:e0ebd71990ef7909b6627b5341a2fe1977dcce61dd3760a29e19e3f9e4c6a275",
+ "sha256:e6f5bf381412e9d3847b76e8b6bd1f84dfadcd3d9c25903c8592facb437909a0",
+ "sha256:e7bbf10cca1376f4f17ae2c447e33a9d4067525abb0c71d488c9a5ced50552f1",
+ "sha256:f9ba6ab2aadd6fd90365fdad5219e4dc7bc2459b94f1e900a733dddaf4e9b2e6",
+ "sha256:fe0a671a2f7dc1ee0438d278ef30ab425a969536100c4352b5cb6bc0b6210818"
+ ],
+ "version": "==1.0.0"
+ },
"nose": {
"hashes": [
"sha256:9ff7c6cc443f8c51994b34a667bbcf45afd6d945be7477b52e97516fd17c53ac",
diff --git a/cereal b/cereal
index 5935572cee..c7d3a0acba 160000
--- a/cereal
+++ b/cereal
@@ -1 +1 @@
-Subproject commit 5935572cee86f202e2524d5f388f9475f92cd649
+Subproject commit c7d3a0acbae267ef93d30044e1941e060dac9e48
diff --git a/docs/CARS.md b/docs/CARS.md
index 14664d480c..8a78afe5cb 100644
--- a/docs/CARS.md
+++ b/docs/CARS.md
@@ -47,7 +47,7 @@ How We Rate The Cars
|Kia|Niro Electric 2019-22|All|
|
|
|
|
|
|Kia|Telluride 2020|SCC + LKAS|
|
|
|
|
|
|Lexus|ES 2019-21|All|
|
|
|
|
|
-|Lexus|ES Hybrid 2019-21|All|
|
|
|
|
|
+|Lexus|ES Hybrid 2019-22|All|
|
|
|
|
|
|Lexus|NX 2020|All|
|
|
|
|
|
|Lexus|RX 2020-22|All|
|
|
|
|
|
|Lexus|RX Hybrid 2020-21|All|
|
|
|
|
|
diff --git a/laika_repo b/laika_repo
index 226adc655e..48a9cb686a 160000
--- a/laika_repo
+++ b/laika_repo
@@ -1 +1 @@
-Subproject commit 226adc655e1488474468a97ab4a7705aad7e5837
+Subproject commit 48a9cb686ae2d12cd830f17c166a8fb9f79ab292
diff --git a/opendbc b/opendbc
index e19ba095c3..919154efe2 160000
--- a/opendbc
+++ b/opendbc
@@ -1 +1 @@
-Subproject commit e19ba095c3ee288d629284e24ec7e0deaf645f3f
+Subproject commit 919154efe2bd07c4dd124d7e6a11a4afc8685f9d
diff --git a/scripts/cell.sh b/scripts/cell.sh
new file mode 100755
index 0000000000..cae701eccc
--- /dev/null
+++ b/scripts/cell.sh
@@ -0,0 +1,5 @@
+#!/usr/bin/bash
+
+nmcli connection modify --temporary lte ipv4.route-metric 1
+nmcli connection modify --temporary lte ipv6.route-metric 1
+nmcli con up lte
diff --git a/scripts/clwaste b/scripts/clwaste
deleted file mode 100755
index 51770f0e37..0000000000
Binary files a/scripts/clwaste and /dev/null differ
diff --git a/scripts/restart_modem.sh b/scripts/restart_modem.sh
deleted file mode 100755
index fac54b32ff..0000000000
--- a/scripts/restart_modem.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/usr/bin/bash
-echo "restart" > /sys/kernel/debug/msm_subsys/modem
diff --git a/scripts/throttling.sh b/scripts/throttling.sh
deleted file mode 100755
index d100c5f5ab..0000000000
--- a/scripts/throttling.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/data/data/com.termux/files/usr/bin/bash
-watch -n1 '
- cat /sys/kernel/debug/clk/pwrcl_clk/measure
- cat /sys/kernel/debug/clk/perfcl_clk/measure
- cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq
- cat /sys/class/kgsl/kgsl-3d0/gpuclk
- echo
- echo -n "CPU0 " ; cat /sys/devices/virtual/thermal/thermal_zone5/temp
- echo -n "CPU1 " ; cat /sys/devices/virtual/thermal/thermal_zone7/temp
- echo -n "CPU2 " ; cat /sys/devices/virtual/thermal/thermal_zone10/temp
- echo -n "CPU3 " ; cat /sys/devices/virtual/thermal/thermal_zone12/temp
- echo -n "MEM " ; cat /sys/devices/virtual/thermal/thermal_zone2/temp
- echo -n "GPU " ; cat /sys/devices/virtual/thermal/thermal_zone16/temp
- echo -n "BAT " ; cat /sys/devices/virtual/thermal/thermal_zone29/temp
-'
-
diff --git a/scripts/waste b/scripts/waste
deleted file mode 100755
index e3154ab01f..0000000000
Binary files a/scripts/waste and /dev/null differ
diff --git a/selfdrive/camerad/cameras/camera_common.cc b/selfdrive/camerad/cameras/camera_common.cc
index 77b0548873..676e740811 100644
--- a/selfdrive/camerad/cameras/camera_common.cc
+++ b/selfdrive/camerad/cameras/camera_common.cc
@@ -36,10 +36,10 @@ public:
hdr_ = ci->hdr;
snprintf(args, sizeof(args),
"-cl-fast-relaxed-math -cl-denorms-are-zero "
- "-DFRAME_WIDTH=%d -DFRAME_HEIGHT=%d -DFRAME_STRIDE=%d "
+ "-DFRAME_WIDTH=%d -DFRAME_HEIGHT=%d -DFRAME_STRIDE=%d -DFRAME_OFFSET=%d "
"-DRGB_WIDTH=%d -DRGB_HEIGHT=%d -DRGB_STRIDE=%d "
"-DBAYER_FLIP=%d -DHDR=%d -DCAM_NUM=%d",
- ci->frame_width, ci->frame_height, ci->frame_stride,
+ ci->frame_width, ci->frame_height, ci->frame_stride, ci->frame_offset,
b->rgb_width, b->rgb_height, b->rgb_stride,
ci->bayer_flip, ci->hdr, s->camera_num);
const char *cl_file = "cameras/real_debayer.cl";
@@ -81,7 +81,7 @@ void CameraBuf::init(cl_device_id device_id, cl_context context, CameraState *s,
frame_buf_count = frame_cnt;
// RAW frame
- const int frame_size = ci->frame_height * ci->frame_stride;
+ const int frame_size = (ci->frame_height + ci->extra_height) * ci->frame_stride;
camera_bufs = std::make_unique(frame_buf_count);
camera_bufs_metadata = std::make_unique(frame_buf_count);
diff --git a/selfdrive/camerad/cameras/camera_common.h b/selfdrive/camerad/cameras/camera_common.h
index 9c7bf6b034..8c836e0bb8 100644
--- a/selfdrive/camerad/cameras/camera_common.h
+++ b/selfdrive/camerad/cameras/camera_common.h
@@ -52,11 +52,15 @@ const bool env_log_raw_frames = getenv("LOG_RAW_FRAMES") != NULL;
typedef void (*release_cb)(void *cookie, int buf_idx);
typedef struct CameraInfo {
- int frame_width, frame_height;
- int frame_stride;
+ uint32_t frame_width, frame_height;
+ uint32_t frame_stride;
bool bayer;
int bayer_flip;
bool hdr;
+ uint32_t frame_offset = 0;
+ uint32_t extra_height = 0;
+ int registers_offset = -1;
+ int stats_offset = -1;
} CameraInfo;
typedef struct FrameMetadata {
diff --git a/selfdrive/camerad/cameras/camera_qcom2.cc b/selfdrive/camerad/cameras/camera_qcom2.cc
index 7120bf9576..ce9b5663d8 100644
--- a/selfdrive/camerad/cameras/camera_qcom2.cc
+++ b/selfdrive/camerad/cameras/camera_qcom2.cc
@@ -31,6 +31,9 @@ const size_t FRAME_WIDTH = 1928;
const size_t FRAME_HEIGHT = 1208;
const size_t FRAME_STRIDE = 2896; // for 12 bit output. 1928 * 12 / 8 + 4 (alignment)
+const size_t AR0231_REGISTERS_HEIGHT = 2;
+const size_t AR0231_STATS_HEIGHT = 2;
+
const int MIPI_SETTLE_CNT = 33; // Calculated by camera_freqs.py
CameraInfo cameras_supported[CAMERA_ID_MAX] = {
@@ -38,17 +41,24 @@ CameraInfo cameras_supported[CAMERA_ID_MAX] = {
.frame_width = FRAME_WIDTH,
.frame_height = FRAME_HEIGHT,
.frame_stride = FRAME_STRIDE,
+ .extra_height = AR0231_REGISTERS_HEIGHT + AR0231_STATS_HEIGHT,
+
+ .registers_offset = 0,
+ .frame_offset = AR0231_REGISTERS_HEIGHT,
+ .stats_offset = AR0231_REGISTERS_HEIGHT + FRAME_HEIGHT,
+
.bayer = true,
.bayer_flip = 1,
- .hdr = false
+ .hdr = false,
},
[CAMERA_ID_IMX390] = {
.frame_width = FRAME_WIDTH,
.frame_height = FRAME_HEIGHT,
.frame_stride = FRAME_STRIDE,
+
.bayer = true,
.bayer_flip = 1,
- .hdr = false
+ .hdr = false,
},
};
@@ -509,10 +519,10 @@ void CameraState::config_isp(int io_mem_handle, int fence, int request_id, int b
if (io_mem_handle != 0) {
io_cfg[0].mem_handle[0] = io_mem_handle;
io_cfg[0].planes[0] = (struct cam_plane_cfg){
- .width = FRAME_WIDTH,
- .height = FRAME_HEIGHT,
- .plane_stride = FRAME_STRIDE,
- .slice_height = FRAME_HEIGHT,
+ .width = ci.frame_width,
+ .height = ci.frame_height + ci.extra_height,
+ .plane_stride = ci.frame_stride,
+ .slice_height = ci.frame_height + ci.extra_height,
.meta_stride = 0x0, // YUV has meta(stride=0x400, size=0x5000)
.meta_size = 0x0,
.meta_offset = 0x0,
@@ -682,23 +692,23 @@ void CameraState::camera_open() {
.lane_cfg = 0x3210,
.vc = 0x0,
- .dt = 0x2C, // CSI_RAW12
+ .dt = 0x12, // Changing stats to 0x2C doesn't work, so change pixels to 0x12 instead
.format = CAM_FORMAT_MIPI_RAW_12,
.test_pattern = 0x2, // 0x3?
.usage_type = 0x0,
.left_start = 0,
- .left_stop = FRAME_WIDTH - 1,
- .left_width = FRAME_WIDTH,
+ .left_stop = ci.frame_width - 1,
+ .left_width = ci.frame_width,
.right_start = 0,
- .right_stop = FRAME_WIDTH - 1,
- .right_width = FRAME_WIDTH,
+ .right_stop = ci.frame_width - 1,
+ .right_width = ci.frame_width,
.line_start = 0,
- .line_stop = FRAME_HEIGHT - 1,
- .height = FRAME_HEIGHT,
+ .line_stop = ci.frame_height + ci.extra_height - 1,
+ .height = ci.frame_height + ci.extra_height,
.pixel_clk = 0x0,
.batch_size = 0x0,
@@ -710,8 +720,8 @@ void CameraState::camera_open() {
.data[0] = (struct cam_isp_out_port_info){
.res_type = CAM_ISP_IFE_OUT_RES_RDI_0,
.format = CAM_FORMAT_MIPI_RAW_12,
- .width = FRAME_WIDTH,
- .height = FRAME_HEIGHT,
+ .width = ci.frame_width,
+ .height = ci.frame_height + ci.extra_height,
.comp_grp_id = 0x0, .split_point = 0x0, .secure_mode = 0x0,
},
};
@@ -935,6 +945,70 @@ void cameras_close(MultiCameraState *s) {
delete s->pm;
}
+std::map> CameraState::ar0231_build_register_lut(uint8_t *data) {
+ // This function builds a lookup table from register address, to a pair of indices in the
+ // buffer where to read this address. The buffer contains padding bytes,
+ // as well as markers to indicate the type of the next byte.
+ //
+ // 0xAA is used to indicate the MSB of the address, 0xA5 for the LSB of the address.
+ // Every byte of data (MSB and LSB) is preceded by 0x5A. Specifying an address is optional
+ // for contigous ranges. See page 27-29 of the AR0231 Developer guide for more information.
+
+ int max_i[] = {1828 / 2 * 3, 1500 / 2 * 3};
+ auto get_next_idx = [](int cur_idx) {
+ return (cur_idx % 3 == 1) ? cur_idx + 2 : cur_idx + 1; // Every third byte is padding
+ };
+
+ std::map> registers;
+ for (int register_row = 0; register_row < 2; register_row++) {
+ uint8_t *registers_raw = data + ci.frame_stride * register_row;
+ assert(registers_raw[0] == 0x0a); // Start of line
+
+ int value_tag_count = 0;
+ int first_val_idx = 0;
+ uint16_t cur_addr = 0;
+
+ for (int i = 1; i <= max_i[register_row]; i = get_next_idx(get_next_idx(i))) {
+ int val_idx = get_next_idx(i);
+
+ uint8_t tag = registers_raw[i];
+ uint16_t val = registers_raw[val_idx];
+
+ if (tag == 0xAA) { // Register MSB tag
+ cur_addr = val << 8;
+ } else if (tag == 0xA5) { // Register LSB tag
+ cur_addr |= val;
+ cur_addr -= 2; // Next value tag will increment address again
+ } else if (tag == 0x5A) { // Value tag
+
+ // First tag
+ if (value_tag_count % 2 == 0) {
+ cur_addr += 2;
+ first_val_idx = val_idx;
+ } else {
+ registers[cur_addr] = std::make_pair(first_val_idx + ci.frame_stride * register_row, val_idx + ci.frame_stride * register_row);
+ }
+
+ value_tag_count++;
+ }
+ }
+ }
+ return registers;
+}
+
+std::map CameraState::ar0231_parse_registers(uint8_t *data, std::initializer_list addrs) {
+ if (ar0231_register_lut.empty()) {
+ ar0231_register_lut = ar0231_build_register_lut(data);
+ }
+
+ std::map registers;
+ for (uint16_t addr : addrs) {
+ auto offset = ar0231_register_lut[addr];
+ registers[addr] = ((uint16_t)data[offset.first] << 8) | data[offset.second];
+ }
+ return registers;
+}
+
void CameraState::handle_camera_event(void *evdat) {
if (!enabled) return;
struct cam_req_mgr_message *event_data = (struct cam_req_mgr_message *)evdat;
@@ -1114,6 +1188,25 @@ void camera_autoexposure(CameraState *s, float grey_frac) {
s->set_camera_exposure(grey_frac);
}
+static float ar0231_parse_temp_sensor(uint16_t calib1, uint16_t calib2, uint16_t data_reg) {
+ // See AR0231 Developer Guide - page 36
+ float slope = (125.0 - 55.0) / ((float)calib1 - (float)calib2);
+ float t0 = 55.0 - slope * (float)calib2;
+ return t0 + slope * (float)data_reg;
+}
+
+static void ar0231_process_registers(MultiCameraState *s, CameraState *c, cereal::FrameData::Builder &framed){
+ uint8_t *data = (uint8_t*)c->buf.cur_camera_buf->addr + c->ci.registers_offset;
+ auto registers = c->ar0231_parse_registers(data, {0x2000, 0x2002, 0x20b0, 0x20b2, 0x30c6, 0x30c8, 0x30ca, 0x30cc});
+
+ uint32_t frame_id = ((uint32_t)registers[0x2000] << 16) | registers[0x2002];
+ framed.setFrameIdSensor(frame_id);
+
+ float temp_0 = ar0231_parse_temp_sensor(registers[0x30c6], registers[0x30c8], registers[0x20b0]);
+ float temp_1 = ar0231_parse_temp_sensor(registers[0x30ca], registers[0x30cc], registers[0x20b2]);
+ framed.setTemperaturesC({temp_0, temp_1});
+}
+
static void driver_cam_auto_exposure(CameraState *c, SubMaster &sm) {
struct ExpRect {int x1, x2, x_skip, y1, y2, y_skip;};
const CameraBuf *b = &c->buf;
@@ -1132,10 +1225,12 @@ static void process_driver_camera(MultiCameraState *s, CameraState *c, int cnt)
if (env_send_driver) {
framed.setImage(get_frame_image(&c->buf));
}
+ if (c->camera_id == CAMERA_ID_AR0231) {
+ ar0231_process_registers(s, c, framed);
+ }
s->pm->send("driverCameraState", msg);
}
-// called by processing_thread
void process_road_camera(MultiCameraState *s, CameraState *c, int cnt) {
const CameraBuf *b = &c->buf;
@@ -1152,6 +1247,11 @@ void process_road_camera(MultiCameraState *s, CameraState *c, int cnt) {
framed.setTransform(b->yuv_transform.v);
LOGT(c->buf.cur_frame_data.frame_id, "%s: Transformed", "RoadCamera");
}
+
+ if (c->camera_id == CAMERA_ID_AR0231) {
+ ar0231_process_registers(s, c, framed);
+ }
+
s->pm->send(c == &s->road_cam ? "roadCameraState" : "wideRoadCameraState", msg);
const auto [x, y, w, h] = (c == &s->wide_road_cam) ? std::tuple(96, 250, 1734, 524) : std::tuple(96, 160, 1734, 986);
@@ -1221,3 +1321,4 @@ void cameras_run(MultiCameraState *s) {
cameras_close(s);
}
+
diff --git a/selfdrive/camerad/cameras/camera_qcom2.h b/selfdrive/camerad/cameras/camera_qcom2.h
index a7c64c0665..e0553f000e 100644
--- a/selfdrive/camerad/cameras/camera_qcom2.h
+++ b/selfdrive/camerad/cameras/camera_qcom2.h
@@ -1,6 +1,8 @@
#pragma once
#include
+#include