From 0ef42d01bb259ce460f4de278d7c8ece77a4ebf0 Mon Sep 17 00:00:00 2001 From: Louka Date: Mon, 23 Jan 2023 21:15:56 -0500 Subject: [PATCH 1/6] Add clear drift compensation --- gui/public/i18n/en/translation.ftl | 3 ++ .../ClearDriftCompensationButton.tsx | 20 +++++++++++++ gui/src/components/MainLayout.tsx | 28 +++++++++++++++++-- .../config/DriftCompensationConfig.java | 9 ++++++ .../dev/slimevr/protocol/rpc/RPCHandler.java | 20 +++++++++++++ .../dev/slimevr/vr/trackers/IMUTracker.java | 10 +++++++ solarxr-protocol | 2 +- 7 files changed, 89 insertions(+), 3 deletions(-) create mode 100644 gui/src/components/ClearDriftCompensationButton.tsx diff --git a/gui/public/i18n/en/translation.ftl b/gui/public/i18n/en/translation.ftl index 3b865671f..4601d6dd1 100644 --- a/gui/public/i18n/en/translation.ftl +++ b/gui/public/i18n/en/translation.ftl @@ -92,6 +92,9 @@ widget-overlay = Overlay widget-overlay-is_visible_label = Show Overlay in SteamVR widget-overlay-is_mirrored_label = Display Overlay as Mirror +## Widget: Drift compensation +widget-drift_compensation-clear = Clear drift compensation + ## Widget: Developer settings widget-developer_mode = Developer Mode widget-developer_mode-high_contrast = High contrast diff --git a/gui/src/components/ClearDriftCompensationButton.tsx b/gui/src/components/ClearDriftCompensationButton.tsx new file mode 100644 index 000000000..4caf687c6 --- /dev/null +++ b/gui/src/components/ClearDriftCompensationButton.tsx @@ -0,0 +1,20 @@ +import { useLocalization } from '@fluent/react'; +import { ClearDriftCompensationRequestT, RpcMessage } from 'solarxr-protocol'; +import { useWebsocketAPI } from '../hooks/websocket-api'; +import { Button } from './commons/Button'; + +export function ClearDriftCompensationButton() { + const { l10n } = useLocalization(); + const { sendRPCPacket } = useWebsocketAPI(); + + const clearDriftCompensation = () => { + const record = new ClearDriftCompensationRequestT(); + sendRPCPacket(RpcMessage.ClearDriftCompensationRequest, record); + }; + + return ( + + ); +} diff --git a/gui/src/components/MainLayout.tsx b/gui/src/components/MainLayout.tsx index c25a550f5..701ee0d32 100644 --- a/gui/src/components/MainLayout.tsx +++ b/gui/src/components/MainLayout.tsx @@ -1,6 +1,13 @@ import classNames from 'classnames'; -import { ReactNode } from 'react'; -import { ResetType } from 'solarxr-protocol'; +import { ReactNode, useEffect, useState } from 'react'; +import { + DriftCompensationSettings, + DriftCompensationSettingsT, + ResetType, + RpcMessage, + SettingsRequestT, + SettingsResponseT, +} from 'solarxr-protocol'; import { useConfig } from '../hooks/config'; import { useLayout } from '../hooks/layout'; import { BVHButton } from './BVHButton'; @@ -9,6 +16,8 @@ import { Navbar } from './Navbar'; import { TopBar } from './TopBar'; import { DeveloperModeWidget } from './widgets/DeveloperModeWidget'; import { OverlayWidget } from './widgets/OverlayWidget'; +import { ClearDriftCompensationButton } from './ClearDriftCompensationButton'; +import { useWebsocketAPI } from '../hooks/websocket-api'; export function MainLayoutRoute({ children, @@ -22,6 +31,18 @@ export function MainLayoutRoute({ const { layoutHeight, ref } = useLayout(); const { layoutWidth, ref: refw } = useLayout(); const { config } = useConfig(); + const { useRPCPacket, sendRPCPacket } = useWebsocketAPI(); + const [driftCompensationEnabled, setDriftCompensationEnabled] = + useState(false); + + useEffect(() => { + sendRPCPacket(RpcMessage.SettingsRequest, new SettingsRequestT()); + }, []); + + useRPCPacket(RpcMessage.SettingsResponse, (settings: SettingsResponseT) => { + if (settings.driftCompensation != null) + setDriftCompensationEnabled(settings.driftCompensation.enabled); + }); return ( <> @@ -59,6 +80,9 @@ export function MainLayoutRoute({ > + {driftCompensationEnabled && ( + + )}
diff --git a/server/src/main/java/dev/slimevr/config/DriftCompensationConfig.java b/server/src/main/java/dev/slimevr/config/DriftCompensationConfig.java index ff350ccfd..ea916ca5a 100644 --- a/server/src/main/java/dev/slimevr/config/DriftCompensationConfig.java +++ b/server/src/main/java/dev/slimevr/config/DriftCompensationConfig.java @@ -33,6 +33,15 @@ public class DriftCompensationConfig { } } + public void clearTrackersDriftCompensation() { + for (Tracker t : Main.getVrServer().getAllTrackers()) { + Tracker tracker = t.get(); + if (tracker instanceof IMUTracker imuTracker) { + imuTracker.clearDriftCompensation(); + } + } + } + public boolean getEnabled() { return enabled; diff --git a/server/src/main/java/dev/slimevr/protocol/rpc/RPCHandler.java b/server/src/main/java/dev/slimevr/protocol/rpc/RPCHandler.java index 9acfa966a..c96c583d8 100644 --- a/server/src/main/java/dev/slimevr/protocol/rpc/RPCHandler.java +++ b/server/src/main/java/dev/slimevr/protocol/rpc/RPCHandler.java @@ -43,6 +43,10 @@ public class RPCHandler extends ProtocolHandler registerPacketListener(RpcMessage.ResetRequest, this::onResetRequest); registerPacketListener(RpcMessage.AssignTrackerRequest, this::onAssignTrackerRequest); + registerPacketListener( + RpcMessage.ClearDriftCompensationRequest, + this::onClearDriftCompensationRequest + ); registerPacketListener(RpcMessage.RecordBVHRequest, this::onRecordBVHRequest); @@ -218,6 +222,22 @@ public class RPCHandler extends ProtocolHandler this.api.server.trackerUpdated(tracker); } + public void onClearDriftCompensationRequest( + GenericConnection conn, + RpcMessageHeader messageHeader + ) { + ClearDriftCompensationRequest req = (ClearDriftCompensationRequest) messageHeader + .message(new ClearDriftCompensationRequest()); + if (req == null) + return; + + this.api.server + .getConfigManager() + .getVrConfig() + .getDriftCompensation() + .clearTrackersDriftCompensation(); + } + @Override public void onMessage(GenericConnection conn, RpcMessageHeader message) { BiConsumer consumer = this.handlers[message diff --git a/server/src/main/java/dev/slimevr/vr/trackers/IMUTracker.java b/server/src/main/java/dev/slimevr/vr/trackers/IMUTracker.java index 9dc6ee9fa..1052f5343 100644 --- a/server/src/main/java/dev/slimevr/vr/trackers/IMUTracker.java +++ b/server/src/main/java/dev/slimevr/vr/trackers/IMUTracker.java @@ -213,6 +213,16 @@ public class IMUTracker } } + public void clearDriftCompensation() { + driftSince = 0L; + timeAtLastReset = 0L; + totalDriftTime = 0L; + if (driftQuats != null) { + driftQuats.clear(); + driftTimes.clear(); + } + } + @Override public void tick() { if (magnetometerCalibrated && hasNewCorrectionData) { diff --git a/solarxr-protocol b/solarxr-protocol index 6d4c79277..38bb61821 160000 --- a/solarxr-protocol +++ b/solarxr-protocol @@ -1 +1 @@ -Subproject commit 6d4c7927708d523e5cd36e228c71024d8f5cdd79 +Subproject commit 38bb618219a62506604dd2e5183ed6a3431681c2 From a0c0cfa978c6a1f612cbb74a7869f9c321a94ac2 Mon Sep 17 00:00:00 2001 From: Louka Date: Mon, 23 Jan 2023 21:27:38 -0500 Subject: [PATCH 2/6] add missing translations --- gui/public/i18n/de/translation.ftl | 26 +++++++++++++++++++++--- gui/public/i18n/en-x-owo/translation.ftl | 3 +++ gui/public/i18n/es-419/translation.ftl | 7 +++++-- gui/public/i18n/et/translation.ftl | 25 ++++++++++++++++++++--- gui/public/i18n/fr/translation.ftl | 3 +++ gui/public/i18n/it/translation.ftl | 3 +++ gui/public/i18n/ja/translation.ftl | 3 +++ gui/public/i18n/ko/translation.ftl | 3 +++ gui/public/i18n/nl/translation.ftl | 3 +++ gui/public/i18n/pl/translation.ftl | 3 +++ gui/public/i18n/pt-BR/translation.ftl | 3 +++ gui/public/i18n/vi/translation.ftl | 9 +++++--- gui/public/i18n/zh-Hans/translation.ftl | 3 +++ 13 files changed, 83 insertions(+), 11 deletions(-) diff --git a/gui/public/i18n/de/translation.ftl b/gui/public/i18n/de/translation.ftl index 4ce30fb64..245f0e170 100644 --- a/gui/public/i18n/de/translation.ftl +++ b/gui/public/i18n/de/translation.ftl @@ -58,6 +58,7 @@ skeleton_bone-UPPER_ARM = Oberarmlänge skeleton_bone-LOWER_ARM = Unterarmlänge skeleton_bone-CONTROLLER_Y = Controller Abstand Y skeleton_bone-CONTROLLER_Z = Controller Abstand Z +skeleton_bone-ELBOW_OFFSET = Elbow Offset ## Tracker reset buttons reset-reset_all = Alle Proportionen zurücksetzen @@ -86,9 +87,28 @@ navbar-settings = Einstellungen bvh-start_recording = BVH aufnehmen bvh-recording = Aufnahme läuft... -## Overlay settings -overlay-is_visible_label = Visualisierungs-Overlay in SteamVR anzeigen -overlay-is_mirrored_label = Visualisierung spiegeln +## Widget: Overlay settings +widget-overlay = Overlay +widget-overlay-is_visible_label = Visualisierungs-Overlay in SteamVR anzeigen +widget-overlay-is_mirrored_label = Visualisierung spiegeln + +## Widget: Drift compensation +widget-drift_compensation-clear = Clear drift compensation + +## Widget: Developer settings +widget-developer_mode = Developer Mode +widget-developer_mode-high_contrast = High contrast +widget-developer_mode-precise_rotation = Precise rotation +widget-developer_mode-fast_data_feed = Fast data feed +widget-developer_mode-filter_slimes_and_hmd = Filter slimes and HMD +widget-developer_mode-sort_by_name = Sort by name +widget-developer_mode-raw_slime_rotation = Raw rotation +widget-developer_mode-more_info = More info + +## Widget: IMU Visualizer +widget-imu_visualizer = Rotation +widget-imu_visualizer-rotation_raw = Raw +widget-imu_visualizer-rotation_preview = Preview ## Tracker status tracker-status-none = Kein Status diff --git a/gui/public/i18n/en-x-owo/translation.ftl b/gui/public/i18n/en-x-owo/translation.ftl index 10306b8f0..cb6a3c25e 100644 --- a/gui/public/i18n/en-x-owo/translation.ftl +++ b/gui/public/i18n/en-x-owo/translation.ftl @@ -92,6 +92,9 @@ widget-overlay = owovelay widget-overlay-is_visible_label = show owovelay in steawmvr widget-overlay-is_mirrored_label = dispway owovelay as miwwow +## Widget: Drift compensation +widget-drift_compensation-clear = cwear dwift compensation + ## Widget: Developer settings widget-developer_mode = devwowwewow mode widget-developer_mode-high_contrast = high contwast diff --git a/gui/public/i18n/es-419/translation.ftl b/gui/public/i18n/es-419/translation.ftl index 8429462fb..8efb73c11 100644 --- a/gui/public/i18n/es-419/translation.ftl +++ b/gui/public/i18n/es-419/translation.ftl @@ -92,6 +92,9 @@ widget-overlay = Overlay widget-overlay-is_visible_label = Mostrar interfaz en SteamVR widget-overlay-is_mirrored_label = Mostrar interfaz reflejada +## Widget: Drift compensation +widget-drift_compensation-clear = Clear drift compensation + ## Widget: Developer settings widget-developer_mode = Developer Mode widget-developer_mode-high_contrast = High contrast @@ -447,7 +450,7 @@ onboarding-connect_tracker-connected_trackers = { $amount -> [0] No hay sensores conectados [one] 1 sensor conectado *[other] { $amount } sensores conectados -} +} onboarding-connect_tracker-next = He conectado todos mis sensores ## Tracker assignment setup @@ -460,7 +463,7 @@ onboarding-assign_trackers-description = Debes escoger dónde van los sensores. onboarding-assign_trackers-assigned = { $assigned } de { $trackers -> [one] 1 sensor asignado *[other] { $trackers } sensores asignados -} +} onboarding-assign_trackers-advanced = Mostrar ubicación de asignaciones avanzados. onboarding-assign_trackers-next = He asignado todos los sensores diff --git a/gui/public/i18n/et/translation.ftl b/gui/public/i18n/et/translation.ftl index d1f06ab8f..57db2bd65 100644 --- a/gui/public/i18n/et/translation.ftl +++ b/gui/public/i18n/et/translation.ftl @@ -87,9 +87,28 @@ navbar-settings = Seaded bvh-start_recording = Salvesta BVH bvh-recording = Salvestamine... -## Overlay settings -overlay-is_visible_label = Näita Ülekatet SteamVR-is -overlay-is_mirrored_label = Näita Ülekatet Peeglina +## Widget: Overlay settings +widget-overlay = Overlay +widget-overlay-is_visible_label = Näita Ülekatet SteamVR-is +widget-overlay-is_mirrored_label = Näita Ülekatet Peeglina + +## Widget: Drift compensation +widget-drift_compensation-clear = Clear drift compensation + +## Widget: Developer settings +widget-developer_mode = Developer Mode +widget-developer_mode-high_contrast = High contrast +widget-developer_mode-precise_rotation = Precise rotation +widget-developer_mode-fast_data_feed = Fast data feed +widget-developer_mode-filter_slimes_and_hmd = Filter slimes and HMD +widget-developer_mode-sort_by_name = Sort by name +widget-developer_mode-raw_slime_rotation = Raw rotation +widget-developer_mode-more_info = More info + +## Widget: IMU Visualizer +widget-imu_visualizer = Rotation +widget-imu_visualizer-rotation_raw = Raw +widget-imu_visualizer-rotation_preview = Preview ## Tracker status tracker-status-none = Staatuseta diff --git a/gui/public/i18n/fr/translation.ftl b/gui/public/i18n/fr/translation.ftl index 5f6d4ceff..53824e115 100644 --- a/gui/public/i18n/fr/translation.ftl +++ b/gui/public/i18n/fr/translation.ftl @@ -92,6 +92,9 @@ widget-overlay = Squelette widget-overlay-is_visible_label = Superposer le squelette dans SteamVR widget-overlay-is_mirrored_label = Afficher le squelette en tant que miroir +## Widget: Drift compensation +widget-drift_compensation-clear = Remise à zéro de la compensation de la dérive + ## Widget: Developer settings widget-developer_mode = Mode développeur widget-developer_mode-high_contrast = Contraste élevé diff --git a/gui/public/i18n/it/translation.ftl b/gui/public/i18n/it/translation.ftl index 7aa3577ae..e871ff627 100644 --- a/gui/public/i18n/it/translation.ftl +++ b/gui/public/i18n/it/translation.ftl @@ -92,6 +92,9 @@ widget-overlay = Overlay widget-overlay-is_visible_label = Mostra Overlay in SteamVR widget-overlay-is_mirrored_label = Includi uno specchio nel Overlay +## Widget: Drift compensation +widget-drift_compensation-clear = Clear drift compensation + ## Widget: Developer settings widget-developer_mode = Developer Mode widget-developer_mode-high_contrast = High contrast diff --git a/gui/public/i18n/ja/translation.ftl b/gui/public/i18n/ja/translation.ftl index 7fdd03228..703db4ed3 100644 --- a/gui/public/i18n/ja/translation.ftl +++ b/gui/public/i18n/ja/translation.ftl @@ -92,6 +92,9 @@ widget-overlay = オーバーレイ設定 widget-overlay-is_visible_label = SteamVRでオーバーレイを表示する widget-overlay-is_mirrored_label = オーバーレイをミラーとして表示する +## Widget: Drift compensation +widget-drift_compensation-clear = Clear drift compensation + ## Widget: Developer settings widget-developer_mode = 開発者モード widget-developer_mode-high_contrast = ハイ コントラスト diff --git a/gui/public/i18n/ko/translation.ftl b/gui/public/i18n/ko/translation.ftl index 55bf22296..3c3a70fdf 100644 --- a/gui/public/i18n/ko/translation.ftl +++ b/gui/public/i18n/ko/translation.ftl @@ -92,6 +92,9 @@ widget-overlay = 오버레이 widget-overlay-is_visible_label = SteamVR에서 오버레이 표시 widget-overlay-is_mirrored_label = 오버레이 반전 +## Widget: Drift compensation +widget-drift_compensation-clear = Clear drift compensation + ## Widget: Developer settings widget-developer_mode = 개발자 모드 widget-developer_mode-high_contrast = High contrast diff --git a/gui/public/i18n/nl/translation.ftl b/gui/public/i18n/nl/translation.ftl index 82a6a41d1..db0839603 100644 --- a/gui/public/i18n/nl/translation.ftl +++ b/gui/public/i18n/nl/translation.ftl @@ -92,6 +92,9 @@ widget-overlay = Overlay widget-overlay-is_visible_label = Overlay in SteamVR weergeven widget-overlay-is_mirrored_label = Overlay weergeven als spiegel +## Widget: Drift compensation +widget-drift_compensation-clear = Clear drift compensation + ## Widget: Developer settings widget-developer_mode = Developer Mode widget-developer_mode-high_contrast = Hoog contrast diff --git a/gui/public/i18n/pl/translation.ftl b/gui/public/i18n/pl/translation.ftl index 266d6a758..496558e2a 100644 --- a/gui/public/i18n/pl/translation.ftl +++ b/gui/public/i18n/pl/translation.ftl @@ -92,6 +92,9 @@ widget-overlay = Overlay widget-overlay-is_visible_label = Pokaż Overlay w SteamVR widget-overlay-is_mirrored_label = Pokaż Overlay jako Lustro +## Widget: Drift compensation +widget-drift_compensation-clear = Clear drift compensation + ## Widget: Developer settings widget-developer_mode = Tryb Dewelopera widget-developer_mode-high_contrast = High contrast diff --git a/gui/public/i18n/pt-BR/translation.ftl b/gui/public/i18n/pt-BR/translation.ftl index 1d247a843..78b1cc27d 100644 --- a/gui/public/i18n/pt-BR/translation.ftl +++ b/gui/public/i18n/pt-BR/translation.ftl @@ -92,6 +92,9 @@ widget-overlay = Overlay widget-overlay-is_visible_label = Mostrar Overlay na SteamVR widget-overlay-is_mirrored_label = Mostrar Overlay como espelho +## Widget: Drift compensation +widget-drift_compensation-clear = Clear drift compensation + ## Widget: Developer settings widget-developer_mode = Modo de desenvolvedor widget-developer_mode-high_contrast = High contrast diff --git a/gui/public/i18n/vi/translation.ftl b/gui/public/i18n/vi/translation.ftl index 1bcea754e..53970f958 100644 --- a/gui/public/i18n/vi/translation.ftl +++ b/gui/public/i18n/vi/translation.ftl @@ -92,6 +92,9 @@ widget-overlay = Overlay widget-overlay-is_visible_label = Xem overlay trên SteamVR widget-overlay-is_mirrored_label = Xem overlay trong gương +## Widget: Drift compensation +widget-drift_compensation-clear = Clear drift compensation + ## Widget: Developer settings widget-developer_mode = Chế độ nhà phát triển widget-developer_mode-high_contrast = Chế độ tương phản cao @@ -262,11 +265,11 @@ settings-general-tracker_mechanics-drift_compensation-max_resets-label = Số l settings-general-fk_settings = Cài đặt nâng cao settings-general-fk_settings-leg_tweak = Chân settings-general-fk_settings-leg_tweak-description = "Ngăn xuyên sàn" có thể giảm thiểu khả năng chân xuống thấp hơn sàn sau khi đặt lại vị trí tracker, có thể gây vấn đề nếu đang đứng bằng đầu gối. "Sửa trượt" giúp giảm thiểu tình trạng chân có chuyển động nhỏ so với sàn khi đứng yên, có thể làm giảm độ chính xác với một số chuyển động cụ thể -# Floor clip: +# Floor clip: # why the name - came from the idea of noclip in video games, but is the opposite where clipping to the floor is a desired feature # definition - Prevents the foot trackers from going lower than they where when a reset was performed settings-general-fk_settings-leg_tweak-floor_clip = Ngăn xuyên sàn -# Skating correction: +# Skating correction: # why the name - without this enabled the feet will often slide across the ground as if your skating across the ground, # since this largely prevents this it corrects for it hence skating correction (note this may be renamed to sliding correction) # definition - Guesses when each foot is in contact with the ground and uses that information to improve tracking @@ -292,7 +295,7 @@ settings-general-gesture_control-description = Cho phép chạm vào tracker đ # $amount (Number) - Amount of taps (touches to the tracker's case) settings-general-gesture_control-taps = { $amount -> # [one] 1 lần # Vietnamese doesn't have singular/plural difference but just leave it here to match up line count, easier for proofing with side by side English - *[other] { $amount } lần + *[other] { $amount } lần } settings-general-gesture_control-quickResetEnabled = Chạm để đặt lại nhanh settings-general-gesture_control-quickResetDelay = Thời gian delay trước khi đặt lại nhanh diff --git a/gui/public/i18n/zh-Hans/translation.ftl b/gui/public/i18n/zh-Hans/translation.ftl index 2b353272f..0a509d280 100644 --- a/gui/public/i18n/zh-Hans/translation.ftl +++ b/gui/public/i18n/zh-Hans/translation.ftl @@ -92,6 +92,9 @@ widget-overlay = 覆盖层 widget-overlay-is_visible_label = 在 SteamVR 中显示覆盖层 widget-overlay-is_mirrored_label = 镜像显示覆盖层 +## Widget: Drift compensation +widget-drift_compensation-clear = Clear drift compensation + ## Widget: Developer settings widget-developer_mode = 开发者选项 widget-developer_mode-high_contrast = 高对比度 From 3ee4e19a92916e84cd4eb7d0a47ce49761db32e2 Mon Sep 17 00:00:00 2001 From: Louka Date: Mon, 23 Jan 2023 22:44:54 -0500 Subject: [PATCH 3/6] Update solarxr-protocol --- solarxr-protocol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solarxr-protocol b/solarxr-protocol index 38bb61821..ecf32d93d 160000 --- a/solarxr-protocol +++ b/solarxr-protocol @@ -1 +1 @@ -Subproject commit 38bb618219a62506604dd2e5183ed6a3431681c2 +Subproject commit ecf32d93dad49a3b03d944c48cd1233f2d632cf6 From 381cf13459edaa5ffb5c69be7382df0c3f706729 Mon Sep 17 00:00:00 2001 From: Louka Date: Thu, 26 Jan 2023 17:55:32 -0500 Subject: [PATCH 4/6] move clearTrackersDriftCompensation to vrserver --- server/src/main/java/dev/slimevr/VRServer.java | 9 +++++++++ .../dev/slimevr/config/DriftCompensationConfig.java | 10 ---------- .../main/java/dev/slimevr/protocol/rpc/RPCHandler.java | 6 +----- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/server/src/main/java/dev/slimevr/VRServer.java b/server/src/main/java/dev/slimevr/VRServer.java index 6f8fc7e2d..bd14b092b 100644 --- a/server/src/main/java/dev/slimevr/VRServer.java +++ b/server/src/main/java/dev/slimevr/VRServer.java @@ -19,6 +19,7 @@ import dev.slimevr.vr.DeviceManager; import dev.slimevr.vr.processor.HumanPoseProcessor; import dev.slimevr.vr.processor.skeleton.Skeleton; import dev.slimevr.vr.trackers.HMDTracker; +import dev.slimevr.vr.trackers.IMUTracker; import dev.slimevr.vr.trackers.ShareableTracker; import dev.slimevr.vr.trackers.Tracker; import dev.slimevr.vr.trackers.udp.TrackersUDPServer; @@ -430,4 +431,12 @@ public class VRServer extends Thread { return fpsTimer; } + public void clearTrackersDriftCompensation() { + for (Tracker t : getAllTrackers()) { + Tracker tracker = t.get(); + if (tracker instanceof IMUTracker imuTracker) { + imuTracker.clearDriftCompensation(); + } + } + } } diff --git a/server/src/main/java/dev/slimevr/config/DriftCompensationConfig.java b/server/src/main/java/dev/slimevr/config/DriftCompensationConfig.java index ea916ca5a..3a95090e6 100644 --- a/server/src/main/java/dev/slimevr/config/DriftCompensationConfig.java +++ b/server/src/main/java/dev/slimevr/config/DriftCompensationConfig.java @@ -33,16 +33,6 @@ public class DriftCompensationConfig { } } - public void clearTrackersDriftCompensation() { - for (Tracker t : Main.getVrServer().getAllTrackers()) { - Tracker tracker = t.get(); - if (tracker instanceof IMUTracker imuTracker) { - imuTracker.clearDriftCompensation(); - } - } - } - - public boolean getEnabled() { return enabled; } diff --git a/server/src/main/java/dev/slimevr/protocol/rpc/RPCHandler.java b/server/src/main/java/dev/slimevr/protocol/rpc/RPCHandler.java index c96c583d8..61d7e85ff 100644 --- a/server/src/main/java/dev/slimevr/protocol/rpc/RPCHandler.java +++ b/server/src/main/java/dev/slimevr/protocol/rpc/RPCHandler.java @@ -231,11 +231,7 @@ public class RPCHandler extends ProtocolHandler if (req == null) return; - this.api.server - .getConfigManager() - .getVrConfig() - .getDriftCompensation() - .clearTrackersDriftCompensation(); + this.api.server.clearTrackersDriftCompensation(); } @Override From dea9f9d3cde9dd3add6c6181808a51d2c4df8691 Mon Sep 17 00:00:00 2001 From: Louka Date: Sun, 29 Jan 2023 17:15:58 -0500 Subject: [PATCH 5/6] fix merge --- server/src/main/java/dev/slimevr/VRServer.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/src/main/java/dev/slimevr/VRServer.java b/server/src/main/java/dev/slimevr/VRServer.java index 555e9da9d..a36c5662d 100644 --- a/server/src/main/java/dev/slimevr/VRServer.java +++ b/server/src/main/java/dev/slimevr/VRServer.java @@ -14,15 +14,15 @@ import dev.slimevr.platform.windows.WindowsNamedPipeBridge; import dev.slimevr.poserecorder.BVHRecorder; import dev.slimevr.protocol.ProtocolAPI; import dev.slimevr.serial.SerialHandler; -import dev.slimevr.util.ann.VRServerThread; import dev.slimevr.tracking.DeviceManager; -import dev.slimevr.tracking.processor.HumanPoseProcessor; -import dev.slimevr.tracking.processor.skeleton.Skeleton; +import dev.slimevr.tracking.processor.HumanPoseManager; +import dev.slimevr.tracking.processor.skeleton.HumanSkeleton; import dev.slimevr.tracking.trackers.HMDTracker; import dev.slimevr.tracking.trackers.IMUTracker; import dev.slimevr.tracking.trackers.ShareableTracker; import dev.slimevr.tracking.trackers.Tracker; import dev.slimevr.tracking.trackers.udp.TrackersUDPServer; +import dev.slimevr.util.ann.VRServerThread; import dev.slimevr.websocketapi.WebSocketVRBridge; import io.eiren.util.OperatingSystem; import io.eiren.util.ann.ThreadSafe; From aec3e9b4ae6b7a3d8cce341f860f672c400f5156 Mon Sep 17 00:00:00 2001 From: Louka Date: Tue, 31 Jan 2023 20:50:17 -0500 Subject: [PATCH 6/6] remove translation in other languages --- gui/public/i18n/es-419/translation.ftl | 3 --- gui/public/i18n/it/translation.ftl | 3 --- gui/public/i18n/ja/translation.ftl | 3 --- gui/public/i18n/ko/translation.ftl | 3 --- gui/public/i18n/nl/translation.ftl | 3 --- gui/public/i18n/pl/translation.ftl | 3 --- gui/public/i18n/pt-BR/translation.ftl | 3 --- gui/public/i18n/vi/translation.ftl | 3 --- gui/public/i18n/zh-Hans/translation.ftl | 3 --- 9 files changed, 27 deletions(-) diff --git a/gui/public/i18n/es-419/translation.ftl b/gui/public/i18n/es-419/translation.ftl index 8efb73c11..bcc1cc052 100644 --- a/gui/public/i18n/es-419/translation.ftl +++ b/gui/public/i18n/es-419/translation.ftl @@ -92,9 +92,6 @@ widget-overlay = Overlay widget-overlay-is_visible_label = Mostrar interfaz en SteamVR widget-overlay-is_mirrored_label = Mostrar interfaz reflejada -## Widget: Drift compensation -widget-drift_compensation-clear = Clear drift compensation - ## Widget: Developer settings widget-developer_mode = Developer Mode widget-developer_mode-high_contrast = High contrast diff --git a/gui/public/i18n/it/translation.ftl b/gui/public/i18n/it/translation.ftl index 2e227a230..29fb3f459 100644 --- a/gui/public/i18n/it/translation.ftl +++ b/gui/public/i18n/it/translation.ftl @@ -92,9 +92,6 @@ widget-overlay = Overlay widget-overlay-is_visible_label = Mostra Overlay in SteamVR widget-overlay-is_mirrored_label = Includi uno specchio nel Overlay -## Widget: Drift compensation -widget-drift_compensation-clear = Clear drift compensation - ## Widget: Developer settings widget-developer_mode = Modalità sviluppatore widget-developer_mode-high_contrast = Alto contrasto diff --git a/gui/public/i18n/ja/translation.ftl b/gui/public/i18n/ja/translation.ftl index 703db4ed3..7fdd03228 100644 --- a/gui/public/i18n/ja/translation.ftl +++ b/gui/public/i18n/ja/translation.ftl @@ -92,9 +92,6 @@ widget-overlay = オーバーレイ設定 widget-overlay-is_visible_label = SteamVRでオーバーレイを表示する widget-overlay-is_mirrored_label = オーバーレイをミラーとして表示する -## Widget: Drift compensation -widget-drift_compensation-clear = Clear drift compensation - ## Widget: Developer settings widget-developer_mode = 開発者モード widget-developer_mode-high_contrast = ハイ コントラスト diff --git a/gui/public/i18n/ko/translation.ftl b/gui/public/i18n/ko/translation.ftl index dc91b8c27..8d973834c 100644 --- a/gui/public/i18n/ko/translation.ftl +++ b/gui/public/i18n/ko/translation.ftl @@ -92,9 +92,6 @@ widget-overlay = 오버레이 widget-overlay-is_visible_label = SteamVR에서 오버레이 표시 widget-overlay-is_mirrored_label = 오버레이 반전 -## Widget: Drift compensation -widget-drift_compensation-clear = Clear drift compensation - ## Widget: Developer settings widget-developer_mode = 개발자 모드 widget-developer_mode-high_contrast = 고대비 diff --git a/gui/public/i18n/nl/translation.ftl b/gui/public/i18n/nl/translation.ftl index db0839603..82a6a41d1 100644 --- a/gui/public/i18n/nl/translation.ftl +++ b/gui/public/i18n/nl/translation.ftl @@ -92,9 +92,6 @@ widget-overlay = Overlay widget-overlay-is_visible_label = Overlay in SteamVR weergeven widget-overlay-is_mirrored_label = Overlay weergeven als spiegel -## Widget: Drift compensation -widget-drift_compensation-clear = Clear drift compensation - ## Widget: Developer settings widget-developer_mode = Developer Mode widget-developer_mode-high_contrast = Hoog contrast diff --git a/gui/public/i18n/pl/translation.ftl b/gui/public/i18n/pl/translation.ftl index 496558e2a..266d6a758 100644 --- a/gui/public/i18n/pl/translation.ftl +++ b/gui/public/i18n/pl/translation.ftl @@ -92,9 +92,6 @@ widget-overlay = Overlay widget-overlay-is_visible_label = Pokaż Overlay w SteamVR widget-overlay-is_mirrored_label = Pokaż Overlay jako Lustro -## Widget: Drift compensation -widget-drift_compensation-clear = Clear drift compensation - ## Widget: Developer settings widget-developer_mode = Tryb Dewelopera widget-developer_mode-high_contrast = High contrast diff --git a/gui/public/i18n/pt-BR/translation.ftl b/gui/public/i18n/pt-BR/translation.ftl index 78b1cc27d..1d247a843 100644 --- a/gui/public/i18n/pt-BR/translation.ftl +++ b/gui/public/i18n/pt-BR/translation.ftl @@ -92,9 +92,6 @@ widget-overlay = Overlay widget-overlay-is_visible_label = Mostrar Overlay na SteamVR widget-overlay-is_mirrored_label = Mostrar Overlay como espelho -## Widget: Drift compensation -widget-drift_compensation-clear = Clear drift compensation - ## Widget: Developer settings widget-developer_mode = Modo de desenvolvedor widget-developer_mode-high_contrast = High contrast diff --git a/gui/public/i18n/vi/translation.ftl b/gui/public/i18n/vi/translation.ftl index fe2508ef7..47fb222e2 100644 --- a/gui/public/i18n/vi/translation.ftl +++ b/gui/public/i18n/vi/translation.ftl @@ -92,9 +92,6 @@ widget-overlay = Overlay widget-overlay-is_visible_label = Xem overlay trên SteamVR widget-overlay-is_mirrored_label = Xem overlay trong gương -## Widget: Drift compensation -widget-drift_compensation-clear = Clear drift compensation - ## Widget: Developer settings widget-developer_mode = Chế độ nhà phát triển widget-developer_mode-high_contrast = Chế độ tương phản cao diff --git a/gui/public/i18n/zh-Hans/translation.ftl b/gui/public/i18n/zh-Hans/translation.ftl index 0a509d280..2b353272f 100644 --- a/gui/public/i18n/zh-Hans/translation.ftl +++ b/gui/public/i18n/zh-Hans/translation.ftl @@ -92,9 +92,6 @@ widget-overlay = 覆盖层 widget-overlay-is_visible_label = 在 SteamVR 中显示覆盖层 widget-overlay-is_mirrored_label = 镜像显示覆盖层 -## Widget: Drift compensation -widget-drift_compensation-clear = Clear drift compensation - ## Widget: Developer settings widget-developer_mode = 开发者选项 widget-developer_mode-high_contrast = 高对比度