|
|
@ -1,6 +1,7 @@ |
|
|
|
#include <stdio.h> |
|
|
|
#include <stdio.h> |
|
|
|
#include <signal.h> |
|
|
|
#include <signal.h> |
|
|
|
#include <cassert> |
|
|
|
#include <cassert> |
|
|
|
|
|
|
|
#include <vector> |
|
|
|
|
|
|
|
|
|
|
|
#if defined(QCOM) && !defined(QCOM_REPLAY) |
|
|
|
#if defined(QCOM) && !defined(QCOM_REPLAY) |
|
|
|
#include "cameras/camera_qcom.h" |
|
|
|
#include "cameras/camera_qcom.h" |
|
|
@ -13,6 +14,7 @@ |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#include "common/util.h" |
|
|
|
#include "common/util.h" |
|
|
|
|
|
|
|
#include "common/params.h" |
|
|
|
#include "common/swaglog.h" |
|
|
|
#include "common/swaglog.h" |
|
|
|
|
|
|
|
|
|
|
|
#include "common/ipc.h" |
|
|
|
#include "common/ipc.h" |
|
|
@ -145,8 +147,8 @@ struct VisionState { |
|
|
|
int rgb_front_width, rgb_front_height, rgb_front_stride; |
|
|
|
int rgb_front_width, rgb_front_height, rgb_front_stride; |
|
|
|
VisionBuf rgb_front_bufs[UI_BUF_COUNT]; |
|
|
|
VisionBuf rgb_front_bufs[UI_BUF_COUNT]; |
|
|
|
cl_mem rgb_front_bufs_cl[UI_BUF_COUNT]; |
|
|
|
cl_mem rgb_front_bufs_cl[UI_BUF_COUNT]; |
|
|
|
|
|
|
|
|
|
|
|
bool rhd_front; |
|
|
|
bool rhd_front; |
|
|
|
bool rhd_front_checked; |
|
|
|
|
|
|
|
int front_meteringbox_xmin, front_meteringbox_xmax; |
|
|
|
int front_meteringbox_xmin, front_meteringbox_xmax; |
|
|
|
int front_meteringbox_ymin, front_meteringbox_ymax; |
|
|
|
int front_meteringbox_ymin, front_meteringbox_ymax; |
|
|
|
|
|
|
|
|
|
|
@ -181,11 +183,12 @@ struct VisionState { |
|
|
|
void* frontview_thread(void *arg) { |
|
|
|
void* frontview_thread(void *arg) { |
|
|
|
int err; |
|
|
|
int err; |
|
|
|
VisionState *s = (VisionState*)arg; |
|
|
|
VisionState *s = (VisionState*)arg; |
|
|
|
|
|
|
|
s->rhd_front = read_db_bool("IsRHD"); |
|
|
|
|
|
|
|
|
|
|
|
set_thread_name("frontview"); |
|
|
|
set_thread_name("frontview"); |
|
|
|
// we subscribe to this for placement of the AE metering box
|
|
|
|
// we subscribe to this for placement of the AE metering box
|
|
|
|
// TODO: the loop is bad, ideally models shouldn't affect sensors
|
|
|
|
// TODO: the loop is bad, ideally models shouldn't affect sensors
|
|
|
|
SubMaster sm({"driverState", "dMonitoringState"}); |
|
|
|
SubMaster sm({"driverState"}); |
|
|
|
|
|
|
|
|
|
|
|
cl_command_queue q = clCreateCommandQueue(s->context, s->device_id, 0, &err); |
|
|
|
cl_command_queue q = clCreateCommandQueue(s->context, s->device_id, 0, &err); |
|
|
|
assert(err == 0); |
|
|
|
assert(err == 0); |
|
|
@ -236,12 +239,6 @@ void* frontview_thread(void *arg) { |
|
|
|
visionbuf_sync(&s->rgb_front_bufs[ui_idx], VISIONBUF_SYNC_FROM_DEVICE); |
|
|
|
visionbuf_sync(&s->rgb_front_bufs[ui_idx], VISIONBUF_SYNC_FROM_DEVICE); |
|
|
|
|
|
|
|
|
|
|
|
sm.update(0); |
|
|
|
sm.update(0); |
|
|
|
// no more check after gps check
|
|
|
|
|
|
|
|
if (!s->rhd_front_checked && sm.updated("dMonitoringState")) { |
|
|
|
|
|
|
|
auto state = sm["dMonitoringState"].getDMonitoringState(); |
|
|
|
|
|
|
|
s->rhd_front = state.getIsRHD(); |
|
|
|
|
|
|
|
s->rhd_front_checked = state.getRhdChecked(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef NOSCREEN |
|
|
|
#ifdef NOSCREEN |
|
|
|
if (frame_data.frame_id % 4 == 2) { |
|
|
|
if (frame_data.frame_id % 4 == 2) { |
|
|
|