update monado

This commit is contained in:
Patrick Nicolas
2025-06-10 14:44:01 +02:00
parent 629f26acd7
commit d065229cb7
19 changed files with 75 additions and 60 deletions
+5 -3
View File
@@ -540,9 +540,11 @@ wivrn_controller::wivrn_controller(int hand_id,
.binding_profile_count = std::size(wivrn_binding_profiles),
.binding_profiles = wivrn_binding_profiles,
.input_count = WIVRN_CONTROLLER_INPUT_COUNT,
.orientation_tracking_supported = true,
.position_tracking_supported = true,
.hand_tracking_supported = cnx->get_info().hand_tracking,
.supported = {
.orientation_tracking = true,
.position_tracking = true,
.hand_tracking = cnx->get_info().hand_tracking,
},
.update_inputs = method_pointer<&wivrn_controller::update_inputs>,
.get_tracked_pose = method_pointer<&wivrn_controller::get_tracked_pose>,
.get_hand_tracking = method_pointer<&wivrn_controller::get_hand_tracking>,
+20 -21
View File
@@ -52,28 +52,27 @@ static xrt_result_t wivrn_eye_tracker_get_tracked_pose(xrt_device * xdev,
}
wivrn_eye_tracker::wivrn_eye_tracker(xrt_device * hmd) :
xrt_device{}, gaze(device_id::EYE_GAZE)
xrt_device{
.name = XRT_DEVICE_EYE_GAZE_INTERACTION,
.device_type = XRT_DEVICE_TYPE_EYE_TRACKER,
.str = "WiVRn Eye Tracker",
.serial = "WiVRn Eye Tracker",
.tracking_origin = hmd->tracking_origin,
.input_count = 1,
.inputs = &gaze_input,
.supported = {
.eye_gaze = true,
},
.update_inputs = wivrn_eye_tracker_update_inputs,
.get_tracked_pose = wivrn_eye_tracker_get_tracked_pose,
.destroy = wivrn_eye_tracker_destroy,
},
gaze_input{
.active = true,
.name = XRT_INPUT_GENERIC_EYE_GAZE_POSE,
},
gaze(device_id::EYE_GAZE)
{
xrt_device * base = this;
base->tracking_origin = hmd->tracking_origin;
base->update_inputs = wivrn_eye_tracker_update_inputs;
base->get_tracked_pose = wivrn_eye_tracker_get_tracked_pose;
base->destroy = wivrn_eye_tracker_destroy;
name = XRT_DEVICE_EYE_GAZE_INTERACTION;
device_type = XRT_DEVICE_TYPE_EYE_TRACKER;
eye_gaze_supported = true;
// Print name.
strcpy(str, "WiVRn Eye Tracker");
strcpy(serial, "WiVRn Eye Tracker");
gaze_input.active = true;
gaze_input.name = XRT_INPUT_GENERIC_EYE_GAZE_POSE;
// Setup input.
inputs = &gaze_input;
input_count = 1;
}
void wivrn_eye_tracker::update_inputs()
+9 -6
View File
@@ -45,18 +45,21 @@ wivrn_fb_face2_tracker::wivrn_fb_face2_tracker(xrt_device * hmd,
.str = "WiVRn FB v2 Face Tracker",
.serial = "WiVRn FB v2 Face Tracker",
.tracking_origin = hmd->tracking_origin,
.face_tracking_supported = true,
.input_count = 1,
.inputs = &face_input,
.supported = {
.face_tracking = true,
},
.update_inputs = method_pointer<&wivrn_fb_face2_tracker::update_inputs>,
.get_face_tracking = method_pointer<&wivrn_fb_face2_tracker::get_face_tracking>,
.destroy = [](xrt_device *) {},
},
face_input{
.active = true,
.name = XRT_INPUT_FB_FACE_TRACKING2_VISUAL,
},
cnx(cnx)
{
// Setup input.
face_input.name = XRT_INPUT_FB_FACE_TRACKING2_VISUAL;
face_input.active = true;
inputs = &face_input;
input_count = 1;
}
xrt_result_t wivrn_fb_face2_tracker::update_inputs()
+5 -3
View File
@@ -113,8 +113,10 @@ wivrn_generic_tracker::wivrn_generic_tracker(int index, xrt_device * hmd, wivrn_
.device_type = XRT_DEVICE_TYPE_GENERIC_TRACKER,
.hmd = nullptr,
.tracking_origin = hmd->tracking_origin,
.orientation_tracking_supported = true,
.position_tracking_supported = true,
.supported = {
.orientation_tracking = true,
.position_tracking = true,
},
.update_inputs = method_pointer<&wivrn_generic_tracker::update_inputs>,
.get_tracked_pose = method_pointer<&wivrn_generic_tracker::get_tracked_pose>,
.destroy = [](xrt_device *) {},
@@ -173,4 +175,4 @@ void wivrn_generic_tracker::update_tracking(const from_headset::body_tracking &
if (!poses.update_tracking(tracking.production_timestamp, tracking.timestamp, pose, offset))
cnx.set_tracker_enabled(index, false);
}
} // namespace wivrn
} // namespace wivrn
+5 -3
View File
@@ -73,9 +73,11 @@ wivrn_hmd::wivrn_hmd(wivrn::wivrn_session * cnx,
.tracking_origin = &tracking_origin,
.input_count = 1,
.inputs = &pose_input,
.orientation_tracking_supported = true,
.position_tracking_supported = true,
.battery_status_supported = true,
.supported = {
.orientation_tracking = true,
.position_tracking = true,
.battery_status = true,
},
.update_inputs = [](xrt_device *) { return XRT_SUCCESS; },
.get_tracked_pose = method_pointer<&wivrn_hmd::get_tracked_pose>,
.get_view_poses = method_pointer<&wivrn_hmd::get_view_poses>,
+15 -8
View File
@@ -45,20 +45,27 @@ wivrn_htc_face_tracker::wivrn_htc_face_tracker(xrt_device * hmd,
.str = "WiVRn HTC Face Tracker",
.serial = "WiVRn HTC Face Tracker",
.tracking_origin = hmd->tracking_origin,
.face_tracking_supported = true,
.supported = {
.face_tracking = true,
},
.update_inputs = method_pointer<&wivrn_htc_face_tracker::update_inputs>,
.get_face_tracking = method_pointer<&wivrn_htc_face_tracker::get_face_tracking>,
.destroy = [](xrt_device *) {},
},
inputs_array{
{
{
.active = true,
.name = XRT_INPUT_HTC_EYE_FACE_TRACKING,
},
{
.active = true,
.name = XRT_INPUT_HTC_LIP_FACE_TRACKING,
},
},
},
cnx(cnx)
{
// Setup input.
inputs_array[0].name = XRT_INPUT_HTC_EYE_FACE_TRACKING;
inputs_array[0].active = true;
inputs_array[1].name = XRT_INPUT_HTC_LIP_FACE_TRACKING;
inputs_array[1].active = true;
inputs = inputs_array.data();
input_count = inputs_array.size();
}
+1 -1
View File
@@ -169,7 +169,7 @@ wivrn::wivrn_session::wivrn_session(std::unique_ptr<wivrn_connection> connection
static_roles.head = xdevs[xdev_count++] = &hmd;
if (hmd.face_tracking_supported)
if (hmd.supported.face_tracking)
static_roles.face = &hmd;
roles.left = xdev_count;