diff --git a/flake.lock b/flake.lock index 0bf2adca6..f594f9e72 100644 --- a/flake.lock +++ b/flake.lock @@ -5,11 +5,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1778716662, - "narHash": "sha256-m1Yf0wZ8j1OHjTc2UwHwyQRSnNeSgLJOd7q5Y45hzi4=", + "lastModified": 1790898470, + "narHash": "sha256-zTwuwezD0w3hpga6a6P8emidzAZFyWqlNeRBlpWOOl8=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "f7c1a2d347e4c52d5fb8d10cb4d94b5884e546fb", + "rev": "024633cd702b10285db5cb19b40ad48d2399ba60", "type": "github" }, "original": { @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1781577229, - "narHash": "sha256-lrp67w8AulE9Ks53n27I45ADSzbOCn4H+CNW1Ck8B+8=", + "lastModified": 1790822859, + "narHash": "sha256-69xHQhAeMAD2wDXO7T2pcOZIF9Sga2W+JkmY2a11Ops=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "567a49d1913ce81ac6e9582e3553dd90a955875f", + "rev": "c59305bab2065cfecc4944690d9eedbb56f3a9fa", "type": "github" }, "original": { @@ -36,11 +36,11 @@ }, "nixpkgs-lib": { "locked": { - "lastModified": 1777168982, - "narHash": "sha256-GOkGPcboWE9BmGCRMLX3worL4EMnsnG8MyKmXNeYuhQ=", + "lastModified": 1790477367, + "narHash": "sha256-oujbxmVKDhci2E4EM3KyAbRUgp5/IsCoiA/LfEF7OOk=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "f5901329dade4a6ea039af1433fb087bd9c1fe14", + "rev": "f7cd230690d9fc982d06129f9189b101fddcfa3b", "type": "github" }, "original": { diff --git a/gui/app/public/i18n/en/translation.ftl b/gui/app/public/i18n/en/translation.ftl index 0277aaaa8..7e77fcfa6 100644 --- a/gui/app/public/i18n/en/translation.ftl +++ b/gui/app/public/i18n/en/translation.ftl @@ -235,6 +235,8 @@ reset-mounting-fingers = Fingers Calibration reset-yaw = Yaw Reset reset-error-mounting-need_full_reset = Need a full reset before mounting reset-error-yaw-need_full_reset = Need a full reset before yaw reset +reset-error-need_positional_head = Step mounting needs a headset or a tracker= with position tracking +reset-error-no_trackers = No tracker available reset-error-no_feet_tracker = No feet tracker assigned / available ## Navigation bar @@ -431,11 +433,14 @@ settings-sidebar-title = Settings settings-sidebar-general = General settings-sidebar-outputs = Outputs settings-sidebar-routing = Bone Routing +settings-sidebar-driver = SteamVR / Monado settings-sidebar-resets = Resets settings-sidebar-stay_aligned = Stay Aligned settings-sidebar-tracking = Tracking settings-sidebar-trackers = Trackers settings-sidebar-interface = Interface +settings-sidebar-vrchat_osc = VRChat OSC +settings-sidebar-osc_vmc = VMC settings-sidebar-utils = Utilities settings-sidebar-serial = USB Serial Console settings-sidebar-appearance = Appearance @@ -469,6 +474,9 @@ settings-routing-duplicate-warning = settings-routing-outputs = Outputs settings-routing-bones = Bones settings-routing-bones-description = A tick means the bone is sent to that output. A dash means the output does not support that bone. Turn off Automatic to pick them yourself. +settings-routing-output-driver = SteamVR / Monado +settings-routing-output-vrc_osc = VRChat OSC +settings-routing-output-vmc = VMC settings-routing-output-bone-count = { $routed } of { $accepts } bones routed settings-routing-output-badge-sending = Sending settings-routing-output-sending-description = Connected and receiving bones. @@ -500,6 +508,7 @@ settings-routing-hands-warning-done = Route hands ## SteamVR / Monado output settings +settings-driver = SteamVR / Monado settings-driver-description = Settings for the SlimeVR driver, used by SteamVR and Monado alike. settings-driver-enable = Enable settings-driver-enable-description = Send your trackers to and receive trackers from SteamVR or Monado through the SlimeVR driver. If this is off, they won't be able to connect to SlimeVR at all. @@ -522,6 +531,8 @@ settings-driver-velocity-description = Send linear and angular velocity data to ## Tracker mechanics settings-general-trackers_settings = Trackers Settings +settings-general-mounting_method = Mounting calibration method +settings-general-mounting_method-description = How the mounting calibration finds the way your trackers are mounted. settings-general-tracker_mechanics-filtering = Filtering # This also cares about multilines settings-general-tracker_mechanics-filtering-description = @@ -799,6 +810,7 @@ settings-serial-send_command-warning-ok = I know what I'm doing settings-serial-send_command-warning-cancel = Cancel ## OSC VRChat settings +settings-osc-vrchat = VRChat OSC # This cares about multilines settings-osc-vrchat-description-v1 = Change settings specific to VRChat OSC and the OSC Trackers standard used to send @@ -823,6 +835,7 @@ settings-osc-vrchat-status-title = Status settings-osc-vrchat-status-input = Input settings-osc-vrchat-status-tracking = Tracking data settings-osc-vrchat-status-output = Output +settings-osc-vrchat-status-oscquery = OSCQuery settings-osc-vrchat-status-input-idle = Not listening settings-osc-vrchat-status-input-listening = Listening on port {$port} settings-osc-vrchat-status-input-last-data = Last data from VRChat: {$elapsed}. @@ -860,6 +873,7 @@ settings-osc-vrchat-status-badge-not-sent = Not sent settings-osc-vrchat-status-badge-unknown = Unknown ## VMC OSC settings +settings-osc-vmc = Virtual Motion Capture # This cares about multilines settings-osc-vmc-description = Change settings specific to the VMC (Virtual Motion Capture) protocol @@ -1222,17 +1236,47 @@ onboarding-assign_trackers-warning-WAIST = Waist is assigned but you need { $una onboarding-choose_mounting = What mounting calibration method to use? # Multiline text onboarding-choose_mounting-description = Mounting orientation corrects for the placement of trackers on your body. -onboarding-choose_mounting-auto_mounting = Automatic mounting + +## Mounting method +mounting_method_modal-title = How do you want to calibrate your trackers? +mounting_method_modal-description = Mounting orientation corrects for the placement of trackers on your body. You can change this later in the settings. # Italicized text -onboarding-choose_mounting-auto_mounting-label-v2 = Recommended -onboarding-choose_mounting-auto_mounting-description = This will automatically detect the mounting orientations for all of your trackers from 2 poses -onboarding-choose_mounting-manual_mounting = Manual mounting -onboarding-choose_mounting-manual_mounting-description = This will let you choose the mounting orientation manually for each tracker +mounting_method-recommended = Recommended +mounting_method-select = Select +mounting_method-step = Step mounting +mounting_method-step-description = Take a step forward and the trackers are calibrated from the way they move. +mounting_method-step-needs_positional_head = Needs a headset or a tracker with position tracking. +mounting_method-pose = Pose mounting +mounting_method-pose-description = Hold a few poses to calibrate the trackers. +mounting_method-manual = Manual mounting +mounting_method-manual-description = Choose the mounting orientation manually for each tracker. + +## Tracker step mounting setup +onboarding-step_mounting-title = Step Mounting Calibration +onboarding-step_mounting-description = For SlimeVR trackers to work, we need to assign a mounting orientation to your trackers to align them with your physical tracker mounting. +onboarding-step_mounting-step-title = Step Mounting Calibration +onboarding-step_mounting-step-0 = 1. Press the "Mounting Calibration" button. +onboarding-step_mounting-step-1 = 2. Take one step forward, then stop and hold still until the calibration finishes. + +## Step mounting calibration +step_mounting-title = Step Mounting Calibration +# $status (String) - StepMountingStatus enum member name +step_mounting-instructions-WAITING_FOR_MOVEMENT = Take a step forward, then stand still. +step_mounting-instructions-RECORDING = Keep still once you've stopped, we're still recording. +step_mounting-instructions-PROCESSING = Hold on, calculating your mounting offset... +step_mounting-status-WAITING_FOR_MOVEMENT = Waiting for movement... +step_mounting-status-RECORDING = Recording your step... +step_mounting-status-PROCESSING = Processing... +step_mounting-status-DONE = Done! +step_mounting-status-ERROR_NO_DATA = Couldn't detect any movement. Try again. +step_mounting-status-ERROR_TIMEOUT = Timed out waiting for movement. Try again. +step_mounting-cancel = Cancel +step_mounting-close = Close +step_mounting-next = Next step ## Tracker manual mounting setup onboarding-manual_mounting = Manual Mounting onboarding-manual_mounting-description = Click on every tracker and select which way they are mounted -onboarding-manual_mounting-auto_mounting = Automatic mounting onboarding-manual_mounting-next = Next step ## Tracker automatic mounting setup @@ -1635,6 +1679,8 @@ tracking_checklist-status-partial = {$count -> *[many] You have {$count} warnings! } tracking_checklist-status-complete = You are prepared to use SlimeVR! +tracking_checklist-MOUNTING_METHOD = Pick a mounting calibration method +tracking_checklist-MOUNTING_METHOD-desc = Choose how your trackers are calibrated to the way they are mounted on your body. tracking_checklist-MOUNTING_CALIBRATION = Perform a mounting calibration tracking_checklist-FEET_MOUNTING_CALIBRATION = Perform a feet mounting calibration tracking_checklist-FULL_RESET = Perform a full reset diff --git a/gui/app/public/images/mounting-reset-pose.webp b/gui/app/public/images/mounting-reset-pose.webp deleted file mode 100644 index ce08ec8a9..000000000 Binary files a/gui/app/public/images/mounting-reset-pose.webp and /dev/null differ diff --git a/gui/app/public/videos/mounting-back-tiptoe.webm b/gui/app/public/videos/mounting-back-tiptoe.webm new file mode 100644 index 000000000..0d1e9e1bf Binary files /dev/null and b/gui/app/public/videos/mounting-back-tiptoe.webm differ diff --git a/gui/app/public/videos/mounting-back.webm b/gui/app/public/videos/mounting-back.webm new file mode 100644 index 000000000..8b932d6a2 Binary files /dev/null and b/gui/app/public/videos/mounting-back.webm differ diff --git a/gui/app/public/videos/mounting-forward-tiptoe.webm b/gui/app/public/videos/mounting-forward-tiptoe.webm new file mode 100644 index 000000000..74482f345 Binary files /dev/null and b/gui/app/public/videos/mounting-forward-tiptoe.webm differ diff --git a/gui/app/public/videos/mounting-forward.webm b/gui/app/public/videos/mounting-forward.webm new file mode 100644 index 000000000..b822c2129 Binary files /dev/null and b/gui/app/public/videos/mounting-forward.webm differ diff --git a/gui/app/public/videos/mounting-tpose-down-tiptoe.webm b/gui/app/public/videos/mounting-tpose-down-tiptoe.webm new file mode 100644 index 000000000..caae4d904 Binary files /dev/null and b/gui/app/public/videos/mounting-tpose-down-tiptoe.webm differ diff --git a/gui/app/public/videos/mounting-tpose-down.webm b/gui/app/public/videos/mounting-tpose-down.webm new file mode 100644 index 000000000..aa3400923 Binary files /dev/null and b/gui/app/public/videos/mounting-tpose-down.webm differ diff --git a/gui/app/public/videos/mounting-tpose-up-tiptoe.webm b/gui/app/public/videos/mounting-tpose-up-tiptoe.webm new file mode 100644 index 000000000..0c8cf4544 Binary files /dev/null and b/gui/app/public/videos/mounting-tpose-up-tiptoe.webm differ diff --git a/gui/app/public/videos/mounting-tpose-up.webm b/gui/app/public/videos/mounting-tpose-up.webm new file mode 100644 index 000000000..e609ce8b6 Binary files /dev/null and b/gui/app/public/videos/mounting-tpose-up.webm differ diff --git a/gui/app/public/videos/step-mounting.webm b/gui/app/public/videos/step-mounting.webm new file mode 100644 index 000000000..83d6f5048 Binary files /dev/null and b/gui/app/public/videos/step-mounting.webm differ diff --git a/gui/app/src/App.tsx b/gui/app/src/App.tsx index b123ffe20..a1746a72e 100644 --- a/gui/app/src/App.tsx +++ b/gui/app/src/App.tsx @@ -64,6 +64,8 @@ import { ElectronContextC, provideElectron } from './hooks/electron'; import { AppLocalizationProvider } from './i18n/config'; import { openUrl } from './hooks/crossplatform'; import { UdevRulesModal } from './components/onboarding/UdevRulesModal'; +import { StepMountingStatusModal } from './components/mounting/StepMountingStatusModal'; +import { StepMountingPage } from './components/onboarding/pages/mounting/StepMounting'; import { ErrorReportingConsentPage } from './components/ErrorReportingConsent'; import { AppStatusGate, @@ -87,6 +89,7 @@ function ConnectedApp() { + @@ -199,6 +202,7 @@ function AppRoutes() { } /> } /> } /> + } /> } /> - diff --git a/gui/app/src/components/Toolbar.tsx b/gui/app/src/components/Toolbar.tsx index 755706657..123ded779 100644 --- a/gui/app/src/components/Toolbar.tsx +++ b/gui/app/src/components/Toolbar.tsx @@ -1,6 +1,6 @@ import { Typography } from './commons/Typography'; import classNames from 'classnames'; -import { ResetType } from 'solarxr-protocol'; +import { MountingMethod, ResetType } from 'solarxr-protocol'; import { BODY_PARTS_GROUPS, MountingResetGroup, @@ -14,6 +14,9 @@ import { assignedTrackersAtom } from '@/store/app-store'; import { useBreakpoint } from '@/hooks/breakpoint'; import { useMemo } from 'react'; import { ResetButtonIcon } from './home/ResetButton'; +import { MountingMethodModal } from './mounting/MountingMethodModal'; +import { useMountingMethod } from '@/hooks/mounting-method'; +import { useResetsSettings } from '@/hooks/resets-settings'; const MAINBUTTON_CLASSES = ({ disabled }: { disabled: boolean }) => classNames( @@ -63,90 +66,103 @@ function BasicResetButton({ duration, error, } = useReset(options); + const { onClick, ...picker } = useMountingMethod(options, triggerReset); + const { resetsSettings } = useResetsSettings(); const progress = status === 'counting' ? resetProress / duration : 0; const name = customName || resetName; const skiReset = - options.type === ResetType.POSE_MOUNTING && options.group === 'default'; + options.type === ResetType.MOUNTING && + options.group === 'default' && + resetsSettings?.mountingMethod === MountingMethod.POSE; return ( - - ) : ( - - ) - } - spacing={5} - preferedDirection={error ? 'bottom' : 'top'} - > - - + +
+ + {timer} + +
+ + + + ); } export function Toolbar() { const assignedTrackers = useAtomValue(assignedTrackersAtom); + const { resetsSettings } = useResetsSettings(); + const splitMounting = resetsSettings?.mountingMethod === MountingMethod.POSE; const { visibleGroups, groupVisibility } = useMemo(() => { const groupVisibility = Object.keys(BODY_PARTS_GROUPS) @@ -190,32 +206,36 @@ export function Toolbar() {
- - {groupVisibility['toes'] && ( - - )} - {groupVisibility['fingers'] && ( - + {splitMounting && ( + <> + + {groupVisibility['toes'] && ( + + )} + {groupVisibility['fingers'] && ( + + )} + )}
diff --git a/gui/app/src/components/commons/icon/StepIcon.tsx b/gui/app/src/components/commons/icon/StepIcon.tsx new file mode 100644 index 000000000..280830c78 --- /dev/null +++ b/gui/app/src/components/commons/icon/StepIcon.tsx @@ -0,0 +1,12 @@ +export function StepIcon({ size = 24 }: { size?: number }) { + return ( + + + + ); +} diff --git a/gui/app/src/components/commons/icon/TuneIcon.tsx b/gui/app/src/components/commons/icon/TuneIcon.tsx new file mode 100644 index 000000000..45eb03f3f --- /dev/null +++ b/gui/app/src/components/commons/icon/TuneIcon.tsx @@ -0,0 +1,12 @@ +export function TuneIcon({ size = 24 }: { size?: number }) { + return ( + + + + ); +} diff --git a/gui/app/src/components/home/ResetButton.tsx b/gui/app/src/components/home/ResetButton.tsx index 0a56e065c..9c39a0cce 100644 --- a/gui/app/src/components/home/ResetButton.tsx +++ b/gui/app/src/components/home/ResetButton.tsx @@ -1,5 +1,5 @@ import { Localized } from '@fluent/react'; -import { ResetType } from 'solarxr-protocol'; +import { MountingMethod, ResetType } from 'solarxr-protocol'; import { Button } from '@/components/commons/Button'; import classNames from 'classnames'; import { useReset, UseResetOptions } from '@/hooks/reset'; @@ -9,20 +9,35 @@ import { } from '@/components/commons/icon/ResetIcon'; import { ReactNode } from 'react'; import { SkiIcon } from '@/components/commons/icon/SkiIcon'; +import { StepIcon } from '@/components/commons/icon/StepIcon'; +import { TuneIcon } from '@/components/commons/icon/TuneIcon'; +import { useResetsSettings } from '@/hooks/resets-settings'; import { FootIcon } from '@/components/commons/icon/FootIcon'; import { FingersIcon } from '@/components/commons/icon/FingersIcon'; import { ToesIcon } from '@/components/commons/icon/ToesIcon'; import { Tooltip } from '@/components/commons/Tooltip'; import { Typography } from '@/components/commons/Typography'; +import { MountingMethodModal } from '@/components/mounting/MountingMethodModal'; +import { useMountingMethod } from '@/hooks/mounting-method'; export function ResetButtonIcon(options: UseResetOptions) { - if (options.type === ResetType.POSE_MOUNTING && !options.group) + const { resetsSettings } = useResetsSettings(); + if (options.type === ResetType.MOUNTING && !options.group) options.group = 'default'; if (options.type === ResetType.YAW) return ; if (options.type === ResetType.FULL) return ; - if (options.type === ResetType.POSE_MOUNTING) { - if (options.group === 'default') return ; + if (options.type === ResetType.MOUNTING) { + if (options.group === 'default') { + switch (resetsSettings?.mountingMethod) { + case MountingMethod.STEP: + return ; + case MountingMethod.MANUAL: + return ; + default: + return ; + } + } if (options.group === 'feet') return ; if (options.group === 'toes') return ; if (options.group === 'fingers') return ; @@ -48,48 +63,59 @@ export function ResetButton({ onReseted, onFailed ); + const { onClick: onResetClick, ...picker } = useMountingMethod( + options, + triggerReset + ); return ( - - ) : ( - <> - ) - } - > - - + + + + ); } diff --git a/gui/app/src/components/mounting/MountingMethodModal.tsx b/gui/app/src/components/mounting/MountingMethodModal.tsx new file mode 100644 index 000000000..110a9b527 --- /dev/null +++ b/gui/app/src/components/mounting/MountingMethodModal.tsx @@ -0,0 +1,95 @@ +import { MountingMethod } from 'solarxr-protocol'; +import { BaseModal } from '@/components/commons/BaseModal'; +import { Button } from '@/components/commons/Button'; +import { Typography } from '@/components/commons/Typography'; +import { SkiIcon } from '@/components/commons/icon/SkiIcon'; +import { StepIcon } from '@/components/commons/icon/StepIcon'; +import { TuneIcon } from '@/components/commons/icon/TuneIcon'; + +function MethodCard({ + method, + icon, + name, + onSelect, + recommended = false, + note, +}: { + method: MountingMethod; + icon: React.ReactNode; + name: string; + onSelect: (method: MountingMethod) => void; + recommended?: boolean; + note?: string; +}) { + return ( +
+ {recommended && ( +
+ +
+ )} +
{icon}
+ + + {note && } +
+ ); +} + +export function MountingMethodModal({ + isOpen, + onClose, + onSelect, +}: { + isOpen: boolean; + onClose: () => void; + onSelect: (method: MountingMethod) => void; +}) { + return ( + +
+ + +
+ } + name="step" + recommended + note="mounting_method-step-needs_positional_head" + onSelect={onSelect} + /> + } + name="pose" + onSelect={onSelect} + /> + } + name="manual" + onSelect={onSelect} + /> +
+
+
+ ); +} diff --git a/gui/app/src/components/mounting/MountingMethodRadio.tsx b/gui/app/src/components/mounting/MountingMethodRadio.tsx new file mode 100644 index 000000000..24f75ae3e --- /dev/null +++ b/gui/app/src/components/mounting/MountingMethodRadio.tsx @@ -0,0 +1,57 @@ +import { useEffect } from 'react'; +import { useForm } from 'react-hook-form'; +import { useLocalization } from '@fluent/react'; +import { MountingMethod } from 'solarxr-protocol'; +import { Radio } from '@/components/commons/Radio'; +import { useResetsSettings } from '@/hooks/resets-settings'; + +type MountingMethodForm = { mountingMethod: string }; + +export function MountingMethodRadio() { + const { l10n } = useLocalization(); + const { resetsSettings, setResetsSettings } = useResetsSettings(); + const { control, watch, reset } = useForm({ + defaultValues: { mountingMethod: String(MountingMethod.UNKNOWN) }, + }); + + useEffect(() => { + if (resetsSettings) { + reset({ mountingMethod: String(resetsSettings.mountingMethod) }); + } + }, [resetsSettings?.mountingMethod]); + + useEffect(() => { + const subscription = watch((values, { type }) => { + if (type === 'change') { + setResetsSettings({ mountingMethod: Number(values.mountingMethod) }); + } + }); + return () => subscription.unsubscribe(); + }, [resetsSettings]); + + return ( +
+ + + +
+ ); +} diff --git a/gui/app/src/components/mounting/PoseMountingVideo.tsx b/gui/app/src/components/mounting/PoseMountingVideo.tsx new file mode 100644 index 000000000..473c122fd --- /dev/null +++ b/gui/app/src/components/mounting/PoseMountingVideo.tsx @@ -0,0 +1,29 @@ +import { ArmsResetMode } from 'solarxr-protocol'; +import { useResetsSettings } from '@/hooks/resets-settings'; + +const ARMS_MODE_NAMES: Record = { + [ArmsResetMode.BACK]: 'back', + [ArmsResetMode.FORWARD]: 'forward', + [ArmsResetMode.T_POSE_UP]: 'tpose-up', + [ArmsResetMode.T_POSE_DOWN]: 'tpose-down', +}; + +/** The pose to hold for a pose mounting, following the arms reset mode and whether the feet are included */ +export function PoseMountingVideo({ className }: { className?: string }) { + const { resetsSettings } = useResetsSettings(); + const armsMode = + ARMS_MODE_NAMES[resetsSettings?.armsResetMode ?? ArmsResetMode.BACK]; + const tiptoe = resetsSettings?.resetMountingFeet ? '-tiptoe' : ''; + + return ( +