点击“设置”的时候,“运行”也处于选中状态。
任务配置->机械臂初始姿态 加入“应用当前姿态”按钮。点击,把机械臂调整为该姿态。 任务配置->网格配置 本来点位行3已经设置好了数据,但现在没有了。 机械臂的IP地址换到了192.168.50.89
This commit is contained in:
@@ -361,6 +361,25 @@ createApp({
|
||||
if (!data.ok) { alert('导航失败: ' + (data.error || '')) }
|
||||
} catch (e) { alert('导航失败: ' + e.message) }
|
||||
},
|
||||
async goToOrigin() {
|
||||
if (!confirm('确认导航到原点 (0, 0, 0)?')) return
|
||||
try {
|
||||
const res = await fetch(API + '/api/navigate/to', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ x: 0, y: 0, yaw: 0 })
|
||||
})
|
||||
const data = await res.json()
|
||||
if (data.ok) {
|
||||
this.mapMsg = '✅ 已发送导航到原点'
|
||||
} else {
|
||||
this.mapMsg = '❌ ' + (data.error || '导航失败')
|
||||
}
|
||||
} catch (e) {
|
||||
this.mapMsg = '❌ 导航请求失败: ' + e.message
|
||||
}
|
||||
setTimeout(() => { this.mapMsg = '' }, 3000)
|
||||
},
|
||||
async clearPoint() {
|
||||
if (!this.editingPoint) return
|
||||
const { pointRow, col } = this.editingPoint
|
||||
@@ -581,6 +600,20 @@ createApp({
|
||||
}
|
||||
} catch (e) { alert('读取角度失败: ' + e.message) }
|
||||
},
|
||||
async applyArmInitialPose() {
|
||||
if (!this.armConnected) { alert('机械臂未连接'); return }
|
||||
if (!confirm('确认应用初始姿态到机械臂?')) return
|
||||
try {
|
||||
const res = await fetch(API + '/api/arm/set_angles', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ angles: this.armInitialPose, speed: 500 })
|
||||
})
|
||||
const data = await res.json()
|
||||
if (data.ok) alert('✅ 机械臂已移动到初始姿态')
|
||||
else alert('❌ 应用失败: ' + (data.error || ''))
|
||||
} catch (e) { alert('应用失败: ' + e.message) }
|
||||
},
|
||||
async loadAllMachines() {
|
||||
try {
|
||||
const res = await fetch(API + '/api/mission/machines')
|
||||
|
||||
Reference in New Issue
Block a user