From 885feddc76a49e169ae5775f092342f0da05d31b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=87=A4=E5=90=89?= Date: Sun, 15 Jun 2025 10:09:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=90=8C=E6=AD=A5=E5=BB=B6=E8=BF=9F?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E5=B7=AE=E4=B8=80=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/service/device/ActionCommandService.java | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/iflytop/gd/app/service/device/ActionCommandService.java b/src/main/java/com/iflytop/gd/app/service/device/ActionCommandService.java index 58b50a6..b29839a 100644 --- a/src/main/java/com/iflytop/gd/app/service/device/ActionCommandService.java +++ b/src/main/java/com/iflytop/gd/app/service/device/ActionCommandService.java @@ -36,6 +36,7 @@ public class ActionCommandService { double clawTrayPick = devicePositionService.getPosition(DevicePositionCode.clawTrayPick).getDistance();//获取夹爪托盘夹取距离 double clawTrayGrip = devicePositionService.getPosition(DevicePositionCode.clawTrayGrip).getDistance();//获取夹爪托盘夹紧距离 double trayLower = devicePositionService.getPosition(DevicePositionCode.trayLower).getDistance(); //获取加热位下降托盘位置 + double trayLift = devicePositionService.getPosition(DevicePositionCode.trayLift).getDistance(); //获取加热位抬升托盘位置 double heatModuleTrayMoveHeight = devicePositionService.getPosition(DevicePositionCode.heatModuleTrayMoveHeight).getDistance();//加热模块托盘z轴移动高度 double solutionModuleTrayMoveHeight = devicePositionService.getPosition(DevicePositionCode.solutionModuleTrayMoveHeight).getDistance();//加液模块托盘z轴移动高度 Point3D liquidAreaTrayPoint3D = devicePositionService.getPosition(DevicePositionCode.liquidAreaTrayPoint).getPoint3D();//获取加液模块上方点位 @@ -43,7 +44,7 @@ public class ActionCommandService { TrayState trayState = deviceStateService.getDeviceState().getTrayStateByHeatModuleCode(heatModuleCode); - heatModuleService.heaterMotorMoveNoWait(commandId, command, heatModuleCode, trayLower);//确保目标加热模块是抬升状态 + heatModuleService.heaterMotorMoveNoWait(commandId, command, heatModuleCode, trayLift);//确保目标加热模块是抬升状态 gantryModuleService.gantryXYMove(commandId, command, heatAreaTrayClawPoint3D);//将机械臂移动至加热模块上方 gantryModuleService.clawMove(commandId, command, clawTrayPick);//将夹爪打开,准备夹取托盘 gantryModuleService.gantryZMove(heatModuleTrayMoveHeight);//下降z轴,使夹爪落入托盘孔位 @@ -53,8 +54,8 @@ public class ActionCommandService { trayState.setInHeatModule(false); } heatModuleService.heaterMotorMoveNoWait(commandId, command, heatModuleCode, trayLower);//下降加热模块 - gantryModuleService.gantryZMove(commandId, command, 0);//抬升z轴 - Thread.sleep(2500); + gantryModuleService.gantryZMoveZero(commandId, command);//抬升z轴 + Thread.sleep(3800); deviceCommandTempUtilService.carryMoveXYToSolutionManyPoints(commandId, command, heatModuleCode, ClawItemType.tray);//携带托盘移动至加液模块 gantryModuleService.gantryXYMove(commandId, command, liquidAreaTrayPoint3D); //将携带托盘的机械臂移动至加液模块上方 deviceCommandTempUtilService.moveTrayHeatModuleAvoidUpNoWait(commandId, command, heatModuleCode);//移动完毕恢复抬升状态 @@ -64,7 +65,7 @@ public class ActionCommandService { trayState.setInSolutionModule(true); } gantryModuleService.clawMove(commandId, command, clawTrayPick);//将夹爪打开,释放托盘 - gantryModuleService.gantryZMove(commandId, command, 0);//抬升z轴 + gantryModuleService.gantryZMoveZero(commandId, command);//抬升z轴 } /** @@ -74,12 +75,13 @@ public class ActionCommandService { double clawCapPick = devicePositionService.getPosition(DevicePositionCode.clawCapPick).getDistance(); //获取拍子夹取距离 double clawCapGrip = devicePositionService.getPosition(DevicePositionCode.clawCapGrip).getDistance(); //获取拍子夹紧距离 double trayLower = devicePositionService.getPosition(DevicePositionCode.trayLower).getDistance(); //获取加热位下降托盘位置 + double trayLift = devicePositionService.getPosition(DevicePositionCode.trayLift).getDistance(); //获取加热位抬升托盘位置 double heatModuleCapMoveHeight = devicePositionService.getPosition(DevicePositionCode.heatModuleCapMoveHeight).getDistance();//加热模块拍子移动高度 double capModuleCapMoveHeight = devicePositionService.getPosition(DevicePositionCode.capModuleCapMoveHeight).getDistance();//拍子升降模块拍子z轴移动高度 Point3D heatAreaCapClawPointPoint3D = heatModuleService.getHeatAreaCapClawPointPoint3D(heatModuleCode);//获取指定加热模块拍子上方点位 - heatModuleService.heaterMotorMoveNoWait(commandId, command, heatModuleCode, trayLower);//确保目标加热模块是抬升状态 + heatModuleService.heaterMotorMoveNoWait(commandId, command, heatModuleCode, trayLift);//确保目标加热模块是抬升状态 gantryModuleService.gantryXYMove(commandId, command, heatAreaCapClawPointPoint3D);//将机械臂移动至加热模块拍子上方 deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setTrayUp(1);//将加热模块托盘状态改为抬起 @@ -88,14 +90,14 @@ public class ActionCommandService { gantryModuleService.clawMove(commandId, command, clawCapGrip);//将夹爪收紧,夹住拍子 deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setCapExist(false);//加热模块是否存在拍子 capModuleService.capMotorMoveByNumNoWait(commandId, command, -1);//拍子存放模块下降1个拍子位置 - gantryModuleService.gantryZMove(commandId, command, 0);//抬升z轴 + gantryModuleService.gantryZMoveZero(commandId, command);//抬升z轴 heatModuleService.heaterMotorMoveNoWait(commandId, command, heatModuleCode, trayLower);//下降加热模块 Thread.sleep(2500); deviceCommandTempUtilService.carryMoveXYToSolutionManyPoints(commandId, command, heatModuleCode, ClawItemType.cap);//携带拍子移动至存放区 deviceCommandTempUtilService.moveTrayHeatModuleAvoidUpNoWait(commandId, command, heatModuleCode);//移动完毕恢复抬升状态 gantryModuleService.gantryZMove(capModuleCapMoveHeight);//下降z轴,使夹拍子落入存放区 gantryModuleService.clawMove(commandId, command, clawCapPick);//将夹爪打开,释放夹取的拍子 - gantryModuleService.gantryZMove(commandId, command, 0);//抬升z轴 + gantryModuleService.gantryZMoveZero(commandId, command);//抬升z轴 } /** @@ -121,7 +123,7 @@ public class ActionCommandService { capModuleService.capUpBalanceNoWait(commandId, command); //提升拍子存放区 deviceCommandTempUtilService.moveTrayHeatModuleAvoidUpNoWait(commandId, command, heatModuleCode); - Thread.sleep(4500); + Thread.sleep(3800); gantryModuleService.gantryZMove(heatModuleCapMoveHeight);//下降z轴,使夹拍子落入加热模块 gantryModuleService.clawMove(commandId, command, clawCapPick);//将夹爪打开,释放拍子 @@ -160,7 +162,7 @@ public class ActionCommandService { deviceCommandTempUtilService.carryMoveXYToHeatManyPoints(commandId, command, heatModuleCode, ClawItemType.tray);//将托盘移动至目标加热模块上方 deviceCommandTempUtilService.moveTrayHeatModuleAvoidUpNoWait(commandId, command, heatModuleCode);//抬升避让的加热模块 - Thread.sleep(3200); + Thread.sleep(2500); gantryModuleService.gantryZMove(heatModuleTrayMoveHeight);//下降z轴,使托盘落入加热模块 gantryModuleService.clawMove(commandId, command, clawTrayPick);//将夹爪打开,释放托盘 @@ -168,7 +170,7 @@ public class ActionCommandService { if (trayState != null) { trayState.setInHeatModule(true); } - gantryModuleService.gantryZMove(commandId, command, 0);//抬升z轴 + gantryModuleService.gantryZMoveZero(commandId, command);//抬升z轴 } }