xrt: Remove xrt_device::get_view_pose

Co-authored-by: Christoph Haag <christoph.haag@collabora.com>
This commit is contained in:
Jakob Bornecrantz 2022-02-08 01:16:49 +00:00
parent b81ab3f09a
commit 9b656cde77
22 changed files with 0 additions and 305 deletions

View file

@ -168,16 +168,6 @@ android_device_get_tracked_pose(struct xrt_device *xdev,
XRT_SPACE_RELATION_ORIENTATION_TRACKED_BIT);
}
static void
android_device_get_view_pose(struct xrt_device *xdev,
const struct xrt_vec3 *eye_relation,
uint32_t view_index,
struct xrt_pose *out_pose)
{
(void)xdev;
u_device_get_view_pose(eye_relation, view_index, out_pose);
}
static void
android_device_get_view_poses(struct xrt_device *xdev,
const struct xrt_vec3 *default_eye_relation,
@ -217,7 +207,6 @@ android_device_create()
d->base.destroy = android_device_destroy;
d->base.update_inputs = android_device_update_inputs;
d->base.get_tracked_pose = android_device_get_tracked_pose;
d->base.get_view_pose = android_device_get_view_pose;
d->base.get_view_poses = android_device_get_view_poses;
d->base.compute_distortion = android_device_compute_distortion;
d->base.inputs[0].name = XRT_INPUT_GENERIC_HEAD_POSE;

View file

@ -143,16 +143,6 @@ dummy_hmd_get_tracked_pose(struct xrt_device *xdev,
XRT_SPACE_RELATION_ORIENTATION_TRACKED_BIT);
}
static void
dummy_hmd_get_view_pose(struct xrt_device *xdev,
const struct xrt_vec3 *eye_relation,
uint32_t view_index,
struct xrt_pose *out_pose)
{
(void)xdev;
u_device_get_view_pose(eye_relation, view_index, out_pose);
}
static void
dummy_hmd_get_view_poses(struct xrt_device *xdev,
const struct xrt_vec3 *default_eye_relation,
@ -174,7 +164,6 @@ dummy_hmd_create(void)
struct dummy_hmd *dh = U_DEVICE_ALLOCATE(struct dummy_hmd, flags, 1, 0);
dh->base.update_inputs = dummy_hmd_update_inputs;
dh->base.get_tracked_pose = dummy_hmd_get_tracked_pose;
dh->base.get_view_pose = dummy_hmd_get_view_pose;
dh->base.get_view_poses = dummy_hmd_get_view_poses;
dh->base.destroy = dummy_hmd_destroy;
dh->base.name = XRT_DEVICE_GENERIC_HMD;

View file

@ -159,16 +159,6 @@ euroc_device_get_tracked_pose(struct xrt_device *xdev,
XRT_SPACE_RELATION_ORIENTATION_TRACKED_BIT | XRT_SPACE_RELATION_POSITION_TRACKED_BIT);
}
static void
euroc_get_view_pose(struct xrt_device *xdev,
const struct xrt_vec3 *eye_relation,
uint32_t view_index,
struct xrt_pose *out_pose)
{
(void)xdev;
u_device_get_view_pose(eye_relation, view_index, out_pose);
}
static void
euroc_get_view_poses(struct xrt_device *xdev,
const struct xrt_vec3 *default_eye_relation,
@ -261,7 +251,6 @@ euroc_device_create(struct xrt_prober *xp)
xd->get_tracked_pose = euroc_device_get_tracked_pose;
xd->destroy = euroc_device_destroy;
if (is_hmd) {
xd->get_view_pose = euroc_get_view_pose;
xd->get_view_poses = euroc_get_view_poses;
}

View file

@ -253,16 +253,6 @@ hdk_device_get_tracked_pose(struct xrt_device *xdev,
hd->quat.w, hd->ang_vel_quat.x, hd->ang_vel_quat.y, hd->ang_vel_quat.z);
}
static void
hdk_device_get_view_pose(struct xrt_device *xdev,
const struct xrt_vec3 *eye_relation,
uint32_t view_index,
struct xrt_pose *out_pose)
{
(void)xdev;
u_device_get_view_pose(eye_relation, view_index, out_pose);
}
static void
hdk_device_get_view_poses(struct xrt_device *xdev,
const struct xrt_vec3 *default_eye_relation,
@ -318,7 +308,6 @@ hdk_device_create(struct os_hid_device *dev, enum HDK_VARIANT variant)
hd->base.update_inputs = hdk_device_update_inputs;
hd->base.get_tracked_pose = hdk_device_get_tracked_pose;
hd->base.get_view_pose = hdk_device_get_view_pose;
hd->base.get_view_poses = hdk_device_get_view_poses;
hd->base.destroy = hdk_device_destroy;
hd->base.inputs[0].name = XRT_INPUT_GENERIC_HEAD_POSE;

View file

@ -130,16 +130,6 @@ illixr_hmd_get_tracked_pose(struct xrt_device *xdev,
XRT_SPACE_RELATION_POSITION_VALID_BIT | XRT_SPACE_RELATION_POSITION_TRACKED_BIT);
}
static void
illixr_hmd_get_view_pose(struct xrt_device *xdev,
const struct xrt_vec3 *eye_relation,
uint32_t view_index,
struct xrt_pose *out_pose)
{
(void)xdev;
u_device_get_view_pose(eye_relation, view_index, out_pose);
}
static void
illixr_hmd_get_view_poses(struct xrt_device *xdev,
const struct xrt_vec3 *default_eye_relation,

View file

@ -182,17 +182,6 @@ set_output(struct xrt_device *xdev, enum xrt_output_name name, union xrt_output_
xrt_device_set_output(target, name, value);
}
static void
get_view_pose(struct xrt_device *xdev,
const struct xrt_vec3 *eye_relation,
uint32_t view_index,
struct xrt_pose *out_pose)
{
struct multi_device *d = (struct multi_device *)xdev;
struct xrt_device *target = d->tracking_override.target;
xrt_device_get_view_pose(target, eye_relation, view_index, out_pose);
}
static void
get_view_poses(struct xrt_device *xdev,
const struct xrt_vec3 *default_eye_relation,
@ -267,7 +256,6 @@ multi_create_tracking_override(enum xrt_tracking_override_type override_type,
d->base.set_output = set_output;
d->base.update_inputs = update_inputs;
d->base.compute_distortion = compute_distortion;
d->base.get_view_pose = get_view_pose;
d->base.get_view_poses = get_view_poses;
return &d->base;

View file

@ -454,16 +454,6 @@ ns_hmd_get_tracked_pose(struct xrt_device *xdev,
*out_relation = ns->no_tracker_relation; // you can change this using the debug gui
}
static void
ns_hmd_get_view_pose(struct xrt_device *xdev,
const struct xrt_vec3 *eye_relation,
uint32_t view_index,
struct xrt_pose *out_pose)
{
struct ns_hmd *ns = ns_hmd(xdev);
*out_pose = ns->head_pose_to_eye[view_index];
}
static void
ns_hmd_get_view_poses(struct xrt_device *xdev,
const struct xrt_vec3 *default_eye_relation,
@ -587,7 +577,6 @@ ns_hmd_create(const char *config_path)
ns->base.update_inputs = ns_hmd_update_inputs;
ns->base.get_tracked_pose = ns_hmd_get_tracked_pose;
ns->base.get_view_pose = ns_hmd_get_view_pose;
ns->base.get_view_poses = ns_hmd_get_view_poses;
ns->base.destroy = ns_hmd_destroy;
ns->base.name = XRT_DEVICE_GENERIC_HMD;

View file

@ -427,16 +427,6 @@ oh_device_get_tracked_pose(struct xrt_device *xdev,
ohd->last_relation = *out_relation;
}
static void
oh_device_get_view_pose(struct xrt_device *xdev,
const struct xrt_vec3 *eye_relation,
uint32_t view_index,
struct xrt_pose *out_pose)
{
(void)xdev;
u_device_get_view_pose(eye_relation, view_index, out_pose);
}
static void
oh_device_get_view_poses(struct xrt_device *xdev,
const struct xrt_vec3 *default_eye_relation,
@ -729,7 +719,6 @@ create_hmd(ohmd_context *ctx, int device_idx, int device_flags)
struct oh_device *ohd = U_DEVICE_ALLOCATE(struct oh_device, flags, 1, 0);
ohd->base.update_inputs = oh_device_update_inputs;
ohd->base.get_tracked_pose = oh_device_get_tracked_pose;
ohd->base.get_view_pose = oh_device_get_view_pose;
ohd->base.get_view_poses = oh_device_get_view_poses;
ohd->base.destroy = oh_device_destroy;
ohd->base.inputs[0].name = XRT_INPUT_GENERIC_HEAD_POSE;
@ -1046,7 +1035,6 @@ create_controller(ohmd_context *ctx, int device_idx, int device_flags, enum xrt_
ohd->base.update_inputs = oh_device_update_inputs;
ohd->base.set_output = oh_device_set_output;
ohd->base.get_tracked_pose = oh_device_get_tracked_pose;
ohd->base.get_view_pose = oh_device_get_view_pose;
ohd->base.get_view_poses = oh_device_get_view_poses;
ohd->base.destroy = oh_device_destroy;
if (oculus_touch) {

View file

@ -927,16 +927,6 @@ psvr_device_get_tracked_pose(struct xrt_device *xdev,
math_quat_normalize(&out_relation->pose.orientation);
}
static void
psvr_device_get_view_pose(struct xrt_device *xdev,
const struct xrt_vec3 *eye_relation,
uint32_t view_index,
struct xrt_pose *out_pose)
{
(void)xdev;
u_device_get_view_pose(eye_relation, view_index, out_pose);
}
static void
psvr_device_get_view_poses(struct xrt_device *xdev,
const struct xrt_vec3 *default_eye_relation,
@ -988,7 +978,6 @@ psvr_device_create(struct hid_device_info *sensor_hid_info,
psvr->log_level = log_level;
psvr->base.update_inputs = psvr_device_update_inputs;
psvr->base.get_tracked_pose = psvr_device_get_tracked_pose;
psvr->base.get_view_pose = psvr_device_get_view_pose;
psvr->base.get_view_poses = psvr_device_get_view_poses;
psvr->base.compute_distortion = psvr_compute_distortion;
psvr->base.destroy = psvr_device_destroy;

View file

@ -203,16 +203,6 @@ qwerty_get_tracked_pose(struct xrt_device *xd,
XRT_SPACE_RELATION_ORIENTATION_TRACKED_BIT | XRT_SPACE_RELATION_POSITION_TRACKED_BIT;
}
static void
qwerty_get_view_pose(struct xrt_device *xdev,
const struct xrt_vec3 *eye_relation,
uint32_t view_index,
struct xrt_pose *out_pose)
{
(void)xdev;
u_device_get_view_pose(eye_relation, view_index, out_pose);
}
static void
qwerty_get_view_poses(struct xrt_device *xdev,
const struct xrt_vec3 *default_eye_relation,
@ -282,7 +272,6 @@ qwerty_hmd_create(void)
xd->update_inputs = qwerty_update_inputs;
xd->get_tracked_pose = qwerty_get_tracked_pose;
xd->get_view_pose = qwerty_get_view_pose;
xd->get_view_poses = qwerty_get_view_poses;
xd->destroy = qwerty_destroy;
u_distortion_mesh_set_none(xd); // Fill in xd->compute_distortion()

View file

@ -411,15 +411,6 @@ rs_ddev_get_tracked_pose(struct xrt_device *xdev,
m_relation_history_get(rs->relation_hist, at_timestamp_ns, out_relation);
}
static void
rs_ddev_get_view_pose(struct xrt_device *xdev,
const struct xrt_vec3 *eye_relation,
uint32_t view_index,
struct xrt_pose *out_pose)
{
assert(false);
}
static void
rs_ddev_get_view_poses(struct xrt_device *xdev,
const struct xrt_vec3 *default_eye_relation,
@ -477,7 +468,6 @@ rs_ddev_create(int device_idx)
rs->enable_relocalization, rs->enable_pose_prediction, rs->enable_pose_filtering);
rs->base.update_inputs = rs_ddev_update_inputs;
rs->base.get_tracked_pose = rs_ddev_get_tracked_pose;
rs->base.get_view_pose = rs_ddev_get_view_pose;
rs->base.get_view_poses = rs_ddev_get_view_poses;
rs->base.destroy = rs_ddev_destroy;
rs->base.name = XRT_DEVICE_REALSENSE;

View file

@ -151,16 +151,6 @@ r_device_get_hand_tracking(struct xrt_device *xdev,
*out_timestamp_ns = requested_timestamp_ns;
}
static void
r_device_get_view_pose(struct xrt_device *xdev,
const struct xrt_vec3 *eye_relation,
uint32_t view_index,
struct xrt_pose *out_pose)
{
// Empty
assert(false);
}
static void
r_device_get_view_poses(struct xrt_device *xdev,
const struct xrt_vec3 *default_eye_relation,
@ -197,7 +187,6 @@ r_device_create(struct r_hub *r, bool is_left)
rd->base.update_inputs = r_device_update_inputs;
rd->base.get_tracked_pose = r_device_get_tracked_pose;
rd->base.get_hand_tracking = r_device_get_hand_tracking;
rd->base.get_view_pose = r_device_get_view_pose;
rd->base.get_view_poses = r_device_get_view_poses;
rd->base.set_output = r_device_set_output;
rd->base.destroy = r_device_destroy;

View file

@ -84,16 +84,6 @@ r_hmd_get_hand_tracking(struct xrt_device *xdev,
(void)rh;
}
static void
r_hmd_get_view_pose(struct xrt_device *xdev,
const struct xrt_vec3 *eye_relation,
uint32_t view_index,
struct xrt_pose *out_pose)
{
(void)xdev;
u_device_get_view_pose(eye_relation, view_index, out_pose);
}
static void
r_hmd_get_view_poses(struct xrt_device *xdev,
const struct xrt_vec3 *default_eye_relation,
@ -130,7 +120,6 @@ r_hmd_create(struct r_hub *r)
rh->base.update_inputs = r_hmd_update_inputs;
rh->base.get_tracked_pose = r_hmd_get_tracked_pose;
rh->base.get_hand_tracking = r_hmd_get_hand_tracking;
rh->base.get_view_pose = r_hmd_get_view_pose;
rh->base.get_view_poses = r_hmd_get_view_poses;
rh->base.set_output = r_hmd_set_output;
rh->base.destroy = r_hmd_destroy;

View file

@ -102,17 +102,6 @@ sample_hmd_get_tracked_pose(struct xrt_device *xdev,
XRT_SPACE_RELATION_ORIENTATION_TRACKED_BIT);
}
static void
sample_hmd_get_view_pose(struct xrt_device *xdev,
const struct xrt_vec3 *eye_relation,
uint32_t view_index,
struct xrt_pose *out_pose)
{
(void)xdev;
// This helper function assumes a symmetric IPD
u_device_get_view_pose(eye_relation, view_index, out_pose);
}
static void
sample_hmd_get_view_poses(struct xrt_device *xdev,
const struct xrt_vec3 *default_eye_relation,
@ -136,7 +125,6 @@ sample_hmd_create(void)
struct sample_hmd *sh = U_DEVICE_ALLOCATE(struct sample_hmd, flags, 1, 0);
sh->base.update_inputs = sample_hmd_update_inputs;
sh->base.get_tracked_pose = sample_hmd_get_tracked_pose;
sh->base.get_view_pose = sample_hmd_get_view_pose;
sh->base.get_view_poses = sample_hmd_get_view_poses;
sh->base.destroy = sample_hmd_destroy;
sh->base.name = XRT_DEVICE_GENERIC_HMD;

View file

@ -448,22 +448,6 @@ survive_controller_get_hand_tracking(struct xrt_device *xdev,
out_value->is_active = true;
}
static void
survive_device_get_view_pose(struct xrt_device *xdev,
const struct xrt_vec3 *eye_relation,
uint32_t view_index,
struct xrt_pose *out_pose)
{
// Only supports two views.
assert(view_index < 2);
u_device_get_view_pose(eye_relation, view_index, out_pose);
// This is for the Index' canted displays, on the Vive [Pro] they are identity.
struct survive_device *survive = (struct survive_device *)xdev;
out_pose->orientation = survive->hmd.config.display.rot[view_index];
}
static void
survive_device_get_view_poses(struct xrt_device *xdev,
const struct xrt_vec3 *default_eye_relation,
@ -856,7 +840,6 @@ _create_hmd_device(struct survive_system *sys, const struct SurviveSimpleObject
survive->base.destroy = survive_device_destroy;
survive->base.update_inputs = survive_device_update_inputs;
survive->base.get_tracked_pose = survive_device_get_tracked_pose;
survive->base.get_view_pose = survive_device_get_view_pose;
survive->base.get_view_poses = survive_device_get_view_poses;
survive->base.tracking_origin = &sys->base;

View file

@ -116,24 +116,6 @@ vive_device_get_tracked_pose(struct xrt_device *xdev,
m_relation_history_get(d->relation_hist, at_timestamp_ns, out_relation);
}
static void
vive_device_get_view_pose(struct xrt_device *xdev,
const struct xrt_vec3 *eye_relation,
uint32_t view_index,
struct xrt_pose *out_pose)
{
XRT_TRACE_MARKER();
// Only supports two views.
assert(view_index < 2);
u_device_get_view_pose(eye_relation, view_index, out_pose);
// This is for the Index' canted displays, on the Vive [Pro] they are identity.
struct vive_device *d = vive_device(xdev);
out_pose->orientation = d->config.display.rot[view_index];
}
static void
vive_device_get_view_poses(struct xrt_device *xdev,
const struct xrt_vec3 *default_eye_relation,
@ -779,7 +761,6 @@ vive_device_create(struct os_hid_device *mainboard_dev,
d->base.update_inputs = vive_device_update_inputs;
d->base.get_tracked_pose = vive_device_get_tracked_pose;
d->base.get_view_pose = vive_device_get_view_pose;
d->base.get_view_poses = vive_device_get_view_poses;
d->base.destroy = vive_device_destroy;
d->base.inputs[0].name = XRT_INPUT_GENERIC_HEAD_POSE;

View file

@ -980,18 +980,6 @@ wmr_hmd_get_tracked_pose(struct xrt_device *xdev,
math_pose_transform(&wh->offset, &out_relation->pose, &out_relation->pose);
}
static void
wmr_hmd_get_view_pose(struct xrt_device *xdev,
const struct xrt_vec3 *eye_relation,
uint32_t view_index,
struct xrt_pose *out_pose)
{
DRV_TRACE_MARKER();
(void)xdev;
u_device_get_view_pose(eye_relation, view_index, out_pose);
}
static void
wmr_hmd_get_view_poses(struct xrt_device *xdev,
const struct xrt_vec3 *default_eye_relation,
@ -1245,7 +1233,6 @@ wmr_hmd_create(enum wmr_headset_type hmd_type,
// Populate the base members.
wh->base.update_inputs = wmr_hmd_update_inputs;
wh->base.get_tracked_pose = wmr_hmd_get_tracked_pose;
wh->base.get_view_pose = wmr_hmd_get_view_pose;
wh->base.get_view_poses = wmr_hmd_get_view_poses;
wh->base.destroy = wmr_hmd_destroy;
wh->base.name = XRT_DEVICE_GENERIC_HMD;

View file

@ -336,39 +336,6 @@ struct xrt_device
*/
void (*set_output)(struct xrt_device *xdev, enum xrt_output_name name, union xrt_output_value *value);
/*!
* @brief Get the per-view pose in relation to the view space.
*
* On most device with coplanar displays, this just calls a helper to
* process the provided eye relation, but this may also handle canted
* displays as well as eye tracking.
*
* Does not do any device level tracking, use
* xrt_device::get_tracked_pose for that.
*
* @param[in] xdev The device.
* @param[in] eye_relation The interpupillary relation as a 3D position.
* Most simple stereo devices would just want to
* set `out_pose->position.[x|y|z] = ipd.[x|y|z]
* / 2.0f` and adjust for left vs right view.
* Not to be confused with IPD that is absolute
* distance, this is a full 3D translation
* If a device has a more accurate/dynamic way of
* knowing the eye relation, it may ignore this
* input.
* @param[in] view_index Index of view.
* @param[out] out_pose Output pose. See eye_relation argument for
* sample position. Be sure to also set
* orientation: most likely identity
* orientation unless you have canted screens.
* (Caution: Even if you have eye tracking, you
* won't use eye orientation here!)
*/
void (*get_view_pose)(struct xrt_device *xdev,
const struct xrt_vec3 *eye_relation,
uint32_t view_index,
struct xrt_pose *out_pose);
/*!
* @brief Get the per-view pose in relation to the view space.
*
@ -465,20 +432,6 @@ xrt_device_set_output(struct xrt_device *xdev, enum xrt_output_name name, union
xdev->set_output(xdev, name, value);
}
/*!
* Helper function for @ref xrt_device::get_view_pose.
*
* @public @memberof xrt_device
*/
static inline void
xrt_device_get_view_pose(struct xrt_device *xdev,
const struct xrt_vec3 *eye_relation,
uint32_t view_index,
struct xrt_pose *out_pose)
{
xdev->get_view_pose(xdev, eye_relation, view_index, out_pose);
}
/*!
* Helper function for @ref xrt_device::get_view_poses.
*

View file

@ -119,16 +119,6 @@ ipc_client_device_get_hand_tracking(struct xrt_device *xdev,
}
}
static void
ipc_client_device_get_view_pose(struct xrt_device *xdev,
const struct xrt_vec3 *eye_relation,
uint32_t view_index,
struct xrt_pose *out_pose)
{
// Empty
assert(false);
}
static void
ipc_client_device_get_view_poses(struct xrt_device *xdev,
const struct xrt_vec3 *default_eye_relation,
@ -170,7 +160,6 @@ ipc_client_device_create(struct ipc_connection *ipc_c, struct xrt_tracking_origi
icd->base.update_inputs = ipc_client_device_update_inputs;
icd->base.get_tracked_pose = ipc_client_device_get_tracked_pose;
icd->base.get_hand_tracking = ipc_client_device_get_hand_tracking;
icd->base.get_view_pose = ipc_client_device_get_view_pose;
icd->base.get_view_poses = ipc_client_device_get_view_poses;
icd->base.set_output = ipc_client_device_set_output;
icd->base.destroy = ipc_client_device_destroy;

View file

@ -104,20 +104,6 @@ ipc_client_hmd_get_tracked_pose(struct xrt_device *xdev,
}
}
static void
ipc_client_hmd_get_view_pose(struct xrt_device *xdev,
const struct xrt_vec3 *eye_relation,
uint32_t view_index,
struct xrt_pose *out_pose)
{
struct ipc_client_hmd *ich = ipc_client_hmd(xdev);
xrt_result_t r = ipc_call_device_get_view_pose(ich->ipc_c, ich->device_id, eye_relation, view_index, out_pose);
if (r != XRT_SUCCESS) {
IPC_ERROR(ich->ipc_c, "Error calling view pose!");
}
}
static void
ipc_client_hmd_get_view_poses(struct xrt_device *xdev,
const struct xrt_vec3 *default_eye_relation,
@ -171,7 +157,6 @@ ipc_client_hmd_create(struct ipc_connection *ipc_c, struct xrt_tracking_origin *
ich->device_id = device_id;
ich->base.update_inputs = ipc_client_hmd_update_inputs;
ich->base.get_tracked_pose = ipc_client_hmd_get_tracked_pose;
ich->base.get_view_pose = ipc_client_hmd_get_view_pose;
ich->base.get_view_poses = ipc_client_hmd_get_view_poses;
ich->base.destroy = ipc_client_hmd_destroy;

View file

@ -954,23 +954,6 @@ ipc_handle_device_get_hand_tracking(volatile struct ipc_client_state *ics,
return XRT_SUCCESS;
}
xrt_result_t
ipc_handle_device_get_view_pose(volatile struct ipc_client_state *ics,
uint32_t id,
const struct xrt_vec3 *eye_relation,
uint32_t view_index,
struct xrt_pose *out_pose)
{
// To make the code a bit more readable.
uint32_t device_id = id;
struct xrt_device *xdev = get_xdev(ics, device_id);
// Get the pose.
xrt_device_get_view_pose(xdev, eye_relation, view_index, out_pose);
return XRT_SUCCESS;
}
xrt_result_t
ipc_handle_device_get_view_poses_2(volatile struct ipc_client_state *ics,
uint32_t id,

View file

@ -201,17 +201,6 @@
]
},
"device_get_view_pose": {
"in": [
{"name": "id", "type": "uint32_t"},
{"name": "eye_relation", "type": "const struct xrt_vec3"},
{"name": "view_index", "type": "uint32_t"}
],
"out": [
{"name": "pose", "type": "struct xrt_pose"}
]
},
"device_get_view_poses_2": {
"in": [
{"name": "id", "type": "uint32_t"},