The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

d/dai: Set fields after nullptr check

authored by

Jakob Bornecrantz and committed by
Moses Turner
9077261a 00c3cc4c

+13 -7
+13 -7
src/xrt/drivers/depthai/depthai_driver.cpp
··· 1015 1015 depthai_fs_monocular_rgb(struct xrt_frame_context *xfctx) 1016 1016 { 1017 1017 struct depthai_fs *depthai = depthai_create_and_do_minimal_setup(); 1018 - depthai->want_cameras = true; 1019 - depthai->want_imu = false; 1020 1018 if (depthai == nullptr) { 1021 1019 return nullptr; 1022 1020 } 1023 1021 1022 + // Set after checking for null. 1023 + depthai->want_imu = false; 1024 + depthai->want_cameras = true; 1025 + 1024 1026 // Currently hardcoded to the default Oak-D camera. 1025 1027 enum depthai_camera_type camera_type = RGB_IMX_378; 1026 1028 ··· 1043 1045 return nullptr; 1044 1046 } 1045 1047 1048 + // Set after checking for null. 1046 1049 depthai->fps = settings->frames_per_second; 1047 1050 depthai->want_cameras = settings->want_cameras; 1048 1051 depthai->want_imu = settings->want_imu; 1049 1052 depthai->half_size_ov9282 = settings->half_size_ov9282; 1050 - 1051 1053 1052 1054 // Last bit is to setup the pipeline. 1053 1055 depthai_setup_stereo_grayscale_pipeline(depthai); ··· 1064 1066 depthai_fs_stereo_grayscale_and_imu(struct xrt_frame_context *xfctx) 1065 1067 { 1066 1068 struct depthai_fs *depthai = depthai_create_and_do_minimal_setup(); 1067 - depthai->want_cameras = true; 1068 - depthai->want_imu = true; 1069 1069 if (depthai == nullptr) { 1070 1070 return nullptr; 1071 1071 } 1072 1072 1073 + // Set after checking for null. 1074 + depthai->want_cameras = true; 1075 + depthai->want_imu = true; 1076 + 1073 1077 // Last bit is to setup the pipeline. 1074 1078 depthai_setup_stereo_grayscale_pipeline(depthai); 1075 1079 ··· 1086 1090 depthai_fs_just_imu(struct xrt_frame_context *xfctx) 1087 1091 { 1088 1092 struct depthai_fs *depthai = depthai_create_and_do_minimal_setup(); 1089 - depthai->want_cameras = false; 1090 - depthai->want_imu = true; 1091 1093 if (depthai == nullptr) { 1092 1094 return nullptr; 1093 1095 } 1096 + 1097 + // Set after checking for null. 1098 + depthai->want_cameras = false; 1099 + depthai->want_imu = true; 1094 1100 1095 1101 // Last bit is to setup the pipeline. 1096 1102 depthai_setup_stereo_grayscale_pipeline(depthai);