The open source OpenXR runtime
0
fork

Configure Feed

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

d/wmr: Split out inertial sensor configuration

Inertial sensor configuration blocks are common to
both HMD and controller calibration. Factor out a
shared structure to receive them.

+16 -11
+5 -5
src/xrt/drivers/wmr/wmr_config.c
··· 36 36 // initialize default sensor transforms 37 37 math_pose_identity(&c->eye_params[0].pose); 38 38 math_pose_identity(&c->eye_params[1].pose); 39 - math_pose_identity(&c->accel_pose); 40 - math_pose_identity(&c->gyro_pose); 41 - math_pose_identity(&c->mag_pose); 39 + math_pose_identity(&c->sensors.accel_pose); 40 + math_pose_identity(&c->sensors.gyro_pose); 41 + math_pose_identity(&c->sensors.mag_pose); 42 42 } 43 43 44 44 static void ··· 170 170 } 171 171 172 172 static bool 173 - wmr_config_parse_inertial_sensor(struct wmr_hmd_config *c, cJSON *sensor, enum u_logging_level log_level) 173 + wmr_inertial_sensors_config_parse(struct wmr_inertial_sensors_config *c, cJSON *sensor, enum u_logging_level log_level) 174 174 { 175 175 struct xrt_pose *out_pose; 176 176 ··· 361 361 362 362 cJSON_ArrayForEach(item, sensors) 363 363 { 364 - if (!wmr_config_parse_inertial_sensor(c, item, log_level)) { 364 + if (!wmr_inertial_sensors_config_parse(&c->sensors, item, log_level)) { 365 365 WMR_WARN(log_level, "Error parsing InertialSensor entry"); 366 366 } 367 367 }
+8 -3
src/xrt/drivers/wmr/wmr_config.h
··· 105 105 struct wmr_distortion_6KT distortion6KT; 106 106 }; 107 107 108 + struct wmr_inertial_sensors_config 109 + { 110 + struct xrt_pose accel_pose; 111 + struct xrt_pose gyro_pose; 112 + struct xrt_pose mag_pose; 113 + }; 114 + 108 115 struct wmr_hmd_config 109 116 { 110 117 /* Left and Right eye mapping and distortion params */ 111 118 struct wmr_distortion_eye_config eye_params[2]; 112 119 113 - struct xrt_pose accel_pose; 114 - struct xrt_pose gyro_pose; 115 - struct xrt_pose mag_pose; 120 + struct wmr_inertial_sensors_config sensors; 116 121 117 122 int n_cameras; 118 123 struct wmr_camera_config cameras[WMR_MAX_CAMERAS];
+3 -3
src/xrt/drivers/wmr/wmr_hmd.c
··· 996 996 math_pose_transform(&wh->centerline, &wh->display_to_centerline[dIdx], 997 997 &wh->display_to_centerline[dIdx]); 998 998 } 999 - math_pose_invert(&wh->config.accel_pose, &wh->accel_to_centerline); 999 + math_pose_invert(&wh->config.sensors.accel_pose, &wh->accel_to_centerline); 1000 1000 math_pose_transform(&wh->centerline, &wh->accel_to_centerline, &wh->accel_to_centerline); 1001 - math_pose_invert(&wh->config.gyro_pose, &wh->gyro_to_centerline); 1001 + math_pose_invert(&wh->config.sensors.gyro_pose, &wh->gyro_to_centerline); 1002 1002 math_pose_transform(&wh->centerline, &wh->gyro_to_centerline, &wh->gyro_to_centerline); 1003 - math_pose_invert(&wh->config.mag_pose, &wh->mag_to_centerline); 1003 + math_pose_invert(&wh->config.sensors.mag_pose, &wh->mag_to_centerline); 1004 1004 math_pose_transform(&wh->centerline, &wh->mag_to_centerline, &wh->mag_to_centerline); 1005 1005 1006 1006 struct u_device_simple_info info;