From 6750204823ff21ed08244cf07ff2d86b6576e44d Mon Sep 17 00:00:00 2001 From: root <13910913995@163.com> Date: Thu, 7 Aug 2025 09:53:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=98=BE=E7=A4=BAbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Log/OrbbecSDK.log.txt | 80 +++++++++++++++++++ backend/device_manager.py | 28 ++++--- frontend/src/renderer/src/views/Detection.vue | 6 +- 3 files changed, 100 insertions(+), 14 deletions(-) diff --git a/Log/OrbbecSDK.log.txt b/Log/OrbbecSDK.log.txt index 5fd9deb0..56d5ae34 100644 --- a/Log/OrbbecSDK.log.txt +++ b/Log/OrbbecSDK.log.txt @@ -194672,3 +194672,83 @@ transform: {rot: [0.994135, -0.00252459, 0.00230278, 0.00226079, 0.994134, 0.108 [08/06 16:16:20.792673][debug][18856][DeviceManager.cpp:64] DeviceManager Destructors done [08/06 16:16:20.794234][debug][18856][MfPal.cpp:128] WmfPal destroyed! [08/06 16:16:20.794542][info][18856][Context.cpp:84] Context destroyed +[08/06 18:49:39.320553][debug][7128][Context.cpp:30] Context creating, work_dir=D:\Trae_space\BodyBalanceEvaluation +[08/06 18:49:39.321439][debug][7128][Context.cpp:49] Config file version=1.1 +[08/06 18:49:39.321794][debug][7128][FrameBufferManager.cpp:23] Max global frame buffer size updated! size=2048.000MB +[08/06 18:49:39.321861][info][7128][Context.cpp:68] Context created with config: default config! +[08/06 18:49:39.322297][info][7128][Context.cpp:73] Work directory=D:\Trae_space\BodyBalanceEvaluation, SDK version=v1.10.11-20240724-aeaa107e5 +[08/06 18:49:39.322605][debug][7128][DeviceManager.cpp:30] DeviceManager init ... +[08/06 18:49:39.322653][info][7128][MfPal.cpp:105] createObPal: create WinPal! +[08/06 18:49:39.324634][debug][7128][MfPal.cpp:110] WmfPal init ... +[08/06 18:49:39.397789][debug][7128][MfPal.cpp:117] WmfPal created! +[08/06 18:49:39.397898][debug][7128][DeviceManager.cpp:34] Enable USB Device Enumerator ... +[08/06 18:49:39.480505][debug][7128][EnumeratorLibusb.cpp:321] queryDevicesInfo done! +[08/06 18:49:39.481199][debug][7128][MfPal.cpp:216] Create WinEventDeviceWatcher! +[08/06 18:49:39.481472][debug][7128][UsbDeviceEnumerator.cpp:78] No matched usb device found! +[08/06 18:49:39.481703][info][7128][DeviceManager.cpp:15] Current found device(s): (0) +[08/06 18:49:39.482334][debug][7128][DeviceManager.cpp:52] DeviceManager construct done! +[08/06 18:49:39.482711][debug][7128][Context.cpp:81] Context destroying ... +[08/06 18:49:39.482753][debug][7128][DeviceManager.cpp:56] DeviceManager destroy ... +[08/06 18:49:39.482846][debug][7128][DeviceManager.cpp:64] DeviceManager Destructors done +[08/06 18:49:39.484599][debug][7128][MfPal.cpp:128] WmfPal destroyed! +[08/06 18:49:39.485324][info][7128][Context.cpp:84] Context destroyed +[08/07 08:37:04.330106][debug][1608][Context.cpp:30] Context creating, work_dir=D:\Trae_space\BodyBalanceEvaluation +[08/07 08:37:04.331001][debug][1608][Context.cpp:49] Config file version=1.1 +[08/07 08:37:04.331403][debug][1608][FrameBufferManager.cpp:23] Max global frame buffer size updated! size=2048.000MB +[08/07 08:37:04.331481][info][1608][Context.cpp:68] Context created with config: default config! +[08/07 08:37:04.331980][info][1608][Context.cpp:73] Work directory=D:\Trae_space\BodyBalanceEvaluation, SDK version=v1.10.11-20240724-aeaa107e5 +[08/07 08:37:04.332345][debug][1608][DeviceManager.cpp:30] DeviceManager init ... +[08/07 08:37:04.332393][info][1608][MfPal.cpp:105] createObPal: create WinPal! +[08/07 08:37:04.332702][debug][1608][MfPal.cpp:110] WmfPal init ... +[08/07 08:37:04.392689][debug][1608][MfPal.cpp:117] WmfPal created! +[08/07 08:37:04.392788][debug][1608][DeviceManager.cpp:34] Enable USB Device Enumerator ... +[08/07 08:37:04.434990][debug][1608][EnumeratorLibusb.cpp:321] queryDevicesInfo done! +[08/07 08:37:04.435417][debug][1608][MfPal.cpp:216] Create WinEventDeviceWatcher! +[08/07 08:37:04.435774][debug][1608][UsbDeviceEnumerator.cpp:78] No matched usb device found! +[08/07 08:37:04.436028][info][1608][DeviceManager.cpp:15] Current found device(s): (0) +[08/07 08:37:04.436282][debug][1608][DeviceManager.cpp:52] DeviceManager construct done! +[08/07 08:37:04.436602][debug][1608][Context.cpp:81] Context destroying ... +[08/07 08:37:04.436640][debug][1608][DeviceManager.cpp:56] DeviceManager destroy ... +[08/07 08:37:04.436974][debug][1608][DeviceManager.cpp:64] DeviceManager Destructors done +[08/07 08:37:04.438813][debug][1608][MfPal.cpp:128] WmfPal destroyed! +[08/07 08:37:04.439737][info][1608][Context.cpp:84] Context destroyed +[08/07 08:53:58.557016][debug][26392][Context.cpp:30] Context creating, work_dir=D:\Trae_space\BodyBalanceEvaluation +[08/07 08:53:58.557193][debug][26392][Context.cpp:49] Config file version=1.1 +[08/07 08:53:58.557237][debug][26392][FrameBufferManager.cpp:23] Max global frame buffer size updated! size=2048.000MB +[08/07 08:53:58.557265][info][26392][Context.cpp:68] Context created with config: default config! +[08/07 08:53:58.557495][info][26392][Context.cpp:73] Work directory=D:\Trae_space\BodyBalanceEvaluation, SDK version=v1.10.11-20240724-aeaa107e5 +[08/07 08:53:58.557711][debug][26392][DeviceManager.cpp:30] DeviceManager init ... +[08/07 08:53:58.557731][info][26392][MfPal.cpp:105] createObPal: create WinPal! +[08/07 08:53:58.557935][debug][26392][MfPal.cpp:110] WmfPal init ... +[08/07 08:53:58.610665][debug][26392][MfPal.cpp:117] WmfPal created! +[08/07 08:53:58.610706][debug][26392][DeviceManager.cpp:34] Enable USB Device Enumerator ... +[08/07 08:53:58.642596][debug][26392][EnumeratorLibusb.cpp:321] queryDevicesInfo done! +[08/07 08:53:58.642997][debug][26392][MfPal.cpp:216] Create WinEventDeviceWatcher! +[08/07 08:53:58.643262][debug][26392][UsbDeviceEnumerator.cpp:78] No matched usb device found! +[08/07 08:53:58.643306][info][26392][DeviceManager.cpp:15] Current found device(s): (0) +[08/07 08:53:58.643483][debug][26392][DeviceManager.cpp:52] DeviceManager construct done! +[08/07 08:53:58.643513][debug][26392][Context.cpp:81] Context destroying ... +[08/07 08:53:58.643527][debug][26392][DeviceManager.cpp:56] DeviceManager destroy ... +[08/07 08:53:58.643540][debug][26392][DeviceManager.cpp:64] DeviceManager Destructors done +[08/07 08:53:58.644558][debug][26392][MfPal.cpp:128] WmfPal destroyed! +[08/07 08:53:58.644986][info][26392][Context.cpp:84] Context destroyed +[08/07 09:03:51.600617][debug][5460][Context.cpp:30] Context creating, work_dir=D:\Trae_space\BodyBalanceEvaluation +[08/07 09:03:51.600710][debug][5460][Context.cpp:49] Config file version=1.1 +[08/07 09:03:51.600737][debug][5460][FrameBufferManager.cpp:23] Max global frame buffer size updated! size=2048.000MB +[08/07 09:03:51.600755][info][5460][Context.cpp:68] Context created with config: default config! +[08/07 09:03:51.600863][info][5460][Context.cpp:73] Work directory=D:\Trae_space\BodyBalanceEvaluation, SDK version=v1.10.11-20240724-aeaa107e5 +[08/07 09:03:51.600973][debug][5460][DeviceManager.cpp:30] DeviceManager init ... +[08/07 09:03:51.600985][info][5460][MfPal.cpp:105] createObPal: create WinPal! +[08/07 09:03:51.601138][debug][5460][MfPal.cpp:110] WmfPal init ... +[08/07 09:03:51.629206][debug][5460][MfPal.cpp:117] WmfPal created! +[08/07 09:03:51.629309][debug][5460][DeviceManager.cpp:34] Enable USB Device Enumerator ... +[08/07 09:03:51.652743][debug][5460][EnumeratorLibusb.cpp:321] queryDevicesInfo done! +[08/07 09:03:51.653156][debug][5460][MfPal.cpp:216] Create WinEventDeviceWatcher! +[08/07 09:03:51.653432][debug][5460][UsbDeviceEnumerator.cpp:78] No matched usb device found! +[08/07 09:03:51.653463][info][5460][DeviceManager.cpp:15] Current found device(s): (0) +[08/07 09:03:51.653658][debug][5460][DeviceManager.cpp:52] DeviceManager construct done! +[08/07 09:03:51.653680][debug][5460][Context.cpp:81] Context destroying ... +[08/07 09:03:51.653690][debug][5460][DeviceManager.cpp:56] DeviceManager destroy ... +[08/07 09:03:51.653698][debug][5460][DeviceManager.cpp:64] DeviceManager Destructors done +[08/07 09:03:51.654355][debug][5460][MfPal.cpp:128] WmfPal destroyed! +[08/07 09:03:51.654625][info][5460][Context.cpp:84] Context destroyed diff --git a/backend/device_manager.py b/backend/device_manager.py index 99dfc089..d6a395b7 100644 --- a/backend/device_manager.py +++ b/backend/device_manager.py @@ -1221,9 +1221,7 @@ class DeviceManager: head_pose_data = { 'rotation': head_pose['rotation'], # 旋转角:左旋(-), 右旋(+) 'tilt': head_pose['tilt'], # 倾斜角:左倾(-), 右倾(+) - 'pitch': head_pose['pitch'], # 俯仰角:俯角(-), 仰角(+) - - 'temperature': imu_data.get('temperature', 25), + 'pitch': head_pose['pitch'], # 俯仰角:俯角(-), 仰角(+) 'timestamp': imu_data['timestamp'] } @@ -1269,6 +1267,14 @@ class DeviceManager: # 计算总压力 total_pressure = left_total + right_total + # 计算各区域压力百分比 + left_front_percent = (left_front / total_pressure * 100) if total_pressure > 0 else 0 + left_rear_percent = (left_rear / total_pressure * 100) if total_pressure > 0 else 0 + right_front_percent = (right_front / total_pressure * 100) if total_pressure > 0 else 0 + right_rear_percent = (right_rear / total_pressure * 100) if total_pressure > 0 else 0 + left_total_percent = (left_total / total_pressure * 100) if total_pressure > 0 else 0 + right_total_percent = (right_total / total_pressure * 100) if total_pressure > 0 else 0 + # 计算平衡比例(左脚压力占总压力的比例) balance_ratio = left_total / total_pressure if total_pressure > 0 else 0.5 @@ -1281,15 +1287,15 @@ class DeviceManager: # 构建完整的足部压力数据 complete_pressure_data = { - # 分区压力值 + # 分区压力百分比 'pressure_zones': { - 'left_front': left_front, - 'left_rear': left_rear, - 'right_front': right_front, - 'right_rear': right_rear, - 'left_total': left_total, - 'right_total': right_total, - 'total_pressure': total_pressure + 'left_front': round(left_front_percent, 1), + 'left_rear': round(left_rear_percent, 1), + 'right_front': round(right_front_percent,1), + 'right_rear': round(right_rear_percent, 1), + 'left_total': round(left_total_percent, 1), + 'right_total': round(right_total_percent, 1), + 'total_pressure': 100.0 # 总压力百分比始终为100% }, # 平衡分析 'balance_analysis': { diff --git a/frontend/src/renderer/src/views/Detection.vue b/frontend/src/renderer/src/views/Detection.vue index 11b6cd2f..da48b7e7 100644 --- a/frontend/src/renderer/src/views/Detection.vue +++ b/frontend/src/renderer/src/views/Detection.vue @@ -810,7 +810,7 @@ function updateHeadPoseMaxValues(headPose) { // 更新旋转角最值 if (headPose.rotation < 0) { // 左旋(负值),取绝对值的最大值 - headPoseMaxValues.value.rotationLeftMax = Math.min( + headPoseMaxValues.value.rotationLeftMax = Math.max( headPoseMaxValues.value.rotationLeftMax, Math.abs(headPose.rotation) ) @@ -825,7 +825,7 @@ function updateHeadPoseMaxValues(headPose) { // 更新倾斜角最值 if (headPose.tilt < 0) { // 左倾(负值),取绝对值的最大值 - headPoseMaxValues.value.tiltLeftMax = Math.min( + headPoseMaxValues.value.tiltLeftMax = Math.max( headPoseMaxValues.value.tiltLeftMax, Math.abs(headPose.tilt) ) @@ -840,7 +840,7 @@ function updateHeadPoseMaxValues(headPose) { // 更新俯仰角最值 if (headPose.pitch < 0) { // 下俯(负值),取绝对值的最大值 - headPoseMaxValues.value.pitchDownMax = Math.min( + headPoseMaxValues.value.pitchDownMax = Math.max( headPoseMaxValues.value.pitchDownMax, Math.abs(headPose.pitch) )