From d5eeb65af98f613bae1825e8bcaba1fe93949be9 Mon Sep 17 00:00:00 2001 From: BabbleBones Date: Tue, 24 Oct 2023 13:42:18 -0400 Subject: [PATCH] d/steamvr_lh: clean up logs and clean up unused tracker inputs --- src/xrt/drivers/steamvr_lh/device.cpp | 31 ++++++++++++++------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/xrt/drivers/steamvr_lh/device.cpp b/src/xrt/drivers/steamvr_lh/device.cpp index 05bc5ba59..80f6205b0 100644 --- a/src/xrt/drivers/steamvr_lh/device.cpp +++ b/src/xrt/drivers/steamvr_lh/device.cpp @@ -128,13 +128,11 @@ const std::unordered_map controller_classes{ XRT_INPUT_GENERIC_TRACKER_POSE, }, { - {"/input/system/click", XRT_INPUT_VIVE_TRACKER_SYSTEM_CLICK}, - {"/input/squeeze/click", XRT_INPUT_VIVE_TRACKER_SQUEEZE_CLICK}, - {"/input/menu/click", XRT_INPUT_VIVE_TRACKER_MENU_CLICK}, - {"/input/trigger/value", XRT_INPUT_VIVE_TRACKER_TRIGGER_VALUE}, - {"/input/trackpad/click", XRT_INPUT_VIVE_TRACKER_TRACKPAD_CLICK}, - {"/input/trackpad/touch", XRT_INPUT_VIVE_TRACKER_TRACKPAD_TOUCH}, - {"/input/trackpad/position", XRT_INPUT_VIVE_TRACKER_TRACKPAD}, + {"/input/power/click", XRT_INPUT_VIVE_TRACKER_SYSTEM_CLICK}, + {"/input/grip/click", XRT_INPUT_VIVE_TRACKER_SQUEEZE_CLICK}, + {"/input/application_menu/click", XRT_INPUT_VIVE_TRACKER_MENU_CLICK}, + {"/input/trigger/click", XRT_INPUT_VIVE_TRACKER_TRIGGER_CLICK}, + {"/input/thumb/click", XRT_INPUT_VIVE_TRACKER_TRACKPAD_CLICK}, }, { // No fingers on this controller type @@ -150,13 +148,11 @@ const std::unordered_map controller_classes{ XRT_INPUT_GENERIC_TRACKER_POSE, }, { - {"/input/system/click", XRT_INPUT_VIVE_TRACKER_SYSTEM_CLICK}, - {"/input/squeeze/click", XRT_INPUT_VIVE_TRACKER_SQUEEZE_CLICK}, - {"/input/menu/click", XRT_INPUT_VIVE_TRACKER_MENU_CLICK}, - {"/input/trigger/value", XRT_INPUT_VIVE_TRACKER_TRIGGER_VALUE}, - {"/input/trackpad/click", XRT_INPUT_VIVE_TRACKER_TRACKPAD_CLICK}, - {"/input/trackpad/touch", XRT_INPUT_VIVE_TRACKER_TRACKPAD_TOUCH}, - {"/input/trackpad/position", XRT_INPUT_VIVE_TRACKER_TRACKPAD}, + {"/input/power/click", XRT_INPUT_VIVE_TRACKER_SYSTEM_CLICK}, + {"/input/grip/click", XRT_INPUT_VIVE_TRACKER_SQUEEZE_CLICK}, + {"/input/application_menu/click", XRT_INPUT_VIVE_TRACKER_MENU_CLICK}, + {"/input/trigger/click", XRT_INPUT_VIVE_TRACKER_TRIGGER_CLICK}, + {"/input/thumb/click", XRT_INPUT_VIVE_TRACKER_TRACKPAD_CLICK}, }, { // No fingers on this controller type @@ -352,6 +348,11 @@ ControllerDevice::update_hand_tracking(struct xrt_hand_joint_set *out) xrt_input * Device::get_input_from_name(const std::string_view name) { + // Return nullptr without any other output to suppress a pile of useless warnings found below. + if (name == "/input/finger/index" || name == "/input/finger/middle" || name == "/input/finger/ring" || + name == "/input/finger/pinky") { + return nullptr; + } auto input = inputs_map.find(name); if (input == inputs_map.end()) { DEV_WARN("requested unknown input name %s for device %s", std::string(name).c_str(), serial); @@ -769,7 +770,7 @@ ControllerDevice::handle_property_write(const vr::PropertyWrite_t &prop) case vr::Prop_ControllerRoleHint_Int32: { vr::ETrackedControllerRole role = *static_cast(prop.pvBuffer); switch (role) { - case vr::TrackedControllerRole_Invalid:{ + case vr::TrackedControllerRole_Invalid: { this->device_type = XRT_DEVICE_TYPE_ANY_HAND_CONTROLLER; break; }