From 43ca0b0122960b9862934bd2ca7587fa47246672 Mon Sep 17 00:00:00 2001 From: zhanghao <774378400@qq.com> Date: Wed, 22 Jul 2026 14:33:02 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E6=9C=BA=E5=99=A8?= =?UTF-8?q?=E4=BA=BA=E6=89=AC=E5=A3=B0=E5=99=A8=E5=92=8C=E9=BA=A6=E5=85=8B?= =?UTF-8?q?=E9=A3=8E=E9=9F=B3=E9=87=8F=E7=9A=84=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 7 +- src/api/inspection/cockpit.js | 40 +++++ .../components/ManualTakeover/RoboticArm.vue | 10 +- .../ManualTakeover/VoiceConversation.vue | 153 +++++++++++++++++- .../components/ManualTakeover/index.vue | 24 ++- 5 files changed, 215 insertions(+), 19 deletions(-) diff --git a/.env.development b/.env.development index 78d43a5..3f2a973 100644 --- a/.env.development +++ b/.env.development @@ -12,5 +12,8 @@ VITE_WS_URL = ws://192.168.0.222:13080/ws # explanation VITE_INSPECTION_TYPE = "inspection" -VITE_INSPECTION_ARM_DEVICEID = "huayan_arm" -VITE_INSPECTION_AGV_DEVICEID = "huayan_arm" \ No newline at end of file +VITE_INSPECTION_ARM_DEVICE_ID = "huayan_arm" +VITE_INSPECTION_AGV_DEVICE_ID = "src1100" +VITE_AUDIO_SERVER_URL = "ws://192.168.0.222:13080/ws/audio" +VITE_SPEAKER_DEVICE_ID = "spk1" +VITE_MIC_DEVICE_ID = "mic1" \ No newline at end of file diff --git a/src/api/inspection/cockpit.js b/src/api/inspection/cockpit.js index 1d7ee0f..055c658 100644 --- a/src/api/inspection/cockpit.js +++ b/src/api/inspection/cockpit.js @@ -54,4 +54,44 @@ export function speedJApi(data) { method: 'post', data: data }) +} + +export function clearFault(params) { + return request({ + url: '/api/arm/clearFault', + method: 'get', + params: params + }) +} + +export function getMicVolume(params) { + return request({ + url: '/api/Microphone/volume', + method: 'get', + params: params + }) +} + +export function setMicVolume(data) { + return request({ + url: '/api/Microphone/volume', + method: 'post', + data: data + }) +} + +export function getSpeakerVolume(params) { + return request({ + url: '/api/Speaker/volume', + method: 'get', + params: params + }) +} + +export function setSpeakerVolume(data) { + return request({ + url: '/api/Speaker/volume', + method: 'post', + data: data + }) } \ No newline at end of file diff --git a/src/views/inspection/cockpit/components/ManualTakeover/RoboticArm.vue b/src/views/inspection/cockpit/components/ManualTakeover/RoboticArm.vue index fe904c0..55d29dc 100644 --- a/src/views/inspection/cockpit/components/ManualTakeover/RoboticArm.vue +++ b/src/views/inspection/cockpit/components/ManualTakeover/RoboticArm.vue @@ -135,8 +135,8 @@
速度:
- -
{{( speed / 2 * 100).toFixed(0) }} %
+ +
{{( speed / 1 * 100).toFixed(0) }} %
@@ -174,7 +174,7 @@ const errorNum = ref(0) const getPose = async (robot) => { try { const res = await getPoseApi({ - deviceId: import.meta.env.VITE_INSPECTION_ARM_DEVICEID, + deviceId: import.meta.env.VITE_INSPECTION_ARM_DEVICE_ID, terminalId: robot.terminalId }) if (res.code === 200) { @@ -249,7 +249,7 @@ const move = async (axis, direction) => { } speedLApi({ - deviceId: import.meta.env.VITE_INSPECTION_ARM_DEVICEID, + deviceId: import.meta.env.VITE_INSPECTION_ARM_DEVICE_ID, terminalId: props.robot.terminalId, duration: 60, acceleration: speed.value + 0.1, @@ -262,7 +262,7 @@ const move = async (axis, direction) => { */ const stop = async () => { await stopMotionApi({ - deviceId: import.meta.env.VITE_INSPECTION_ARM_DEVICEID, + deviceId: import.meta.env.VITE_INSPECTION_ARM_DEVICE_ID, terminalId: props.robot.terminalId }) } diff --git a/src/views/inspection/cockpit/components/ManualTakeover/VoiceConversation.vue b/src/views/inspection/cockpit/components/ManualTakeover/VoiceConversation.vue index 036ebe1..6134eba 100644 --- a/src/views/inspection/cockpit/components/ManualTakeover/VoiceConversation.vue +++ b/src/views/inspection/cockpit/components/ManualTakeover/VoiceConversation.vue @@ -52,6 +52,34 @@ +
+ 机器人麦克风音量 + + {{ microphoneVolume }}% +
+ +
+ 机器人扬声器音量 + + {{ speakerVolume }}% +
+

当前状态:{{ statusMeta.label }}

@@ -72,12 +100,13 @@ @@ -843,6 +962,30 @@ $panel-border: rgb(112 192 255 / 24%); :deep(.el-button + .el-button) { margin-left: 0; } } + .robot-volume { + display: grid; + grid-template-columns: auto minmax(120px, 210px) 42px; + align-items: center; + gap: 12px; + width: min(100%, 430px); + margin-top: 10px; + color: #badeff;; + font-size: 11px; + + &__label { white-space: nowrap; } + &__value { color: #fff; text-align: right; font-variant-numeric: tabular-nums; } + + :deep(.el-slider__runway) { background-color: #dff7ff; } + :deep(.el-slider__bar) { background: linear-gradient(90deg, #46c8ff, #936cff); } + :deep(.el-slider__button) { + width: 14px; + height: 14px; + border-color: #46c8ff; + background: #dff7ff; + box-shadow: 0 0 10px rgb(70 200 255 / 65%); + } + } + :deep(.call-button) { width: 178px; height: 34px; diff --git a/src/views/inspection/cockpit/components/ManualTakeover/index.vue b/src/views/inspection/cockpit/components/ManualTakeover/index.vue index 8727efb..c31703a 100644 --- a/src/views/inspection/cockpit/components/ManualTakeover/index.vue +++ b/src/views/inspection/cockpit/components/ManualTakeover/index.vue @@ -82,8 +82,8 @@
速度:
- -
{{( jointSpeed / 3 * 100).toFixed(0) }} %
+ +
{{( jointSpeed / 1 * 100).toFixed(0) }} %
@@ -119,7 +119,7 @@ import UrdfViewer from './UrdfView.vue' import DirectionControl from './DirectionControl.vue' import RoboticArm from "./RoboticArm.vue"; import { getRobotList } from '@/api/inspection/robot' -import { getJointStateApi, moveJApi, torqueOnApi, speedJApi, stopMotionApi } from '@/api/inspection/cockpit' +import { getJointStateApi, moveJApi, torqueOnApi, speedJApi, stopMotionApi, clearFault } from '@/api/inspection/cockpit' import { Remove, CirclePlus } from '@element-plus/icons-vue' import VoiceConversation from "./VoiceConversation.vue"; import IPlayer from "@/components/IPlayer/index.vue"; @@ -178,8 +178,14 @@ const handlerController = (value) => { if (value === 2) { // 开启机械臂使能 torqueOnApi({ - deviceId: import.meta.env.VITE_INSPECTION_ARM_DEVICEID, + deviceId: import.meta.env.VITE_INSPECTION_ARM_DEVICE_ID, terminalId: activeBotData.value.terminalId + }).catch(error => { + console.error('开启机械臂使能失败:', error) + clearFault({ + deviceId: import.meta.env.VITE_INSPECTION_ARM_DEVICE_ID, + terminalId: activeBotData.value.terminalId + }) }) jointControls.value = urdfViewerRef.value.jointControls if (animationId.value) { @@ -188,6 +194,10 @@ const handlerController = (value) => { animationId.value = setInterval(() => { getJointState(activeBotData.value) }, 100) + } else { + if (animationId.value) { + clearInterval(animationId.value) + } } } @@ -209,7 +219,7 @@ const errCount = ref(0) const getJointState = async (robot) => { try { const res = await getJointStateApi({ - deviceId: import.meta.env.VITE_INSPECTION_ARM_DEVICEID, + deviceId: import.meta.env.VITE_INSPECTION_ARM_DEVICE_ID, terminalId: robot.terminalId }) if (res.code === 200) { @@ -246,7 +256,7 @@ const updateJoint = async (jointName, _dir) => { const index = jointControls.value.findIndex(joint => joint.name === jointName) velocities[index] = jointSpeed.value * (_dir === '+' ? 1 : -1) const res = await speedJApi({ - deviceId: import.meta.env.VITE_INSPECTION_ARM_DEVICEID, + deviceId: import.meta.env.VITE_INSPECTION_ARM_DEVICE_ID, terminalId: activeBotData.value.terminalId, acceleration: jointSpeed.value + 0.1, duration: 60, @@ -259,7 +269,7 @@ const updateJoint = async (jointName, _dir) => { */ const stop = async () => { await stopMotionApi({ - deviceId: import.meta.env.VITE_INSPECTION_ARM_DEVICEID, + deviceId: import.meta.env.VITE_INSPECTION_ARM_DEVICE_ID, terminalId: activeBotData.value.terminalId }) }