The open source OpenXR runtime
0
fork

Configure Feed

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

d/ns: Hopefully make v2 driver read ipd from baseline in v2 config files

+13 -4
+12 -4
src/xrt/drivers/north_star/ns_hmd.c
··· 241 241 struct xrt_pose *out_pose) 242 242 { 243 243 // Copied from dummy driver 244 + 245 + struct ns_hmd *ns = ns_hmd(xdev); 246 + 244 247 struct xrt_pose pose = {{0.0f, 0.0f, 0.0f, 1.0f}, {0.0f, 0.0f, 0.0f}}; 245 248 bool adjust = view_index == 0; 246 249 247 - pose.position.x = eye_relation->x / 2.0f; 250 + pose.position.x = ns->ipd / 2.0f; 248 251 pose.position.y = eye_relation->y / 2.0f; 249 252 pose.position.z = eye_relation->z / 2.0f; 250 253 ··· 385 388 // enough for public consumption - many cases where a malformed 386 389 // config json results in cryptic errors. Should get fixed 387 390 // whenever we have more than 5 people using this. 388 - 391 + u_json_get_float( 392 + cJSON_GetObjectItemCaseSensitive(config_json, "baseline"), 393 + &ns->ipd); 394 + ns->ipd = ns->ipd / 1000.0f; // converts from mm to m 389 395 u_json_get_float_array(cJSON_GetObjectItemCaseSensitive( 390 396 config_json, "left_uv_to_rect_x"), 391 397 ns->eye_configs_v2[0].y_coefficients, ··· 532 538 if (!ns_config_load(ns)) 533 539 goto cleanup; 534 540 535 - if (ns->is_v2) { // ns_config_load() sets ns->is_v2 541 + // ns_config_load() sets ns->is_v2. 542 + // to change how we switch between v1 and v2, 543 + // you'll need to start in ns_config_load() 544 + if (ns->is_v2) { 536 545 ns->base.get_view_pose = ns_v2_hmd_get_view_pose; 537 546 ns_v2_fov_calculate(ns, 0); 538 547 ns_v2_fov_calculate(ns, 1); ··· 548 557 ns->base.hmd->distortion.preferred = 549 558 XRT_DISTORTION_MODEL_COMPUTE; 550 559 ns->base.compute_distortion = ns_v2_mesh_calc; 551 - 552 560 } else { 553 561 // V1 554 562 ns->base.get_view_pose = ns_hmd_get_view_pose;
+1
src/xrt/drivers/north_star/ns_hmd.h
··· 117 117 118 118 struct ns_v1_eye eye_configs_v1[2]; // will be NULL if is_v2. 119 119 struct ns_v2_eye eye_configs_v2[2]; // will be NULL if !is_v2 120 + float ipd; 120 121 121 122 struct ns_leap leap_config; // will be NULL if is_v2 122 123