···11+psmv: Introduce proper grip and aim poses, correctly rotate the grip pose to
22+follow the spec more closely. The aim poses replaces the previous ball tip pose
33+that was used before for aim.
+15-7
src/xrt/drivers/psmv/psmv_driver.c
···7171 PSMV_INDEX_CIRCLE_CLICK,
7272 PSMV_INDEX_TRIANGLE_CLICK,
7373 PSMV_INDEX_TRIGGER_VALUE,
7474+ PSMV_INDEX_GRIP_POSE,
7575+ PSMV_INDEX_AIM_POSE,
7476 PSMV_INDEX_BODY_CENTER_POSE,
7577 PSMV_INDEX_BALL_CENTER_POSE,
7676- PSMV_INDEX_BALL_TIP_POSE,
7778};
78797980/*!
···886887 *out_relation_timestamp_ns = now;
887888 }
888889889889- // Adjust from the normal body center pose to the ball tip.
890890- if (name != XRT_INPUT_PSMV_BALL_TIP_POSE) {
890890+ /*
891891+ * Both the grip and aim pose needs adjustments, the grip is a rotated
892892+ * body center pose, while the aim pose needs to rotated and translated
893893+ * to the tip of the ball.
894894+ */
895895+ if (name != XRT_INPUT_PSMV_AIM_POSE &&
896896+ name != XRT_INPUT_PSMV_GRIP_POSE) {
891897 return;
892898 }
893899894894- float y = PSMV_BALL_FROM_IMU_Y_M;
895895- if (name == XRT_INPUT_PSMV_BALL_TIP_POSE) {
900900+ float y = 0.0;
901901+ if (name == XRT_INPUT_PSMV_AIM_POSE) {
902902+ y += PSMV_BALL_FROM_IMU_Y_M;
896903 y += PSMV_BALL_DIAMETER_M / 2.0;
897904 }
898905···967974968975 enum u_device_alloc_flags flags = U_DEVICE_ALLOC_TRACKING_NONE;
969976 struct psmv_device *psmv =
970970- U_DEVICE_ALLOCATE(struct psmv_device, flags, 12, 1);
977977+ U_DEVICE_ALLOCATE(struct psmv_device, flags, 13, 1);
971978 psmv->base.destroy = psmv_device_destroy;
972979 psmv->base.update_inputs = psmv_device_update_inputs;
973980 psmv->base.get_tracked_pose = psmv_device_get_tracked_pose;
···10191026 SET_INPUT(CIRCLE_CLICK);
10201027 SET_INPUT(TRIANGLE_CLICK);
10211028 SET_INPUT(TRIGGER_VALUE);
10291029+ SET_INPUT(GRIP_POSE);
10301030+ SET_INPUT(AIM_POSE);
10221031 SET_INPUT(BODY_CENTER_POSE);
10231032 SET_INPUT(BALL_CENTER_POSE);
10241024- SET_INPUT(BALL_TIP_POSE);
1025103310261034 // We only have one output.
10271035 psmv->base.outputs[0].name = XRT_OUTPUT_NAME_PSMV_RUMBLE_VIBRATION;