Skip to content

Commit

Permalink
camerad: remove unused SubMaster (commaai#24844)
Browse files Browse the repository at this point in the history
  • Loading branch information
pd0wm authored and netadvanced committed Jun 15, 2022
1 parent 20bd8dc commit 794f80c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
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

0 comments on commit 794f80c

Please sign in to comment.