The open source OpenXR runtime
0
fork

Configure Feed

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

st/oxr: handle xrt_device_get_hand_tracking returned result

Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2357>

Simon Zeni d681358b f46d3cde

+8 -33
-12
src/xrt/state_trackers/oxr/oxr_objects.h
··· 1182 1182 bool 1183 1183 oxr_xdev_find_output(struct xrt_device *xdev, enum xrt_output_name name, struct xrt_output **out_output); 1184 1184 1185 - /*! 1186 - * Returns the hand tracking value of the named input from the device. 1187 - * Does NOT apply tracking origin offset to each joint. 1188 - */ 1189 - void 1190 - oxr_xdev_get_hand_tracking_at(struct oxr_logger *log, 1191 - struct oxr_instance *inst, 1192 - struct xrt_device *xdev, 1193 - enum xrt_input_name name, 1194 - XrTime at_time, 1195 - struct xrt_hand_joint_set *out_value); 1196 - 1197 1185 #ifdef OXR_HAVE_MNDX_xdev_space 1198 1186 static inline XrXDevListMNDX 1199 1187 oxr_xdev_list_to_openxr(struct oxr_xdev_list *sc)
+8 -1
src/xrt/state_trackers/oxr/oxr_session.c
··· 1289 1289 struct oxr_space *baseSpc = XRT_CAST_OXR_HANDLE_TO_PTR(struct oxr_space *, locateInfo->baseSpace); 1290 1290 1291 1291 struct oxr_session *sess = hand_tracker->sess; 1292 + struct oxr_instance *inst = sess->sys->inst; 1292 1293 1293 1294 XrHandJointVelocitiesEXT *vel = 1294 1295 OXR_GET_OUTPUT_FROM_CHAIN(locations, XR_TYPE_HAND_JOINT_VELOCITIES_EXT, XrHandJointVelocitiesEXT); ··· 1302 1303 enum xrt_input_name name = hand_tracker->input_name; 1303 1304 1304 1305 XrTime at_time = locateInfo->time; 1306 + 1307 + //! Convert at_time to monotonic and give to device. 1308 + int64_t at_timestamp_ns = time_state_ts_to_monotonic_ns(inst->timekeeping, at_time); 1309 + 1305 1310 struct xrt_hand_joint_set value; 1311 + int64_t ignored; 1306 1312 1307 - oxr_xdev_get_hand_tracking_at(log, sess->sys->inst, xdev, name, at_time, &value); 1313 + xrt_result_t xret = xrt_device_get_hand_tracking(xdev, name, at_timestamp_ns, &value, &ignored); 1314 + OXR_CHECK_XRET(log, sess, xret, xrt_device_get_hand_tracking); 1308 1315 1309 1316 // The hand pose is returned in the xdev's space. 1310 1317 struct xrt_space_relation T_xdev_hand = value.hand_pose;
-20
src/xrt/state_trackers/oxr/oxr_xdev.c
··· 123 123 return false; 124 124 } 125 125 126 - void 127 - oxr_xdev_get_hand_tracking_at(struct oxr_logger *log, 128 - struct oxr_instance *inst, 129 - struct xrt_device *xdev, 130 - enum xrt_input_name name, 131 - XrTime at_time, 132 - struct xrt_hand_joint_set *out_value) 133 - { 134 - //! Convert at_time to monotonic and give to device. 135 - int64_t at_timestamp_ns = time_state_ts_to_monotonic_ns(inst->timekeeping, at_time); 136 - 137 - struct xrt_hand_joint_set value; 138 - 139 - int64_t ignored; 140 - 141 - xrt_device_get_hand_tracking(xdev, name, at_timestamp_ns, &value, &ignored); 142 - 143 - *out_value = value; 144 - } 145 - 146 126 147 127 /* 148 128 *