···241241 struct xrt_pose *out_pose)
242242{
243243 // Copied from dummy driver
244244+245245+ struct ns_hmd *ns = ns_hmd(xdev);
246246+244247 struct xrt_pose pose = {{0.0f, 0.0f, 0.0f, 1.0f}, {0.0f, 0.0f, 0.0f}};
245248 bool adjust = view_index == 0;
246249247247- pose.position.x = eye_relation->x / 2.0f;
250250+ pose.position.x = ns->ipd / 2.0f;
248251 pose.position.y = eye_relation->y / 2.0f;
249252 pose.position.z = eye_relation->z / 2.0f;
250253···385388 // enough for public consumption - many cases where a malformed
386389 // config json results in cryptic errors. Should get fixed
387390 // whenever we have more than 5 people using this.
388388-391391+ u_json_get_float(
392392+ cJSON_GetObjectItemCaseSensitive(config_json, "baseline"),
393393+ &ns->ipd);
394394+ ns->ipd = ns->ipd / 1000.0f; // converts from mm to m
389395 u_json_get_float_array(cJSON_GetObjectItemCaseSensitive(
390396 config_json, "left_uv_to_rect_x"),
391397 ns->eye_configs_v2[0].y_coefficients,
···532538 if (!ns_config_load(ns))
533539 goto cleanup;
534540535535- if (ns->is_v2) { // ns_config_load() sets ns->is_v2
541541+ // ns_config_load() sets ns->is_v2.
542542+ // to change how we switch between v1 and v2,
543543+ // you'll need to start in ns_config_load()
544544+ if (ns->is_v2) {
536545 ns->base.get_view_pose = ns_v2_hmd_get_view_pose;
537546 ns_v2_fov_calculate(ns, 0);
538547 ns_v2_fov_calculate(ns, 1);
···548557 ns->base.hmd->distortion.preferred =
549558 XRT_DISTORTION_MODEL_COMPUTE;
550559 ns->base.compute_distortion = ns_v2_mesh_calc;
551551-552560 } else {
553561 // V1
554562 ns->base.get_view_pose = ns_hmd_get_view_pose;
+1
src/xrt/drivers/north_star/ns_hmd.h
···117117118118 struct ns_v1_eye eye_configs_v1[2]; // will be NULL if is_v2.
119119 struct ns_v2_eye eye_configs_v2[2]; // will be NULL if !is_v2
120120+ float ipd;
120121121122 struct ns_leap leap_config; // will be NULL if is_v2
122123