Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

camerad: remove unused SubMaster #24844

Merged
merged 1 commit into from
Jun 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions selfdrive/camerad/cameras/camera_qcom2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,6 @@ void cameras_init(VisionIpcServer *v, MultiCameraState *s, cl_device_id device_i
s->road_cam.camera_init(s, v, CAMERA_ID_AR0231, 1, 20, device_id, ctx, VISION_STREAM_RGB_ROAD, VISION_STREAM_ROAD, !env_disable_road);
s->wide_road_cam.camera_init(s, v, CAMERA_ID_AR0231, 0, 20, device_id, ctx, VISION_STREAM_RGB_WIDE_ROAD, VISION_STREAM_WIDE_ROAD, !env_disable_wide_road);

s->sm = new SubMaster({"driverState"});
s->pm = new PubMaster({"roadCameraState", "driverCameraState", "wideRoadCameraState", "thumbnail"});
}

Expand Down Expand Up @@ -948,7 +947,6 @@ void cameras_close(MultiCameraState *s) {
s->road_cam.camera_close();
s->wide_road_cam.camera_close();

delete s->sm;
delete s->pm;
}

Expand Down Expand Up @@ -1221,16 +1219,15 @@ static void ar0231_process_registers(MultiCameraState *s, CameraState *c, cereal
framed.setTemperaturesC({temp_0, temp_1});
}

static void driver_cam_auto_exposure(CameraState *c, SubMaster &sm) {
static void driver_cam_auto_exposure(CameraState *c) {
struct ExpRect {int x1, x2, x_skip, y1, y2, y_skip;};
const CameraBuf *b = &c->buf;
static ExpRect rect = {96, 1832, 2, 242, 1148, 4};
camera_autoexposure(c, set_exposure_target(b, rect.x1, rect.x2, rect.x_skip, rect.y1, rect.y2, rect.y_skip));
}

static void process_driver_camera(MultiCameraState *s, CameraState *c, int cnt) {
s->sm->update(0);
driver_cam_auto_exposure(c, *(s->sm));
driver_cam_auto_exposure(c);

MessageBuilder msg;
auto framed = msg.initEvent().initDriverCameraState();
Expand Down
1 change: 0 additions & 1 deletion selfdrive/camerad/cameras/camera_qcom2.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,5 @@ typedef struct MultiCameraState {
CameraState wide_road_cam;
CameraState driver_cam;

SubMaster *sm;
PubMaster *pm;
} MultiCameraState;
1 change: 0 additions & 1 deletion selfdrive/camerad/test/camera_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ typedef struct MultiCameraState {
CameraState road_cam;
CameraState driver_cam;

SubMaster *sm = nullptr;
PubMaster *pm = nullptr;
} MultiCameraState;

Expand Down