mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2024-12-29 11:06:18 +00:00
d/vive/controller: Add Vive tracker gen 2 support.
This commit is contained in:
parent
6662e0caef
commit
d047ce8af4
|
@ -365,7 +365,10 @@ vive_config_parse_controller(struct vive_controller_device *d,
|
|||
} else if (strcmp(d->firmware.model_number, "Vive Tracker PVT") == 0) {
|
||||
d->variant = CONTROLLER_TRACKER_GEN1;
|
||||
VIVE_CONTROLLER_DEBUG(d, "Found Gen 1 tracker.");
|
||||
|
||||
} else if (strcmp(d->firmware.model_number, "VIVE Tracker Pro MV") ==
|
||||
0) {
|
||||
d->variant = CONTROLLER_TRACKER_GEN2;
|
||||
VIVE_CONTROLLER_DEBUG(d, "Found Gen 2 tracker.");
|
||||
} else {
|
||||
VIVE_CONTROLLER_ERROR(d, "Failed to parse controller variant");
|
||||
}
|
||||
|
@ -381,13 +384,17 @@ vive_config_parse_controller(struct vive_controller_device *d,
|
|||
d->firmware.mb_serial_number);
|
||||
} break;
|
||||
case CONTROLLER_INDEX_LEFT:
|
||||
case CONTROLLER_INDEX_RIGHT: {
|
||||
case CONTROLLER_INDEX_RIGHT:
|
||||
case CONTROLLER_TRACKER_GEN2: {
|
||||
const cJSON *imu = u_json_get(json, "imu");
|
||||
_get_pose_from_pos_x_z(imu, &d->imu.trackref);
|
||||
|
||||
JSON_VEC3(imu, "acc_bias", &d->imu.acc_bias);
|
||||
JSON_VEC3(imu, "acc_scale", &d->imu.acc_scale);
|
||||
JSON_VEC3(imu, "gyro_bias", &d->imu.gyro_bias);
|
||||
|
||||
if (d->variant == CONTROLLER_TRACKER_GEN2)
|
||||
JSON_VEC3(imu, "gyro_scale", &d->imu.gyro_scale);
|
||||
} break;
|
||||
default:
|
||||
VIVE_CONTROLLER_ERROR(d, "Unknown Vive watchman variant.\n");
|
||||
|
|
|
@ -1145,6 +1145,9 @@ vive_controller_create(struct os_hid_device *controller_hid,
|
|||
} else if (d->variant == CONTROLLER_TRACKER_GEN1) {
|
||||
d->base.name = XRT_DEVICE_VIVE_TRACKER_GEN1;
|
||||
d->base.update_inputs = _update_tracker_inputs;
|
||||
} else if (d->variant == CONTROLLER_TRACKER_GEN2) {
|
||||
d->base.name = XRT_DEVICE_VIVE_TRACKER_GEN2;
|
||||
d->base.update_inputs = _update_tracker_inputs;
|
||||
} else {
|
||||
d->base.name = XRT_DEVICE_GENERIC_HMD;
|
||||
VIVE_CONTROLLER_ERROR(d,
|
||||
|
|
|
@ -39,6 +39,7 @@ enum controller_variant
|
|||
CONTROLLER_INDEX_LEFT,
|
||||
CONTROLLER_INDEX_RIGHT,
|
||||
CONTROLLER_TRACKER_GEN1,
|
||||
CONTROLLER_TRACKER_GEN2,
|
||||
CONTROLLER_UNKNOWN
|
||||
};
|
||||
|
||||
|
|
|
@ -387,6 +387,7 @@ enum xrt_device_name
|
|||
XRT_DEVICE_INDEX_CONTROLLER = 5,
|
||||
XRT_DEVICE_VIVE_WAND = 6,
|
||||
XRT_DEVICE_VIVE_TRACKER_GEN1 = 7,
|
||||
XRT_DEVICE_VIVE_TRACKER_GEN2 = 8,
|
||||
};
|
||||
|
||||
/*!
|
||||
|
|
Loading…
Reference in a new issue