Add patches and dashboard setting for maximum steamvr_lh pose prediction

This commit is contained in:
Sapphire
2026-08-29 15:24:53 -05:00
parent 15716d04c6
commit 28a8fbd743
9 changed files with 268 additions and 1 deletions
+32
View File
@@ -132,6 +132,31 @@ Kirigami.ScrollablePage {
toolTipText: i18n("Allows the use of lighthouse-based controllers and trackers.\nRequires SteamVR to be installed.\nDevices must be be powered on before connecting to WiVRn.\nAn external tool such as motoc is needed for calibration.")
}
}
Controls.CheckBox {
id: lh_max_extrapolation_enabled
visible: Settings.steamvr_lh_supported && steamvr_lh.checked
text: i18n("Clamp extrapolation for SteamVR tracked devices")
}
RowLayout {
visible: Settings.steamvr_lh_supported && steamvr_lh.checked && lh_max_extrapolation_enabled.checked
Kirigami.FormData.label: i18n("SteamVR max pose extrapolation")
Controls.Slider {
id: lh_max_extrapolation
Layout.fillWidth: true
from: 0.0
to: 100.0
stepSize: 1.0
value: Settings.lhMaxExtrapolation
}
Controls.Label {
text: i18ncp("value display for SteamVR max pose extrapolation", "%1ms", "%1ms", lh_max_extrapolation.value)
Layout.preferredWidth: 35
Layout.alignment: Qt.AlignRight
}
Kirigami.ContextualHelpButton {
toolTipText: i18n("Maximum time in milliseconds that poses may be extrapolated ahead for SteamVR tracked devices. Tune this value if you experience jittery or wobbly tracking.")
}
}
RowLayout {
visible: Settings.steamvr_lh_supported && steamvr_lh.checked
Kirigami.FormData.label: i18n("SteamVR joystick deadzone")
@@ -309,6 +334,11 @@ Kirigami.ScrollablePage {
Settings.debugGui = debug_gui.checked;
Settings.steamVrLh = steamvr_lh.checked;
if (lh_max_extrapolation_enabled.checked) {
Settings.lhMaxExtrapolation = lh_max_extrapolation.value;
} else {
Settings.lhMaxExtrapolation = -1;
}
Settings.lhStickDeadzone = lh_stick_deadzone.value;
Settings.hidForwarding = hid_forwarding.checked;
@@ -319,6 +349,8 @@ Kirigami.ScrollablePage {
select_game.load();
debug_gui.checked = Settings.debugGui;
steamvr_lh.checked = Settings.steamVrLh;
lh_max_extrapolation_enabled.checked = Settings.lhMaxExtrapolationEnabled;
lh_max_extrapolation.value = Settings.lhMaxExtrapolation;
lh_stick_deadzone.value = Settings.lhStickDeadzone;
hid_forwarding.checked = Settings.hidForwarding;
+35
View File
@@ -121,6 +121,8 @@ void Settings::emitAllChanged()
openvrChanged();
debugGuiChanged();
steamVrLhChanged();
lhMaxExtrapolationEnabledChanged();
lhMaxExtrapolationChanged();
lhStickDeadzoneChanged();
hidForwardingChanged();
portChanged();
@@ -417,6 +419,39 @@ void Settings::set_steamVrLh(const bool & value)
steamVrLhChanged();
}
bool Settings::lhMaxExtrapolationEnabled() const
{
auto it = m_jsonSettings.find("lh-max-extrapolation");
return it != m_jsonSettings.end() and it->is_number();
}
int64_t Settings::lhMaxExtrapolation() const
{
auto it = m_jsonSettings.find("lh-max-extrapolation");
if (it != m_jsonSettings.end() and it->is_number())
return static_cast<int64_t>(*it);
return 50;
}
void Settings::set_lhMaxExtrapolation(const int64_t & value)
{
auto old = lhMaxExtrapolation();
if (value != -1)
{
m_jsonSettings["lh-max-extrapolation"] = value;
}
else
{
m_jsonSettings.erase("lh-max-extrapolation");
}
if (old != value)
{
lhMaxExtrapolationEnabledChanged();
lhMaxExtrapolationChanged();
}
}
float Settings::lhStickDeadzone() const
{
auto it = m_jsonSettings.find("lh-stick-deadzone");
+4
View File
@@ -76,6 +76,8 @@ public:
Q_PROPERTY(bool hidForwarding READ hidForwarding WRITE set_hidForwarding NOTIFY hidForwardingChanged)
Q_PROPERTY(bool debugGui READ debugGui WRITE set_debugGui NOTIFY debugGuiChanged)
Q_PROPERTY(bool steamVrLh READ steamVrLh WRITE set_steamVrLh NOTIFY steamVrLhChanged)
Q_PROPERTY(bool lhMaxExtrapolationEnabled READ lhMaxExtrapolationEnabled NOTIFY lhMaxExtrapolationEnabledChanged)
Q_PROPERTY(int64_t lhMaxExtrapolation READ lhMaxExtrapolation WRITE set_lhMaxExtrapolation NOTIFY lhMaxExtrapolationChanged)
Q_PROPERTY(float lhStickDeadzone READ lhStickDeadzone WRITE set_lhStickDeadzone NOTIFY lhStickDeadzoneChanged)
Q_PROPERTY(bool flatpak READ flatpak CONSTANT)
@@ -92,6 +94,8 @@ public:
SETTER_GETTER_NOTIFY(bool, hidForwarding)
SETTER_GETTER_NOTIFY(bool, debugGui)
SETTER_GETTER_NOTIFY(bool, steamVrLh)
SETTER_GETTER_NOTIFY(bool, lhMaxExtrapolationEnabled)
SETTER_GETTER_NOTIFY(int64_t, lhMaxExtrapolation)
SETTER_GETTER_NOTIFY(float, lhStickDeadzone)
SETTER_GETTER_NOTIFY(bool, tcpOnly)
SETTER_GETTER_NOTIFY(int, port)