mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-11-24 02:51:20 -08:00
Compare commits
43
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8881746941 | ||
|
|
d3ee82cccc | ||
|
|
947f440600 | ||
|
|
8e887395f1 | ||
|
|
3f42b8ab51 | ||
|
|
52a8e24d9e | ||
|
|
80248e82f9 | ||
|
|
647964fe99 | ||
|
|
010018b400 | ||
|
|
4783eab37c | ||
|
|
f693d562ba | ||
|
|
964b19be01 | ||
|
|
00c768919d | ||
|
|
c9415b2c02 | ||
|
|
93d666a233 | ||
|
|
cc8538a332 | ||
|
|
f9d619f93a | ||
|
|
471714afd0 | ||
|
|
91ce0ed734 | ||
|
|
a35d2a77a2 | ||
|
|
ea31d58fb8 | ||
|
|
e74dee1892 | ||
|
|
d84fc40b23 | ||
|
|
0dd004825d | ||
|
|
9f36444169 | ||
|
|
52509c7950 | ||
|
|
868c441220 | ||
|
|
5ad408f61d | ||
|
|
9b30f9800c | ||
|
|
07e5ef647a | ||
|
|
47909ad46c | ||
|
|
99c92fad9e | ||
|
|
d7861614b7 | ||
|
|
b4a3e9cbd5 | ||
|
|
e58946f622 | ||
|
|
c8532c76c2 | ||
|
|
6f26ea7b50 | ||
|
|
a848dfac43 | ||
|
|
e5ea747cde | ||
|
|
34a782193b | ||
|
|
8498270df6 | ||
|
|
cd6ed7296b | ||
|
|
57541e560c |
No files matched your search
@@ -87,6 +87,7 @@ jobs:
|
||||
shell: bash
|
||||
env:
|
||||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
NODE_OPTIONS: ${{ matrix.os == 'macos-latest' && '--max-old-space-size=4096' || '' }}
|
||||
run: pnpm run skipbundler --config $( ./gui/scripts/gitversion.mjs )
|
||||
|
||||
- if: matrix.os == 'windows-latest'
|
||||
|
||||
@@ -280,6 +280,7 @@ jobs:
|
||||
- name: Build
|
||||
env:
|
||||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
NODE_OPTIONS: --max-old-space-size=4096
|
||||
run: pnpm run tauri build --target universal-apple-darwin --config $( ./gui/scripts/gitversion.mjs )
|
||||
|
||||
- name: Modify Application
|
||||
|
||||
@@ -105,6 +105,7 @@ When touching SolarXR:
|
||||
- After editing files, you should run `cd solarxr-protocol`, then either run
|
||||
`./generate-flatbuffer.ps1` (Windows) or `./generate-flatbuffer.sh` (Linux/OSX)
|
||||
- Make sure to commit your changes inside the submodule.
|
||||
- To make sure the gui use the latest generated code, run `pnpm i`.
|
||||
|
||||
## Code Licensing
|
||||
SlimeVR uses dual MIT and Apache-2.0 license. Be sure that any code that you reference,
|
||||
|
||||
+2
-1
@@ -22,6 +22,7 @@
|
||||
"@tauri-apps/plugin-os": "^2.0.0",
|
||||
"@tauri-apps/plugin-shell": "^2.0.0",
|
||||
"@tauri-apps/plugin-store": "^2.0.0",
|
||||
"@twemoji/svg": "^15.0.0",
|
||||
"browser-fs-access": "^0.35.0",
|
||||
"classnames": "^2.5.1",
|
||||
"flatbuffers": "22.10.26",
|
||||
@@ -98,4 +99,4 @@
|
||||
"typescript-eslint": "^8.8.0",
|
||||
"vite": "^5.4.8"
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
@@ -306,6 +306,7 @@ tracker-settings-forget = Tracker Vergessen
|
||||
tracker-settings-forget-description = Entfernt den Tracker vom SlimeVR Server und verhindert, dass er sich wieder verbindet, bis der Server neu gestartet wurde. Die Konfiguration des Trackers geht nicht verloren.
|
||||
tracker-settings-forget-label = Tracker Vergessen
|
||||
tracker-settings-update-unavailable = Kann nicht aktualisiert werden (DIY)
|
||||
tracker-settings-update-low-battery = Aktualisierung nicht möglich. Akku unter 50 %
|
||||
tracker-settings-update-up_to_date = Auf dem neusten Stand
|
||||
tracker-settings-update-available = { $versionName } ist jetzt Verfügbar
|
||||
tracker-settings-update = Jetzt aktualisieren
|
||||
@@ -1297,7 +1298,7 @@ firmware_tool-build_step = Building
|
||||
firmware_tool-build_step-description = Die Firmware wird erstellt, bitte warten.
|
||||
firmware_tool-flashing_step = Flashen
|
||||
firmware_tool-flashing_step-description = Ihre Tracker werden geflasht, bitte folgen Sie den Anweisungen auf dem Bildschirm.
|
||||
firmware_tool-flashing_step-warning = Trennen Sie den Tracker während des Upload-Prozesses nicht vom Computer und starten Sie ihn nicht neu, es sei denn, Sie werden dazu aufgefordert. Andernfalls könnte Ihr Board unbrauchbar werden.
|
||||
firmware_tool-flashing_step-warning-v2 = Trennen oder schalten Sie den Tracker während des Upload-Vorgangs nicht aus, es sei denn, Sie werden dazu aufgefordert, da dies den Tracker unbrauchbar machen kann.
|
||||
firmware_tool-flashing_step-flash_more = Weitere Tracker flashen
|
||||
firmware_tool-flashing_step-exit = Schließen
|
||||
|
||||
@@ -1315,7 +1316,7 @@ firmware_tool-build-ERROR = Die Firmware konnte nicht erstellt werden
|
||||
## Firmware update status
|
||||
|
||||
firmware_update-status-DOWNLOADING = Lade die Firmware herunter
|
||||
firmware_update-status-NEED_MANUAL_REBOOT = Bitte starten Sie den Tracker neu
|
||||
firmware_update-status-NEED_MANUAL_REBOOT-v2 = Bitte schalten Sie Ihren Tracker aus und wieder ein.
|
||||
firmware_update-status-AUTHENTICATING = Authentifizierung mit dem Mikrokontroller
|
||||
firmware_update-status-UPLOADING = Lade die Firmware hoch
|
||||
firmware_update-status-SYNCING_WITH_MCU = Synchronisieren mit dem Mikrokontroller
|
||||
|
||||
@@ -107,12 +107,12 @@ skeleton_bone-HEAD = Head Shift
|
||||
skeleton_bone-HEAD-desc =
|
||||
This is the distance from your headset to the middle of your head.
|
||||
To adjust it, shake your head left to right as if you're disagreeing and modify
|
||||
it until any movement in other trackers is negligible.
|
||||
it until any movement in other trackers is negligible.
|
||||
skeleton_bone-NECK = Neck Length
|
||||
skeleton_bone-NECK-desc =
|
||||
This is the distance from the middle of your head to the base of your neck.
|
||||
To adjust it, move your head up and down as if you're nodding or tilt your head
|
||||
to the left and right and modify it until any movement in other trackers is negligible.
|
||||
To adjust it, move your head up and down as if you're nodding or tilt your head
|
||||
to the left and right and modify it until any movement in other trackers is negligible.
|
||||
skeleton_bone-torso_group = Torso length
|
||||
skeleton_bone-torso_group-desc =
|
||||
This is the distance from the base of your neck to your hips.
|
||||
@@ -163,7 +163,7 @@ skeleton_bone-UPPER_LEG-desc =
|
||||
until your virtual knees are at the same level as your real ones.
|
||||
skeleton_bone-LOWER_LEG = Lower Leg Length
|
||||
skeleton_bone-LOWER_LEG-desc =
|
||||
This is the distance from your hips to your knees.
|
||||
This is the distance from your knees to your ankles.
|
||||
To adjust it, adjust your Leg Length properly and modify it
|
||||
until your virtual knees are at the same level as your real ones.
|
||||
skeleton_bone-FOOT_LENGTH = Foot Length
|
||||
@@ -184,45 +184,45 @@ skeleton_bone-SKELETON_OFFSET-desc =
|
||||
skeleton_bone-SHOULDERS_DISTANCE = Shoulders Distance
|
||||
skeleton_bone-SHOULDERS_DISTANCE-desc =
|
||||
This is the vertical distance from the base of your neck to your shoulders.
|
||||
To adjust it, set Upper Arm Length to 0 and modify it until your virtual elbow trackers
|
||||
To adjust it, set Upper Arm Length to 0 and modify it until your virtual elbow trackers
|
||||
line up vertically with your real shoulders.
|
||||
skeleton_bone-SHOULDERS_WIDTH = Shoulders Width
|
||||
skeleton_bone-SHOULDERS_WIDTH-desc =
|
||||
This is the horizontal distance from the base of your neck to your shoulders.
|
||||
To adjust it, set Upper Arm Length to 0 and modify it until your virtual elbow trackers
|
||||
To adjust it, set Upper Arm Length to 0 and modify it until your virtual elbow trackers
|
||||
line up horizontally with your real shoulders.
|
||||
skeleton_bone-arm_group = Arm length
|
||||
skeleton_bone-arm_group-desc =
|
||||
This is the distance from your shoulders to your wrists.
|
||||
To adjust it, adjust Shoulders Distance properly, set Hand Distance Y
|
||||
To adjust it, adjust Shoulders Distance properly, set Hand Distance Y
|
||||
to 0 and modify it until your hand trackers line up with your wrists.
|
||||
skeleton_bone-UPPER_ARM = Upper Arm Length
|
||||
skeleton_bone-UPPER_ARM-desc =
|
||||
This is the distance from your shoulders to your elbows.
|
||||
To adjust it, adjust Arm Length properly and modify it until
|
||||
To adjust it, adjust Arm Length properly and modify it until
|
||||
your elbow trackers line up with your real elbows.
|
||||
skeleton_bone-LOWER_ARM = Lower Arm Length
|
||||
skeleton_bone-LOWER_ARM-desc =
|
||||
This is the distance from your elbows to your wrists.
|
||||
To adjust it, adjust Arm Length properly and modify it until
|
||||
To adjust it, adjust Arm Length properly and modify it until
|
||||
your elbow trackers line up with your real elbows.
|
||||
skeleton_bone-HAND_Y = Hand Distance Y
|
||||
skeleton_bone-HAND_Y-desc =
|
||||
This is the vertical distance from your wrists to the middle of your hand.
|
||||
To adjust it for motion capture, adjust Arm Length properly and modify it until your
|
||||
hand trackers line up vertically with the middle of your hands.
|
||||
To adjust it for elbow tracking from your controllers, set Arm Length to 0 and
|
||||
To adjust it for elbow tracking from your controllers, set Arm Length to 0 and
|
||||
modify it until your elbow trackers line up vertically with your wrists.
|
||||
skeleton_bone-HAND_Z = Hand Distance Z
|
||||
skeleton_bone-HAND_Z-desc =
|
||||
This is the horizontal distance from your wrists to the middle of your hand.
|
||||
To adjust it for motion capture, set it to 0.
|
||||
To adjust it for elbow tracking from your controllers, set Arm Length to 0 and
|
||||
To adjust it for elbow tracking from your controllers, set Arm Length to 0 and
|
||||
modify it until your elbow trackers line up horizontally with your wrists.
|
||||
skeleton_bone-ELBOW_OFFSET = Elbow Offset
|
||||
skeleton_bone-ELBOW_OFFSET-desc =
|
||||
This can be adjusted to move your virtual elbow trackers up or down in order to aid
|
||||
with VRChat accidentally binding and elbow tracker to the chest.
|
||||
with VRChat accidentally binding an elbow tracker to the chest.
|
||||
|
||||
## Tracker reset buttons
|
||||
reset-reset_all = Reset all proportions
|
||||
@@ -458,6 +458,7 @@ settings-sidebar-appearance = Appearance
|
||||
settings-sidebar-notifications = Notifications
|
||||
settings-sidebar-behavior = Behavior
|
||||
settings-sidebar-firmware-tool = DIY Firmware Tool
|
||||
settings-sidebar-vrc_warnings = VRChat Config Warnings
|
||||
settings-sidebar-advanced = Advanced
|
||||
|
||||
## SteamVR settings
|
||||
@@ -913,6 +914,17 @@ onboarding-connect_tracker-connection_status-looking_for_server = Looking for se
|
||||
onboarding-connect_tracker-connection_status-connection_error = Unable to connect to Wi-Fi
|
||||
onboarding-connect_tracker-connection_status-could_not_find_server = Could not find the server
|
||||
onboarding-connect_tracker-connection_status-done = Connected to the Server
|
||||
onboarding-connect_tracker-connection_status-no_serial_log = Could not get logs from the tracker
|
||||
onboarding-connect_tracker-connection_status-no_serial_device_found = Could not find a tracker from USB
|
||||
onboarding-connect_serial-error-modal-no_serial_log = Is the tracker turned on?
|
||||
onboarding-connect_serial-error-modal-no_serial_log-desc = Make sure the tracker is turned on and connected to your computer
|
||||
onboarding-connect_serial-error-modal-no_serial_device_found = No trackers detected
|
||||
onboarding-connect_serial-error-modal-no_serial_device_found-desc =
|
||||
Please connect a tracker with the provided usb cable to your computer and turn the tracker on.
|
||||
If this does not work:
|
||||
- try with another usb cable
|
||||
- try with another usb port
|
||||
- try reinstalling the SlimeVR server and select "USB Drivers" in the components section
|
||||
# $amount (Number) - Amount of trackers connected (this is a number, but you can use CLDR plural rules for your language)
|
||||
# More info on https://www.unicode.org/cldr/cldr-aux/charts/22/supplemental/language_plural_rules.html
|
||||
# English in this case only has 2 plural rules, which are "one" and "other",
|
||||
@@ -1230,6 +1242,7 @@ status_system-StatusSteamVRDisconnected = { $type ->
|
||||
}
|
||||
status_system-StatusTrackerError = The { $trackerName } tracker has an error.
|
||||
status_system-StatusUnassignedHMD = The VR headset should be assigned as a head tracker.
|
||||
status_system-StatusPublicNetwork = Your network profile is currently set to Public. This is not recomended for SlimeVR to function properly. <PublicFixLink>See how to fix it here.</PublicFixLink>
|
||||
|
||||
|
||||
## Firmware tool globals
|
||||
@@ -1431,6 +1444,9 @@ vrc_config-show_more = Show more
|
||||
vrc_config-setting_name = VRChat Setting name
|
||||
vrc_config-recommended_value = Recommended Value
|
||||
vrc_config-current_value = Current Value
|
||||
vrc_config-mute = Mute Warning
|
||||
vrc_config-mute-btn = Mute
|
||||
vrc_config-unmute-btn = Unmute
|
||||
vrc_config-legacy_mode = Use Legacy IK Solving
|
||||
vrc_config-disable_shoulder_tracking = Disable Shoulder Tracking
|
||||
vrc_config-shoulder_width_compensation = Shoulder Width Compensation
|
||||
|
||||
@@ -41,7 +41,7 @@ body_part-RIGHT_UPPER_ARM = Braço superior direito
|
||||
body_part-RIGHT_LOWER_ARM = Antebraço direito
|
||||
body_part-RIGHT_HAND = Mão Direita
|
||||
body_part-RIGHT_UPPER_LEG = Coxa direita
|
||||
body_part-RIGHT_LOWER_LEG = Canela direita
|
||||
body_part-RIGHT_LOWER_LEG = Tornozelo direito
|
||||
body_part-RIGHT_FOOT = Pé direito
|
||||
body_part-UPPER_CHEST = Peito Superior
|
||||
body_part-CHEST = Peito
|
||||
@@ -52,7 +52,7 @@ body_part-LEFT_UPPER_ARM = Braço superior esquerdo
|
||||
body_part-LEFT_LOWER_ARM = Antebraço esquerdo
|
||||
body_part-LEFT_HAND = Mão esquerda
|
||||
body_part-LEFT_UPPER_LEG = Coxa esquerda
|
||||
body_part-LEFT_LOWER_LEG = Canela esquerda
|
||||
body_part-LEFT_LOWER_LEG = Tornozelo esquerdo
|
||||
body_part-LEFT_FOOT = Pé esquerdo
|
||||
body_part-LEFT_THUMB_METACARPAL = Metacarpo do polegar esquerdo
|
||||
body_part-LEFT_THUMB_PROXIMAL = Proximal do polegar esquerdo
|
||||
@@ -540,6 +540,9 @@ settings-general-gesture_control-numberTrackersOverThreshold-description = Aumen
|
||||
## Appearance settings
|
||||
|
||||
settings-interface-appearance = Aparência
|
||||
settings-general-interface-dev_mode = Modo de desenvolvedor
|
||||
settings-general-interface-dev_mode-description = Este modo pode ser útil se precisar de dados específicos ou para interagir com trackers conectados a um nível mais avançado
|
||||
settings-general-interface-dev_mode-label = Modo de desenvolvedor
|
||||
settings-general-interface-theme = Cor do tema
|
||||
settings-general-interface-show-navbar-onboarding = Mostrar "{ navbar-onboarding }" na barra de navegação
|
||||
settings-general-interface-show-navbar-onboarding-description = Isso muda se o botão "{ navbar-onboarding }" for exibido na barra de navegação.
|
||||
@@ -945,18 +948,18 @@ onboarding-assign_trackers-warning-RIGHT_FOOT =
|
||||
# $unassigned (Number) - Bits are based on BodyAssignment.ASSIGNMENT_RULES order
|
||||
onboarding-assign_trackers-warning-LEFT_LOWER_LEG =
|
||||
{ $unassigned ->
|
||||
[0] Canela esquerda está atribuída, porém a coxa esquerda e peito, quadril ou cintura também precisam ser atribuídos!
|
||||
[1] Canela esquerda está atribuída, porém peito, quadril ou cintura também precisam ser atribuídos!
|
||||
[2] Canela esquerda está atribuída, porém a coxa direita também precisa ser atribuída!
|
||||
*[unknown] Canela esquerda está atribuída, porém a parte do corpo desconhecida não atribuída também precisa ser atribuída!
|
||||
[2] Tornozelo esquerdo está atribuído, porém a coxa direita também precisa ser atribuída!
|
||||
[1] Tornozelo esquerdo está atribuído, porém peito, quadril ou cintura também precisam ser atribuídos!
|
||||
[0] Tornozelo esquerdo está atribuído, porém a coxa esquerda e peito, quadril ou cintura também precisam ser atribuídos!
|
||||
*[unknown] Tornozelo esquerdo está atribuído, porém a parte do corpo desconhecida não atribuída também precisa ser atribuída!
|
||||
}
|
||||
# $unassigned (Number) - Bits are based on BodyAssignment.ASSIGNMENT_RULES order
|
||||
onboarding-assign_trackers-warning-RIGHT_LOWER_LEG =
|
||||
{ $unassigned ->
|
||||
[0] Canela direita está atribuída, porém a coxa direita e peito, quadril ou cintura também precisam ser atribuídos!
|
||||
[1] Canela direita está atribuída, porém peito, quadril ou cintura também precisam ser atribuídos!
|
||||
[2] Canela direita está atribuída, porém a coxa direita também precisa ser atribuída!
|
||||
*[unknown] Canela direita está atribuída, porém a parte do corpo desconhecida não atribuída também precisa ser atribuída!
|
||||
[2] Tornozelo direito está atribuído, porém a coxa direita também precisa ser atribuída!
|
||||
[1] Tornozelo direito está atribuído, porém peito, quadril ou cintura também precisam ser atribuídos!
|
||||
[0] Tornozelo direito está atribuído, porém a coxa direita e peito, quadril ou cintura também precisam ser atribuídos!
|
||||
*[unknown] Tornozelo direito está atribuído, porém a parte do corpo desconhecida não atribuída também precisa ser atribuída!
|
||||
}
|
||||
# $unassigned (Number) - Bits are based on BodyAssignment.ASSIGNMENT_RULES order
|
||||
onboarding-assign_trackers-warning-LEFT_UPPER_LEG =
|
||||
@@ -1037,15 +1040,10 @@ onboarding-automatic_mounting-put_trackers_on-next = Coloquei todos os meus trac
|
||||
|
||||
onboarding-manual_proportions-back = Voltar para o tutorial de reset
|
||||
onboarding-manual_proportions-title = Proporções de corpo manuais
|
||||
onboarding-manual_proportions-precision = Ajuste de precisão
|
||||
onboarding-manual_proportions-auto = Calibragem Automática
|
||||
onboarding-manual_proportions-ratio = Ajustar por grupos de proporções
|
||||
onboarding-manual_proportions-fine_tuning_button = Melhorar automaticamente as proporções
|
||||
onboarding-manual_proportions-fine_tuning_button-disabled-tooltip = Por favor, conecte seu headset VR para utilizar a melhoria automatica
|
||||
onboarding-manual_proportions-export = Exportar proporções
|
||||
onboarding-manual_proportions-import = Importar proporções
|
||||
onboarding-manual_proportions-import-success = Importado
|
||||
onboarding-manual_proportions-import-failed = Falhou
|
||||
onboarding-manual_proportions-file_type = Arquivo de proporções do corpo
|
||||
|
||||
## Tracker automatic proportions setup
|
||||
@@ -1270,7 +1268,6 @@ firmware_tool-build_step = Compilando
|
||||
firmware_tool-build_step-description = O firmware está sendo compilado, aguarde
|
||||
firmware_tool-flashing_step = Atualizando
|
||||
firmware_tool-flashing_step-description = Seus trackers estão atualizando, por favor, siga as instruções na tela
|
||||
firmware_tool-flashing_step-warning = Não desconecte nem reinicie o tracker durante o processo de upload, a menos que seja solicitado, pois isso pode tornar sua placa inutilizável
|
||||
firmware_tool-flashing_step-flash_more = Atualizar mais trackers
|
||||
firmware_tool-flashing_step-exit = Sair
|
||||
|
||||
@@ -1288,7 +1285,6 @@ firmware_tool-build-ERROR = Não foi possível compilar o firmware
|
||||
## Firmware update status
|
||||
|
||||
firmware_update-status-DOWNLOADING = Baixando o firmware
|
||||
firmware_update-status-NEED_MANUAL_REBOOT = Favor reiniciar o tracker
|
||||
firmware_update-status-AUTHENTICATING = Autenticando com o mcu
|
||||
firmware_update-status-UPLOADING = Fazendo upload do firmware
|
||||
firmware_update-status-SYNCING_WITH_MCU = Sincronizando com o mcu
|
||||
|
||||
@@ -9,6 +9,11 @@
|
||||
|
||||
websocket-connecting = 正在连接到服务器
|
||||
websocket-connection_lost = 与服务器的连接丢失,正在尝试重新连接...
|
||||
websocket-connection_lost-desc = 看起来 SlimeVR 服务器崩溃了。检查日志并重新启动程序
|
||||
websocket-timedout = 无法连接到服务器
|
||||
websocket-timedout-desc = 看起来 SlimeVR 服务器崩溃或超时了。检查日志并重新启动程序
|
||||
websocket-error-close = 退出 SlimeVR
|
||||
websocket-error-logs = 打开日志文件夹
|
||||
|
||||
## Update notification
|
||||
|
||||
@@ -92,7 +97,15 @@ board_type-ESP01 = ESP-01
|
||||
board_type-SLIMEVR = SlimeVR
|
||||
board_type-LOLIN_C3_MINI = Lolin C3 Mini
|
||||
board_type-BEETLE32C3 = Beetle ESP32-C3
|
||||
board_type-ES32C3DEVKITM1 = Espressif ESP32-C3 DevKitM-1
|
||||
board_type-ESP32C3DEVKITM1 = Espressif ESP32-C3 DevKitM-1
|
||||
board_type-OWOTRACK = owoTrack
|
||||
board_type-WRANGLER = Wrangler Joycons
|
||||
board_type-MOCOPI = 索尼 Mocopi
|
||||
board_type-WEMOSWROOM02 = Wemos Wroom-02 D1 Mini
|
||||
board_type-XIAO_ESP32C3 = Seeed Studio XIAO ESP32C3
|
||||
board_type-HARITORA = Haritora
|
||||
board_type-ESP32C6DEVKITC1 = Espressif ESP32-C6 DevKitC-1
|
||||
board_type-GLOVE_IMU_SLIMEVR_DEV = SlimeVR开发版IMU手套
|
||||
|
||||
## Proportions
|
||||
|
||||
@@ -125,14 +138,13 @@ skeleton_bone-ELBOW_OFFSET = 肘部偏移
|
||||
## Tracker reset buttons
|
||||
|
||||
reset-reset_all = 重置身体比例
|
||||
reset-reset_all_warning =
|
||||
<b>警告:</b> 这会将您的身体比例重置为仅基于身高的默认比例。
|
||||
reset-reset_all_warning-v2 =
|
||||
<b>警告:</b> 您的骨骼比例将重置为您配置的身高下的默认值。
|
||||
您确定要执行此操作吗?
|
||||
reset-reset_all_warning-reset = 重置身体比例
|
||||
reset-reset_all_warning-cancel = 取消
|
||||
reset-reset_all_warning_default =
|
||||
<b>警告:</b> 您当前没有设置身高,
|
||||
这样将使用默认身高计算身体比例。
|
||||
reset-reset_all_warning_default-v2 =
|
||||
<b>警告:</b> 您的身高尚未配置,您的骨骼比例将重置为默认身高下的默认值。
|
||||
您确定要执行此操作吗?
|
||||
reset-full = 完整重置
|
||||
reset-mounting = 重置佩戴
|
||||
@@ -294,6 +306,7 @@ tracker-settings-forget = 忘记追踪器
|
||||
tracker-settings-forget-description = 从 SlimeVR 服务器中移除该追踪器,并在服务器重启前不再连接这一追踪器。追踪器的配置信息不会被清除。
|
||||
tracker-settings-forget-label = 忘记追踪器
|
||||
tracker-settings-update-unavailable = 无法升级(DIY)
|
||||
tracker-settings-update-low-battery = 无法更新。当前电池电量低于 50%
|
||||
tracker-settings-update-up_to_date = 已是最新
|
||||
tracker-settings-update-available = { $versionName } 现在可用
|
||||
tracker-settings-update = 立即更新
|
||||
@@ -373,6 +386,7 @@ settings-sidebar-utils = 工具
|
||||
settings-sidebar-serial = 串口控制台
|
||||
settings-sidebar-appearance = 外观
|
||||
settings-sidebar-notifications = 通知
|
||||
settings-sidebar-behavior = 行为
|
||||
settings-sidebar-firmware-tool = DIY固件工具
|
||||
settings-sidebar-advanced = 高级选项
|
||||
|
||||
@@ -514,9 +528,6 @@ settings-general-fk_settings-skeleton_settings-interp_knee_tracker_ankle = 平
|
||||
settings-general-fk_settings-skeleton_settings-interp_knee_ankle = 平均膝盖与小腿间航向轴和横滚轴的数值
|
||||
settings-general-fk_settings-self_localization-title = 动作捕捉模式
|
||||
settings-general-fk_settings-self_localization-description = 动作捕捉模式允许在没有头戴设备或其他追踪器的情况下粗略地跟踪骨架姿态。请注意,本功能需要脚部和头部追踪器,且现阶段依然是实验性的。
|
||||
settings-general-fk_settings-vive_emulation-title = Vive 模拟
|
||||
settings-general-fk_settings-vive_emulation-description = 模拟Vive追踪器的腰部丢追问题。( 注:这是一个玩笑功能,会劣化追踪质量。)
|
||||
settings-general-fk_settings-vive_emulation-label = 开启 Vive 模拟
|
||||
|
||||
## Gesture control settings (tracker tapping)
|
||||
|
||||
@@ -548,9 +559,6 @@ settings-general-gesture_control-numberTrackersOverThreshold-description = 如
|
||||
## Appearance settings
|
||||
|
||||
settings-interface-appearance = 外观
|
||||
settings-general-interface-dev_mode = 开发者模式
|
||||
settings-general-interface-dev_mode-description = 如果你需要深入的资料或对连接的追踪器进行进阶调整,开启此模式将会非常有用。
|
||||
settings-general-interface-dev_mode-label = 开发者模式
|
||||
settings-general-interface-theme = 主题颜色
|
||||
settings-general-interface-show-navbar-onboarding = 在导航栏上显示 “{ navbar-onboarding }”
|
||||
settings-general-interface-show-navbar-onboarding-description = 本选项设置是否将 "{ navbar-onboarding }" 按钮显示在导航栏上。
|
||||
@@ -583,6 +591,13 @@ settings-general-interface-feedback_sound-volume = 提示音音量
|
||||
settings-general-interface-connected_trackers_warning = 已连接追踪器警告
|
||||
settings-general-interface-connected_trackers_warning-description = 启用本选项后,每次当退出 SlimeVR 时仍有追踪器连接着会显示通知,提醒你在使用完毕时关闭追踪器电源来节省电池电量。
|
||||
settings-general-interface-connected_trackers_warning-label = 退出时,有追踪器连接中则显示警告
|
||||
|
||||
## Behavior settings
|
||||
|
||||
settings-interface-behavior = 行为
|
||||
settings-general-interface-dev_mode = 开发者模式
|
||||
settings-general-interface-dev_mode-description = 如果你需要深入的资料或对连接的追踪器进行进阶调整,开启此模式将会非常有用。
|
||||
settings-general-interface-dev_mode-label = 开发者模式
|
||||
settings-general-interface-use_tray = 最小化至任务栏
|
||||
settings-general-interface-use_tray-description = 关闭 SlimeVR 窗口时,SlimeVR 服务器将会隐藏至任务栏图标而不会直接退出,可以继续使用。
|
||||
settings-general-interface-use_tray-label = 最小化至任务栏
|
||||
@@ -594,6 +609,14 @@ settings-general-interface-discord_presence-message =
|
||||
[0] { "" }
|
||||
*[other] 正在使用 { $amount } 个追踪器
|
||||
}
|
||||
settings-interface-behavior-error_tracking = 通过 Sentry.io 收集错误信息
|
||||
settings-interface-behavior-error_tracking-description_v2 =
|
||||
<h1>您是否同意收集匿名的错误信息?</h1>
|
||||
|
||||
<b>我们不会收集您的个人信息</b> ,例如您的 IP 地址或 WiFi 信息。SlimeVR 重视您的隐私!
|
||||
|
||||
为了提供最佳用户体验,我们会收集匿名错误报告、性能指标和操作系统信息。这有助于我们检测 SlimeVR 的错误和问题。这些指标将通过 Sentry.io 收集。
|
||||
settings-interface-behavior-error_tracking-label = 向开发人员发送错误信息
|
||||
|
||||
## Serial settings
|
||||
|
||||
@@ -656,6 +679,13 @@ settings-osc-vrchat-description-v1 =
|
||||
settings-osc-vrchat-enable = 启用
|
||||
settings-osc-vrchat-enable-description = 切换数据的发送和接收
|
||||
settings-osc-vrchat-enable-label = 启用
|
||||
settings-osc-vrchat-oscqueryEnabled = 启用 OSCQuery
|
||||
settings-osc-vrchat-oscqueryEnabled-description =
|
||||
OSCQuery 会自动检测正在运行的 VRChat 并向其发送数据。
|
||||
它还可以向 VRChat 通告自身,以便接收头戴显示器和控制器数据。
|
||||
要允许从 VRChat 接收头戴显示器和控制器数据,请进入主菜单的设置
|
||||
并启用“允许发送头部和手腕VR追踪OSC数据”。
|
||||
settings-osc-vrchat-oscqueryEnabled-label = 启用 OSCQuery
|
||||
settings-osc-vrchat-network = 网络端口
|
||||
settings-osc-vrchat-network-description-v1 = 设置传输OSC数据的端口。用于VRChat时无需修改。
|
||||
settings-osc-vrchat-network-port_in =
|
||||
@@ -733,9 +763,12 @@ settings-utils-advanced-reset_warning =
|
||||
}
|
||||
settings-utils-advanced-reset_warning-reset = 重置设置
|
||||
settings-utils-advanced-reset_warning-cancel = 取消
|
||||
settings-utils-advanced-open_data = 数据文件夹
|
||||
settings-utils-advanced-open_data-description = 在文件管理器中打开SlimeVR的数据文件夹,查看配置文件与日志文件。
|
||||
settings-utils-advanced-open_data-v1 = 配置文件夹
|
||||
settings-utils-advanced-open_data-description-v1 = 在文件管理器中打开SlimeVR的配置文件夹,查看配置文件。
|
||||
settings-utils-advanced-open_data-label = 打开文件夹
|
||||
settings-utils-advanced-open_logs = 日志文件夹
|
||||
settings-utils-advanced-open_logs-description = 在文件管理器中打开SlimeVR的日志文件夹,查看SlimeVR的日志文件。
|
||||
settings-utils-advanced-open_logs-label = 打开文件夹
|
||||
|
||||
## Setup/onboarding menu
|
||||
|
||||
@@ -1007,47 +1040,20 @@ onboarding-automatic_mounting-put_trackers_on-title = 穿戴好追踪器
|
||||
onboarding-automatic_mounting-put_trackers_on-description = 为了校准佩戴方向,我们将使用你刚才分配的追踪器。戴上你所有的追踪器,你可以在右边的图中看到哪个追踪器对应哪个。
|
||||
onboarding-automatic_mounting-put_trackers_on-next = 所有的追踪器都已开启!
|
||||
|
||||
## Tracker proportions method choose
|
||||
|
||||
onboarding-choose_proportions = 使用哪种方法校准身体比例?
|
||||
# Multiline string
|
||||
onboarding-choose_proportions-description-v1 =
|
||||
身体比例记录了你身体各部分的尺寸。它们被用来计算虚拟追踪器的位置。
|
||||
如果保存的身体比例和实际身体尺寸不匹配,追踪精度将会下降,并且会出现脚在地面滑动,或是身体和虚拟形象动作不一致的情况。
|
||||
<b>身体比例设置只要进行一次!</b> 除非身体比例存在错误或是身体尺寸发生了改变,否则不需要重复进行身体比例设置。
|
||||
onboarding-choose_proportions-auto_proportions = 自动调整身体比例
|
||||
# Italicized text
|
||||
onboarding-choose_proportions-auto_proportions-subtitle = 推荐
|
||||
onboarding-choose_proportions-auto_proportions-descriptionv3 =
|
||||
这将录制你的运动样本并通过算法来推测你的身体比例。
|
||||
|
||||
<b>需要戴上头戴设备,并确保设备已连接到 SlimeVR!</b>
|
||||
onboarding-choose_proportions-manual_proportions = 手动调整身体比例
|
||||
# Italicized text
|
||||
onboarding-choose_proportions-manual_proportions-subtitle = 用于精细调整
|
||||
onboarding-choose_proportions-manual_proportions-description = 这将需要你手动修改以调整你的身体比例
|
||||
onboarding-choose_proportions-scaled_proportions = 标准身体比例
|
||||
# Italized text
|
||||
onboarding-choose_proportions-scaled_proportions-subtitle = 推荐新用户使用
|
||||
# Multiline string
|
||||
onboarding-choose_proportions-scaled_proportions-description =
|
||||
这将根据您的身高和平均人体比例设置身体比例,可以获得基本的全身跟踪效果。
|
||||
|
||||
<b>这需要将您的头戴显示器 (HMD) 连接到 SlimeVR 并戴在头上!</b>
|
||||
onboarding-choose_proportions-scaled_proportions-button = 标准身体比例
|
||||
onboarding-choose_proportions-export = 导出身体比例
|
||||
onboarding-choose_proportions-import = 导入身体比例
|
||||
onboarding-choose_proportions-import-success = 导入成功
|
||||
onboarding-choose_proportions-import-failed = 导入失败
|
||||
onboarding-choose_proportions-file_type = 身体比例文件
|
||||
|
||||
## Tracker manual proportions setup
|
||||
## Tracker manual proportions setupa
|
||||
|
||||
onboarding-manual_proportions-back = 返回重置教程
|
||||
onboarding-manual_proportions-title = 手动调整身体比例
|
||||
onboarding-manual_proportions-precision = 精确调整
|
||||
onboarding-manual_proportions-auto = 自动校准
|
||||
onboarding-manual_proportions-ratio = 按比例分组调整
|
||||
onboarding-manual_proportions-fine_tuning_button = 自动微调身体比例
|
||||
onboarding-manual_proportions-fine_tuning_button-disabled-tooltip = 请连接 VR头戴显示器 以使用自动微调
|
||||
onboarding-manual_proportions-export = 导出身体比例
|
||||
onboarding-manual_proportions-import = 导入身体比例
|
||||
onboarding-manual_proportions-import-success = 导入成功
|
||||
onboarding-manual_proportions-import-failed = 导入失败
|
||||
onboarding-manual_proportions-file_type = 身体比例文件
|
||||
|
||||
## Tracker automatic proportions setup
|
||||
|
||||
@@ -1068,10 +1074,10 @@ onboarding-automatic_proportions-requirements-descriptionv2 =
|
||||
你的头戴设备正在向 SlimeVR 服务器回报位置信息(通常需要 SteamVR 正在运行且通过 SlimeVR 的 SteamVR 驱动连接到 SlimeVR)。
|
||||
你的追踪器正常工作并能反应实际运动(进行过完整重置和佩戴重置,踢腿、弯腰、坐下等动作时虚拟骨骼向正确的方向弯曲)。
|
||||
onboarding-automatic_proportions-requirements-next = 我已阅读
|
||||
onboarding-automatic_proportions-check_height-title-v2 = 测量你的身高
|
||||
onboarding-automatic_proportions-check_height-title-v3 = 测量你的头戴显示器的高度
|
||||
onboarding-automatic_proportions-check_height-description-v2 = 您的头戴显示器 (HMD) 高度应略小于您的身高,因为头戴显示器会测量您眼睛的高度。此测量值将用作计算您身体比例的基准。
|
||||
# All the text is in bold!
|
||||
onboarding-automatic_proportions-check_height-calculation_warning-v2 = 在 <u>直立</u> 时开始测量以计算您的身高。小心不要将手举到高于头显,它们可能会影响测量结果!
|
||||
onboarding-automatic_proportions-check_height-calculation_warning-v3 = 在 <u>站直</u> 时开始测量以计算您的身高。注意不要将手举过头显,不然可能会影响测量结果!
|
||||
onboarding-automatic_proportions-check_height-guardian_tip =
|
||||
如果你正在使用一体机进行串流,请确保开启并设置了安全边界,
|
||||
以获取正确的高度信息。
|
||||
@@ -1086,9 +1092,10 @@ onboarding-automatic_proportions-check_height-next_step = 数值没问题
|
||||
onboarding-automatic_proportions-check_floor_height-title = 测量您的地板高度(可选)
|
||||
onboarding-automatic_proportions-check_floor_height-description = 在某些情况下,头戴显示器可能无法正确设置地板高度,从而导致头显测得的身高高于实际身高。您可以测量地板的“高度”以校正头显的高度。
|
||||
# All the text is in bold!
|
||||
onboarding-automatic_proportions-check_floor_height-calculation_warning = 如果您确定您的地板高度是正确的,则可以跳过此步骤。
|
||||
onboarding-automatic_proportions-check_floor_height-calculation_warning-v2 = 开始测量并将控制器放在地板上以测量地板高度。如果您确定您的地板高度是正确的,则可以跳过此步骤。
|
||||
# Shows an element below it
|
||||
onboarding-automatic_proportions-check_floor_height-floor_height = 您的地板高度为:
|
||||
onboarding-automatic_proportions-check_floor_height-full_height = 估计您的身高为:
|
||||
onboarding-automatic_proportions-check_floor_height-measure-start = 开始测量
|
||||
onboarding-automatic_proportions-check_floor_height-measure-stop = 停止测量
|
||||
onboarding-automatic_proportions-check_floor_height-measure-reset = 重试测量
|
||||
@@ -1134,10 +1141,18 @@ onboarding-automatic_proportions-smol_warning-cancel = 返回
|
||||
onboarding-scaled_proportions-title = 标准身体比例
|
||||
onboarding-scaled_proportions-description = 为了让 SlimeVR 追踪器正常使用,我们需要知道你的骨头的长度。将会使用人体平均骨骼比例,并缩放至您的身高。
|
||||
onboarding-scaled_proportions-manual_height-title = 配置您的身高
|
||||
onboarding-scaled_proportions-manual_height-description = 您的头戴显示器 (HMD) 高度应略小于您的身高,因为头戴显示器会测量您眼睛的高度。此高度将用作计算您身体比例的基准。
|
||||
onboarding-scaled_proportions-manual_height-description-v2 = 此身高将用作您身体比例的基准。
|
||||
onboarding-scaled_proportions-manual_height-missing_steamvr = SteamVR 当前未连接到 SlimeVR,因此不能基于您的头戴显示器进行测量。 <b>请连接后再继续操作或查看文档!</b>
|
||||
onboarding-scaled_proportions-manual_height-height = 您的头戴显示器的高度是
|
||||
onboarding-scaled_proportions-manual_height-height-v2 = 您的身高为
|
||||
onboarding-scaled_proportions-manual_height-estimated_height = 估计您的头显高度为:
|
||||
onboarding-scaled_proportions-manual_height-next_step = 保存并继续
|
||||
onboarding-scaled_proportions-manual_height-warning =
|
||||
您当前正在手动设置缩放身体比例!
|
||||
<b>建议只在您不使用头戴显示器时使用此模式</b>
|
||||
|
||||
为了能够使用自动缩放身体比例,请:
|
||||
onboarding-scaled_proportions-manual_height-warning-no_hmd = 连接 VR 头戴显示器
|
||||
onboarding-scaled_proportions-manual_height-warning-no_controllers = 确保您的控制器已连接并正确分配到手部
|
||||
|
||||
## Tracker scaled proportions reset
|
||||
|
||||
@@ -1267,7 +1282,7 @@ firmware_tool-build_step = 构建中
|
||||
firmware_tool-build_step-description = 固件正在构建中,请稍候
|
||||
firmware_tool-flashing_step = 固件烧录中
|
||||
firmware_tool-flashing_step-description = 正在向追踪器烧录固件,请按照屏幕上的指示操作
|
||||
firmware_tool-flashing_step-warning = 除非特别指示,在固件传输过程中请勿断开或重启追踪器,否则可能会导致您的电路板无法使用
|
||||
firmware_tool-flashing_step-warning-v2 = 除非特别指示,在固件传输过程中请勿断开或关闭追踪器,否则可能会导致您的电路板无法使用
|
||||
firmware_tool-flashing_step-flash_more = 烧录更多的追踪器
|
||||
firmware_tool-flashing_step-exit = 退出
|
||||
|
||||
@@ -1285,7 +1300,7 @@ firmware_tool-build-ERROR = 无法构建固件
|
||||
## Firmware update status
|
||||
|
||||
firmware_update-status-DOWNLOADING = 正在下载固件
|
||||
firmware_update-status-NEED_MANUAL_REBOOT = 等待用户重启追踪器
|
||||
firmware_update-status-NEED_MANUAL_REBOOT-v2 = 请关闭您的追踪器,然后再重新打开
|
||||
firmware_update-status-AUTHENTICATING = 正在确认追踪器连接
|
||||
firmware_update-status-UPLOADING = 正在传输固件
|
||||
firmware_update-status-SYNCING_WITH_MCU = 正在与追踪器同步
|
||||
@@ -1339,3 +1354,13 @@ unknown_device-modal-description =
|
||||
要将它连接到 SlimeVR 吗?
|
||||
unknown_device-modal-confirm = 是的!
|
||||
unknown_device-modal-forget = 忽略它
|
||||
|
||||
## Error collection consent modal
|
||||
|
||||
error_collection_modal-title = 我们可以收集错误信息吗?
|
||||
error_collection_modal-description_v2 =
|
||||
{ settings-interface-behavior-error_tracking-description_v2 }
|
||||
|
||||
您可以稍后在设置页面的行为部分中更改此设置。
|
||||
error_collection_modal-confirm = 我同意
|
||||
error_collection_modal-cancel = 还是算了
|
||||
@@ -111,29 +111,120 @@ board_type-GLOVE_IMU_SLIMEVR_DEV = SlimeVR Dev IMU 手套
|
||||
|
||||
skeleton_bone-NONE = 無
|
||||
skeleton_bone-HEAD = 頭部偏移
|
||||
skeleton_bone-HEAD-desc =
|
||||
這是從頭戴顯示器到頭中央的距離。
|
||||
若要調整,請左右搖頭(如不同意、否定般的樣子)並不要移動身體,檢查其他
|
||||
追蹤器的數值跳動並變更此參數,直到數值跳動小到可以忽略不計。
|
||||
skeleton_bone-NECK = 頸部長度
|
||||
skeleton_bone-NECK-desc =
|
||||
這是從頭中央到脖子底部的距離。
|
||||
若要調整,請上下點頭(如同意、肯定般的樣子)並不要移動身體,檢查其他
|
||||
追蹤器的數值跳動並變更此參數,直到數值跳動小到可以忽略不計。
|
||||
skeleton_bone-torso_group = 軀幹長度
|
||||
skeleton_bone-torso_group-desc =
|
||||
這是從脖子底部到臀部的距離。
|
||||
若要調整,請站立並調整此參數,直到虛擬的臀部與實際臀部對齊。
|
||||
skeleton_bone-UPPER_CHEST = 上胸長度
|
||||
skeleton_bone-UPPER_CHEST-desc =
|
||||
這是從脖子底部到胸部中間的距離。
|
||||
若要調整,請適當調整軀幹長度,檢查各種姿勢(坐下、彎腰、躺下等)並進行
|
||||
修改,直到虛擬的脊椎與實際脊椎對齊。
|
||||
skeleton_bone-CHEST_OFFSET = 胸部偏移
|
||||
skeleton_bone-CHEST_OFFSET-desc =
|
||||
調整胸部追蹤器的上下補償。某些遊戲或是應用程式可能會期待追蹤器比較上面
|
||||
或下面,可以透過調整本數值來校正。
|
||||
skeleton_bone-CHEST = 胸部長度
|
||||
skeleton_bone-CHEST-desc =
|
||||
這是從胸部中間到脊椎中間的距離。
|
||||
若要調整,請適當調整軀幹長度,檢查各種姿勢(坐下、彎腰、躺下等)並進行
|
||||
修改,直到虛擬的脊椎與實際脊椎對齊。
|
||||
skeleton_bone-WAIST = 腰部長度
|
||||
skeleton_bone-WAIST-desc =
|
||||
這是從脊椎中間到肚臍的距離。
|
||||
若要調整,請適當調整軀幹長度,檢查各種姿勢(坐下、彎腰、躺下等)並進行
|
||||
修改,直到虛擬的脊椎與實際脊椎對齊。
|
||||
skeleton_bone-HIP = 臀部長度
|
||||
skeleton_bone-HIP-desc =
|
||||
這是從肚臍到臀部的距離。
|
||||
若要調整,請適當調整軀幹長度,檢查各種姿勢(坐下、彎腰、躺下等)並進行
|
||||
修改,直到虛擬的脊椎與實際脊椎對齊。
|
||||
skeleton_bone-HIP_OFFSET = 臀部偏移
|
||||
skeleton_bone-HIP_OFFSET-desc =
|
||||
調整臀部追蹤器的上下補償。某些遊戲或是應用程式可能會期待追蹤器在腰部,
|
||||
可以透過調整本數值來校正。
|
||||
skeleton_bone-HIPS_WIDTH = 臀部寬度
|
||||
skeleton_bone-HIPS_WIDTH-desc =
|
||||
這是兩腿之間的起始距離。
|
||||
若要調整,請站直進行完整重置後,修改到虛擬的腿部與實際腿部對齊。
|
||||
skeleton_bone-leg_group = 腿部長度
|
||||
skeleton_bone-leg_group-desc =
|
||||
這是從臀部到腳部的距離。
|
||||
若要調整,請適當調整軀幹長度後,修改此數值,直到虛擬的腳部
|
||||
與實際腳部的高度一致。
|
||||
skeleton_bone-UPPER_LEG = 大腿長度
|
||||
skeleton_bone-UPPER_LEG-desc =
|
||||
這是從臀部到膝蓋的距離。
|
||||
若要調整,請適當調整腿部長度後,修改此數值,直到虛擬的膝蓋
|
||||
與實際膝蓋的高度一致。
|
||||
skeleton_bone-LOWER_LEG = 小腿長度
|
||||
skeleton_bone-LOWER_LEG-desc =
|
||||
這是從膝蓋到腳踝的距離。
|
||||
若要調整,請適當調整腿部長度後,修改此數值,直到虛擬的膝蓋
|
||||
與實際膝蓋的高度一致。
|
||||
skeleton_bone-FOOT_LENGTH = 腳部長度
|
||||
skeleton_bone-FOOT_LENGTH-desc =
|
||||
這是從腳踝到腳趾的距離。
|
||||
若要調整,請踮起腳尖,修改此數值,直到虛擬的腳部與實際腳部對齊。
|
||||
skeleton_bone-FOOT_SHIFT = 腳部偏移
|
||||
skeleton_bone-FOOT_SHIFT-desc =
|
||||
這是從膝蓋到腳踝的水平距離。
|
||||
這個數值可以校正站直時小腿會向後移動的問題。
|
||||
若要調整,請將腳部長度設為 0,進行完整重置後再修改,直到虛擬腳部與
|
||||
腳踝中間對齊。
|
||||
skeleton_bone-SKELETON_OFFSET = 骨骼偏移
|
||||
skeleton_bone-SKELETON_OFFSET-desc =
|
||||
調整全部追蹤器的向前或向後補償。某些遊戲或是應用程式可能會期待追蹤器
|
||||
比較前面,可以透過調整本數值來校正。
|
||||
skeleton_bone-SHOULDERS_DISTANCE = 肩膀距離
|
||||
skeleton_bone-SHOULDERS_DISTANCE-desc =
|
||||
這是從脖子底部到肩膀的垂直距離。
|
||||
若要調整,請將上臂長度設為 0 再修改,直到虛擬的肘部追蹤器與
|
||||
實際的肩膀垂直對齊。
|
||||
skeleton_bone-SHOULDERS_WIDTH = 肩膀寬度
|
||||
skeleton_bone-SHOULDERS_WIDTH-desc =
|
||||
這是從脖子底部到肩膀的水平距離。
|
||||
若要調整,請將上臂長度設為 0 再修改,直到虛擬的肘部追蹤器與
|
||||
實際的肩膀水平對齊。
|
||||
skeleton_bone-arm_group = 手臂長度
|
||||
skeleton_bone-arm_group-desc =
|
||||
這是從肩膀到手腕的距離。
|
||||
若要調整,請適當調整肩膀距離,將手部距離 Y 設定為 0 再修改,
|
||||
直到虛擬的手部追蹤器與手腕對齊。
|
||||
skeleton_bone-UPPER_ARM = 上臂長度
|
||||
skeleton_bone-UPPER_ARM-desc =
|
||||
這是從肩膀到手肘的距離。
|
||||
若要調整,請適當調整手臂長度後,修改此數值,直到虛擬的
|
||||
手肘追蹤器與實際手肘的位置一致。
|
||||
skeleton_bone-LOWER_ARM = 前臂長度
|
||||
skeleton_bone-LOWER_ARM-desc =
|
||||
這是從手肘到手腕的距離。
|
||||
若要調整,請適當調整手臂長度後,修改此數值,直到虛擬的
|
||||
手肘追蹤器與實際手肘的位置一致。
|
||||
skeleton_bone-HAND_Y = 手部距離Y
|
||||
skeleton_bone-HAND_Y-desc =
|
||||
這是從手腕到手中間的垂直距離。
|
||||
若要調整以進行動作捕捉,請適當調整手臂長度後修改此數值,直到虛擬的手部追蹤器
|
||||
與實際的手中間垂直對齊。
|
||||
若要調整以從控制器進行肘部跟蹤,請將手臂長度設為 0 後修改此數值,直到虛擬的肘
|
||||
部追蹤器與實際的手腕垂直對齊。
|
||||
skeleton_bone-HAND_Z = 手部距離Z
|
||||
skeleton_bone-HAND_Z-desc =
|
||||
這是從手腕到手中間的水平距離。
|
||||
若要調整以進行動作捕捉,請將此值設定為 0。
|
||||
若要調整以從控制器進行肘部跟蹤,請將手臂長度設為 0 後修改此數值,直到虛擬的肘
|
||||
部追蹤器與實際的手腕水平對齊。
|
||||
skeleton_bone-ELBOW_OFFSET = 肘部偏移
|
||||
skeleton_bone-ELBOW_OFFSET-desc = 將虛擬的肘部追蹤器向上或向下調整,以避免 VRChat 將肘部追蹤器綁到胸部。
|
||||
|
||||
## Tracker reset buttons
|
||||
|
||||
@@ -199,7 +290,7 @@ widget-developer_mode = 開發者選項
|
||||
widget-developer_mode-high_contrast = 高對比 UI
|
||||
widget-developer_mode-precise_rotation = 顯示精確旋轉
|
||||
widget-developer_mode-fast_data_feed = 快速資料更新
|
||||
widget-developer_mode-filter_slimes_and_hmd = 只顯示 Slime 追蹤器與頭戴顯示器
|
||||
widget-developer_mode-filter_slimes_and_hmd = 只顯示 SlimeVR 追蹤器與頭戴顯示器
|
||||
widget-developer_mode-sort_by_name = 依名稱排序
|
||||
widget-developer_mode-raw_slime_rotation = 顯示原始旋轉
|
||||
widget-developer_mode-more_info = 更多資訊
|
||||
@@ -306,6 +397,7 @@ tracker-settings-forget = 忘記追蹤器
|
||||
tracker-settings-forget-description = 從 SlimeVR 伺服器程式中移除該追蹤器,且直到重新啟動伺服器前不會再次連接。該追蹤器的設定不會遺失。
|
||||
tracker-settings-forget-label = 忘記追蹤器
|
||||
tracker-settings-update-unavailable = 無法更新 (DIY)
|
||||
tracker-settings-update-low-battery = 無法更新,電池電量低於 50%
|
||||
tracker-settings-update-up_to_date = 已為最新版本
|
||||
tracker-settings-update-available = 版本 { $versionName } 可供更新
|
||||
tracker-settings-update = 立即更新
|
||||
@@ -387,6 +479,7 @@ settings-sidebar-appearance = 外觀
|
||||
settings-sidebar-notifications = 通知
|
||||
settings-sidebar-behavior = 行為
|
||||
settings-sidebar-firmware-tool = DIY 韌體工具
|
||||
settings-sidebar-vrc_warnings = VRChat 配置警告
|
||||
settings-sidebar-advanced = 進階
|
||||
|
||||
## SteamVR settings
|
||||
@@ -558,6 +651,9 @@ settings-general-gesture_control-numberTrackersOverThreshold-description = 如
|
||||
## Appearance settings
|
||||
|
||||
settings-interface-appearance = 外觀
|
||||
settings-general-interface-dev_mode = 開發者模式
|
||||
settings-general-interface-dev_mode-description = 本功能會提供更深入的資料,也能與已連線的追蹤器進行更進一步的控制。
|
||||
settings-general-interface-dev_mode-label = 開發者模式
|
||||
settings-general-interface-theme = 佈景主題色彩
|
||||
settings-general-interface-show-navbar-onboarding = 在導覽列上顯示「{ navbar-onboarding }」
|
||||
settings-general-interface-show-navbar-onboarding-description = 本選項變更 「{ navbar-onboarding }」 按鈕是否要顯示在導覽列上。
|
||||
@@ -574,7 +670,7 @@ settings-interface-appearance-font-slime_font = 預設字體
|
||||
settings-interface-appearance-font_size = 文字縮放
|
||||
settings-interface-appearance-font_size-description = 本設定會影響整個 UI 的文字大小,除了本設定面板以外。
|
||||
settings-interface-appearance-decorations = 使用系統原生的視窗邊框
|
||||
settings-interface-appearance-decorations-description = 不顯示標題列 UI,替換成作業系統提供的標題列。
|
||||
settings-interface-appearance-decorations-description = 不顯示標題列 UI,使用作業系統提供的標題列。
|
||||
settings-interface-appearance-decorations-label = 使用原生的視窗邊框
|
||||
|
||||
## Notification settings
|
||||
@@ -678,8 +774,8 @@ settings-osc-vrchat-oscqueryEnabled = 啟用 OSCQuery
|
||||
settings-osc-vrchat-oscqueryEnabled-description =
|
||||
OSCQuery 會自動偵測並發送數據給正在執行中的 VRChat 程式。
|
||||
也會把自己廣告給其他應用程式,以接收頭戴顯示器與控制器的數據。
|
||||
要允許從 VRChat 接收頭戴顯示器與控制器的數據,請進入主功能表的設定
|
||||
並啟用「允許透過 OSC 發送頭部與腕部的 VR 追蹤數據」。
|
||||
要允許從 VRChat 接收頭戴顯示器與控制器的數據,請進入主選單的設定
|
||||
在「追蹤 & IK」下,啟用「允許透過 OSC 發送頭部與腕部的 VR 追蹤數據」。
|
||||
settings-osc-vrchat-oscqueryEnabled-label = 啟用 OSCQuery
|
||||
settings-osc-vrchat-network = 連接埠
|
||||
settings-osc-vrchat-network-description-v1 = 設定收發追蹤器資料的連接埠埠號,使用 VRChat 不須更改。
|
||||
@@ -855,6 +951,17 @@ onboarding-connect_tracker-connection_status-looking_for_server = 正在尋找
|
||||
onboarding-connect_tracker-connection_status-connection_error = 無法連線到 Wi-Fi
|
||||
onboarding-connect_tracker-connection_status-could_not_find_server = 未尋找到可用的伺服器
|
||||
onboarding-connect_tracker-connection_status-done = 已連線到伺服器
|
||||
onboarding-connect_tracker-connection_status-no_serial_log = 無法從追蹤器取得紀錄訊息
|
||||
onboarding-connect_tracker-connection_status-no_serial_device_found = 無法透過 USB 找到追蹤器
|
||||
onboarding-connect_serial-error-modal-no_serial_log = 追蹤器電源開了嗎?
|
||||
onboarding-connect_serial-error-modal-no_serial_log-desc = 請確認追蹤器電源已開啟,並連接到這台電腦上
|
||||
onboarding-connect_serial-error-modal-no_serial_device_found = 找不到追蹤器
|
||||
onboarding-connect_serial-error-modal-no_serial_device_found-desc =
|
||||
請使用隨附的 USB 傳輸線將追蹤器連接到你的電腦後,再打開追蹤器電源。
|
||||
如果還是不行,請嘗試以下操作:
|
||||
- 使用另一條 USB 傳輸線
|
||||
- 使用另一個 USB 插座
|
||||
- 重新安裝 SlimeVR 伺服器程式,然後在安裝元件部分將「USB drivers」打勾
|
||||
# $amount (Number) - Amount of trackers connected (this is a number, but you can use CLDR plural rules for your language)
|
||||
# More info on https://www.unicode.org/cldr/cldr-aux/charts/22/supplemental/language_plural_rules.html
|
||||
# English in this case only has 2 plural rules, which are "one" and "other",
|
||||
@@ -1039,16 +1146,16 @@ onboarding-automatic_mounting-put_trackers_on-next = 我所有的追蹤器都戴
|
||||
|
||||
onboarding-manual_proportions-back = 返回重置教學
|
||||
onboarding-manual_proportions-title = 手動調整軀幹比例
|
||||
onboarding-manual_proportions-precision = 精確調整
|
||||
onboarding-manual_proportions-auto = 進行自動校正
|
||||
onboarding-manual_proportions-ratio = 依比例分組調整
|
||||
onboarding-manual_proportions-fine_tuning_button = 自動微調軀幹比例
|
||||
onboarding-manual_proportions-fine_tuning_button-disabled-tooltip = 請連接 VR 頭戴顯示器以使用此功能
|
||||
onboarding-manual_proportions-export = 匯出軀幹比例
|
||||
onboarding-manual_proportions-import = 匯入軀幹比例
|
||||
onboarding-manual_proportions-import-success = 匯入成功
|
||||
onboarding-manual_proportions-import-failed = 匯入失敗
|
||||
onboarding-manual_proportions-file_type = 軀幹比例描述檔
|
||||
onboarding-manual_proportions-normal_increment = 正常調整
|
||||
onboarding-manual_proportions-precise_increment = 精確調整
|
||||
onboarding-manual_proportions-grouped_proportions = 分組調整軀幹比例
|
||||
onboarding-manual_proportions-all_proportions = 全部軀幹比例
|
||||
onboarding-manual_proportions-estimated_height = 預估的使用者身高
|
||||
|
||||
## Tracker automatic proportions setup
|
||||
|
||||
@@ -1277,7 +1384,7 @@ firmware_tool-build_step = 建置中
|
||||
firmware_tool-build_step-description = 韌體正在建置中,請稍後
|
||||
firmware_tool-flashing_step = 燒錄中
|
||||
firmware_tool-flashing_step-description = 追蹤器燒錄中,請遵循畫面上的指示
|
||||
firmware_tool-flashing_step-warning = 除非特別指示,燒錄中請勿移除或是重啟追蹤器,否則可能導致主板無法使用。
|
||||
firmware_tool-flashing_step-warning-v2 = 除非特別指示,燒錄中請勿移除或是關閉追蹤器,否則可能導致主板無法使用
|
||||
firmware_tool-flashing_step-flash_more = 燒錄更多追蹤器
|
||||
firmware_tool-flashing_step-exit = 離開
|
||||
|
||||
@@ -1295,7 +1402,7 @@ firmware_tool-build-ERROR = 無法建置韌體
|
||||
## Firmware update status
|
||||
|
||||
firmware_update-status-DOWNLOADING = 正在下載韌體
|
||||
firmware_update-status-NEED_MANUAL_REBOOT = 請重新啟動追蹤器
|
||||
firmware_update-status-NEED_MANUAL_REBOOT-v2 = 請關閉追蹤器的電源再打開
|
||||
firmware_update-status-AUTHENTICATING = 正在與 MCU 認證
|
||||
firmware_update-status-UPLOADING = 正在上傳韌體
|
||||
firmware_update-status-SYNCING_WITH_MCU = 正在與 MCU 同步
|
||||
@@ -1350,6 +1457,46 @@ unknown_device-modal-description =
|
||||
要將它連接到 SlimeVR 嗎?
|
||||
unknown_device-modal-confirm = 好喔!
|
||||
unknown_device-modal-forget = 別管它
|
||||
# VRChat config warnings
|
||||
vrc_config-page-title = VRChat 設定警告
|
||||
vrc_config-page-desc = 本頁會顯示 VRChat 的設定並顯示哪些設定與 SlimeVR 不相容。非常建議您根據這裡顯示的警告來修改設定,以獲得最佳的 SlimeVR 使用體驗。
|
||||
vrc_config-page-help = 找不到設定在哪裡嗎?
|
||||
vrc_config-page-help-desc = 請查閱<a>本主題的相關文件</a>
|
||||
vrc_config-page-big_menu = 追蹤 & IK(主選單)
|
||||
vrc_config-page-big_menu-desc = 主選單中與 IK (逆向運動學)相關的設定
|
||||
vrc_config-page-wrist_menu = 追蹤 & IK(快速選單)
|
||||
vrc_config-page-wrist_menu-desc = 快速選單中與 IK (逆向運動學)相關的設定
|
||||
vrc_config-on = 開啟
|
||||
vrc_config-off = 關閉
|
||||
vrc_config-invalid = VRChat 的設定設錯了!
|
||||
vrc_config-show_more = 顯示更多
|
||||
vrc_config-setting_name = VRChat 設定名稱
|
||||
vrc_config-recommended_value = 建議設定
|
||||
vrc_config-current_value = 目前設定
|
||||
vrc_config-mute = 將警告靜音
|
||||
vrc_config-mute-btn = 靜音
|
||||
vrc_config-unmute-btn = 取消靜音
|
||||
vrc_config-legacy_mode = 使用傳統 IK 解決方案
|
||||
vrc_config-disable_shoulder_tracking = 停用肩膀追蹤
|
||||
vrc_config-shoulder_width_compensation = 肩寬補償
|
||||
vrc_config-spine_mode = FBT 脊椎模式
|
||||
vrc_config-tracker_model = FBT 追蹤器形狀
|
||||
vrc_config-avatar_measurement_type = 角色測量
|
||||
vrc_config-calibration_range = 校正範圍
|
||||
vrc_config-calibration_visuals = 顯示 FBT 校正範圍
|
||||
vrc_config-user_height = 用戶真實身高
|
||||
vrc_config-spine_mode-UNKNOWN = 不明
|
||||
vrc_config-spine_mode-LOCK_BOTH = 同時鎖定
|
||||
vrc_config-spine_mode-LOCK_HEAD = 鎖定頭部
|
||||
vrc_config-spine_mode-LOCK_HIP = 鎖定臀部
|
||||
vrc_config-tracker_model-UNKNOWN = 不明
|
||||
vrc_config-tracker_model-AXIS = 軸
|
||||
vrc_config-tracker_model-BOX = 箱型
|
||||
vrc_config-tracker_model-SPHERE = 球型
|
||||
vrc_config-tracker_model-SYSTEM = 系統
|
||||
vrc_config-avatar_measurement_type-UNKNOWN = 不明
|
||||
vrc_config-avatar_measurement_type-HEIGHT = 身高
|
||||
vrc_config-avatar_measurement_type-ARM_SPAN = 臂展
|
||||
|
||||
## Error collection consent modal
|
||||
|
||||
|
||||
Binary file not shown.
@@ -1,9 +1,10 @@
|
||||
import { useLayoutEffect } from 'react';
|
||||
import { useConfig } from './hooks/config';
|
||||
import { Outlet } from 'react-router-dom';
|
||||
import { Outlet, useNavigate } from 'react-router-dom';
|
||||
|
||||
export function AppLayout() {
|
||||
const { config } = useConfig();
|
||||
const navigate = useNavigate();
|
||||
|
||||
useLayoutEffect(() => {
|
||||
if (!config) return;
|
||||
@@ -26,6 +27,12 @@ export function AppLayout() {
|
||||
}
|
||||
}, [config]);
|
||||
|
||||
useLayoutEffect(() => {
|
||||
if (config && !config.doneOnboarding) {
|
||||
navigate('/onboarding/home');
|
||||
}
|
||||
}, [config?.doneOnboarding]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Outlet />
|
||||
|
||||
@@ -21,6 +21,7 @@ import { ClearMountingButton } from './ClearMountingButton';
|
||||
import { ToggleableSkeletonVisualizerWidget } from './widgets/SkeletonVisualizerWidget';
|
||||
import { useAtomValue } from 'jotai';
|
||||
import { flatTrackersAtom } from '@/store/app-store';
|
||||
import { A } from './commons/A';
|
||||
|
||||
function UnprioritizedStatuses() {
|
||||
const { l10n } = useLocalization();
|
||||
@@ -38,6 +39,11 @@ function UnprioritizedStatuses() {
|
||||
id={`status_system-${StatusData[status.dataType]}`}
|
||||
vars={parseStatusToLocale(status, trackers, l10n)}
|
||||
key={status.id}
|
||||
elems={{
|
||||
PublicFixLink: (
|
||||
<A href="https://docs.slimevr.dev/common-issues.html#network-profile-is-currently-set-to-public"></A>
|
||||
),
|
||||
}}
|
||||
>
|
||||
<TipBox whitespace={false} hideIcon>
|
||||
{`Warning, you should fix ${StatusData[status.dataType]}`}
|
||||
|
||||
@@ -10,6 +10,7 @@ export function BaseModal({
|
||||
}: {
|
||||
isOpen: boolean;
|
||||
children: ReactNode;
|
||||
appendClasses?: string;
|
||||
important?: boolean;
|
||||
closeable?: boolean;
|
||||
} & ReactModal.Props) {
|
||||
@@ -31,7 +32,8 @@ export function BaseModal({
|
||||
classNames(
|
||||
'items-center focus:ring-transparent focus:ring-offset-transparent',
|
||||
'focus:outline-transparent outline-none bg-background-60 p-6 rounded-lg m-2',
|
||||
'text-background-10'
|
||||
'text-background-10',
|
||||
props.appendClasses
|
||||
)
|
||||
}
|
||||
>
|
||||
|
||||
@@ -2,7 +2,8 @@ import { useLocalization } from '@fluent/react';
|
||||
import { useEffect, useMemo, useContext } from 'react';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import { useConfig } from '@/hooks/config';
|
||||
import { langs, LangContext } from '@/i18n/config';
|
||||
import { LangContext } from '@/i18n/config';
|
||||
import { langs } from '@/i18n/names';
|
||||
import { Dropdown, DropdownDirection } from './Dropdown';
|
||||
|
||||
export function LangSelector({
|
||||
@@ -20,7 +21,21 @@ export function LangSelector({
|
||||
});
|
||||
|
||||
const languagesItems = useMemo(
|
||||
() => langs.map(({ key, name }) => ({ label: name, value: key })),
|
||||
() =>
|
||||
langs.map(({ key, name, emoji }) => ({
|
||||
component: (
|
||||
<div>
|
||||
<img
|
||||
draggable="false"
|
||||
className="inline-block w-auto h-[1em] -translate-y-[0.05em]"
|
||||
src={emoji}
|
||||
/>
|
||||
{' ' + name}
|
||||
</div>
|
||||
),
|
||||
label: name,
|
||||
value: key,
|
||||
})),
|
||||
[]
|
||||
);
|
||||
|
||||
|
||||
@@ -5,12 +5,12 @@ export function WifiIcon({
|
||||
value,
|
||||
disabled = false,
|
||||
}: {
|
||||
value: number;
|
||||
value: number | null;
|
||||
disabled?: boolean;
|
||||
}) {
|
||||
const percent = useMemo(
|
||||
() =>
|
||||
value
|
||||
value != null
|
||||
? Math.max(
|
||||
Math.min(((value - -95) * (100 - 0)) / (-40 - -95) + 0, 100)
|
||||
) / 100
|
||||
@@ -18,7 +18,7 @@ export function WifiIcon({
|
||||
[value]
|
||||
);
|
||||
|
||||
const y = useMemo(() => (percent ? (1 - percent) * 13 : 0), [percent]);
|
||||
const y = useMemo(() => (1 - percent) * 13, [percent]);
|
||||
|
||||
const col = useMemo(() => {
|
||||
const colorsMap: { [key: number]: string } = {
|
||||
|
||||
@@ -55,8 +55,8 @@ export function checkForUpdate(
|
||||
|
||||
if (
|
||||
canUpdate &&
|
||||
device.hardwareStatus?.batteryPctEstimate &&
|
||||
device.hardwareStatus?.batteryPctEstimate < 50
|
||||
device.hardwareStatus?.batteryPctEstimate != null &&
|
||||
device.hardwareStatus.batteryPctEstimate < 50
|
||||
) {
|
||||
return 'low-battery';
|
||||
}
|
||||
@@ -101,12 +101,12 @@ const DeviceList = ({
|
||||
|
||||
const StatusList = ({ status }: { status: Record<string, UpdateStatus> }) => {
|
||||
const statusKeys = Object.keys(status);
|
||||
const devices = useAtomValue(devicesAtom);
|
||||
|
||||
return statusKeys.map((id, index) => {
|
||||
const val = status[id];
|
||||
|
||||
if (!val) throw new Error('there should always be a val');
|
||||
const devices = useAtomValue(devicesAtom);
|
||||
|
||||
const device = devices.find(({ id: dId }) => id === dId?.id.toString());
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import { useNavigate } from 'react-router-dom';
|
||||
import {
|
||||
RpcMessage,
|
||||
StartWifiProvisioningRequestT,
|
||||
StatusData,
|
||||
StopWifiProvisioningRequestT,
|
||||
WifiProvisioningStatus,
|
||||
WifiProvisioningStatusResponseT,
|
||||
@@ -15,13 +16,16 @@ import { ArrowLink } from '@/components/commons/ArrowLink';
|
||||
import { Button } from '@/components/commons/Button';
|
||||
import { LoaderIcon, SlimeState } from '@/components/commons/icon/LoaderIcon';
|
||||
import { ProgressBar } from '@/components/commons/ProgressBar';
|
||||
import { TipBox } from '@/components/commons/TipBox';
|
||||
import { TipBox, WarningBox } from '@/components/commons/TipBox';
|
||||
import { Typography } from '@/components/commons/Typography';
|
||||
import { TrackerCard } from '@/components/tracker/TrackerCard';
|
||||
import { useIsRestCalibrationTrackers } from '@/hooks/imu-logic';
|
||||
import './ConnectTracker.scss';
|
||||
import { useAtomValue } from 'jotai';
|
||||
import { connectedIMUTrackersAtom } from '@/store/app-store';
|
||||
import { BaseModal } from '@/components/commons/BaseModal';
|
||||
import { useStatusContext } from '@/hooks/status-system';
|
||||
import { A } from '@/components/commons/A';
|
||||
|
||||
const statusLabelMap = {
|
||||
[WifiProvisioningStatus.NONE]:
|
||||
@@ -42,12 +46,25 @@ const statusLabelMap = {
|
||||
'onboarding-connect_tracker-connection_status-connection_error',
|
||||
[WifiProvisioningStatus.COULD_NOT_FIND_SERVER]:
|
||||
'onboarding-connect_tracker-connection_status-could_not_find_server',
|
||||
[WifiProvisioningStatus.NO_SERIAL_LOGS_ERROR]:
|
||||
'onboarding-connect_tracker-connection_status-no_serial_log',
|
||||
[WifiProvisioningStatus.NO_SERIAL_DEVICE_FOUND]:
|
||||
'onboarding-connect_tracker-connection_status-no_serial_device_found',
|
||||
};
|
||||
|
||||
const errorLabelMap = {
|
||||
[WifiProvisioningStatus.NO_SERIAL_LOGS_ERROR]:
|
||||
'onboarding-connect_serial-error-modal-no_serial_log',
|
||||
[WifiProvisioningStatus.NO_SERIAL_DEVICE_FOUND]:
|
||||
'onboarding-connect_serial-error-modal-no_serial_device_found',
|
||||
};
|
||||
|
||||
const statusProgressMap = {
|
||||
[WifiProvisioningStatus.NONE]: 0,
|
||||
[WifiProvisioningStatus.SERIAL_INIT]: 0.2,
|
||||
[WifiProvisioningStatus.NO_SERIAL_DEVICE_FOUND]: 0.2,
|
||||
[WifiProvisioningStatus.OBTAINING_MAC_ADDRESS]: 0.3,
|
||||
[WifiProvisioningStatus.NO_SERIAL_LOGS_ERROR]: 0.3,
|
||||
[WifiProvisioningStatus.PROVISIONING]: 0.4,
|
||||
[WifiProvisioningStatus.CONNECTING]: 0.6,
|
||||
[WifiProvisioningStatus.LOOKING_FOR_SERVER]: 0.8,
|
||||
@@ -58,12 +75,15 @@ const statusProgressMap = {
|
||||
|
||||
export function ConnectTrackersPage() {
|
||||
const { l10n } = useLocalization();
|
||||
const { statuses } = useStatusContext();
|
||||
|
||||
const connectedIMUTrackers = useAtomValue(connectedIMUTrackersAtom);
|
||||
const { applyProgress, state } = useOnboarding();
|
||||
const navigate = useNavigate();
|
||||
const { sendRPCPacket, useRPCPacket } = useWebsocketAPI();
|
||||
const [provisioningStatus, setProvisioningStatus] =
|
||||
useState<WifiProvisioningStatus>(WifiProvisioningStatus.NONE);
|
||||
const [ignoreError, setIgnoreError] = useState(false);
|
||||
|
||||
applyProgress(0.4);
|
||||
|
||||
@@ -94,9 +114,22 @@ export function ConnectTrackersPage() {
|
||||
}
|
||||
);
|
||||
|
||||
const isError =
|
||||
provisioningStatus === WifiProvisioningStatus.CONNECTION_ERROR ||
|
||||
provisioningStatus === WifiProvisioningStatus.COULD_NOT_FIND_SERVER;
|
||||
const isError = useMemo(
|
||||
() =>
|
||||
[
|
||||
WifiProvisioningStatus.CONNECTION_ERROR,
|
||||
WifiProvisioningStatus.COULD_NOT_FIND_SERVER,
|
||||
WifiProvisioningStatus.NO_SERIAL_LOGS_ERROR,
|
||||
WifiProvisioningStatus.NO_SERIAL_DEVICE_FOUND,
|
||||
].includes(provisioningStatus),
|
||||
[provisioningStatus]
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (isError) {
|
||||
setIgnoreError(false);
|
||||
}
|
||||
}, [isError]);
|
||||
|
||||
const progressBarClass = useMemo(() => {
|
||||
if (isError) {
|
||||
@@ -121,7 +154,7 @@ export function ConnectTrackersPage() {
|
||||
default:
|
||||
return SlimeState.JUMPY;
|
||||
}
|
||||
}, [provisioningStatus]);
|
||||
}, [provisioningStatus, isError]);
|
||||
|
||||
const currentTip = useMemo(
|
||||
() =>
|
||||
@@ -131,126 +164,193 @@ export function ConnectTrackersPage() {
|
||||
[connectedIMUTrackers.length]
|
||||
);
|
||||
|
||||
const filteredStatuses = useMemo(() => {
|
||||
return Object.entries(statuses).filter(
|
||||
([, value]) => value.dataType == StatusData.StatusPublicNetwork
|
||||
);
|
||||
}, [statuses]);
|
||||
|
||||
return (
|
||||
<div className="connect-tracker-layout h-full">
|
||||
<div style={{ gridArea: 's' }} className="p-4">
|
||||
<Typography variant="main-title">
|
||||
{l10n.getString('onboarding-connect_tracker-title')}
|
||||
</Typography>
|
||||
<Typography color="secondary">
|
||||
{l10n.getString('onboarding-connect_tracker-description-p0-v1')}
|
||||
</Typography>
|
||||
<Typography color="secondary">
|
||||
{l10n.getString('onboarding-connect_tracker-description-p1-v1')}
|
||||
</Typography>
|
||||
<div className="flex flex-col gap-2 py-5">
|
||||
<ArrowLink
|
||||
to="/settings/serial"
|
||||
state={{ SerialPort: 'Auto' }}
|
||||
direction="right"
|
||||
variant={state.alonePage ? 'boxed-2' : 'boxed'}
|
||||
>
|
||||
{l10n.getString('onboarding-connect_tracker-issue-serial')}
|
||||
</ArrowLink>
|
||||
</div>
|
||||
<Localized
|
||||
id={currentTip}
|
||||
elems={{ em: <em className="italic"></em>, b: <b></b> }}
|
||||
>
|
||||
<TipBox>Conditional tip</TipBox>
|
||||
</Localized>
|
||||
|
||||
<div
|
||||
className={classNames(
|
||||
'rounded-xl h-24 flex gap-2 p-3 lg:w-full mt-4 relative',
|
||||
state.alonePage ? 'bg-background-60' : 'bg-background-70',
|
||||
isError && 'border-2 border-status-critical'
|
||||
)}
|
||||
>
|
||||
<div
|
||||
className={classNames(
|
||||
'flex flex-col justify-center fill-background-10 absolute',
|
||||
'right-5 bottom-8'
|
||||
)}
|
||||
>
|
||||
<LoaderIcon slimeState={slimeStatus}></LoaderIcon>
|
||||
</div>
|
||||
|
||||
<div className="flex flex-col grow self-center">
|
||||
<Typography bold>
|
||||
{l10n.getString('onboarding-connect_tracker-usb')}
|
||||
</Typography>
|
||||
<div className="flex fill-background-10 gap-1">
|
||||
<Typography color="secondary">
|
||||
{l10n.getString(statusLabelMap[provisioningStatus])}
|
||||
</Typography>
|
||||
</div>
|
||||
<ProgressBar
|
||||
progress={statusProgressMap[provisioningStatus]}
|
||||
height={14}
|
||||
animated={true}
|
||||
colorClass={progressBarClass}
|
||||
></ProgressBar>
|
||||
<>
|
||||
<BaseModal
|
||||
isOpen={
|
||||
!ignoreError &&
|
||||
[
|
||||
WifiProvisioningStatus.NO_SERIAL_LOGS_ERROR,
|
||||
WifiProvisioningStatus.NO_SERIAL_DEVICE_FOUND,
|
||||
].includes(provisioningStatus)
|
||||
}
|
||||
appendClasses={'w-xl max-w-xl mobile:w-full'}
|
||||
closeable
|
||||
onRequestClose={() => {
|
||||
setIgnoreError(true);
|
||||
}}
|
||||
>
|
||||
<div className="flex flex-col items-center gap-2 ">
|
||||
<Localized id={(errorLabelMap as any)[provisioningStatus]}>
|
||||
<Typography variant="main-title"></Typography>
|
||||
</Localized>
|
||||
<Localized id={`${(errorLabelMap as any)[provisioningStatus]}-desc`}>
|
||||
<Typography
|
||||
variant="standard"
|
||||
whitespace="whitespace-pre-wrap"
|
||||
block
|
||||
></Typography>
|
||||
</Localized>
|
||||
<video
|
||||
src="/videos/turn-on-tracker.webm"
|
||||
loop
|
||||
autoPlay
|
||||
className="w-full aspect-video rounded-md mt-2"
|
||||
></video>
|
||||
<div className="flex gap-3 pt-5 justify-end w-full">
|
||||
<Button
|
||||
variant="tertiary"
|
||||
onClick={() => {
|
||||
setIgnoreError(true);
|
||||
}}
|
||||
>
|
||||
Close
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-row mt-4 gap-3">
|
||||
<Button
|
||||
variant="secondary"
|
||||
state={{ alonePage: state.alonePage }}
|
||||
to="/onboarding/wifi-creds"
|
||||
</BaseModal>
|
||||
<div className="connect-tracker-layout h-full">
|
||||
<div style={{ gridArea: 's' }} className="p-4">
|
||||
<Typography variant="main-title">
|
||||
{l10n.getString('onboarding-connect_tracker-title')}
|
||||
</Typography>
|
||||
<Typography color="secondary">
|
||||
{l10n.getString('onboarding-connect_tracker-description-p0-v1')}
|
||||
</Typography>
|
||||
<Typography color="secondary">
|
||||
{l10n.getString('onboarding-connect_tracker-description-p1-v1')}
|
||||
</Typography>
|
||||
<div className="flex flex-col gap-2 py-5">
|
||||
<ArrowLink
|
||||
to="/settings/serial"
|
||||
state={{ SerialPort: 'Auto' }}
|
||||
direction="right"
|
||||
variant={state.alonePage ? 'boxed-2' : 'boxed'}
|
||||
>
|
||||
{l10n.getString('onboarding-connect_tracker-issue-serial')}
|
||||
</ArrowLink>
|
||||
</div>
|
||||
<Localized
|
||||
id={currentTip}
|
||||
elems={{ em: <em className="italic"></em>, b: <b></b> }}
|
||||
>
|
||||
{state.alonePage
|
||||
? l10n.getString('onboarding-connect_tracker-back')
|
||||
: l10n.getString('onboarding-previous_step')}
|
||||
</Button>
|
||||
<Button
|
||||
variant="primary"
|
||||
to={
|
||||
state.alonePage
|
||||
? '/'
|
||||
: bnoExists
|
||||
? '/onboarding/calibration-tutorial'
|
||||
: '/onboarding/assign-tutorial'
|
||||
}
|
||||
className="ml-auto"
|
||||
>
|
||||
{l10n.getString('onboarding-connect_tracker-next')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<div style={{ gridArea: 't' }} className="flex items-center px-5">
|
||||
<Typography color="secondary" bold>
|
||||
{l10n.getString('onboarding-connect_tracker-connected_trackers', {
|
||||
amount: connectedIMUTrackers.length,
|
||||
})}
|
||||
</Typography>
|
||||
</div>
|
||||
<div style={{ gridArea: 'c' }} className="xs:overflow-y-auto">
|
||||
<div className="grid lg:grid-cols-2 md:grid-cols-1 gap-2 pr-1 mx-5 py-4">
|
||||
{Array.from({
|
||||
...connectedIMUTrackers,
|
||||
length: Math.max(connectedIMUTrackers.length, 1),
|
||||
}).map((tracker, index) => (
|
||||
<div key={index}>
|
||||
{!tracker && (
|
||||
<div
|
||||
className={classNames(
|
||||
'rounded-xl h-16 animate-pulse',
|
||||
state.alonePage ? 'bg-background-80' : 'bg-background-70'
|
||||
)}
|
||||
></div>
|
||||
)}
|
||||
{tracker && (
|
||||
<TrackerCard
|
||||
tracker={tracker.tracker}
|
||||
device={tracker.device}
|
||||
smol
|
||||
></TrackerCard>
|
||||
)}
|
||||
<TipBox>Conditional tip</TipBox>
|
||||
</Localized>
|
||||
{filteredStatuses.map(([, status]) => (
|
||||
<div className="pt-4">
|
||||
<Localized
|
||||
key={status.id}
|
||||
id={`status_system-${StatusData[status.dataType]}`}
|
||||
elems={{
|
||||
PublicFixLink: (
|
||||
<A href="https://docs.slimevr.dev/common-issues.html#network-profile-is-currently-set-to-public"></A>
|
||||
),
|
||||
}}
|
||||
>
|
||||
<WarningBox whitespace={false}>
|
||||
{`Warning, you should fix ${StatusData[status.dataType]}`}
|
||||
</WarningBox>
|
||||
</Localized>
|
||||
</div>
|
||||
))}
|
||||
<div
|
||||
className={classNames(
|
||||
'rounded-xl h-24 flex gap-2 p-3 lg:w-full mt-4 relative',
|
||||
state.alonePage ? 'bg-background-60' : 'bg-background-70',
|
||||
isError && 'border-2 border-status-critical'
|
||||
)}
|
||||
>
|
||||
<div
|
||||
className={classNames(
|
||||
'flex flex-col justify-center fill-background-10 absolute',
|
||||
'right-5 bottom-8'
|
||||
)}
|
||||
>
|
||||
<LoaderIcon slimeState={slimeStatus}></LoaderIcon>
|
||||
</div>
|
||||
|
||||
<div className="flex flex-col grow self-center">
|
||||
<Typography bold>
|
||||
{l10n.getString('onboarding-connect_tracker-usb')}
|
||||
</Typography>
|
||||
<div className="flex fill-background-10 gap-1">
|
||||
<Typography color="secondary">
|
||||
{l10n.getString(statusLabelMap[provisioningStatus])}
|
||||
</Typography>
|
||||
</div>
|
||||
<ProgressBar
|
||||
progress={statusProgressMap[provisioningStatus]}
|
||||
height={14}
|
||||
animated={true}
|
||||
colorClass={progressBarClass}
|
||||
></ProgressBar>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-row mt-4 gap-3">
|
||||
<Button
|
||||
variant="secondary"
|
||||
state={{ alonePage: state.alonePage }}
|
||||
to="/onboarding/wifi-creds"
|
||||
>
|
||||
{state.alonePage
|
||||
? l10n.getString('onboarding-connect_tracker-back')
|
||||
: l10n.getString('onboarding-previous_step')}
|
||||
</Button>
|
||||
<Button
|
||||
variant="primary"
|
||||
to={
|
||||
state.alonePage
|
||||
? '/'
|
||||
: bnoExists
|
||||
? '/onboarding/calibration-tutorial'
|
||||
: '/onboarding/assign-tutorial'
|
||||
}
|
||||
className="ml-auto"
|
||||
>
|
||||
{l10n.getString('onboarding-connect_tracker-next')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<div style={{ gridArea: 't' }} className="flex items-center px-5">
|
||||
<Typography color="secondary" bold>
|
||||
{l10n.getString('onboarding-connect_tracker-connected_trackers', {
|
||||
amount: connectedIMUTrackers.length,
|
||||
})}
|
||||
</Typography>
|
||||
</div>
|
||||
<div style={{ gridArea: 'c' }} className="xs:overflow-y-auto">
|
||||
<div className="grid lg:grid-cols-2 md:grid-cols-1 gap-2 pr-1 mx-5 py-4">
|
||||
{Array.from({
|
||||
...connectedIMUTrackers,
|
||||
length: Math.max(connectedIMUTrackers.length, 1),
|
||||
}).map((tracker, index) => (
|
||||
<div key={index}>
|
||||
{!tracker && (
|
||||
<div
|
||||
className={classNames(
|
||||
'rounded-xl h-16 animate-pulse',
|
||||
state.alonePage ? 'bg-background-80' : 'bg-background-70'
|
||||
)}
|
||||
></div>
|
||||
)}
|
||||
{tracker && (
|
||||
<TrackerCard
|
||||
tracker={tracker.tracker}
|
||||
device={tracker.device}
|
||||
smol
|
||||
></TrackerCard>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import { DEFAULT_LOCALE, LangContext } from '@/i18n/config';
|
||||
import { getSentryOrCompute } from '@/utils/sentry';
|
||||
|
||||
const config = await loadConfig();
|
||||
|
||||
if (config?.errorTracking !== undefined) {
|
||||
// load sentry ASAP to catch early errors
|
||||
getSentryOrCompute(config.errorTracking ?? false);
|
||||
|
||||
@@ -8,9 +8,11 @@ import { useForm } from 'react-hook-form';
|
||||
import { useLocalization } from '@fluent/react';
|
||||
import { useLocation, useNavigate } from 'react-router-dom';
|
||||
import './SettingsLayout.scss';
|
||||
import { useVRCConfig } from '@/hooks/vrc-config';
|
||||
|
||||
export function SettingSelectorMobile() {
|
||||
const { l10n } = useLocalization();
|
||||
const { state: vrcConfigState } = useVRCConfig();
|
||||
const navigate = useNavigate();
|
||||
const { pathname } = useLocation();
|
||||
|
||||
@@ -44,6 +46,14 @@ export function SettingSelectorMobile() {
|
||||
label: l10n.getString('settings-sidebar-firmware-tool'),
|
||||
value: { url: '/settings/firmware-tool' },
|
||||
},
|
||||
...(vrcConfigState?.isSupported
|
||||
? [
|
||||
{
|
||||
label: l10n.getString('settings-sidebar-vrc_warnings'),
|
||||
value: { url: '/vrc-warnings' },
|
||||
},
|
||||
]
|
||||
: []),
|
||||
{
|
||||
label: l10n.getString('settings-sidebar-advanced'),
|
||||
value: { url: '/settings/advanced' },
|
||||
|
||||
@@ -3,6 +3,7 @@ import { ReactNode, useMemo } from 'react';
|
||||
import { NavLink, useLocation, useMatch } from 'react-router-dom';
|
||||
import { Typography } from '@/components/commons/Typography';
|
||||
import { useLocalization } from '@fluent/react';
|
||||
import { useVRCConfig } from '@/hooks/vrc-config';
|
||||
|
||||
export function SettingsLink({
|
||||
to,
|
||||
@@ -41,6 +42,7 @@ export function SettingsLink({
|
||||
|
||||
export function SettingsSidebar() {
|
||||
const { l10n } = useLocalization();
|
||||
const { state: vrcConfigState } = useVRCConfig();
|
||||
|
||||
return (
|
||||
<div className="flex flex-col px-5 py-5 gap-3 overflow-y-auto bg-background-70 rounded-lg h-full">
|
||||
@@ -107,6 +109,13 @@ export function SettingsSidebar() {
|
||||
{l10n.getString('settings-sidebar-firmware-tool')}
|
||||
</SettingsLink>
|
||||
</div>
|
||||
{vrcConfigState?.isSupported && (
|
||||
<div className="flex flex-col gap-2">
|
||||
<SettingsLink to="/vrc-warnings">
|
||||
{l10n.getString('settings-sidebar-vrc_warnings')}
|
||||
</SettingsLink>
|
||||
</div>
|
||||
)}
|
||||
<div className="flex flex-col gap-2">
|
||||
<SettingsLink to="/settings/advanced">
|
||||
{l10n.getString('settings-sidebar-advanced')}
|
||||
|
||||
@@ -27,25 +27,32 @@ export function TrackerBattery({
|
||||
minimumFractionDigits: 2,
|
||||
});
|
||||
|
||||
const charging = (voltage || 0) > 4.3;
|
||||
const showVoltage = voltage && config?.debug;
|
||||
|
||||
return (
|
||||
<div className="flex gap-2">
|
||||
<div className="flex flex-col justify-around">
|
||||
<BatteryIcon
|
||||
value={value}
|
||||
disabled={disabled}
|
||||
charging={(voltage || 0) > 4.3}
|
||||
/>
|
||||
</div>
|
||||
<div className="w-10">
|
||||
<Typography color={textColor}>
|
||||
{percentFormatter.format(value)}
|
||||
</Typography>
|
||||
{voltage && config?.debug && (
|
||||
<Typography color={textColor}>
|
||||
{voltageFormatter.format(voltage)}V
|
||||
</Typography>
|
||||
)}
|
||||
<BatteryIcon value={value} disabled={disabled} charging={charging} />
|
||||
</div>
|
||||
{((!charging || showVoltage) && (
|
||||
<div className="w-10">
|
||||
{!charging && (
|
||||
<Typography color={textColor}>
|
||||
{percentFormatter.format(value)}
|
||||
</Typography>
|
||||
)}
|
||||
{showVoltage && (
|
||||
<Typography color={textColor}>
|
||||
{voltageFormatter.format(voltage)}V
|
||||
</Typography>
|
||||
)}
|
||||
</div>
|
||||
)) || (
|
||||
<div className="flex flex-col justify-center w-10">
|
||||
<div className="w-5 h-1 bg-background-30 rounded-full"></div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
import { useConfig } from '@/hooks/config';
|
||||
import { MouseEventHandler } from 'react';
|
||||
import {
|
||||
DeviceDataT,
|
||||
@@ -69,6 +70,8 @@ function TrackerBig({
|
||||
tracker: TrackerDataT;
|
||||
device?: DeviceDataT;
|
||||
}) {
|
||||
const { config } = useConfig();
|
||||
|
||||
const { useName } = useTracker(tracker);
|
||||
|
||||
const trackerName = useName();
|
||||
@@ -86,10 +89,10 @@ function TrackerBig({
|
||||
<div className="flex justify-center">
|
||||
<TrackerStatus status={tracker.status}></TrackerStatus>
|
||||
</div>
|
||||
<div className="flex text-default justify-center gap-5 flex-wrap">
|
||||
<div className="min-h-9 flex text-default justify-center gap-5 flex-wrap items-center">
|
||||
{device && device.hardwareStatus && (
|
||||
<>
|
||||
{device.hardwareStatus.batteryPctEstimate && (
|
||||
{device.hardwareStatus.batteryPctEstimate != null && (
|
||||
<TrackerBattery
|
||||
voltage={device.hardwareStatus.batteryVoltage}
|
||||
value={device.hardwareStatus.batteryPctEstimate / 100}
|
||||
@@ -100,8 +103,9 @@ function TrackerBig({
|
||||
{(device.hardwareStatus.rssi != null ||
|
||||
device.hardwareStatus.ping != null) && (
|
||||
<TrackerWifi
|
||||
rssi={device.hardwareStatus.rssi || 0}
|
||||
ping={device.hardwareStatus.ping || 0}
|
||||
rssi={device.hardwareStatus.rssi}
|
||||
rssiShowNumeric={config?.debug}
|
||||
ping={device.hardwareStatus.ping}
|
||||
disabled={tracker.status === TrackerStatusEnum.DISCONNECTED}
|
||||
></TrackerWifi>
|
||||
)}
|
||||
@@ -138,7 +142,7 @@ function TrackerSmol({
|
||||
{device && device.hardwareStatus && (
|
||||
<>
|
||||
<div className="flex flex-col justify-center items-center">
|
||||
{device.hardwareStatus.batteryPctEstimate && (
|
||||
{device.hardwareStatus.batteryPctEstimate != null && (
|
||||
<TrackerBattery
|
||||
voltage={device.hardwareStatus.batteryVoltage}
|
||||
value={device.hardwareStatus.batteryPctEstimate / 100}
|
||||
@@ -150,8 +154,8 @@ function TrackerSmol({
|
||||
{(device.hardwareStatus.rssi != null ||
|
||||
device.hardwareStatus.ping != null) && (
|
||||
<TrackerWifi
|
||||
rssi={device.hardwareStatus.rssi || 0}
|
||||
ping={device.hardwareStatus.ping || 0}
|
||||
rssi={device.hardwareStatus.rssi}
|
||||
ping={device.hardwareStatus.ping}
|
||||
disabled={tracker.status === TrackerStatusEnum.DISCONNECTED}
|
||||
></TrackerWifi>
|
||||
)}
|
||||
@@ -200,10 +204,11 @@ export function TrackerCard({
|
||||
<div
|
||||
onClick={onClick}
|
||||
className={classNames(
|
||||
'rounded-lg overflow-hidden',
|
||||
'rounded-lg overflow-hidden transition-[box-shadow] duration-200 ease-linear',
|
||||
interactable && 'hover:bg-background-50 cursor-pointer',
|
||||
outlined && 'outline outline-2 outline-accent-background-40',
|
||||
warning && 'border-status-warning border-solid border-2',
|
||||
warning &&
|
||||
'outline outline-2 -outline-offset-2 outline-status-warning',
|
||||
bg
|
||||
)}
|
||||
style={
|
||||
|
||||
@@ -78,7 +78,7 @@ export function TrackerPartCard({
|
||||
(showCard && (
|
||||
<div
|
||||
className={classNames(
|
||||
'flex flex-col gap-1 control xs:w-32 hover:bg-background-50 px-2 py-1 rounded-md relative',
|
||||
'flex flex-col gap-1 control xs:w-32 hover:bg-background-50 px-2 py-1 rounded-md relative transition-[box-shadow] duration-200 ease-linear',
|
||||
direction === 'left' ? 'items-start' : 'items-end'
|
||||
)}
|
||||
id={BodyPart[role]}
|
||||
|
||||
@@ -8,8 +8,8 @@ export function TrackerWifi({
|
||||
disabled,
|
||||
textColor = 'secondary',
|
||||
}: {
|
||||
rssi: number;
|
||||
ping: number;
|
||||
rssi: number | null;
|
||||
ping: number | null;
|
||||
rssiShowNumeric?: boolean;
|
||||
disabled?: boolean;
|
||||
textColor?: string;
|
||||
@@ -19,19 +19,20 @@ export function TrackerWifi({
|
||||
<div className="flex flex-col justify-around">
|
||||
<WifiIcon value={rssi} disabled={disabled} />
|
||||
</div>
|
||||
{!disabled && (
|
||||
{(!disabled && (ping != null || (rssiShowNumeric && rssi != null)) && (
|
||||
<div className="w-12">
|
||||
<Typography color={textColor} whitespace="whitespace-nowrap">
|
||||
{ping} ms
|
||||
</Typography>
|
||||
{rssiShowNumeric && (
|
||||
{ping != null && (
|
||||
<Typography color={textColor} whitespace="whitespace-nowrap">
|
||||
{ping} ms
|
||||
</Typography>
|
||||
)}
|
||||
{rssiShowNumeric && rssi != null && (
|
||||
<Typography color={textColor} whitespace="whitespace-nowrap">
|
||||
{rssi} dBm
|
||||
</Typography>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
{disabled && (
|
||||
)) || (
|
||||
<div className="flex flex-col justify-center w-12">
|
||||
<div className="w-7 h-1 bg-background-30 rounded-full"></div>
|
||||
</div>
|
||||
|
||||
@@ -141,13 +141,13 @@ export function RowContainer({
|
||||
)}px rgb(var(--accent-background-30))`,
|
||||
}}
|
||||
className={classNames(
|
||||
'h-[50px] flex flex-col justify-center px-3',
|
||||
rounded === 'left' && 'rounded-l-lg',
|
||||
rounded === 'right' && 'rounded-r-lg',
|
||||
'h-[50px] flex flex-col justify-center px-3 transition-[box-shadow] duration-200 ease-linear',
|
||||
rounded === 'left' && 'rounded-l-lg border-l-2',
|
||||
rounded === 'right' && 'rounded-r-lg border-r-2',
|
||||
hover ? 'bg-background-50 cursor-pointer' : 'bg-background-60',
|
||||
warning && 'border-status-warning border-solid border-t-2 border-b-2',
|
||||
rounded === 'left' && warning && 'border-l-2',
|
||||
rounded === 'right' && warning && 'border-r-2'
|
||||
(warning &&
|
||||
'border-status-warning border-solid border-t-2 border-b-2') ||
|
||||
'border-transparent'
|
||||
)}
|
||||
>
|
||||
{children}
|
||||
@@ -273,10 +273,10 @@ export function TrackersTable({
|
||||
id: DisplayColumn.BATTERY,
|
||||
label: l10n.getString('tracker-table-column-battery'),
|
||||
row: ({ device, tracker }) =>
|
||||
device?.hardwareStatus?.batteryPctEstimate && (
|
||||
device?.hardwareStatus?.batteryPctEstimate != null && (
|
||||
<TrackerBattery
|
||||
value={device.hardwareStatus.batteryPctEstimate / 100}
|
||||
voltage={device.hardwareStatus?.batteryVoltage}
|
||||
voltage={device.hardwareStatus.batteryVoltage}
|
||||
disabled={tracker.status === TrackerStatusEnum.DISCONNECTED}
|
||||
textColor={fontColor}
|
||||
/>
|
||||
@@ -290,9 +290,9 @@ export function TrackersTable({
|
||||
(device?.hardwareStatus?.rssi != null ||
|
||||
device?.hardwareStatus?.ping != null) && (
|
||||
<TrackerWifi
|
||||
rssi={device?.hardwareStatus?.rssi || 0}
|
||||
rssi={device?.hardwareStatus?.rssi}
|
||||
rssiShowNumeric
|
||||
ping={device?.hardwareStatus?.ping || 0}
|
||||
ping={device?.hardwareStatus?.ping}
|
||||
disabled={tracker.status === TrackerStatusEnum.DISCONNECTED}
|
||||
textColor={fontColor}
|
||||
></TrackerWifi>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Typography } from '@/components/commons/Typography';
|
||||
import { ReactNode } from 'react';
|
||||
import {} from 'solarxr-protocol';
|
||||
import { CheckIcon } from '@/components/commons/icon/CheckIcon';
|
||||
import { WarningIcon } from '@/components/commons/icon/WarningIcon';
|
||||
import {
|
||||
@@ -8,22 +7,28 @@ import {
|
||||
spineModeTranslationMap,
|
||||
trackerModelTranslationMap,
|
||||
useVRCConfig,
|
||||
VRCConfigStateSupported,
|
||||
} from '@/hooks/vrc-config';
|
||||
import { Localized, useLocalization } from '@fluent/react';
|
||||
import classNames from 'classnames';
|
||||
import { useLocaleConfig } from '@/i18n/config';
|
||||
import { A } from '@/components/commons/A';
|
||||
import { Button } from '@/components/commons/Button';
|
||||
|
||||
export function SettingRow({
|
||||
function SettingRow({
|
||||
name,
|
||||
valid,
|
||||
value,
|
||||
recommendedValue,
|
||||
muted,
|
||||
mute,
|
||||
}: {
|
||||
valid: boolean;
|
||||
name: string;
|
||||
recommendedValue: ReactNode;
|
||||
value: ReactNode;
|
||||
valid: boolean;
|
||||
muted: boolean;
|
||||
mute: () => void;
|
||||
}) {
|
||||
return (
|
||||
<tr className="group border-b border-background-60">
|
||||
@@ -41,21 +46,65 @@ export function SettingRow({
|
||||
<td
|
||||
className={classNames(
|
||||
'px-6 py-4 text-end items-center',
|
||||
!valid && 'text-status-warning'
|
||||
!valid && !muted && 'text-status-warning'
|
||||
)}
|
||||
>
|
||||
{value}
|
||||
</td>
|
||||
<td
|
||||
className={classNames('px-6 py-4 text-end items-end justify-end flex')}
|
||||
>
|
||||
<Localized id={muted ? 'vrc_config-unmute-btn' : 'vrc_config-mute-btn'}>
|
||||
<Button
|
||||
variant="secondary"
|
||||
className="min-w-24"
|
||||
onClick={mute}
|
||||
></Button>
|
||||
</Localized>
|
||||
</td>
|
||||
</tr>
|
||||
);
|
||||
}
|
||||
|
||||
function Table({ children }: { children: ReactNode }) {
|
||||
return (
|
||||
<table className="min-w-full divide-y divide-background-50">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" className="px-6 py-3 text-start">
|
||||
<Localized id={'vrc_config-setting_name'}>
|
||||
<Typography />
|
||||
</Localized>
|
||||
</th>
|
||||
|
||||
<th scope="col" className="px-6 py-3 text-end">
|
||||
<Localized id={'vrc_config-recommended_value'}>
|
||||
<Typography />
|
||||
</Localized>
|
||||
</th>
|
||||
<th scope="col" className="px-6 py-3 text-end">
|
||||
<Localized id={'vrc_config-current_value'}>
|
||||
<Typography />
|
||||
</Localized>
|
||||
</th>
|
||||
<th scope="col" className="px-6 py-3 text-end">
|
||||
<Localized id={'vrc_config-mute'}>
|
||||
<Typography />
|
||||
</Localized>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>{children}</tbody>
|
||||
</table>
|
||||
);
|
||||
}
|
||||
|
||||
const onOffKey = (value: boolean) =>
|
||||
value ? 'vrc_config-on' : 'vrc_config-off';
|
||||
|
||||
export function VRCWarningsPage() {
|
||||
const { l10n } = useLocalization();
|
||||
const { state } = useVRCConfig();
|
||||
const { state, toggleMutedSettings, mutedSettings } = useVRCConfig();
|
||||
const { currentLocales } = useLocaleConfig();
|
||||
|
||||
const meterFormat = Intl.NumberFormat(currentLocales, {
|
||||
@@ -68,6 +117,12 @@ export function VRCWarningsPage() {
|
||||
return <></>;
|
||||
}
|
||||
|
||||
const settingRowProps = (key: keyof VRCConfigStateSupported['validity']) => ({
|
||||
mute: () => toggleMutedSettings(key),
|
||||
muted: mutedSettings.includes(key),
|
||||
valid: state.validity[key] == true,
|
||||
});
|
||||
|
||||
return (
|
||||
<div className="flex flex-col p-4 w-full">
|
||||
<div className="flex flex-col max-w-lg mobile:w-full gap-3">
|
||||
@@ -89,126 +144,104 @@ export function VRCWarningsPage() {
|
||||
<Localized id="vrc_config-page-big_menu-desc">
|
||||
<Typography color="secondary" />
|
||||
</Localized>
|
||||
<table className="min-w-full divide-y divide-background-50">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" className="px-6 py-3 text-start">
|
||||
<Localized id={'vrc_config-setting_name'}>
|
||||
<Typography />
|
||||
</Localized>
|
||||
</th>
|
||||
|
||||
<th scope="col" className="px-6 py-3 text-end">
|
||||
<Localized id={'vrc_config-recommended_value'}>
|
||||
<Typography />
|
||||
</Localized>
|
||||
</th>
|
||||
<th scope="col" className="px-6 py-3 text-end">
|
||||
<Localized id={'vrc_config-current_value'}>
|
||||
<Typography />
|
||||
</Localized>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<SettingRow
|
||||
name="vrc_config-user_height"
|
||||
recommendedValue={meterFormat.format(
|
||||
state.recommended.userHeight
|
||||
)}
|
||||
value={meterFormat.format(state.state.userHeight)}
|
||||
valid={state.validity.userHeightOk}
|
||||
></SettingRow>
|
||||
<SettingRow
|
||||
name="vrc_config-legacy_mode"
|
||||
recommendedValue={
|
||||
<Localized
|
||||
id={onOffKey(state.recommended.legacyMode)}
|
||||
></Localized>
|
||||
}
|
||||
value={
|
||||
<Localized
|
||||
id={onOffKey(state.state.legacyMode)}
|
||||
></Localized>
|
||||
}
|
||||
valid={state.validity.legacyModeOk}
|
||||
></SettingRow>
|
||||
<SettingRow
|
||||
name="vrc_config-disable_shoulder_tracking"
|
||||
recommendedValue={
|
||||
<Localized
|
||||
id={onOffKey(
|
||||
state.recommended.shoulderTrackingDisabled
|
||||
)}
|
||||
></Localized>
|
||||
}
|
||||
value={
|
||||
<Localized
|
||||
id={onOffKey(state.state.shoulderTrackingDisabled)}
|
||||
></Localized>
|
||||
}
|
||||
valid={state.validity.shoulderTrackingOk}
|
||||
></SettingRow>
|
||||
<SettingRow
|
||||
name="vrc_config-shoulder_width_compensation"
|
||||
recommendedValue={
|
||||
<Localized
|
||||
id={onOffKey(
|
||||
state.recommended.shoulderWidthCompensation
|
||||
)}
|
||||
></Localized>
|
||||
}
|
||||
value={
|
||||
<Localized
|
||||
id={onOffKey(state.state.shoulderWidthCompensation)}
|
||||
></Localized>
|
||||
}
|
||||
valid={state.validity.shoulderWidthCompensationOk}
|
||||
></SettingRow>
|
||||
<SettingRow
|
||||
name="vrc_config-calibration_visuals"
|
||||
recommendedValue={
|
||||
<Localized
|
||||
id={onOffKey(state.recommended.calibrationVisuals)}
|
||||
></Localized>
|
||||
}
|
||||
value={
|
||||
<Localized
|
||||
id={onOffKey(state.state.calibrationVisuals)}
|
||||
></Localized>
|
||||
}
|
||||
valid={state.validity.calibrationVisualsOk}
|
||||
></SettingRow>
|
||||
<SettingRow
|
||||
name="vrc_config-calibration_range"
|
||||
recommendedValue={meterFormat.format(
|
||||
state.recommended.calibrationRange
|
||||
)}
|
||||
value={meterFormat.format(state.state.calibrationRange)}
|
||||
valid={state.validity.calibrationRangeOk}
|
||||
></SettingRow>
|
||||
<SettingRow
|
||||
name="vrc_config-tracker_model"
|
||||
recommendedValue={
|
||||
<Localized
|
||||
id={
|
||||
trackerModelTranslationMap[
|
||||
state.recommended.trackerModel
|
||||
]
|
||||
}
|
||||
></Localized>
|
||||
}
|
||||
value={
|
||||
<Localized
|
||||
id={
|
||||
trackerModelTranslationMap[state.state.trackerModel]
|
||||
}
|
||||
></Localized>
|
||||
}
|
||||
valid={state.validity.trackerModelOk}
|
||||
></SettingRow>
|
||||
</tbody>
|
||||
</table>
|
||||
<Table>
|
||||
<SettingRow
|
||||
{...settingRowProps('userHeightOk')}
|
||||
name="vrc_config-user_height"
|
||||
recommendedValue={meterFormat.format(
|
||||
state.recommended.userHeight
|
||||
)}
|
||||
value={meterFormat.format(state.state.userHeight)}
|
||||
></SettingRow>
|
||||
<SettingRow
|
||||
{...settingRowProps('legacyModeOk')}
|
||||
name="vrc_config-legacy_mode"
|
||||
recommendedValue={
|
||||
<Localized
|
||||
id={onOffKey(state.recommended.legacyMode)}
|
||||
></Localized>
|
||||
}
|
||||
value={
|
||||
<Localized
|
||||
id={onOffKey(state.state.legacyMode)}
|
||||
></Localized>
|
||||
}
|
||||
></SettingRow>
|
||||
<SettingRow
|
||||
{...settingRowProps('shoulderTrackingOk')}
|
||||
name="vrc_config-disable_shoulder_tracking"
|
||||
recommendedValue={
|
||||
<Localized
|
||||
id={onOffKey(
|
||||
state.recommended.shoulderTrackingDisabled
|
||||
)}
|
||||
></Localized>
|
||||
}
|
||||
value={
|
||||
<Localized
|
||||
id={onOffKey(state.state.shoulderTrackingDisabled)}
|
||||
></Localized>
|
||||
}
|
||||
></SettingRow>
|
||||
<SettingRow
|
||||
{...settingRowProps('shoulderWidthCompensationOk')}
|
||||
name="vrc_config-shoulder_width_compensation"
|
||||
recommendedValue={
|
||||
<Localized
|
||||
id={onOffKey(
|
||||
state.recommended.shoulderWidthCompensation
|
||||
)}
|
||||
></Localized>
|
||||
}
|
||||
value={
|
||||
<Localized
|
||||
id={onOffKey(state.state.shoulderWidthCompensation)}
|
||||
></Localized>
|
||||
}
|
||||
></SettingRow>
|
||||
<SettingRow
|
||||
{...settingRowProps('calibrationVisualsOk')}
|
||||
name="vrc_config-calibration_visuals"
|
||||
recommendedValue={
|
||||
<Localized
|
||||
id={onOffKey(state.recommended.calibrationVisuals)}
|
||||
></Localized>
|
||||
}
|
||||
value={
|
||||
<Localized
|
||||
id={onOffKey(state.state.calibrationVisuals)}
|
||||
></Localized>
|
||||
}
|
||||
></SettingRow>
|
||||
<SettingRow
|
||||
{...settingRowProps('calibrationRangeOk')}
|
||||
name="vrc_config-calibration_range"
|
||||
recommendedValue={meterFormat.format(
|
||||
state.recommended.calibrationRange
|
||||
)}
|
||||
value={meterFormat.format(state.state.calibrationRange)}
|
||||
></SettingRow>
|
||||
<SettingRow
|
||||
{...settingRowProps('trackerModelOk')}
|
||||
name="vrc_config-tracker_model"
|
||||
recommendedValue={
|
||||
<Localized
|
||||
id={
|
||||
trackerModelTranslationMap[
|
||||
state.recommended.trackerModel
|
||||
]
|
||||
}
|
||||
></Localized>
|
||||
}
|
||||
value={
|
||||
<Localized
|
||||
id={
|
||||
trackerModelTranslationMap[state.state.trackerModel]
|
||||
}
|
||||
></Localized>
|
||||
}
|
||||
></SettingRow>
|
||||
</Table>
|
||||
</div>
|
||||
<div className="flex flex-col gap-2">
|
||||
<Localized id="vrc_config-page-wrist_menu">
|
||||
@@ -217,67 +250,45 @@ export function VRCWarningsPage() {
|
||||
<Localized id="vrc_config-page-wrist_menu-desc">
|
||||
<Typography color="secondary" />
|
||||
</Localized>
|
||||
<table className="min-w-full divide-y divide-background-50">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" className="px-6 py-3 text-start">
|
||||
<Localized id={'vrc_config-setting_name'}>
|
||||
<Typography />
|
||||
</Localized>
|
||||
</th>
|
||||
<Table>
|
||||
<SettingRow
|
||||
{...settingRowProps('spineModeOk')}
|
||||
name="vrc_config-spine_mode"
|
||||
recommendedValue={state.recommended.spineMode
|
||||
.map((mode) =>
|
||||
l10n.getString(spineModeTranslationMap[mode])
|
||||
)
|
||||
.join(', ')}
|
||||
value={
|
||||
<Localized
|
||||
id={spineModeTranslationMap[state.state.spineMode]}
|
||||
></Localized>
|
||||
}
|
||||
></SettingRow>
|
||||
|
||||
<th scope="col" className="px-6 py-3 text-end">
|
||||
<Localized id={'vrc_config-recommended_value'}>
|
||||
<Typography />
|
||||
</Localized>
|
||||
</th>
|
||||
<th scope="col" className="px-6 py-3 text-end">
|
||||
<Localized id={'vrc_config-current_value'}>
|
||||
<Typography />
|
||||
</Localized>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<SettingRow
|
||||
name="vrc_config-spine_mode"
|
||||
recommendedValue={state.recommended.spineMode
|
||||
.map((mode) =>
|
||||
l10n.getString(spineModeTranslationMap[mode])
|
||||
)
|
||||
.join(', ')}
|
||||
value={
|
||||
<Localized
|
||||
id={spineModeTranslationMap[state.state.spineMode]}
|
||||
></Localized>
|
||||
}
|
||||
valid={state.validity.spineModeOk}
|
||||
></SettingRow>
|
||||
|
||||
<SettingRow
|
||||
name="vrc_config-avatar_measurement_type"
|
||||
recommendedValue={
|
||||
<Localized
|
||||
id={
|
||||
avatarMeasurementTypeTranslationMap[
|
||||
state.recommended.avatarMeasurementType
|
||||
]
|
||||
}
|
||||
></Localized>
|
||||
}
|
||||
value={
|
||||
<Localized
|
||||
id={
|
||||
avatarMeasurementTypeTranslationMap[
|
||||
state.state.avatarMeasurementType
|
||||
]
|
||||
}
|
||||
></Localized>
|
||||
}
|
||||
valid={state.validity.avatarMeasurementTypeOk}
|
||||
></SettingRow>
|
||||
</tbody>
|
||||
</table>
|
||||
<SettingRow
|
||||
{...settingRowProps('avatarMeasurementTypeOk')}
|
||||
name="vrc_config-avatar_measurement_type"
|
||||
recommendedValue={
|
||||
<Localized
|
||||
id={
|
||||
avatarMeasurementTypeTranslationMap[
|
||||
state.recommended.avatarMeasurementType
|
||||
]
|
||||
}
|
||||
></Localized>
|
||||
}
|
||||
value={
|
||||
<Localized
|
||||
id={
|
||||
avatarMeasurementTypeTranslationMap[
|
||||
state.state.avatarMeasurementType
|
||||
]
|
||||
}
|
||||
></Localized>
|
||||
}
|
||||
></SettingRow>
|
||||
</Table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -9,7 +9,7 @@ import { PerspectiveCamera, Vector3 } from 'three';
|
||||
import { Button } from '@/components/commons/Button';
|
||||
import { QuatObject } from '@/maths/quaternion';
|
||||
import { useLocalization } from '@fluent/react';
|
||||
import { Vector3Object } from '@/maths/vector3';
|
||||
import { Vector3Object, Vector3FromVec3fT } from '@/maths/vector3';
|
||||
import { Gltf } from '@react-three/drei';
|
||||
import { ErrorBoundary } from 'react-error-boundary';
|
||||
|
||||
@@ -28,12 +28,19 @@ export function TrackerModel({ model }: { model: string }) {
|
||||
function SceneRenderer({
|
||||
quat,
|
||||
vec,
|
||||
mag,
|
||||
model,
|
||||
}: {
|
||||
quat: QuatObject;
|
||||
vec: Vector3Object;
|
||||
mag: Vector3Object;
|
||||
model: string;
|
||||
}) {
|
||||
const magDir = new Vector3(mag.x, mag.y, mag.z);
|
||||
const magLen = magDir.length();
|
||||
const magMag = Math.sqrt(magLen / 100); // normalize magnituge
|
||||
if (magLen > 0) magDir.multiplyScalar(1 / magLen);
|
||||
|
||||
return (
|
||||
<Canvas
|
||||
className="container"
|
||||
@@ -56,23 +63,17 @@ function SceneRenderer({
|
||||
|
||||
<arrowHelper
|
||||
args={[
|
||||
new Vector3(-Math.sign(vec.x), 0, 0),
|
||||
Vector3FromVec3fT(vec).normalize(),
|
||||
new Vector3(0, 0, 0),
|
||||
Math.sqrt(Math.abs(vec.x)) * 2,
|
||||
Math.sqrt(Vector3FromVec3fT(vec).length()) * 2,
|
||||
]}
|
||||
/>
|
||||
<arrowHelper
|
||||
args={[
|
||||
new Vector3(0, Math.sign(vec.y), 0),
|
||||
new Vector3(0, 0, 0),
|
||||
Math.sqrt(Math.abs(vec.y)) * 2,
|
||||
]}
|
||||
/>
|
||||
<arrowHelper
|
||||
args={[
|
||||
new Vector3(0, 0, -Math.sign(vec.z)),
|
||||
new Vector3(0, 0, 0),
|
||||
Math.sqrt(Math.abs(vec.z)) * 2,
|
||||
magDir,
|
||||
magDir.clone().multiplyScalar(-magMag),
|
||||
2 * magMag,
|
||||
THREE.Color.NAMES.aqua,
|
||||
]}
|
||||
/>
|
||||
|
||||
@@ -116,6 +117,7 @@ export function IMUVisualizerWidget({ tracker }: { tracker: TrackerDataT }) {
|
||||
tracker?.linearAcceleration ||
|
||||
tracker?.rawAcceleration ||
|
||||
new THREE.Vector3();
|
||||
const mag = tracker?.rawMagneticVector || new THREE.Vector3();
|
||||
|
||||
return (
|
||||
<div className="bg-background-70 flex flex-col p-3 rounded-lg gap-2">
|
||||
@@ -157,6 +159,15 @@ export function IMUVisualizerWidget({ tracker }: { tracker: TrackerDataT }) {
|
||||
</div>
|
||||
)}
|
||||
|
||||
{tracker.rawMagneticVector && (
|
||||
<div className="flex justify-between">
|
||||
<Typography color="secondary">
|
||||
{l10n.getString('tracker-infos-magnetometer')}
|
||||
</Typography>
|
||||
<Typography>{formatVector3(tracker.rawMagneticVector, 1)}</Typography>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{!enabled && (
|
||||
<Button
|
||||
variant="secondary"
|
||||
@@ -189,6 +200,7 @@ export function IMUVisualizerWidget({ tracker }: { tracker: TrackerDataT }) {
|
||||
<SceneRenderer
|
||||
quat={{ ...quat }}
|
||||
vec={{ ...vec }}
|
||||
mag={{ ...mag }}
|
||||
model={
|
||||
isExtension ? '/models/extension.gltf' : '/models/tracker.gltf'
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ export interface Config {
|
||||
errorTracking: boolean | null;
|
||||
decorations: boolean;
|
||||
showNavbarOnboarding: boolean;
|
||||
vrcMutedWarnings: string[];
|
||||
}
|
||||
|
||||
export interface ConfigContext {
|
||||
@@ -67,6 +68,7 @@ export const defaultConfig: Omit<Config, 'devSettings'> = {
|
||||
errorTracking: null,
|
||||
decorations: false,
|
||||
showNavbarOnboarding: true,
|
||||
vrcMutedWarnings: [],
|
||||
};
|
||||
|
||||
interface CrossStorage {
|
||||
|
||||
@@ -17,6 +17,7 @@ export function useDataFeedConfig() {
|
||||
trackerData.rotationReferenceAdjusted = true;
|
||||
trackerData.rotationIdentityAdjusted = true;
|
||||
trackerData.tps = true;
|
||||
trackerData.rawMagneticVector = true;
|
||||
|
||||
const dataMask = new DeviceDataMaskT();
|
||||
dataMask.deviceData = true;
|
||||
|
||||
@@ -188,6 +188,7 @@ export function useFirmwareToolContext(): FirmwareToolContext {
|
||||
boardConfig: {
|
||||
...currConfig.boardConfig,
|
||||
...form,
|
||||
batteryResistances: form.batteryResistances.map((r) => Number(r)),
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
@@ -75,7 +75,7 @@ export function useManualProportions({ type }: { type: 'linear' | 'ratio' }): {
|
||||
}
|
||||
|
||||
return [
|
||||
...BONE_MAPPING.keys().map((groupName) => {
|
||||
...[...BONE_MAPPING.keys()].map((groupName) => {
|
||||
const groupBones = BONE_MAPPING.get(groupName);
|
||||
if (!groupBones) throw 'invalid state - this value should always exits';
|
||||
const total = config.skeletonParts
|
||||
@@ -101,7 +101,8 @@ export function useManualProportions({ type }: { type: 'linear' | 'ratio' }): {
|
||||
}),
|
||||
...config.skeletonParts
|
||||
.filter(
|
||||
({ bone }) => !BONE_MAPPING.values().find((bones) => bones.includes(bone))
|
||||
({ bone }) =>
|
||||
![...BONE_MAPPING.values()].find((bones) => bones.includes(bone))
|
||||
)
|
||||
.map(
|
||||
({ bone, value }) =>
|
||||
|
||||
@@ -124,6 +124,7 @@ export function parseStatusToLocale(
|
||||
case StatusData.NONE:
|
||||
case StatusData.StatusTrackerReset:
|
||||
case StatusData.StatusUnassignedHMD:
|
||||
case StatusData.StatusPublicNetwork:
|
||||
return {};
|
||||
case StatusData.StatusSteamVRDisconnected: {
|
||||
const data = status.data as StatusSteamVRDisconnectedT;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useEffect, useMemo, useState } from 'react';
|
||||
import { useLayoutEffect, useMemo, useState } from 'react';
|
||||
import { useWebsocketAPI } from './websocket-api';
|
||||
import {
|
||||
RpcMessage,
|
||||
@@ -8,16 +8,16 @@ import {
|
||||
VRCSpineMode,
|
||||
VRCTrackerModel,
|
||||
} from 'solarxr-protocol';
|
||||
import { useConfig } from './config';
|
||||
|
||||
type NonNull<T> = {
|
||||
[P in keyof T]: NonNullable<T[P]>;
|
||||
};
|
||||
|
||||
export type VRCConfigState =
|
||||
| { isSupported: false }
|
||||
| ({ isSupported: true } & NonNull<
|
||||
Pick<VRCConfigStateChangeResponseT, 'recommended' | 'state' | 'validity'>
|
||||
>);
|
||||
export type VRCConfigStateSupported = { isSupported: true } & NonNull<
|
||||
Pick<VRCConfigStateChangeResponseT, 'recommended' | 'state' | 'validity'>
|
||||
>;
|
||||
export type VRCConfigState = { isSupported: false } | VRCConfigStateSupported;
|
||||
|
||||
export const spineModeTranslationMap: Record<VRCSpineMode, string> = {
|
||||
[VRCSpineMode.UNKNOWN]: 'vrc_config-spine_mode-UNKNOWN',
|
||||
@@ -45,9 +45,10 @@ export const avatarMeasurementTypeTranslationMap: Record<
|
||||
|
||||
export function useVRCConfig() {
|
||||
const { sendRPCPacket, useRPCPacket } = useWebsocketAPI();
|
||||
const { config, setConfig } = useConfig();
|
||||
const [state, setState] = useState<VRCConfigState | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
useLayoutEffect(() => {
|
||||
sendRPCPacket(RpcMessage.VRCConfigStateRequest, new VRCConfigStateRequestT());
|
||||
}, []);
|
||||
|
||||
@@ -58,13 +59,31 @@ export function useVRCConfig() {
|
||||
}
|
||||
);
|
||||
|
||||
const mutedSettings = useMemo(() => {
|
||||
if (!state?.isSupported) return [];
|
||||
return Object.keys(state.validity).filter((k) =>
|
||||
config?.vrcMutedWarnings.includes(k)
|
||||
);
|
||||
}, [state, config]);
|
||||
|
||||
const invalidConfig = useMemo(() => {
|
||||
if (!state?.isSupported) return false;
|
||||
return Object.values(state.validity).some((v) => !v);
|
||||
}, [state]);
|
||||
return Object.entries(state.validity)
|
||||
.filter(([k]) => !config?.vrcMutedWarnings.includes(k))
|
||||
.some(([, v]) => !v);
|
||||
}, [state, config]);
|
||||
|
||||
return {
|
||||
state,
|
||||
invalidConfig,
|
||||
mutedSettings,
|
||||
toggleMutedSettings: async (key: keyof VRCConfigStateSupported['validity']) => {
|
||||
if (!config) return;
|
||||
const index = config.vrcMutedWarnings.findIndex((v) => v === key);
|
||||
if (index === -1) config.vrcMutedWarnings.push(key);
|
||||
else config?.vrcMutedWarnings.splice(index, 1);
|
||||
await setConfig(config);
|
||||
console.log(config.vrcMutedWarnings);
|
||||
},
|
||||
};
|
||||
}
|
||||
+1
-95
@@ -13,106 +13,12 @@ import { exists, readTextFile, BaseDirectory } from '@tauri-apps/plugin-fs';
|
||||
import { error } from '@/utils/logging';
|
||||
import { invoke } from '@tauri-apps/api/core';
|
||||
import { isTrayAvailable } from '@/utils/tauri';
|
||||
import { langs } from './names';
|
||||
|
||||
export const defaultNS = 'translation';
|
||||
export const DEFAULT_LOCALE = 'en';
|
||||
const OVERRIDE_FILENAME = 'override.ftl';
|
||||
|
||||
export const langs = [
|
||||
{
|
||||
name: '🇦🇪 عربى',
|
||||
key: 'ar',
|
||||
},
|
||||
{
|
||||
name: '🇨🇿 Čeština',
|
||||
key: 'cs',
|
||||
},
|
||||
{
|
||||
name: '🇩🇰 Dansk',
|
||||
key: 'da',
|
||||
},
|
||||
{
|
||||
name: '🇩🇪 Deutsch',
|
||||
key: 'de',
|
||||
},
|
||||
{
|
||||
name: '🇺🇸 English',
|
||||
key: 'en',
|
||||
},
|
||||
{
|
||||
name: '🌎 Español Latinoamericano',
|
||||
key: 'es-419',
|
||||
},
|
||||
{
|
||||
name: '🇪🇸 Español España',
|
||||
key: 'es-ES',
|
||||
},
|
||||
{
|
||||
name: '🇪🇪 Eesti',
|
||||
key: 'et',
|
||||
},
|
||||
{
|
||||
name: '🇫🇮 Suomi',
|
||||
key: 'fi',
|
||||
},
|
||||
{
|
||||
name: '🇫🇷 Français',
|
||||
key: 'fr',
|
||||
},
|
||||
{
|
||||
name: '🇮🇹 Italiano',
|
||||
key: 'it',
|
||||
},
|
||||
{
|
||||
name: '🇯🇵 日本語',
|
||||
key: 'ja',
|
||||
},
|
||||
{
|
||||
name: '🇰🇷 한국어',
|
||||
key: 'ko',
|
||||
},
|
||||
{
|
||||
name: '🇳🇴 Norsk bokmål',
|
||||
key: 'nb-NO',
|
||||
},
|
||||
{
|
||||
name: '🇳🇱 Nederlands',
|
||||
key: 'nl',
|
||||
},
|
||||
{
|
||||
name: '🇵🇱 Polski',
|
||||
key: 'pl',
|
||||
},
|
||||
{
|
||||
name: '🇧🇷 Português Brasileiro',
|
||||
key: 'pt-BR',
|
||||
},
|
||||
{
|
||||
name: '🇷🇺 Русский',
|
||||
key: 'ru',
|
||||
},
|
||||
{
|
||||
name: '🇺🇦 Українська',
|
||||
key: 'uk',
|
||||
},
|
||||
{
|
||||
name: '🇻🇳 Tiếng Việt',
|
||||
key: 'vi',
|
||||
},
|
||||
{
|
||||
name: '🇨🇳 简体中文',
|
||||
key: 'zh-Hans',
|
||||
},
|
||||
{
|
||||
name: '🧋 繁體中文',
|
||||
key: 'zh-Hant',
|
||||
},
|
||||
{
|
||||
name: '🥺 Engwish~ OwO',
|
||||
key: 'en-x-owo',
|
||||
},
|
||||
];
|
||||
|
||||
// AppConfig path: https://docs.rs/tauri/1.2.4/tauri/api/path/fn.config_dir.html
|
||||
// We doing this only once, don't want an override check to be done on runtime,
|
||||
// only on launch :P
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
import ar from '@twemoji/svg/1f1e6-1f1ea.svg';
|
||||
import cs from '@twemoji/svg/1f1e8-1f1ff.svg';
|
||||
import da from '@twemoji/svg/1f1e9-1f1f0.svg';
|
||||
import de from '@twemoji/svg/1f1e9-1f1ea.svg';
|
||||
import en from '@twemoji/svg/1f1fa-1f1f8.svg';
|
||||
import americas from '@twemoji/svg/1f30e.svg';
|
||||
import es from '@twemoji/svg/1f1ea-1f1f8.svg';
|
||||
import et from '@twemoji/svg/1f1ea-1f1ea.svg';
|
||||
import fi from '@twemoji/svg/1f1eb-1f1ee.svg';
|
||||
import fr from '@twemoji/svg/1f1eb-1f1f7.svg';
|
||||
import it from '@twemoji/svg/1f1ee-1f1f9.svg';
|
||||
import ja from '@twemoji/svg/1f1ef-1f1f5.svg';
|
||||
import ko from '@twemoji/svg/1f1f0-1f1f7.svg';
|
||||
import nb from '@twemoji/svg/1f1f3-1f1f4.svg';
|
||||
import nl from '@twemoji/svg/1f1f3-1f1f1.svg';
|
||||
import pl from '@twemoji/svg/1f1f5-1f1f1.svg';
|
||||
import br from '@twemoji/svg/1f1e7-1f1f7.svg';
|
||||
import ru from '@twemoji/svg/1f1f7-1f1fa.svg';
|
||||
import uk from '@twemoji/svg/1f1fa-1f1e6.svg';
|
||||
import vi from '@twemoji/svg/1f1fb-1f1f3.svg';
|
||||
import cn from '@twemoji/svg/1f1e8-1f1f3.svg';
|
||||
import bubble from '@twemoji/svg/1f9cb.svg';
|
||||
import plead from '@twemoji/svg/1f97a.svg';
|
||||
|
||||
export const langs = [
|
||||
{
|
||||
emoji: ar,
|
||||
name: 'عربى',
|
||||
key: 'ar',
|
||||
},
|
||||
{
|
||||
emoji: cs,
|
||||
name: 'Čeština',
|
||||
key: 'cs',
|
||||
},
|
||||
{
|
||||
emoji: da,
|
||||
name: 'Dansk',
|
||||
key: 'da',
|
||||
},
|
||||
{
|
||||
emoji: de,
|
||||
name: 'Deutsch',
|
||||
key: 'de',
|
||||
},
|
||||
{
|
||||
emoji: en,
|
||||
name: 'English',
|
||||
key: 'en',
|
||||
},
|
||||
{
|
||||
emoji: americas,
|
||||
name: 'Español Latinoamericano',
|
||||
key: 'es-419',
|
||||
},
|
||||
{
|
||||
emoji: es,
|
||||
name: 'Español España',
|
||||
key: 'es-ES',
|
||||
},
|
||||
{
|
||||
emoji: et,
|
||||
name: 'Eesti',
|
||||
key: 'et',
|
||||
},
|
||||
{
|
||||
emoji: fi,
|
||||
name: 'Suomi',
|
||||
key: 'fi',
|
||||
},
|
||||
{
|
||||
emoji: fr,
|
||||
name: 'Français',
|
||||
key: 'fr',
|
||||
},
|
||||
{
|
||||
emoji: it,
|
||||
name: 'Italiano',
|
||||
key: 'it',
|
||||
},
|
||||
{
|
||||
emoji: ja,
|
||||
name: '日本語',
|
||||
key: 'ja',
|
||||
},
|
||||
{
|
||||
emoji: ko,
|
||||
name: '한국어',
|
||||
key: 'ko',
|
||||
},
|
||||
{
|
||||
emoji: nb,
|
||||
name: 'Norsk bokmål',
|
||||
key: 'nb-NO',
|
||||
},
|
||||
{
|
||||
emoji: nl,
|
||||
name: 'Nederlands',
|
||||
key: 'nl',
|
||||
},
|
||||
{
|
||||
emoji: pl,
|
||||
name: 'Polski',
|
||||
key: 'pl',
|
||||
},
|
||||
{
|
||||
emoji: br,
|
||||
name: 'Português Brasileiro',
|
||||
key: 'pt-BR',
|
||||
},
|
||||
{
|
||||
emoji: ru,
|
||||
name: 'Русский',
|
||||
key: 'ru',
|
||||
},
|
||||
{
|
||||
emoji: uk,
|
||||
name: 'Українська',
|
||||
key: 'uk',
|
||||
},
|
||||
{
|
||||
emoji: vi,
|
||||
name: 'Tiếng Việt',
|
||||
key: 'vi',
|
||||
},
|
||||
{
|
||||
emoji: cn,
|
||||
name: '简体中文',
|
||||
key: 'zh-Hans',
|
||||
},
|
||||
{
|
||||
emoji: bubble,
|
||||
name: '繁體中文',
|
||||
key: 'zh-Hant',
|
||||
},
|
||||
{
|
||||
emoji: plead,
|
||||
name: 'Engwish~ OwO',
|
||||
key: 'en-x-owo',
|
||||
},
|
||||
];
|
||||
+1
-25
@@ -4,8 +4,7 @@
|
||||
|
||||
body {
|
||||
font-variant-numeric: tabular-nums;
|
||||
font-family: var(--font-name), 'Noto Sans CJK', sans-serif, 'Twemoji Chromium',
|
||||
emoji;
|
||||
font-family: var(--font-name), 'Noto Sans CJK', sans-serif, emoji;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
user-select: none;
|
||||
@@ -16,29 +15,6 @@ body {
|
||||
scrollbar-width: thin;
|
||||
}
|
||||
|
||||
@media (-webkit-animation) {
|
||||
body {
|
||||
font-family: var(--font-name), 'Noto Sans CJK', sans-serif, 'Twemoji Webkit',
|
||||
emoji;
|
||||
}
|
||||
|
||||
body.linux {
|
||||
font-family: var(--font-name), 'Noto Sans CJK', sans-serif, emoji;
|
||||
}
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Twemoji Webkit';
|
||||
src: url('/fonts/twemoji-picosvg.woff2') format('woff2');
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Twemoji Chromium';
|
||||
src: url('/fonts/twemoji-glyf_colr_1.woff2') format('woff2');
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'OpenDyslexic';
|
||||
src: url('/fonts/OpenDyslexic-Regular.woff') format('woff');
|
||||
|
||||
Generated
+8
@@ -71,6 +71,9 @@ importers:
|
||||
'@tauri-apps/plugin-store':
|
||||
specifier: ^2.0.0
|
||||
version: 2.0.0
|
||||
'@twemoji/svg':
|
||||
specifier: ^15.0.0
|
||||
version: 15.0.0
|
||||
browser-fs-access:
|
||||
specifier: ^0.35.0
|
||||
version: 0.35.0
|
||||
@@ -1255,6 +1258,9 @@ packages:
|
||||
'@tweenjs/[email protected]':
|
||||
resolution: {integrity: sha512-kMCNaZCJugWI86xiEHaY338CU5JpD0B97p1j1IKNn/Zto8PgACjQx0UxbHjmOcLl/dDOBnItwD07KmCs75pxtQ==}
|
||||
|
||||
'@twemoji/[email protected]':
|
||||
resolution: {integrity: sha512-ZSPef2B6nBaYnfgdTbAy4jgW95o7pi2xPGwGCU+WMTxo7J6B1lMPTWwSq/wTuiMq+N0khQ90CcvYp1wFoQpo/w==}
|
||||
|
||||
'@types/[email protected]':
|
||||
resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==}
|
||||
|
||||
@@ -5457,6 +5463,8 @@ snapshots:
|
||||
|
||||
'@tweenjs/[email protected]': {}
|
||||
|
||||
'@twemoji/[email protected]': {}
|
||||
|
||||
'@types/[email protected]':
|
||||
dependencies:
|
||||
'@babel/parser': 7.24.7
|
||||
|
||||
@@ -244,15 +244,15 @@ class AndroidSerialHandler(val activity: AppCompatActivity) :
|
||||
|
||||
override fun getCurrentPort(): SlimeSerialPort? = this.currentPort
|
||||
|
||||
private fun addLog(str: String) {
|
||||
private fun addLog(str: String, server: Boolean = true) {
|
||||
LogManager.info("[Serial] $str")
|
||||
listeners.forEach { it.onSerialLog(str) }
|
||||
listeners.forEach { it.onSerialLog(str, server) }
|
||||
}
|
||||
|
||||
override fun onNewData(data: ByteArray?) {
|
||||
if (data != null) {
|
||||
val s = StandardCharsets.UTF_8.decode(ByteBuffer.wrap(data)).toString()
|
||||
addLog(s)
|
||||
addLog(s, false)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ net session >nul 2>&1
|
||||
if %errorlevel% == 0 (
|
||||
echo Running with administrative privileges! - Needed for firewall modification!
|
||||
) else (
|
||||
echo Requesting administrative privileges - Needed for firewall modification!
|
||||
echo Requesting administrative privileges - Needed for firewall modification!
|
||||
:: Temp script to request admin... Works and doesn't leave a mess.
|
||||
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
|
||||
echo UAC.ShellExecute "%~s0", "", "%~dp0", "runas", 1 >> "%temp%\getadmin.vbs"
|
||||
@@ -21,8 +21,8 @@ rem WebSocket server default port
|
||||
call :AddRule "SlimeVR TCP 21110 incoming" "dir=in action=allow protocol=TCP localport=21110 enable=yes"
|
||||
call :AddRule "SlimeVR TCP 21110 outgoing" "dir=out action=allow protocol=TCP localport=21110 enable=yes"
|
||||
rem OpenJDK Platform Binary access
|
||||
call :AddRule "SlimeVR OpenJDK Platform incoming" "dir=in action=allow program=%~dp0jre\bin\java.exe enable=yes"
|
||||
call :AddRule "SlimeVR OpenJDK Platform outgoing" "dir=out action=allow program=%~dp0jre\bin\java.exe enable=yes"
|
||||
call :AddRule "SlimeVR OpenJDK Platform incoming" "dir=in action=allow program=""%~dp0jre\bin\java.exe"" enable=yes"
|
||||
call :AddRule "SlimeVR OpenJDK Platform outgoing" "dir=out action=allow program=""%~dp0jre\bin\java.exe"" enable=yes"
|
||||
rem ESP8266 OTA default port
|
||||
call :AddRule "SlimeVR UDP 8266 incoming" "dir=in action=allow protocol=UDP localport=8266 enable=yes"
|
||||
call :AddRule "SlimeVR UDP 8266 outgoing" "dir=out action=allow protocol=UDP localport=8266 enable=yes"
|
||||
@@ -35,7 +35,9 @@ exit /B
|
||||
:AddRule
|
||||
setlocal
|
||||
set "ruleName=%~1"
|
||||
set "ruleParams=%~2"
|
||||
set "rulePara=%~2"
|
||||
:: Change from "" to "
|
||||
set "ruleParams=%rulePara:""="%"
|
||||
|
||||
netsh advfirewall firewall show rule name="%ruleName%" >nul 2>&1
|
||||
if %errorlevel% neq 0 (
|
||||
|
||||
@@ -26,6 +26,9 @@ call :DeleteRule "SlimeVR TCP 21110 outgoing"
|
||||
rem OpenJDK Platform Binary access
|
||||
call :DeleteRule "SlimeVR OpenJDK Platform incoming"
|
||||
call :DeleteRule "SlimeVR OpenJDK Platform outgoing"
|
||||
rem ESP8266 OTA default port
|
||||
call :DeleteRule "SlimeVR UDP 8266 incoming"
|
||||
call :DeleteRule "SlimeVR UDP 8266 outgoing"
|
||||
|
||||
echo Done!
|
||||
pause
|
||||
|
||||
@@ -13,7 +13,7 @@ class FiltersConfig {
|
||||
fun updateTrackersFilters() {
|
||||
for (tracker in VRServer.instance.allTrackers) {
|
||||
if (tracker.allowFiltering) {
|
||||
tracker.filteringHandler.readFilteringConfig(this, tracker.getRawRotation())
|
||||
tracker.filteringHandler.readFilteringConfig(this, tracker.getRotation())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,6 +58,7 @@ class ServerConfig {
|
||||
}.awaitAll()
|
||||
|
||||
useMagnetometerOnAllTrackers = state
|
||||
VRServer.instance.configManager.saveConfig()
|
||||
} finally {
|
||||
magMutex.unlock()
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ class VRConfig {
|
||||
if (tracker.allowFiltering) {
|
||||
tracker
|
||||
.filteringHandler
|
||||
.readFilteringConfig(filters, tracker.getRawRotation())
|
||||
.readFilteringConfig(filters, tracker.getRotation())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,9 @@ class QuaternionMovingAverage(
|
||||
predictFactor = PREDICT_MULTIPLIER * amount + PREDICT_MIN
|
||||
rotBuffer = CircularArrayList(PREDICT_BUFFER)
|
||||
}
|
||||
resetQuats(initialRotation)
|
||||
|
||||
// We have no reference at the start, so just use the initial rotation
|
||||
resetQuats(initialRotation, initialRotation)
|
||||
}
|
||||
|
||||
// Runs at up to 1000hz. We use a timer to make it framerate-independent
|
||||
@@ -57,17 +59,17 @@ class QuaternionMovingAverage(
|
||||
@Synchronized
|
||||
fun update() {
|
||||
if (type == TrackerFilters.PREDICTION) {
|
||||
if (rotBuffer!!.size > 0) {
|
||||
var quatBuf = latestQuaternion
|
||||
|
||||
val rotBuf = rotBuffer
|
||||
if (rotBuf != null && rotBuf.isNotEmpty()) {
|
||||
// Applies the past rotations to the current rotation
|
||||
rotBuffer?.forEach { quatBuf *= it }
|
||||
val predictRot = rotBuf.fold(latestQuaternion) { buf, rot -> buf * rot }
|
||||
|
||||
// Calculate how much to slerp
|
||||
// Limit slerp by a reasonable amount so low TPS doesn't break tracking
|
||||
val amt = (predictFactor * fpsTimer.timePerFrame).coerceAtMost(1f)
|
||||
|
||||
// Slerps the target rotation to that predicted rotation by amt
|
||||
filteredQuaternion = filteredQuaternion.interpR(quatBuf, amt)
|
||||
filteredQuaternion = filteredQuaternion.interpQ(predictRot, amt)
|
||||
}
|
||||
} else if (type == TrackerFilters.SMOOTHING) {
|
||||
// Make it framerate-independent
|
||||
@@ -78,7 +80,7 @@ class QuaternionMovingAverage(
|
||||
val amt = (smoothFactor * timeSinceUpdate).coerceAtMost(1f)
|
||||
|
||||
// Smooth towards the target rotation by the slerp factor
|
||||
filteredQuaternion = smoothingQuaternion.interpR(latestQuaternion, amt)
|
||||
filteredQuaternion = smoothingQuaternion.interpQ(latestQuaternion, amt)
|
||||
}
|
||||
|
||||
filteringImpact = latestQuaternion.angleToR(filteredQuaternion)
|
||||
@@ -86,29 +88,40 @@ class QuaternionMovingAverage(
|
||||
|
||||
@Synchronized
|
||||
fun addQuaternion(q: Quaternion) {
|
||||
val oldQ = latestQuaternion
|
||||
val newQ = q.twinNearest(oldQ)
|
||||
latestQuaternion = newQ
|
||||
|
||||
if (type == TrackerFilters.PREDICTION) {
|
||||
if (rotBuffer!!.size == rotBuffer!!.capacity()) {
|
||||
rotBuffer?.removeLast()
|
||||
}
|
||||
|
||||
// Gets and stores the rotation between the last 2 quaternions
|
||||
rotBuffer?.add(latestQuaternion.inv().times(q))
|
||||
rotBuffer?.add(oldQ.inv().times(newQ))
|
||||
} else if (type == TrackerFilters.SMOOTHING) {
|
||||
timeSinceUpdate = 0f
|
||||
smoothingQuaternion = filteredQuaternion
|
||||
} else {
|
||||
// No filtering; just keep track of rotations (for going over 180 degrees)
|
||||
filteredQuaternion = q.twinNearest(filteredQuaternion)
|
||||
filteredQuaternion = newQ
|
||||
}
|
||||
|
||||
latestQuaternion = q
|
||||
}
|
||||
|
||||
/**
|
||||
* Aligns the quaternion space of [q] to the [reference] and sets the latest
|
||||
* [filteredQuaternion] immediately
|
||||
*/
|
||||
@Synchronized
|
||||
fun resetQuats(q: Quaternion) {
|
||||
fun resetQuats(q: Quaternion, reference: Quaternion) {
|
||||
// Assume a rotation within 180 degrees of the reference
|
||||
// TODO: Currently the reference is the headset, this restricts all trackers to
|
||||
// have at most a 180 degree rotation from the HMD during a reset, we can
|
||||
// probably do better using a hierarchy
|
||||
val rot = q.twinNearest(reference)
|
||||
rotBuffer?.clear()
|
||||
latestQuaternion = q
|
||||
filteredQuaternion = q
|
||||
addQuaternion(q)
|
||||
latestQuaternion = rot
|
||||
filteredQuaternion = rot
|
||||
addQuaternion(rot)
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,7 @@ class SerialRebootHandler(
|
||||
currentPort = null
|
||||
}
|
||||
|
||||
override fun onSerialLog(str: String) {
|
||||
override fun onSerialLog(str: String, ignored: Boolean) {
|
||||
if (str.contains("starting up...")) {
|
||||
val foundPort = watchRestartQueue.find { it.first.id == currentPort?.portLocation }
|
||||
if (foundPort != null) {
|
||||
|
||||
@@ -3,6 +3,7 @@ package dev.slimevr.protocol.datafeed;
|
||||
import com.google.flatbuffers.FlatBufferBuilder;
|
||||
import dev.slimevr.tracking.trackers.Device;
|
||||
import dev.slimevr.tracking.trackers.Tracker;
|
||||
import dev.slimevr.tracking.trackers.udp.MagnetometerStatus;
|
||||
import dev.slimevr.tracking.trackers.udp.UDPDevice;
|
||||
import io.github.axisangles.ktmath.Quaternion;
|
||||
import io.github.axisangles.ktmath.Vector3;
|
||||
@@ -80,6 +81,16 @@ public class DataFeedBuilder {
|
||||
return TrackerId.endTrackerId(fbb);
|
||||
}
|
||||
|
||||
public static int createVec3(FlatBufferBuilder fbb, Vector3 vec) {
|
||||
return Vec3f
|
||||
.createVec3f(
|
||||
fbb,
|
||||
vec.getX(),
|
||||
vec.getY(),
|
||||
vec.getZ()
|
||||
);
|
||||
}
|
||||
|
||||
public static int createQuat(FlatBufferBuilder fbb, Quaternion quaternion) {
|
||||
return Quat
|
||||
.createQuat(
|
||||
@@ -146,14 +157,7 @@ public class DataFeedBuilder {
|
||||
}
|
||||
|
||||
public static int createTrackerPosition(FlatBufferBuilder fbb, Tracker tracker) {
|
||||
Vector3 pos = tracker.getPosition();
|
||||
return Vec3f
|
||||
.createVec3f(
|
||||
fbb,
|
||||
pos.getX(),
|
||||
pos.getY(),
|
||||
pos.getZ()
|
||||
);
|
||||
return createVec3(fbb, tracker.getPosition());
|
||||
}
|
||||
|
||||
public static int createTrackerRotation(FlatBufferBuilder fbb, Tracker tracker) {
|
||||
@@ -161,14 +165,11 @@ public class DataFeedBuilder {
|
||||
}
|
||||
|
||||
public static int createTrackerAcceleration(FlatBufferBuilder fbb, Tracker tracker) {
|
||||
Vector3 accel = tracker.getAcceleration();
|
||||
return Vec3f
|
||||
.createVec3f(
|
||||
fbb,
|
||||
accel.getX(),
|
||||
accel.getY(),
|
||||
accel.getZ()
|
||||
);
|
||||
return createVec3(fbb, tracker.getAcceleration());
|
||||
}
|
||||
|
||||
public static int createTrackerMagneticVector(FlatBufferBuilder fbb, Tracker tracker) {
|
||||
return createVec3(fbb, tracker.getMagVector());
|
||||
}
|
||||
|
||||
public static int createTrackerTemperature(FlatBufferBuilder fbb, Tracker tracker) {
|
||||
@@ -233,6 +234,9 @@ public class DataFeedBuilder {
|
||||
if (mask.getTps()) {
|
||||
TrackerData.addTps(fbb, (int) tracker.getTps());
|
||||
}
|
||||
if (mask.getRawMagneticVector() && tracker.getMagStatus() == MagnetometerStatus.ENABLED) {
|
||||
TrackerData.addRawMagneticVector(fbb, createTrackerMagneticVector(fbb, tracker));
|
||||
}
|
||||
|
||||
return TrackerData.endTrackerData(fbb);
|
||||
}
|
||||
|
||||
+1
-1
@@ -65,7 +65,7 @@ public class RPCProvisioningHandler implements ProvisioningListener {
|
||||
FlatBufferBuilder fbb = new FlatBufferBuilder(32);
|
||||
|
||||
WifiProvisioningStatusResponse.startWifiProvisioningStatusResponse(fbb);
|
||||
WifiProvisioningStatusResponse.addStatus(fbb, status.getId());
|
||||
WifiProvisioningStatusResponse.addStatus(fbb, status.id);
|
||||
int update = WifiProvisioningStatusResponse.endWifiProvisioningStatusResponse(fbb);
|
||||
int outbound = rpcHandler
|
||||
.createRPCMessage(fbb, RpcMessage.WifiProvisioningStatusResponse, update);
|
||||
|
||||
@@ -71,7 +71,7 @@ public class RPCSerialHandler implements SerialListener {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSerialLog(String str) {
|
||||
public void onSerialLog(String str, boolean server) {
|
||||
FlatBufferBuilder fbb = new FlatBufferBuilder(32);
|
||||
|
||||
int logOffset = fbb.createString(str);
|
||||
|
||||
@@ -26,6 +26,7 @@ public class ProvisioningHandler implements SerialListener {
|
||||
private final Timer provisioningTickTimer = new Timer("ProvisioningTickTimer");
|
||||
private long lastStatusChange = -1;
|
||||
private byte connectRetries = 0;
|
||||
private boolean hasLogs = false;
|
||||
private final byte MAX_CONNECTION_RETRIES = 1;
|
||||
private final VRServer vrServer;
|
||||
|
||||
@@ -45,6 +46,7 @@ public class ProvisioningHandler implements SerialListener {
|
||||
|
||||
public void start(String ssid, String password, String port) {
|
||||
this.isRunning = true;
|
||||
this.hasLogs = false;
|
||||
this.ssid = ssid;
|
||||
this.password = password;
|
||||
this.preferredPort = port;
|
||||
@@ -54,6 +56,7 @@ public class ProvisioningHandler implements SerialListener {
|
||||
|
||||
public void stop() {
|
||||
this.isRunning = false;
|
||||
this.hasLogs = false;
|
||||
this.ssid = null;
|
||||
this.password = null;
|
||||
this.connectRetries = 0;
|
||||
@@ -63,6 +66,7 @@ public class ProvisioningHandler implements SerialListener {
|
||||
|
||||
public void initSerial(String port) {
|
||||
this.provisioningStatus = ProvisioningStatus.SERIAL_INIT;
|
||||
this.hasLogs = false;
|
||||
|
||||
try {
|
||||
boolean openResult = false;
|
||||
@@ -93,27 +97,43 @@ public class ProvisioningHandler implements SerialListener {
|
||||
|
||||
|
||||
public void provisioningTick() {
|
||||
if (this.provisioningStatus == ProvisioningStatus.OBTAINING_MAC_ADDRESS)
|
||||
this.tryObtainMacAddress();
|
||||
|
||||
if (
|
||||
this.provisioningStatus == ProvisioningStatus.CONNECTION_ERROR
|
||||
|| this.provisioningStatus == ProvisioningStatus.DONE
|
||||
)
|
||||
!hasLogs
|
||||
&& this.provisioningStatus == ProvisioningStatus.OBTAINING_MAC_ADDRESS
|
||||
&& System.currentTimeMillis() - this.lastStatusChange > 1_000
|
||||
) {
|
||||
this.changeStatus(ProvisioningStatus.NO_SERIAL_LOGS_ERROR);
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
this.provisioningStatus == ProvisioningStatus.SERIAL_INIT
|
||||
&& vrServer.serialHandler.getKnownPorts().findAny().isEmpty()
|
||||
&& System.currentTimeMillis() - this.lastStatusChange > 15_000
|
||||
) {
|
||||
this.changeStatus(ProvisioningStatus.NO_SERIAL_DEVICE_FOUND);
|
||||
return;
|
||||
}
|
||||
|
||||
if (System.currentTimeMillis() - this.lastStatusChange > 10000) {
|
||||
if (
|
||||
System.currentTimeMillis() - this.lastStatusChange
|
||||
> this.provisioningStatus.getTimeout()
|
||||
) {
|
||||
if (
|
||||
this.provisioningStatus == ProvisioningStatus.NONE
|
||||
|| this.provisioningStatus == ProvisioningStatus.SERIAL_INIT
|
||||
)
|
||||
this.initSerial(this.preferredPort);
|
||||
else if (
|
||||
this.provisioningStatus == ProvisioningStatus.OBTAINING_MAC_ADDRESS
|
||||
|| this.provisioningStatus == ProvisioningStatus.PROVISIONING
|
||||
)
|
||||
this.tryObtainMacAddress();
|
||||
else if (this.provisioningStatus == ProvisioningStatus.CONNECTING)
|
||||
this.changeStatus(ProvisioningStatus.CONNECTION_ERROR);
|
||||
else if (this.provisioningStatus == ProvisioningStatus.LOOKING_FOR_SERVER)
|
||||
this.changeStatus(ProvisioningStatus.COULD_NOT_FIND_SERVER);
|
||||
else if (!this.provisioningStatus.isError()) {
|
||||
this.changeStatus(ProvisioningStatus.CONNECTION_ERROR); // TIMEOUT
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,9 +154,17 @@ public class ProvisioningHandler implements SerialListener {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSerialLog(@NotNull String str) {
|
||||
public void onSerialLog(@NotNull String str, boolean server) {
|
||||
if (!isRunning)
|
||||
return;
|
||||
if (!server) {
|
||||
this.hasLogs = true;
|
||||
if (provisioningStatus == ProvisioningStatus.NO_SERIAL_LOGS_ERROR) {
|
||||
// Recover the onboarding process if the user turned on the
|
||||
// tracker afterward
|
||||
this.changeStatus(ProvisioningStatus.OBTAINING_MAC_ADDRESS);
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
provisioningStatus == ProvisioningStatus.OBTAINING_MAC_ADDRESS && str.contains("mac:")
|
||||
@@ -190,8 +218,8 @@ public class ProvisioningHandler implements SerialListener {
|
||||
}
|
||||
|
||||
public void changeStatus(ProvisioningStatus status) {
|
||||
this.lastStatusChange = System.currentTimeMillis();
|
||||
if (this.provisioningStatus != status) {
|
||||
this.lastStatusChange = System.currentTimeMillis();
|
||||
this.listeners
|
||||
.forEach(
|
||||
(l) -> l
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
package dev.slimevr.serial;
|
||||
|
||||
import solarxr_protocol.rpc.WifiProvisioningStatus;
|
||||
|
||||
|
||||
public enum ProvisioningStatus {
|
||||
|
||||
NONE(WifiProvisioningStatus.NONE),
|
||||
SERIAL_INIT(WifiProvisioningStatus.SERIAL_INIT),
|
||||
PROVISIONING(WifiProvisioningStatus.PROVISIONING),
|
||||
OBTAINING_MAC_ADDRESS(WifiProvisioningStatus.OBTAINING_MAC_ADDRESS),
|
||||
CONNECTING(WifiProvisioningStatus.CONNECTING),
|
||||
CONNECTION_ERROR(WifiProvisioningStatus.CONNECTION_ERROR),
|
||||
LOOKING_FOR_SERVER(WifiProvisioningStatus.LOOKING_FOR_SERVER),
|
||||
COULD_NOT_FIND_SERVER(WifiProvisioningStatus.COULD_NOT_FIND_SERVER),
|
||||
DONE(WifiProvisioningStatus.DONE);
|
||||
|
||||
public final int id;
|
||||
|
||||
ProvisioningStatus(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package dev.slimevr.serial
|
||||
|
||||
import solarxr_protocol.rpc.WifiProvisioningStatus
|
||||
|
||||
enum class ProvisioningStatus(@JvmField val id: Int, val isError: Boolean, val timeout: Int = 10_000) {
|
||||
NONE(WifiProvisioningStatus.NONE, false, 3_000),
|
||||
SERIAL_INIT(WifiProvisioningStatus.SERIAL_INIT, false, 3_000),
|
||||
PROVISIONING(WifiProvisioningStatus.PROVISIONING, false),
|
||||
OBTAINING_MAC_ADDRESS(WifiProvisioningStatus.OBTAINING_MAC_ADDRESS, false),
|
||||
CONNECTING(WifiProvisioningStatus.CONNECTING, false, 30_000),
|
||||
CONNECTION_ERROR(WifiProvisioningStatus.CONNECTION_ERROR, true),
|
||||
LOOKING_FOR_SERVER(WifiProvisioningStatus.LOOKING_FOR_SERVER, false),
|
||||
COULD_NOT_FIND_SERVER(WifiProvisioningStatus.COULD_NOT_FIND_SERVER, true),
|
||||
NO_SERIAL_LOGS_ERROR(WifiProvisioningStatus.NO_SERIAL_LOGS_ERROR, true),
|
||||
NO_SERIAL_DEVICE_FOUND(WifiProvisioningStatus.NO_SERIAL_DEVICE_FOUND, true),
|
||||
DONE(WifiProvisioningStatus.DONE, false),
|
||||
}
|
||||
@@ -23,7 +23,9 @@ abstract class SerialPort {
|
||||
interface SerialListener {
|
||||
fun onSerialConnected(port: SerialPort)
|
||||
fun onSerialDisconnected()
|
||||
fun onSerialLog(str: String)
|
||||
|
||||
// var server indicates if the log is injected by the server (not an actual serial log)
|
||||
fun onSerialLog(str: String, server: Boolean)
|
||||
fun onNewSerialDevice(port: SerialPort)
|
||||
|
||||
// This is called when the serial diver does not see the device anymore
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package dev.slimevr.tracking.processor.skeleton
|
||||
|
||||
import com.jme3.math.FastMath
|
||||
import dev.slimevr.VRServer
|
||||
import dev.slimevr.tracking.processor.Bone
|
||||
import dev.slimevr.tracking.processor.BoneType
|
||||
@@ -19,8 +18,6 @@ import dev.slimevr.util.ann.VRServerThread
|
||||
import io.eiren.util.ann.ThreadSafe
|
||||
import io.eiren.util.collections.FastList
|
||||
import io.eiren.util.logging.LogManager
|
||||
import io.github.axisangles.ktmath.EulerAngles
|
||||
import io.github.axisangles.ktmath.EulerOrder
|
||||
import io.github.axisangles.ktmath.Quaternion
|
||||
import io.github.axisangles.ktmath.Quaternion.Companion.I
|
||||
import io.github.axisangles.ktmath.Quaternion.Companion.IDENTITY
|
||||
@@ -1694,13 +1691,4 @@ class HumanSkeleton(
|
||||
setPauseTracking(newState, sourceName)
|
||||
return newState
|
||||
}
|
||||
|
||||
companion object {
|
||||
val FORWARD_QUATERNION = EulerAngles(
|
||||
EulerOrder.YZX,
|
||||
FastMath.HALF_PI,
|
||||
0f,
|
||||
0f,
|
||||
).toQuaternion()
|
||||
}
|
||||
}
|
||||
@@ -92,6 +92,7 @@ class Tracker @JvmOverloads constructor(
|
||||
private var timeAtLastUpdate: Long = System.currentTimeMillis()
|
||||
private var _rotation = Quaternion.IDENTITY
|
||||
private var _acceleration = Vector3.NULL
|
||||
private var _magVector = Vector3.NULL
|
||||
var position = Vector3.NULL
|
||||
val resetsHandler: TrackerResetsHandler = TrackerResetsHandler(this)
|
||||
val filteringHandler: TrackerFilteringHandler = TrackerFilteringHandler()
|
||||
@@ -424,6 +425,22 @@ class Tracker @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the magnetic field vector, in mGauss.
|
||||
*/
|
||||
fun getMagVector() = if (needsReset) {
|
||||
resetsHandler.getReferenceAdjustedAccel(_rotation, _magVector)
|
||||
} else {
|
||||
_magVector
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the magnetic field vector.
|
||||
*/
|
||||
fun setMagVector(vec: Vector3) {
|
||||
this._magVector = vec
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the current TPS of the tracker
|
||||
*/
|
||||
@@ -433,7 +450,7 @@ class Tracker @JvmOverloads constructor(
|
||||
/**
|
||||
* Call when doing a full reset to reset the tracking of rotations >180 degrees
|
||||
*/
|
||||
fun resetFilteringQuats() {
|
||||
filteringHandler.resetMovingAverage(getAdjustedRotation())
|
||||
fun resetFilteringQuats(reference: Quaternion) {
|
||||
filteringHandler.resetMovingAverage(getAdjustedRotation(), reference)
|
||||
}
|
||||
}
|
||||
@@ -18,17 +18,20 @@ class TrackerFilteringHandler {
|
||||
/**
|
||||
* Reads/loads filtering settings from given config
|
||||
*/
|
||||
fun readFilteringConfig(config: FiltersConfig, currentRawRotation: Quaternion) {
|
||||
fun readFilteringConfig(config: FiltersConfig, currentRotation: Quaternion) {
|
||||
val type = TrackerFilters.getByConfigkey(config.type)
|
||||
if (type == TrackerFilters.SMOOTHING || type == TrackerFilters.PREDICTION) {
|
||||
movingAverage = QuaternionMovingAverage(
|
||||
type,
|
||||
config.amount,
|
||||
currentRawRotation,
|
||||
currentRotation,
|
||||
)
|
||||
filteringEnabled = true
|
||||
} else {
|
||||
movingAverage = QuaternionMovingAverage(TrackerFilters.NONE)
|
||||
movingAverage = QuaternionMovingAverage(
|
||||
TrackerFilters.NONE,
|
||||
initialRotation = currentRotation,
|
||||
)
|
||||
filteringEnabled = false
|
||||
}
|
||||
}
|
||||
@@ -50,8 +53,8 @@ class TrackerFilteringHandler {
|
||||
/**
|
||||
* Call when doing a full reset to reset the tracking of rotations >180 degrees
|
||||
*/
|
||||
fun resetMovingAverage(currentRotation: Quaternion) {
|
||||
movingAverage.resetQuats(currentRotation)
|
||||
fun resetMovingAverage(currentRotation: Quaternion, reference: Quaternion) {
|
||||
movingAverage.resetQuats(currentRotation, reference)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -272,10 +272,10 @@ class TrackerResetsHandler(val tracker: Tracker) {
|
||||
|
||||
if (tracker.trackerDataType == TrackerDataType.FLEX_RESISTANCE) {
|
||||
tracker.trackerFlexHandler.resetMin()
|
||||
postProcessResetFull()
|
||||
postProcessResetFull(reference)
|
||||
return
|
||||
} else if (tracker.trackerDataType == TrackerDataType.FLEX_ANGLE) {
|
||||
postProcessResetFull()
|
||||
postProcessResetFull(reference)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -342,16 +342,16 @@ class TrackerResetsHandler(val tracker: Tracker) {
|
||||
|
||||
calculateDrift(oldRot)
|
||||
|
||||
postProcessResetFull()
|
||||
postProcessResetFull(reference)
|
||||
}
|
||||
|
||||
private fun postProcessResetFull() {
|
||||
private fun postProcessResetFull(reference: Quaternion) {
|
||||
if (this.tracker.lastResetStatus != 0u) {
|
||||
VRServer.instance.statusSystem.removeStatus(this.tracker.lastResetStatus)
|
||||
this.tracker.lastResetStatus = 0u
|
||||
}
|
||||
|
||||
tracker.resetFilteringQuats()
|
||||
tracker.resetFilteringQuats(reference)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -398,7 +398,7 @@ class TrackerResetsHandler(val tracker: Tracker) {
|
||||
this.tracker.lastResetStatus = 0u
|
||||
}
|
||||
|
||||
tracker.resetFilteringQuats()
|
||||
tracker.resetFilteringQuats(reference)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -408,7 +408,7 @@ class TrackerResetsHandler(val tracker: Tracker) {
|
||||
fun resetMounting(reference: Quaternion) {
|
||||
if (tracker.trackerDataType == TrackerDataType.FLEX_RESISTANCE) {
|
||||
tracker.trackerFlexHandler.resetMax()
|
||||
tracker.resetFilteringQuats()
|
||||
tracker.resetFilteringQuats(reference)
|
||||
return
|
||||
} else if (tracker.trackerDataType == TrackerDataType.FLEX_ANGLE) {
|
||||
return
|
||||
@@ -463,7 +463,7 @@ class TrackerResetsHandler(val tracker: Tracker) {
|
||||
// save mounting reset
|
||||
if (saveMountingReset) tracker.saveMountingResetOrientation(mountRotFix)
|
||||
|
||||
tracker.resetFilteringQuats()
|
||||
tracker.resetFilteringQuats(reference)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,7 +12,6 @@ import io.eiren.util.logging.LogManager
|
||||
import io.github.axisangles.ktmath.Quaternion.Companion.fromRotationVector
|
||||
import io.github.axisangles.ktmath.Vector3
|
||||
import kotlinx.coroutines.*
|
||||
import org.apache.commons.lang3.ArrayUtils
|
||||
import solarxr_protocol.rpc.ResetType
|
||||
import java.net.DatagramPacket
|
||||
import java.net.DatagramSocket
|
||||
@@ -193,14 +192,17 @@ class TrackersUDPServer(private val port: Int, name: String, private val tracker
|
||||
if (imuTracker == null) {
|
||||
var formattedHWID = connection.hardwareIdentifier.replace(":", "").takeLast(5)
|
||||
if (trackerId != 0) {
|
||||
formattedHWID += "_$trackerId"
|
||||
formattedHWID += " Extension"
|
||||
if (trackerId > 1) {
|
||||
formattedHWID += " $trackerId"
|
||||
}
|
||||
}
|
||||
|
||||
imuTracker = Tracker(
|
||||
connection,
|
||||
VRServer.getNextLocalTrackerId(),
|
||||
connection.name + "/" + trackerId,
|
||||
"IMU Tracker $formattedHWID",
|
||||
"Tracker $formattedHWID",
|
||||
trackerPosition,
|
||||
trackerNum = trackerId,
|
||||
hasRotation = true,
|
||||
@@ -612,11 +614,14 @@ class TrackersUDPServer(private val port: Int, name: String, private val tracker
|
||||
sb.append("null")
|
||||
} else {
|
||||
sb.append(packet.address.toString())
|
||||
sb.append(':')
|
||||
sb.append(packet.port)
|
||||
sb.append(',')
|
||||
sb.append(packet.length)
|
||||
sb.append(',')
|
||||
sb.append(ArrayUtils.toString(packet.data))
|
||||
sb.append('{')
|
||||
sb.append(HexFormat.ofDelimiter(",").formatHex(packet.data, 0, packet.length))
|
||||
sb.append('}')
|
||||
}
|
||||
sb.append('}')
|
||||
return sb.toString()
|
||||
|
||||
@@ -20,6 +20,11 @@ value class Quaternion(val w: Float, val x: Float, val y: Float, val z: Float) {
|
||||
*/
|
||||
val SLIMEVR: SlimeVR = SlimeVR
|
||||
|
||||
/**
|
||||
* Used to rotate an identity quaternion to face upwards for [twinExtendedBack].
|
||||
*/
|
||||
private val UP_ADJ = Quaternion(0.707f, -0.707f, 0f, 0f)
|
||||
|
||||
/**
|
||||
* creates a new quaternion representing the rotation about v's axis
|
||||
* by an angle of v's length
|
||||
@@ -114,7 +119,7 @@ value class Quaternion(val w: Float, val x: Float, val y: Float, val z: Float) {
|
||||
/**
|
||||
* computes the dot product of this quaternion with that quaternion
|
||||
* @param that the quaternion with which to be dotted
|
||||
* @return the inverse quaternion
|
||||
* @return the dot product between quaternions
|
||||
**/
|
||||
fun dot(that: Quaternion): Float =
|
||||
this.w * that.w + this.x * that.x + this.y * that.y + this.z * that.z
|
||||
@@ -227,12 +232,38 @@ value class Quaternion(val w: Float, val x: Float, val y: Float, val z: Float) {
|
||||
|
||||
/**
|
||||
* between this and -this, picks the one nearest to that quaternion
|
||||
* @param that the quaternion to be nearest
|
||||
* @param that the quaternion to be nearest to
|
||||
* @return nearest quaternion
|
||||
**/
|
||||
fun twinNearest(that: Quaternion): Quaternion =
|
||||
if (this.dot(that) < 0f) -this else this
|
||||
|
||||
/**
|
||||
* between this and -this, picks the one furthest from that quaternion
|
||||
* @param that the quaternion to be furthest from
|
||||
* @return furthest quaternion
|
||||
**/
|
||||
fun twinFurthest(that: Quaternion): Quaternion =
|
||||
if (this.dot(that) < 0f) this else -this
|
||||
|
||||
/**
|
||||
* Similar to [twinNearest], but offset so the lower back quadrant is the furthest
|
||||
* rotation relative to [that]. This is useful for joints that have limited forward
|
||||
* rotation, but extensive backward rotation.
|
||||
* @param that The reference quaternion to be nearest to or furthest from.
|
||||
* @return The furthest quaternion if in the lower back quadrant, otherwise the
|
||||
* nearest quaternion.
|
||||
**/
|
||||
fun twinExtendedBack(that: Quaternion): Quaternion {
|
||||
/*
|
||||
* This handles the thigh extending behind the torso to face downwards, and the
|
||||
* hip extending behind the chest. The thigh cannot bend to the back away from
|
||||
* the torso and the spine hopefully can't bend back that far, so we can fairly
|
||||
* safely assume the rotation is towards the torso.
|
||||
*/
|
||||
return this.twinNearest(that * UP_ADJ)
|
||||
}
|
||||
|
||||
/**
|
||||
* interpolates from this quaternion to that quaternion by t in quaternion space
|
||||
* @param that the quaternion to interpolate to
|
||||
@@ -365,7 +396,7 @@ value class Quaternion(val w: Float, val x: Float, val y: Float, val z: Float) {
|
||||
|
||||
val angleA = atan2(2f * (abQ * bQ + aQ * rot.w), rot.w * rot.w - aQ * aQ + bQ * bQ - abQ * abQ)
|
||||
val angleB = atan2(2f * (abQ * aQ + bQ * rot.w), rot.w * rot.w + aQ * aQ - bQ * bQ - abQ * abQ)
|
||||
|
||||
|
||||
return floatArrayOf(angleA, angleB)
|
||||
}
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@ import com.jme3.math.FastMath
|
||||
import dev.slimevr.VRServer.Companion.getNextLocalTrackerId
|
||||
import dev.slimevr.tracking.trackers.Tracker
|
||||
import dev.slimevr.tracking.trackers.udp.IMUType
|
||||
import dev.slimevr.unit.TrackerUtils.assertAnglesApproxEqual
|
||||
import dev.slimevr.unit.TrackerUtils.deg
|
||||
import dev.slimevr.unit.TrackerUtils.yaw
|
||||
import dev.slimevr.unit.TrackerTestUtils.assertAnglesApproxEqual
|
||||
import dev.slimevr.unit.TrackerTestUtils.deg
|
||||
import dev.slimevr.unit.TrackerTestUtils.yaw
|
||||
import io.github.axisangles.ktmath.EulerAngles
|
||||
import io.github.axisangles.ktmath.EulerOrder
|
||||
import io.github.axisangles.ktmath.Quaternion
|
||||
@@ -23,8 +23,8 @@ import org.junit.jupiter.api.TestFactory
|
||||
class MountingResetTests {
|
||||
|
||||
@TestFactory
|
||||
fun testResetAndMounting(): List<DynamicTest> = TrackerUtils.directions.flatMap { e ->
|
||||
TrackerUtils.directions.map { m ->
|
||||
fun testResetAndMounting(): List<DynamicTest> = TrackerTestUtils.directions.flatMap { e ->
|
||||
TrackerTestUtils.directions.map { m ->
|
||||
DynamicTest.dynamicTest(
|
||||
"Full and Mounting Reset Test of Tracker (Expected: ${deg(e)}, reference: ${deg(m)})",
|
||||
) {
|
||||
@@ -35,7 +35,7 @@ class MountingResetTests {
|
||||
|
||||
private fun checkResetMounting(expected: Quaternion, reference: Quaternion) {
|
||||
// Compute the pitch/roll for the expected mounting
|
||||
val trackerRot = (expected * (TrackerUtils.frontRot / expected))
|
||||
val trackerRot = (expected * (TrackerTestUtils.frontRot / expected))
|
||||
|
||||
val tracker = Tracker(
|
||||
null,
|
||||
@@ -120,7 +120,7 @@ class MountingResetTests {
|
||||
val expected = Quaternion.SLIMEVR.RIGHT
|
||||
val reference = EulerAngles(EulerOrder.YZX, FastMath.PI / 8f, FastMath.HALF_PI, 0f).toQuaternion()
|
||||
// Compute the pitch/roll for the expected mounting
|
||||
val trackerRot = (expected * (TrackerUtils.frontRot / expected))
|
||||
val trackerRot = (expected * (TrackerTestUtils.frontRot / expected))
|
||||
|
||||
val tracker = Tracker(
|
||||
null,
|
||||
|
||||
@@ -1,119 +1,82 @@
|
||||
package dev.slimevr.unit
|
||||
|
||||
import com.jme3.math.FastMath
|
||||
import dev.slimevr.VRServer.Companion.getNextLocalTrackerId
|
||||
import dev.slimevr.tracking.processor.HumanPoseManager
|
||||
import dev.slimevr.tracking.trackers.Tracker
|
||||
import dev.slimevr.tracking.trackers.TrackerPosition
|
||||
import dev.slimevr.tracking.trackers.TrackerStatus
|
||||
import dev.slimevr.tracking.trackers.udp.IMUType
|
||||
import dev.slimevr.unit.TrackerUtils.assertAnglesApproxEqual
|
||||
import dev.slimevr.unit.TrackerUtils.quatApproxEqual
|
||||
import io.eiren.util.collections.FastList
|
||||
import dev.slimevr.unit.TrackerTestUtils.assertAnglesApproxEqual
|
||||
import dev.slimevr.unit.TrackerTestUtils.quatApproxEqual
|
||||
import io.github.axisangles.ktmath.EulerAngles
|
||||
import io.github.axisangles.ktmath.EulerOrder
|
||||
import io.github.axisangles.ktmath.Quaternion
|
||||
import org.junit.jupiter.api.Test
|
||||
import kotlin.random.Random
|
||||
|
||||
class SkeletonResetTests {
|
||||
|
||||
val resetSource = "Unit Test"
|
||||
|
||||
@Test
|
||||
fun testSkeletonReset() {
|
||||
val rand = Random(42)
|
||||
|
||||
val hmd = mkTrack(TrackerPosition.HEAD, true, true, false)
|
||||
val chest = mkTrack(TrackerPosition.CHEST)
|
||||
val hip = mkTrack(TrackerPosition.HIP)
|
||||
|
||||
val upperLeft = mkTrack(TrackerPosition.LEFT_UPPER_LEG)
|
||||
val lowerLeft = mkTrack(TrackerPosition.LEFT_LOWER_LEG)
|
||||
|
||||
val upperRight = mkTrack(TrackerPosition.RIGHT_UPPER_LEG)
|
||||
val lowerRight = mkTrack(TrackerPosition.RIGHT_LOWER_LEG)
|
||||
|
||||
// Collect all our trackers
|
||||
val tracks = arrayOf(chest, hip, upperLeft, lowerLeft, upperRight, lowerRight)
|
||||
val tracksWithHmd = tracks.plus(hmd)
|
||||
val trackerList = FastList(tracksWithHmd)
|
||||
fun testSkeletonFullReset() {
|
||||
val trackers = TestTrackerSet()
|
||||
|
||||
// Initialize skeleton and everything
|
||||
val hpm = HumanPoseManager(trackerList)
|
||||
val hpm = HumanPoseManager(trackers.allL)
|
||||
|
||||
val headRot1 = EulerAngles(EulerOrder.YZX, 0f, FastMath.HALF_PI, FastMath.QUARTER_PI).toQuaternion()
|
||||
val expectRot1 = EulerAngles(EulerOrder.YZX, 0f, FastMath.HALF_PI, 0f).toQuaternion()
|
||||
|
||||
// Randomize tracker orientations, these should be zeroed and matched to the
|
||||
// headset yaw by full reset
|
||||
for (tracker in tracks) {
|
||||
val init = EulerAngles(
|
||||
EulerOrder.YZX,
|
||||
rand.nextFloat() * FastMath.TWO_PI,
|
||||
rand.nextFloat() * FastMath.TWO_PI,
|
||||
rand.nextFloat() * FastMath.TWO_PI,
|
||||
).toQuaternion()
|
||||
tracker.setRotation(init)
|
||||
for ((i, tracker) in trackers.set.withIndex()) {
|
||||
tracker.setRotation(TrackerTestUtils.testRotFromIndex(i))
|
||||
}
|
||||
hmd.setRotation(headRot1)
|
||||
trackers.head.setRotation(headRot1)
|
||||
hpm.resetTrackersFull(resetSource)
|
||||
|
||||
for (tracker in tracks) {
|
||||
for (tracker in trackers.set) {
|
||||
val actual = tracker.getRotation()
|
||||
assert(quatApproxEqual(expectRot1, actual)) {
|
||||
"\"${tracker.name}\" did not reset to the reference rotation. Expected <$expectRot1>, actual <$actual>."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testSkeletonYawReset() {
|
||||
val trackers = TestTrackerSet()
|
||||
|
||||
// Initialize skeleton and everything
|
||||
val hpm = HumanPoseManager(trackers.allL)
|
||||
|
||||
// Randomize full tracker orientations, these should match the headset yaw but
|
||||
// retain orientation otherwise
|
||||
for (tracker in tracks) {
|
||||
val init = EulerAngles(
|
||||
EulerOrder.YZX,
|
||||
rand.nextFloat() * FastMath.TWO_PI,
|
||||
rand.nextFloat() * FastMath.TWO_PI,
|
||||
rand.nextFloat() * FastMath.TWO_PI,
|
||||
).toQuaternion()
|
||||
tracker.setRotation(init)
|
||||
for ((i, tracker) in trackers.set.withIndex()) {
|
||||
// Offset index so it's different from last reset
|
||||
tracker.setRotation(TrackerTestUtils.testRotFromIndex(i))
|
||||
}
|
||||
hmd.setRotation(Quaternion.IDENTITY)
|
||||
trackers.head.setRotation(Quaternion.IDENTITY)
|
||||
hpm.resetTrackersYaw(resetSource)
|
||||
|
||||
for (tracker in tracks) {
|
||||
val yaw = TrackerUtils.yaw(tracker.getRotation())
|
||||
for (tracker in trackers.set) {
|
||||
val yaw = TrackerTestUtils.yaw(tracker.getRotation())
|
||||
assertAnglesApproxEqual(0f, yaw, "\"${tracker.name}\" did not reset to the reference rotation.")
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testSkeletonMount() {
|
||||
val hmd = mkTrack(TrackerPosition.HEAD, true, true, false)
|
||||
val chest = mkTrack(TrackerPosition.CHEST)
|
||||
val hip = mkTrack(TrackerPosition.HIP)
|
||||
|
||||
val upperLeft = mkTrack(TrackerPosition.LEFT_UPPER_LEG)
|
||||
val lowerLeft = mkTrack(TrackerPosition.LEFT_LOWER_LEG)
|
||||
|
||||
val upperRight = mkTrack(TrackerPosition.RIGHT_UPPER_LEG)
|
||||
val lowerRight = mkTrack(TrackerPosition.RIGHT_LOWER_LEG)
|
||||
|
||||
// Collect all our trackers
|
||||
val tracks = arrayOf(chest, hip, upperLeft, lowerLeft, upperRight, lowerRight)
|
||||
val tracksWithHmd = tracks.plus(hmd)
|
||||
val trackerList = FastList(tracksWithHmd)
|
||||
fun testSkeletonMountReset() {
|
||||
val trackers = TestTrackerSet()
|
||||
|
||||
// Initialize skeleton and everything
|
||||
val hpm = HumanPoseManager(trackerList)
|
||||
val hpm = HumanPoseManager(trackers.allL)
|
||||
|
||||
// Just a bunch of random mounting orientations
|
||||
val expected = arrayOf(
|
||||
Pair(chest, Quaternion.SLIMEVR.FRONT),
|
||||
Pair(hip, Quaternion.SLIMEVR.RIGHT),
|
||||
Pair(upperLeft, Quaternion.SLIMEVR.BACK),
|
||||
Pair(lowerLeft, Quaternion.SLIMEVR.LEFT),
|
||||
Pair(upperRight, Quaternion.SLIMEVR.FRONT),
|
||||
Pair(lowerRight, Quaternion.SLIMEVR.RIGHT),
|
||||
Pair(trackers.chest, Quaternion.SLIMEVR.FRONT),
|
||||
Pair(trackers.hip, Quaternion.SLIMEVR.RIGHT),
|
||||
Pair(trackers.leftThigh, Quaternion.SLIMEVR.BACK),
|
||||
Pair(trackers.leftCalf, Quaternion.SLIMEVR.LEFT),
|
||||
Pair(trackers.rightThigh, Quaternion.SLIMEVR.FRONT),
|
||||
Pair(trackers.rightCalf, Quaternion.SLIMEVR.RIGHT),
|
||||
)
|
||||
// Rotate the tracker to fit the expected mounting orientation
|
||||
for ((tracker, mountRot) in expected) {
|
||||
@@ -141,8 +104,8 @@ class SkeletonResetTests {
|
||||
val actualMounting = tracker.resetsHandler.mountRotFix
|
||||
|
||||
// Make sure yaw matches
|
||||
val expectedY = TrackerUtils.yaw(expectedMounting)
|
||||
val actualY = TrackerUtils.yaw(actualMounting)
|
||||
val expectedY = TrackerTestUtils.yaw(expectedMounting)
|
||||
val actualY = TrackerTestUtils.yaw(actualMounting)
|
||||
assertAnglesApproxEqual(expectedY, actualY, "\"${tracker.name}\" did not reset to the reference rotation.")
|
||||
|
||||
// X and Z components should be zero for mounting
|
||||
@@ -155,26 +118,5 @@ class SkeletonResetTests {
|
||||
}
|
||||
}
|
||||
|
||||
fun mkTrack(pos: TrackerPosition, hmd: Boolean = false, computed: Boolean = false, reset: Boolean = true): Tracker {
|
||||
val name = "test ${pos.designation}"
|
||||
val tracker = Tracker(
|
||||
null,
|
||||
getNextLocalTrackerId(),
|
||||
name,
|
||||
name,
|
||||
pos,
|
||||
hasPosition = hmd,
|
||||
hasRotation = true,
|
||||
isComputed = computed,
|
||||
imuType = IMUType.UNKNOWN,
|
||||
needsReset = true,
|
||||
needsMounting = reset,
|
||||
isHmd = hmd,
|
||||
trackRotDirection = false,
|
||||
)
|
||||
tracker.status = TrackerStatus.OK
|
||||
return tracker
|
||||
}
|
||||
|
||||
fun mkTrackMount(rot: Quaternion): Quaternion = rot * (TrackerUtils.frontRot / rot)
|
||||
fun mkTrackMount(rot: Quaternion): Quaternion = rot * (TrackerTestUtils.frontRot / rot)
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package dev.slimevr.unit
|
||||
|
||||
import dev.slimevr.tracking.trackers.Tracker
|
||||
import dev.slimevr.tracking.trackers.TrackerPosition
|
||||
import dev.slimevr.tracking.trackers.TrackerStatus
|
||||
|
||||
class TestTrackerSet(
|
||||
val computed: Boolean = false,
|
||||
val positional: Boolean = false,
|
||||
val resetHead: Boolean = false,
|
||||
) {
|
||||
|
||||
val head = mkTrack(0, TrackerPosition.HEAD, true)
|
||||
|
||||
val chest = mkTrack(1, TrackerPosition.CHEST)
|
||||
val hip = mkTrack(2, TrackerPosition.HIP)
|
||||
|
||||
val leftThigh = mkTrack(3, TrackerPosition.LEFT_UPPER_LEG)
|
||||
val leftCalf = mkTrack(4, TrackerPosition.LEFT_LOWER_LEG)
|
||||
|
||||
val rightThigh = mkTrack(5, TrackerPosition.RIGHT_UPPER_LEG)
|
||||
val rightCalf = mkTrack(6, TrackerPosition.RIGHT_LOWER_LEG)
|
||||
|
||||
/**
|
||||
* All the trackers in the set.
|
||||
*/
|
||||
val set = arrayOf(
|
||||
chest,
|
||||
hip,
|
||||
leftThigh,
|
||||
leftCalf,
|
||||
rightThigh,
|
||||
rightCalf,
|
||||
)
|
||||
|
||||
/**
|
||||
* All the trackers in the set as a list.
|
||||
*/
|
||||
val setL = set.asList()
|
||||
|
||||
/**
|
||||
* All the trackers in the set plus the headset.
|
||||
*/
|
||||
val all = set + head
|
||||
|
||||
/**
|
||||
* All the trackers in the set plus the headset as a list.
|
||||
*/
|
||||
val allL = all.asList()
|
||||
|
||||
fun mkTrack(id: Int, pos: TrackerPosition, isHmd: Boolean = false): Tracker {
|
||||
val tracker = Tracker(
|
||||
device = null,
|
||||
id = id,
|
||||
name = pos.name,
|
||||
trackerPosition = pos,
|
||||
trackerNum = 0,
|
||||
hasPosition = positional || isHmd,
|
||||
hasRotation = true,
|
||||
isComputed = computed || isHmd,
|
||||
needsReset = resetHead || !isHmd,
|
||||
needsMounting = resetHead || !isHmd,
|
||||
isHmd = isHmd,
|
||||
trackRotDirection = false,
|
||||
)
|
||||
tracker.status = TrackerStatus.OK
|
||||
return tracker
|
||||
}
|
||||
}
|
||||
+31
-3
@@ -1,13 +1,13 @@
|
||||
package dev.slimevr.unit
|
||||
|
||||
import com.jme3.math.FastMath
|
||||
import io.github.axisangles.ktmath.EulerAngles
|
||||
import io.github.axisangles.ktmath.EulerOrder
|
||||
import io.github.axisangles.ktmath.Quaternion
|
||||
import io.github.axisangles.ktmath.Vector3
|
||||
import org.junit.jupiter.api.AssertionFailureBuilder
|
||||
import kotlin.math.abs
|
||||
|
||||
object TrackerUtils {
|
||||
object TrackerTestUtils {
|
||||
val directions = arrayOf(
|
||||
Quaternion.SLIMEVR.FRONT,
|
||||
Quaternion.SLIMEVR.FRONT_LEFT,
|
||||
@@ -19,7 +19,30 @@ object TrackerUtils {
|
||||
Quaternion.SLIMEVR.BACK,
|
||||
)
|
||||
|
||||
val frontRot = EulerAngles(EulerOrder.YZX, FastMath.HALF_PI, 0f, 0f).toQuaternion()
|
||||
val frontRot = Quaternion(0.707f, 0.707f, 0f, 0f)
|
||||
|
||||
// A diverse range of quaternions to be used for testing where specific rotations
|
||||
// do not matter
|
||||
val testRots = arrayOf(
|
||||
// Various rotations
|
||||
frontRot,
|
||||
Quaternion(0.707f, 0f, 0f, 0.707f),
|
||||
Quaternion(0.854f, 0.354f, 0.146f, 0.354f),
|
||||
// Pure yaw rotations
|
||||
Quaternion.SLIMEVR.FRONT,
|
||||
Quaternion.SLIMEVR.LEFT,
|
||||
Quaternion.SLIMEVR.RIGHT,
|
||||
// Axes
|
||||
Quaternion.I,
|
||||
Quaternion.K,
|
||||
// Negative axes (same rotations, different sign)
|
||||
-Quaternion.I,
|
||||
-Quaternion.K,
|
||||
// Identity
|
||||
Quaternion.IDENTITY,
|
||||
)
|
||||
|
||||
fun testRotFromIndex(index: Int): Quaternion = testRots[abs(index) % testRots.size]
|
||||
|
||||
/**
|
||||
* Makes a radian angle positive
|
||||
@@ -58,4 +81,9 @@ object TrackerUtils {
|
||||
FastMath.isApproxEqual(q1.x, q2.x, tolerance) &&
|
||||
FastMath.isApproxEqual(q1.y, q2.y, tolerance) &&
|
||||
FastMath.isApproxEqual(q1.z, q2.z, tolerance)
|
||||
|
||||
fun vectorApproxEqual(v1: Vector3, v2: Vector3, tolerance: Float = FastMath.ZERO_TOLERANCE): Boolean =
|
||||
FastMath.isApproxEqual(v1.x, v2.x, tolerance) &&
|
||||
FastMath.isApproxEqual(v1.y, v2.y, tolerance) &&
|
||||
FastMath.isApproxEqual(v1.z, v2.z, tolerance)
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package dev.slimevr.unit
|
||||
|
||||
import dev.slimevr.tracking.processor.HumanPoseManager
|
||||
import dev.slimevr.unit.TrackerTestUtils.quatApproxEqual
|
||||
import dev.slimevr.unit.TrackerTestUtils.vectorApproxEqual
|
||||
import io.github.axisangles.ktmath.Quaternion
|
||||
import io.github.axisangles.ktmath.Vector3
|
||||
import org.junit.jupiter.api.Test
|
||||
import kotlin.test.assertNotNull
|
||||
|
||||
class TrackingPauseTests {
|
||||
|
||||
val resetSource = "Unit Test"
|
||||
|
||||
@Test
|
||||
fun testTrackingPause() {
|
||||
val trackers = TestTrackerSet()
|
||||
|
||||
// Initialize skeleton and everything
|
||||
val hpm = HumanPoseManager(trackers.allL)
|
||||
// TODO: This being enabled makes waist position infinity initially but not
|
||||
// later? Something weird is going on here...
|
||||
hpm.setLegTweaksEnabled(false)
|
||||
hpm.update()
|
||||
|
||||
// Store expected tracker data
|
||||
val expected = mutableMapOf<Int, Pair<Quaternion, Vector3>>()
|
||||
for (tracker in hpm.computedTrackers) {
|
||||
expected.put(tracker.id, Pair(tracker.getRotation(), tracker.position))
|
||||
}
|
||||
|
||||
// Pause tracking, nothing should move after this
|
||||
hpm.setPauseTracking(true, resetSource)
|
||||
|
||||
// Randomize tracker orientations, this should not affect the skeleton!
|
||||
for ((i, tracker) in trackers.set.withIndex()) {
|
||||
tracker.setRotation(TrackerTestUtils.testRotFromIndex(i))
|
||||
}
|
||||
|
||||
// Tick the skeleton with random tracker rotations
|
||||
hpm.update()
|
||||
|
||||
// Since we paused before moving anything, the output should still be identity
|
||||
for (tracker in hpm.computedTrackers) {
|
||||
val trackerExpected = expected[tracker.id]
|
||||
assertNotNull(trackerExpected)
|
||||
|
||||
val expectedRot = trackerExpected.first
|
||||
val expectedPos = trackerExpected.second
|
||||
|
||||
val actualRot = tracker.getRotation()
|
||||
val actualPos = tracker.position
|
||||
|
||||
assert(quatApproxEqual(expectedRot, actualRot)) {
|
||||
"\"${tracker.name}\" moved after being paused. Expected <$expectedRot>, actual <$actualRot>."
|
||||
}
|
||||
assert(vectorApproxEqual(expectedPos, actualPos)) {
|
||||
"\"${tracker.name}\" moved after being paused. Expected <$expectedPos>, actual <$actualPos>."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package dev.slimevr.unit
|
||||
|
||||
import com.jme3.math.FastMath
|
||||
import io.github.axisangles.ktmath.EulerAngles
|
||||
import io.github.axisangles.ktmath.EulerOrder
|
||||
import io.github.axisangles.ktmath.Quaternion
|
||||
import org.junit.jupiter.api.DynamicTest
|
||||
import org.junit.jupiter.api.TestFactory
|
||||
import kotlin.math.sign
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
class TwinExtendedBackTests {
|
||||
|
||||
// Bottom back quarter
|
||||
val negRange = -269..-180
|
||||
|
||||
// Front two quarters and top back quarter
|
||||
val posRange = -179..90
|
||||
|
||||
val pitchRange = negRange.map {
|
||||
AngleTest(it.toFloat(), -1f)
|
||||
}.plus(
|
||||
posRange.map {
|
||||
AngleTest(it.toFloat(), 1f)
|
||||
},
|
||||
)
|
||||
|
||||
@get:TestFactory
|
||||
val pitchTests: List<DynamicTest>
|
||||
get() = pitchRange
|
||||
.map { a: AngleTest ->
|
||||
DynamicTest.dynamicTest(
|
||||
"Dot product test for ${if (a.sign > 0f) "positive" else "negative"} signs <$a>",
|
||||
) {
|
||||
testSign(
|
||||
Quaternion.IDENTITY,
|
||||
EulerAngles(
|
||||
EulerOrder.YZX,
|
||||
a.pitch * FastMath.DEG_TO_RAD,
|
||||
0f,
|
||||
0f,
|
||||
).toQuaternion(),
|
||||
a.sign,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fun testSign(ref: Quaternion, extended: Quaternion, expectedSign: Float) {
|
||||
val result = extended.twinExtendedBack(ref)
|
||||
val dot = ref.dot(result)
|
||||
assertEquals(expectedSign.sign, dot.sign, "Resulting dot ($dot) does not match the expected sign ($expectedSign)")
|
||||
}
|
||||
|
||||
data class AngleTest(val pitch: Float, val sign: Float)
|
||||
}
|
||||
@@ -129,6 +129,8 @@ fun main(args: Array<String>) {
|
||||
)
|
||||
vrServer.start()
|
||||
|
||||
NetworkProfileChecker(vrServer)
|
||||
|
||||
// Start service for USB HID trackers
|
||||
TrackersHID(
|
||||
"Sensors HID service",
|
||||
@@ -143,6 +145,7 @@ fun main(args: Array<String>) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
vrServer.join()
|
||||
scanner.join()
|
||||
LogManager.closeLogger()
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
package dev.slimevr.desktop
|
||||
|
||||
import dev.slimevr.VRServer
|
||||
import io.eiren.util.OperatingSystem
|
||||
import solarxr_protocol.rpc.StatusData
|
||||
import solarxr_protocol.rpc.StatusDataUnion
|
||||
import solarxr_protocol.rpc.StatusPublicNetworkT
|
||||
import java.io.BufferedReader
|
||||
import java.io.InputStreamReader
|
||||
import java.util.*
|
||||
import kotlin.concurrent.scheduleAtFixedRate
|
||||
|
||||
enum class NetworkProfile {
|
||||
PRIVATE,
|
||||
PUBLIC,
|
||||
}
|
||||
|
||||
fun checkNetworkProfile(): NetworkProfile? {
|
||||
if (OperatingSystem.currentPlatform != OperatingSystem.WINDOWS) {
|
||||
return null
|
||||
}
|
||||
try {
|
||||
// Full command as a single string
|
||||
val command = "powershell.exe -Command \"(Get-NetConnectionProfile).NetworkCategory\""
|
||||
|
||||
// Use ProcessBuilder with the full command passed through the shell
|
||||
val processBuilder = ProcessBuilder(command.split(" "))
|
||||
processBuilder.redirectErrorStream(true)
|
||||
val process = processBuilder.start()
|
||||
|
||||
// Capture the output
|
||||
val output = BufferedReader(InputStreamReader(process.inputStream)).useLines { lines ->
|
||||
lines.joinToString("\n")
|
||||
}
|
||||
val exitCode = process.waitFor()
|
||||
if (exitCode != 0) {
|
||||
return null
|
||||
}
|
||||
return when (output.trim()) {
|
||||
"Private" -> NetworkProfile.PRIVATE
|
||||
"Public" -> NetworkProfile.PUBLIC
|
||||
else -> null
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
class NetworkProfileChecker(private val server: VRServer) {
|
||||
private val updateTickTimer = Timer("NetworkProfileCheck")
|
||||
private var lastPublicNetworkStatus: UInt = 0u
|
||||
private var currentNetworkProfile: NetworkProfile? = null
|
||||
|
||||
init {
|
||||
if (OperatingSystem.currentPlatform == OperatingSystem.WINDOWS) {
|
||||
this.updateTickTimer.scheduleAtFixedRate(0, 3000) {
|
||||
val profile = checkNetworkProfile()
|
||||
if (profile != currentNetworkProfile) {
|
||||
currentNetworkProfile = profile
|
||||
if (lastPublicNetworkStatus == 0u && profile == NetworkProfile.PUBLIC) {
|
||||
lastPublicNetworkStatus = server.statusSystem.addStatus(
|
||||
StatusDataUnion().apply {
|
||||
type = StatusData.StatusPublicNetwork
|
||||
value = StatusPublicNetworkT()
|
||||
},
|
||||
false,
|
||||
)
|
||||
} else if (lastPublicNetworkStatus != 0u && profile != NetworkProfile.PUBLIC) {
|
||||
server.statusSystem.removeStatus(lastPublicNetworkStatus)
|
||||
lastPublicNetworkStatus = 0u
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+9
-1
@@ -75,7 +75,7 @@ class DesktopVRCConfigHandler : VRCConfigHandler() {
|
||||
private val getDevicesTimer = Timer("FetchVRCConfigTimer")
|
||||
|
||||
private var configState: VRCConfigValues? = null
|
||||
private var vrcConfigKeys = getVRChatKeys(VRC_REG_PATH)
|
||||
private var vrcConfigKeys: Map<String, String>
|
||||
lateinit var onChange: (config: VRCConfigValues) -> Unit
|
||||
|
||||
private fun intValue(key: String): Int? {
|
||||
@@ -88,6 +88,14 @@ class DesktopVRCConfigHandler : VRCConfigHandler() {
|
||||
return getQwordValue(VRC_REG_PATH, realKey)
|
||||
}
|
||||
|
||||
init {
|
||||
vrcConfigKeys = if (OperatingSystem.currentPlatform === OperatingSystem.WINDOWS) {
|
||||
getVRChatKeys(VRC_REG_PATH)
|
||||
} else {
|
||||
mapOf()
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateCurrentState() {
|
||||
vrcConfigKeys = getVRChatKeys(VRC_REG_PATH)
|
||||
val newConfig = VRCConfigValues(
|
||||
|
||||
@@ -204,9 +204,9 @@ class DesktopSerialHandler :
|
||||
}
|
||||
}
|
||||
|
||||
fun addLog(str: String) {
|
||||
fun addLog(str: String, server: Boolean = true) {
|
||||
LogManager.info("[Serial] $str")
|
||||
listeners.forEach { it.onSerialLog(str) }
|
||||
listeners.forEach { it.onSerialLog(str, server) }
|
||||
}
|
||||
|
||||
override fun getListeningEvents(): Int = (
|
||||
@@ -219,7 +219,7 @@ class DesktopSerialHandler :
|
||||
SerialPort.LISTENING_EVENT_DATA_RECEIVED -> {
|
||||
val newData = event.receivedData
|
||||
val s = StandardCharsets.UTF_8.decode(ByteBuffer.wrap(newData)).toString()
|
||||
addLog(s)
|
||||
addLog(s, false)
|
||||
}
|
||||
|
||||
SerialPort.LISTENING_EVENT_PORT_DISCONNECTED -> {
|
||||
|
||||
+45
-8
@@ -118,11 +118,12 @@ class TrackersHID(name: String, private val trackersConsumer: Consumer<Tracker>)
|
||||
// LogManager.info("[TrackerServer] Sensor $trackerId for ${device.name}, status $sensorStatus")
|
||||
var imuTracker = device.getTracker(trackerId)
|
||||
if (imuTracker == null) {
|
||||
var formattedHWID = device.hardwareIdentifier.replace(":", "").takeLast(5)
|
||||
imuTracker = Tracker(
|
||||
device,
|
||||
VRServer.getNextLocalTrackerId(),
|
||||
device.name + "/" + trackerId,
|
||||
"IMU Tracker #" + VRServer.currentLocalTrackerId,
|
||||
"Tracker $formattedHWID",
|
||||
null,
|
||||
trackerNum = trackerId,
|
||||
hasRotation = true,
|
||||
@@ -216,6 +217,7 @@ class TrackersHID(name: String, private val trackersConsumer: Consumer<Tracker>)
|
||||
var devicesDataReceived = false
|
||||
val q = intArrayOf(0, 0, 0, 0)
|
||||
val a = intArrayOf(0, 0, 0)
|
||||
val m = intArrayOf(0, 0, 0)
|
||||
for ((hidDevice, deviceList) in devicesByHID) {
|
||||
val dataReceived: ByteArray = try {
|
||||
hidDevice.readAll(0) // multiples 64 bytes
|
||||
@@ -265,8 +267,8 @@ class TrackersHID(name: String, private val trackersConsumer: Consumer<Tracker>)
|
||||
val sensorType = IMUType.getById(imu_id.toUInt())
|
||||
// only able to register magnetometer status, not magnetometer type
|
||||
val magStatus = MagnetometerStatus.getById(mag_id.toUByte())
|
||||
if (sensorType != null) {
|
||||
setUpSensor(device, trackerId, sensorType!!, TrackerStatus.OK, magStatus!!)
|
||||
if (sensorType != null && magStatus != null) {
|
||||
setUpSensor(device, trackerId, sensorType, TrackerStatus.OK, magStatus)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -317,7 +319,7 @@ class TrackersHID(name: String, private val trackersConsumer: Consumer<Tracker>)
|
||||
// Q15 as short big endian
|
||||
q[j] = dataReceived[i + 2 + j * 2 + 1].toInt() shl 8 or dataReceived[i + 2 + j * 2].toUByte().toInt()
|
||||
}
|
||||
for (j in 0..2) { // accel received as fixed 7, in m/s
|
||||
for (j in 0..2) { // accel received as fixed 7, in m/s^2
|
||||
// Q7 as short big endian
|
||||
a[j] = dataReceived[i + 10 + j * 2 + 1].toInt() shl 8 or dataReceived[i + 10 + j * 2].toUByte().toInt()
|
||||
}
|
||||
@@ -335,7 +337,7 @@ class TrackersHID(name: String, private val trackersConsumer: Consumer<Tracker>)
|
||||
q[0] = (q_buf and 1023u).toInt()
|
||||
q[1] = (q_buf shr 10 and 2047u).toInt()
|
||||
q[2] = (q_buf shr 21 and 2047u).toInt()
|
||||
for (j in 0..2) { // accel received as fixed 7, in m/s
|
||||
for (j in 0..2) { // accel received as fixed 7, in m/s^2
|
||||
// Q7 as short big endian
|
||||
a[j] = dataReceived[i + 9 + j * 2 + 1].toInt() shl 8 or dataReceived[i + 9 + j * 2].toUByte().toInt()
|
||||
}
|
||||
@@ -348,6 +350,17 @@ class TrackersHID(name: String, private val trackersConsumer: Consumer<Tracker>)
|
||||
rssi = dataReceived[i + 15].toUByte().toInt()
|
||||
}
|
||||
|
||||
4 -> { // full precision quat and mag, no extra data
|
||||
for (j in 0..3) { // quat received as fixed Q15
|
||||
// Q15 as short big endian
|
||||
q[j] = dataReceived[i + 2 + j * 2 + 1].toInt() shl 8 or dataReceived[i + 2 + j * 2].toUByte().toInt()
|
||||
}
|
||||
for (j in 0..2) { // mag received as fixed 10, in gauss
|
||||
// Q10 as short big endian
|
||||
m[j] = dataReceived[i + 10 + j * 2 + 1].toInt() shl 8 or dataReceived[i + 10 + j * 2].toUByte().toInt()
|
||||
}
|
||||
}
|
||||
|
||||
else -> {
|
||||
}
|
||||
}
|
||||
@@ -394,7 +407,7 @@ class TrackersHID(name: String, private val trackersConsumer: Consumer<Tracker>)
|
||||
}
|
||||
|
||||
// Assign rotation and acceleration
|
||||
if (packetType == 1) {
|
||||
if (packetType == 1 || packetType == 4) {
|
||||
// The data comes in the same order as in the UDP protocol
|
||||
// x y z w -> w x y z
|
||||
var rot = Quaternion(q[3].toFloat(), q[0].toFloat(), q[1].toFloat(), q[2].toFloat())
|
||||
@@ -422,10 +435,30 @@ class TrackersHID(name: String, private val trackersConsumer: Consumer<Tracker>)
|
||||
tracker.setRotation(rot)
|
||||
}
|
||||
if (packetType == 1 || packetType == 2) {
|
||||
// TODO: Acceleration "was" wrong
|
||||
// Acceleration is in local device frame
|
||||
// On flat surface / face up:
|
||||
// Right side of the device is +X
|
||||
// Front side (facing up) is +Z
|
||||
// Mounted on body / standing up:
|
||||
// Top side of the device is +Y
|
||||
// Front side (facing out) is +Z
|
||||
val scaleAccel = 1 / (1 shl 7).toFloat() // compile time evaluation
|
||||
var acceleration = Vector3(a[0].toFloat(), a[1].toFloat(), a[2].toFloat()).times(scaleAccel) // no division
|
||||
tracker.setAcceleration(acceleration)
|
||||
}
|
||||
if (packetType == 4) {
|
||||
// Magnetometer is in local device frame
|
||||
// On flat surface / face up:
|
||||
// Right side of the device is +X
|
||||
// Front side (facing up) is +Z
|
||||
// Mounted on body / standing up:
|
||||
// Top side of the device is +Y
|
||||
// Front side (facing out) is +Z
|
||||
val scaleMag = 1000 / (1 shl 10).toFloat() // compile time evaluation, and change gauss to milligauss
|
||||
var magnetometer = Vector3(m[0].toFloat(), m[1].toFloat(), m[2].toFloat()).times(scaleMag) // no division
|
||||
tracker.setMagVector(magnetometer)
|
||||
}
|
||||
if (packetType == 1 || packetType == 2 || packetType == 4) {
|
||||
tracker.dataTick() // only data tick if there is rotation data
|
||||
}
|
||||
|
||||
@@ -462,10 +495,14 @@ class TrackersHID(name: String, private val trackersConsumer: Consumer<Tracker>)
|
||||
// Work on devicesByHid and add/remove as necessary
|
||||
val removeList: MutableList<HidDevice> = devicesByHID.keys.toMutableList()
|
||||
removeList.removeAll(hidDeviceList)
|
||||
hidDeviceList.removeAll(devicesByHID.keys) // addList
|
||||
for (device in removeList) {
|
||||
removeDevice(device)
|
||||
}
|
||||
// Quickly reattaching a device may not be detected, so always try to open existing devices
|
||||
for (device in devicesByHID.keys) {
|
||||
device.open()
|
||||
}
|
||||
hidDeviceList.removeAll(devicesByHID.keys) // addList
|
||||
for (device in hidDeviceList) {
|
||||
checkConfigureDevice(device)
|
||||
}
|
||||
|
||||
+1
-1
Submodule solarxr-protocol updated: 74cdc8b7be...8e9be687c7.
Reference in new issue
Block a user