diff --git a/.env.development b/.env.development index b051a37..8e4c6fe 100644 --- a/.env.development +++ b/.env.development @@ -7,8 +7,9 @@ VITE_APP_ENV = 'development' # 招商车研物联网平台/开发环境 VITE_APP_BASE_API = '/dev-api' -VITE_API_URL = http://192.168.1.201:13080 -VITE_WS_URL = ws://192.168.1.201:13080/ws +VITE_API_URL = http://192.168.1.101:13080 +VITE_WS_URL = ws://192.168.1.101:13080/ws # explanation -VITE_INSPECTION_TYPE = "inspection" \ No newline at end of file +VITE_INSPECTION_TYPE = "inspection" +VITE_INSPECTION_ALM_DEVICEID = "huayan_arm" \ No newline at end of file diff --git a/src/adapters/XacroAdapter.js b/src/adapters/XacroAdapter.js index 9a7275f..97b4c56 100644 --- a/src/adapters/XacroAdapter.js +++ b/src/adapters/XacroAdapter.js @@ -92,7 +92,6 @@ export class XacroAdapter { // Check for parsing errors const parseError = cleanUrdfXML.querySelector('parsererror'); if (parseError) { - console.error('[XacroAdapter] XML parsing error:', parseError.textContent); throw new Error('Generated URDF has invalid XML: ' + parseError.textContent); } @@ -261,7 +260,6 @@ export class XacroAdapter { } else { let stlPath = path stlPath = stlPath.replace('file:///', 'inspection/elfin10') - console.log(stlPath, manager, done) originalLoadMeshCb(path, manager, done); } }).catch(error => { @@ -306,9 +304,6 @@ export class XacroAdapter { * @returns {Promise} */ static async loadFileFromMap(path, fileMap, workingPath) { - console.log('path', path) - console.log('fileMap', fileMap) - console.log('workingPath', workingPath) // Clean path - remove leading slash if present let cleanPath = path; // if (cleanPath.startsWith('/')) { @@ -318,7 +313,6 @@ export class XacroAdapter { // // Remove leading ./ // cleanPath = cleanPath.replace(/^\.\//, ''); cleanPath = cleanPath.split('///')[1]; - console.log('cleanPath', cleanPath) // Try different path combinations const possiblePaths = [ cleanPath, @@ -328,13 +322,11 @@ export class XacroAdapter { // Also try without the first directory component cleanPath.includes('/') ? cleanPath.substring(cleanPath.indexOf('/') + 1) : cleanPath, ]; - console.log('possiblePaths', possiblePaths) + // Try each path for (const tryPath of possiblePaths) { - console.log('tryPath', tryPath) const file = fileMap.get(tryPath); if (file) { - console.log(12345) const content = await file.text(); return content; } diff --git a/src/api/inspection/cockpit.js b/src/api/inspection/cockpit.js new file mode 100644 index 0000000..1d7ee0f --- /dev/null +++ b/src/api/inspection/cockpit.js @@ -0,0 +1,57 @@ +import request from '@/utils/request' + +export function getPoseApi(params) { + return request({ + url: '/api/arm/getPose', + method: 'get', + params: params + }) +} + +export function getJointStateApi(params) { + return request({ + url: '/api/arm/getJointState', + method: 'get', + params: params + }) +} + +export function speedLApi(data) { + return request({ + url: '/api/arm/speedL', + method: 'post', + data: data + }) +} + +export function moveJApi(data) { + return request({ + url: '/api/arm/moveJ', + method: 'post', + data: data + }) +} + +export function stopMotionApi(params) { + return request({ + url: '/api/arm/stopMotion', + method: 'get', + params: params + }) +} + +export function torqueOnApi(params) { + return request({ + url: '/api/arm/torqueOn', + method: 'get', + params: params + }) +} + +export function speedJApi(data) { + return request({ + url: '/api/arm/speedJ', + method: 'post', + data: data + }) +} \ No newline at end of file diff --git a/src/views/flow/components/params/BasicNodeParams.vue b/src/views/flow/components/params/BasicNodeParams.vue index 8fc17e9..e78f5ab 100644 --- a/src/views/flow/components/params/BasicNodeParams.vue +++ b/src/views/flow/components/params/BasicNodeParams.vue @@ -31,7 +31,7 @@ :prop="`nodeParams.${index}.input`"> + :controls="property?.controls || true" :step-strictly="true" :step="property.step || 1" placeholder="请输入" clearable /> -
-
-
-
选择机器人
-
-
-
- -
-
-
机器人#01
-
厂区A-在线
-
-
-
-
-
-
-
控制模式
-
-
- - 自动巡检 -
-
- - 人工接管 -
-
-
-
- - 底盘 - 机械臂 - 相机 - -
人工控制面板
-
-
- - 方向控制器 -
-
-
-
-
- -
-
-
- -
-
- -
-
- -
-
-
- -
-
-
-
-
-
移动速度
-
{{ speed }}m/s
-
- -
-
- - 末端控制 - 关节控制 - 姿态控制 - - -
-
左手
-
右手
-
- -
-
-
-
-
X
-
+124.50
-
-
-
Y
-
−38.20
-
-
-
Z
-
+502.00
-
-
-
- -
- -
-
X
-
-
前后平移
-
- - - - - - -
-
-
- - -
-
Y
-
-
左右平移
-
- - - - - - -
-
-
- - -
-
Z
-
-
上下平移
-
- - - - - - -
-
-
-
-
-
-
-
- - - {{ (joint.value * 180 / Math.PI).toFixed(1) }}° -
-
-
-
-
- -
-
-
地图
-
- -
-
监控
-
-
-
车载监控
-
-
-
语音对话
- -
-
- - - - \ No newline at end of file diff --git a/src/views/inspection/cockpit/components/ManualTakeover/DirectionControl.vue b/src/views/inspection/cockpit/components/ManualTakeover/DirectionControl.vue new file mode 100644 index 0000000..be69b45 --- /dev/null +++ b/src/views/inspection/cockpit/components/ManualTakeover/DirectionControl.vue @@ -0,0 +1,314 @@ + + + \ 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 new file mode 100644 index 0000000..c89d7b1 --- /dev/null +++ b/src/views/inspection/cockpit/components/ManualTakeover/RoboticArm.vue @@ -0,0 +1,400 @@ + + + \ No newline at end of file diff --git a/src/views/inspection/cockpit/components/UrdfView.vue b/src/views/inspection/cockpit/components/ManualTakeover/UrdfView.vue similarity index 88% rename from src/views/inspection/cockpit/components/UrdfView.vue rename to src/views/inspection/cockpit/components/ManualTakeover/UrdfView.vue index ddb1530..edf45fa 100644 --- a/src/views/inspection/cockpit/components/UrdfView.vue +++ b/src/views/inspection/cockpit/components/ManualTakeover/UrdfView.vue @@ -41,46 +41,35 @@ const initScene = () => { const height = container.clientHeight || 600; scene = new THREE.Scene(); scene.background = new THREE.Color('#000d2e'); - camera = new THREE.PerspectiveCamera(45, width / height, 0.1, 1000); - camera.position.set(2, 2, 3); + + camera = new THREE.PerspectiveCamera(35, width / height, 0.1, 1000); + camera.position.set(0, 0, 4); + renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true }); renderer.setSize(width, height); - renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2)); - renderer.shadowMap.enabled = true; - renderer.shadowMap.type = THREE.PCFSoftShadowMap; - renderer.toneMapping = THREE.ACESFilmicToneMapping; - renderer.toneMappingExposure = 1.2; + container.appendChild(renderer.domElement); + controls = new OrbitControls(camera, renderer.domElement); controls.enableDamping = true; controls.dampingFactor = 0.1; controls.target.set(0, 0.5, 0); controls.update(); - const ambient = new THREE.AmbientLight(0x404060, 0.6); + const ambient = new THREE.AmbientLight(0xffffff, 0.6) scene.add(ambient); - const main = new THREE.DirectionalLight(0xffffff, 1.0); - main.position.set(5, 10, 7); - main.castShadow = true; - scene.add(main); - const fill = new THREE.DirectionalLight(0x8888ff, 0.4); - fill.position.set(-5, 0, 5); - scene.add(fill); - const rim = new THREE.DirectionalLight(0xffffff, 0.3); - rim.position.set(0, -5, 5); - scene.add(rim); - // const grid = new THREE.GridHelper(3, 20, 0x444466, 0x333355); - // grid.position.y = -0.5; - // scene.add(grid); + + const directionalLight = new THREE.DirectionalLight(0xffffff, 1.0); + directionalLight.position.set(5, 10, 7); + directionalLight.castShadow = true; + scene.add(directionalLight); }; // ============ 关节控制(无需修改) ============ const updateJoint = (jointName, angle) => { if (!robotInstance) return; - const joint = robotInstance.joints[jointName]; - if (!joint) { console.warn(`未找到关节: ${jointName}`); return; @@ -93,6 +82,7 @@ const updateJoint = (jointName, angle) => { joint.setJointValue(angle); } + // 同步滑块显示值 const control = jointControls.find(c => c.name === jointName); if (control) control.value = angle; diff --git a/src/views/inspection/cockpit/components/ManualTakeover/index.vue b/src/views/inspection/cockpit/components/ManualTakeover/index.vue new file mode 100644 index 0000000..9ca937e --- /dev/null +++ b/src/views/inspection/cockpit/components/ManualTakeover/index.vue @@ -0,0 +1,516 @@ + + + + \ No newline at end of file diff --git a/src/views/inspection/cockpit/index.vue b/src/views/inspection/cockpit/index.vue index f90095e..cdacc2b 100644 --- a/src/views/inspection/cockpit/index.vue +++ b/src/views/inspection/cockpit/index.vue @@ -13,7 +13,7 @@