From 3c89ed98b9b9a9822a69db777db62871154453b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=87=A4=E5=90=89?= Date: Wed, 11 Jun 2025 21:03:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E7=83=AD=E6=A8=A1=E5=9D=975=E4=B8=B4?= =?UTF-8?q?=E6=97=B6=E9=AB=98=E4=BA=8610=E5=8E=98=E7=B1=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../command/control/MoveToSolutionAreaCommand.java | 8 +- .../gd/app/command/control/TrayUpCommand.java | 6 +- .../debug/step/DebugCapInHeatAreaCommand.java | 128 ++++++++++----------- .../debug/step/DebugCapOutHeatAreaCommand.java | 126 ++++++++++---------- .../debug/step/DebugMoveTrayToHeatAreaCommand.java | 122 ++++++++++---------- .../step/DebugMoveTrayToSolutionAreaCommand.java | 124 ++++++++++---------- .../command/debug/step/DebugShowSmogCommand.java | 8 +- .../gd/app/command/selftest/TrayOutCommand.java | 8 +- .../gd/app/service/crafts/CraftsStepService.java | 12 +- .../device/DeviceCommandTempUtilService.java | 24 +++- .../service/device/module/GantryModuleService.java | 9 +- 11 files changed, 313 insertions(+), 262 deletions(-) diff --git a/src/main/java/com/iflytop/gd/app/command/control/MoveToSolutionAreaCommand.java b/src/main/java/com/iflytop/gd/app/command/control/MoveToSolutionAreaCommand.java index 4d6cfbf..626b7bb 100644 --- a/src/main/java/com/iflytop/gd/app/command/control/MoveToSolutionAreaCommand.java +++ b/src/main/java/com/iflytop/gd/app/command/control/MoveToSolutionAreaCommand.java @@ -103,7 +103,13 @@ public class MoveToSolutionAreaCommand extends BaseCommandHandler { capModuleService.capUpBalanceNoWait(cmdDTO.getCommandId(), cmdDTO.getCommand()); //提升拍子存放区至拍子夹取的高度 gantryModuleService.gantryMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatAreaCapClawPointPoint3D);//将机械臂移动至加热模块拍子上方 deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setTrayUp(1);//将加热模块托盘状态改为抬起 - heatModuleService.heaterMotorMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatModuleCode, trayLift);//抬升指定加热位托盘 + + double newTrayLift = trayLift; //TODO 临时调整位置 + if(HeatModuleCode.heat_module_05.equals(heatModuleCode)){ + newTrayLift = trayLift - 10; + } + + heatModuleService.heaterMotorMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatModuleCode, newTrayLift);//抬升指定加热位托盘 gantryModuleService.clawMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), clawCapPick);//将夹爪打开,准备夹取拍子 gantryModuleService.gantryZMove(heatModuleCapMoveHeight);//下降z轴,使夹爪落入加热模块拍子孔位 gantryModuleService.clawMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), clawCapGrip);//将夹爪收紧,夹住拍子 diff --git a/src/main/java/com/iflytop/gd/app/command/control/TrayUpCommand.java b/src/main/java/com/iflytop/gd/app/command/control/TrayUpCommand.java index 10f95e8..d555ddc 100644 --- a/src/main/java/com/iflytop/gd/app/command/control/TrayUpCommand.java +++ b/src/main/java/com/iflytop/gd/app/command/control/TrayUpCommand.java @@ -47,7 +47,11 @@ public class TrayUpCommand extends BaseCommandHandler { return runAsync(() -> { try { //抬升加热位托盘 - heatModuleService.heaterMotorMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatModuleCode, trayLift); + double newTrayLift = trayLift; //TODO 临时调整位置 + if (HeatModuleCode.heat_module_05.equals(heatModuleCode)) { + newTrayLift = trayLift - 10; + } + heatModuleService.heaterMotorMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatModuleCode, newTrayLift); deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setTrayUp(1); } catch (Exception e) { log.error("抬起托盘失败", e); diff --git a/src/main/java/com/iflytop/gd/app/command/debug/step/DebugCapInHeatAreaCommand.java b/src/main/java/com/iflytop/gd/app/command/debug/step/DebugCapInHeatAreaCommand.java index 6ea7db4..380e444 100644 --- a/src/main/java/com/iflytop/gd/app/command/debug/step/DebugCapInHeatAreaCommand.java +++ b/src/main/java/com/iflytop/gd/app/command/debug/step/DebugCapInHeatAreaCommand.java @@ -1,64 +1,64 @@ -package com.iflytop.gd.app.command.debug.step; - -import com.iflytop.gd.app.core.BaseCommandHandler; -import com.iflytop.gd.app.model.bo.Point3D; -import com.iflytop.gd.app.model.dto.CmdDTO; -import com.iflytop.gd.app.service.api.DevicePositionService; -import com.iflytop.gd.app.service.device.module.CapModuleService; -import com.iflytop.gd.app.service.device.module.GantryModuleService; -import com.iflytop.gd.app.service.device.module.HeatModuleService; -import com.iflytop.gd.common.annotation.CommandMapping; -import com.iflytop.gd.common.enums.HeatModuleCode; -import com.iflytop.gd.common.enums.data.DevicePositionCode; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Component; - -import java.util.concurrent.CompletableFuture; - -/** - * 指定加热模块安装拍子 - */ -@Slf4j -@Component -@RequiredArgsConstructor -@CommandMapping("debug_cap_in_heat_area") -public class DebugCapInHeatAreaCommand extends BaseCommandHandler { - private final GantryModuleService gantryModuleService; - private final HeatModuleService heatModuleService; - private final CapModuleService capModuleService; - private final DevicePositionService devicePositionService; - - @Override - public CompletableFuture handle(CmdDTO cmdDTO) throws Exception { - String heatId = cmdDTO.getStringParam("heatId"); - HeatModuleCode heatModuleId = HeatModuleCode.valueOf(heatId); - double clawCapPick = devicePositionService.getPosition(DevicePositionCode.clawCapPick).getDistance(); //获取拍子夹取距离 - double clawCapGrip = devicePositionService.getPosition(DevicePositionCode.clawCapGrip).getDistance(); //获取拍子夹紧距离 - double trayLift = devicePositionService.getPosition(DevicePositionCode.trayLift).getDistance(); //托盘升降抬升距离 - double trayLower = devicePositionService.getPosition(DevicePositionCode.trayLower).getDistance(); //获取加热位下降托盘位置 - double heatModuleCapMoveHeight = devicePositionService.getPosition(DevicePositionCode.heatModuleCapMoveHeight).getDistance();//加热模块拍子移动高度 - double capModuleCapMoveHeight = devicePositionService.getPosition(DevicePositionCode.capModuleCapMoveHeight).getDistance();//拍子升降模块拍子z轴移动高度 - - Point3D heatAreaCapClawPointPoint3D = heatModuleService.getHeatAreaCapClawPointPoint3D(heatModuleId);//获取指定加热模块拍子上方点位 - Point3D capStorageCapClawPoint3D = devicePositionService.getPosition(DevicePositionCode.capStorageCapClawPoint).getPoint3D();//获取拍子存放区上方点位; - - return runAsync(() -> { - capModuleService.capUpBalance(cmdDTO.getCommandId(), cmdDTO.getCommand());//提升拍子存放区至拍子夹取的高度 - gantryModuleService.gantryMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), capStorageCapClawPoint3D);//移动机械臂至拍子存放区上方 - - gantryModuleService.clawMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), clawCapPick);//将夹爪打开,准备夹取拍子 - gantryModuleService.gantryZMove(capModuleCapMoveHeight);//下降z轴,使夹爪落入拍子升降模块拍子孔位 - gantryModuleService.clawMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), clawCapGrip);//将夹爪收紧,夹住拍子 - gantryModuleService.gantryZMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), 0);//抬升z轴 - gantryModuleService.gantryMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatAreaCapClawPointPoint3D);//将携带拍子的机械臂移动至加热模块拍子上方 - heatModuleService.heaterMotorMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatModuleId, trayLift);//抬升加热模块托盘 - gantryModuleService.gantryZMove(heatModuleCapMoveHeight);//下降z轴,使夹拍子落入加热模块 - gantryModuleService.clawMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), clawCapPick);//将夹爪打开,释放拍子 - gantryModuleService.gantryZMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), 0);//抬升z轴 - heatModuleService.heaterMotorMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatModuleId, trayLower);//下降加热模块托盘 - capModuleService.capUpBalance(cmdDTO.getCommandId(), cmdDTO.getCommand()); //提升拍子存放区 - }); - } -} - +//package com.iflytop.gd.app.command.debug.step; +// +//import com.iflytop.gd.app.core.BaseCommandHandler; +//import com.iflytop.gd.app.model.bo.Point3D; +//import com.iflytop.gd.app.model.dto.CmdDTO; +//import com.iflytop.gd.app.service.api.DevicePositionService; +//import com.iflytop.gd.app.service.device.module.CapModuleService; +//import com.iflytop.gd.app.service.device.module.GantryModuleService; +//import com.iflytop.gd.app.service.device.module.HeatModuleService; +//import com.iflytop.gd.common.annotation.CommandMapping; +//import com.iflytop.gd.common.enums.HeatModuleCode; +//import com.iflytop.gd.common.enums.data.DevicePositionCode; +//import lombok.RequiredArgsConstructor; +//import lombok.extern.slf4j.Slf4j; +//import org.springframework.stereotype.Component; +// +//import java.util.concurrent.CompletableFuture; +// +///** +// * 指定加热模块安装拍子 +// */ +//@Slf4j +//@Component +//@RequiredArgsConstructor +//@CommandMapping("debug_cap_in_heat_area") +//public class DebugCapInHeatAreaCommand extends BaseCommandHandler { +// private final GantryModuleService gantryModuleService; +// private final HeatModuleService heatModuleService; +// private final CapModuleService capModuleService; +// private final DevicePositionService devicePositionService; +// +// @Override +// public CompletableFuture handle(CmdDTO cmdDTO) throws Exception { +// String heatId = cmdDTO.getStringParam("heatId"); +// HeatModuleCode heatModuleId = HeatModuleCode.valueOf(heatId); +// double clawCapPick = devicePositionService.getPosition(DevicePositionCode.clawCapPick).getDistance(); //获取拍子夹取距离 +// double clawCapGrip = devicePositionService.getPosition(DevicePositionCode.clawCapGrip).getDistance(); //获取拍子夹紧距离 +// double trayLift = devicePositionService.getPosition(DevicePositionCode.trayLift).getDistance(); //托盘升降抬升距离 +// double trayLower = devicePositionService.getPosition(DevicePositionCode.trayLower).getDistance(); //获取加热位下降托盘位置 +// double heatModuleCapMoveHeight = devicePositionService.getPosition(DevicePositionCode.heatModuleCapMoveHeight).getDistance();//加热模块拍子移动高度 +// double capModuleCapMoveHeight = devicePositionService.getPosition(DevicePositionCode.capModuleCapMoveHeight).getDistance();//拍子升降模块拍子z轴移动高度 +// +// Point3D heatAreaCapClawPointPoint3D = heatModuleService.getHeatAreaCapClawPointPoint3D(heatModuleId);//获取指定加热模块拍子上方点位 +// Point3D capStorageCapClawPoint3D = devicePositionService.getPosition(DevicePositionCode.capStorageCapClawPoint).getPoint3D();//获取拍子存放区上方点位; +// +// return runAsync(() -> { +// capModuleService.capUpBalance(cmdDTO.getCommandId(), cmdDTO.getCommand());//提升拍子存放区至拍子夹取的高度 +// gantryModuleService.gantryMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), capStorageCapClawPoint3D);//移动机械臂至拍子存放区上方 +// +// gantryModuleService.clawMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), clawCapPick);//将夹爪打开,准备夹取拍子 +// gantryModuleService.gantryZMove(capModuleCapMoveHeight);//下降z轴,使夹爪落入拍子升降模块拍子孔位 +// gantryModuleService.clawMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), clawCapGrip);//将夹爪收紧,夹住拍子 +// gantryModuleService.gantryZMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), 0);//抬升z轴 +// gantryModuleService.gantryMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatAreaCapClawPointPoint3D);//将携带拍子的机械臂移动至加热模块拍子上方 +// heatModuleService.heaterMotorMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatModuleId, trayLift);//抬升加热模块托盘 +// gantryModuleService.gantryZMove(heatModuleCapMoveHeight);//下降z轴,使夹拍子落入加热模块 +// gantryModuleService.clawMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), clawCapPick);//将夹爪打开,释放拍子 +// gantryModuleService.gantryZMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), 0);//抬升z轴 +// heatModuleService.heaterMotorMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatModuleId, trayLower);//下降加热模块托盘 +// capModuleService.capUpBalance(cmdDTO.getCommandId(), cmdDTO.getCommand()); //提升拍子存放区 +// }); +// } +//} +// diff --git a/src/main/java/com/iflytop/gd/app/command/debug/step/DebugCapOutHeatAreaCommand.java b/src/main/java/com/iflytop/gd/app/command/debug/step/DebugCapOutHeatAreaCommand.java index 605710e..3be09bf 100644 --- a/src/main/java/com/iflytop/gd/app/command/debug/step/DebugCapOutHeatAreaCommand.java +++ b/src/main/java/com/iflytop/gd/app/command/debug/step/DebugCapOutHeatAreaCommand.java @@ -1,63 +1,63 @@ -package com.iflytop.gd.app.command.debug.step; - -import com.iflytop.gd.app.core.BaseCommandHandler; -import com.iflytop.gd.app.model.bo.Point3D; -import com.iflytop.gd.app.model.dto.CmdDTO; -import com.iflytop.gd.app.service.api.DevicePositionService; -import com.iflytop.gd.app.service.device.module.CapModuleService; -import com.iflytop.gd.app.service.device.module.GantryModuleService; -import com.iflytop.gd.app.service.device.module.HeatModuleService; -import com.iflytop.gd.common.annotation.CommandMapping; -import com.iflytop.gd.common.enums.HeatModuleCode; -import com.iflytop.gd.common.enums.data.DevicePositionCode; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Component; - -import java.util.concurrent.CompletableFuture; - -/** - * 指定加热模块拆卸拍子 - */ -@Slf4j -@Component -@RequiredArgsConstructor -@CommandMapping("debug_cap_out_heat_area") -public class DebugCapOutHeatAreaCommand extends BaseCommandHandler { - private final GantryModuleService gantryModuleService; - private final HeatModuleService heatModuleService; - private final CapModuleService capModuleService; - private final DevicePositionService devicePositionService; - - @Override - public CompletableFuture handle(CmdDTO cmdDTO) throws Exception { - String heatId = cmdDTO.getStringParam("heatId"); - HeatModuleCode heatModuleId = HeatModuleCode.valueOf(heatId); - double clawCapPick = devicePositionService.getPosition(DevicePositionCode.clawCapPick).getDistance(); //获取拍子夹取距离 - double clawCapGrip = devicePositionService.getPosition(DevicePositionCode.clawCapGrip).getDistance(); //获取拍子夹紧距离 - double trayLift = devicePositionService.getPosition(DevicePositionCode.trayLift).getDistance(); //托盘升降抬升距离 - double trayLower = devicePositionService.getPosition(DevicePositionCode.trayLower).getDistance(); //获取加热位下降托盘位置 - double heatModuleCapMoveHeight = devicePositionService.getPosition(DevicePositionCode.heatModuleCapMoveHeight).getDistance();//加热模块拍子移动高度 - double capModuleCapMoveHeight = devicePositionService.getPosition(DevicePositionCode.capModuleCapMoveHeight).getDistance();//拍子升降模块拍子z轴移动高度 - - Point3D heatAreaCapClawPointPoint3D = heatModuleService.getHeatAreaCapClawPointPoint3D(heatModuleId);//获取指定加热模块拍子上方点位 - Point3D capStorageCapClawPoint3D = devicePositionService.getPosition(DevicePositionCode.capStorageCapClawPoint).getPoint3D();//获取拍子存放区上方点位; - - return runAsync(() -> { - capModuleService.capUpBalance(cmdDTO.getCommandId(), cmdDTO.getCommand()); //提升拍子存放区至拍子夹取的高度 - gantryModuleService.gantryMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatAreaCapClawPointPoint3D);//将机械臂移动至加热模块拍子上方 - heatModuleService.heaterMotorMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatModuleId, trayLift);//抬升指定加热位托盘 - gantryModuleService.clawMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), clawCapPick);//将夹爪打开,准备夹取拍子 - gantryModuleService.gantryZMove(heatModuleCapMoveHeight);//下降z轴,使夹爪落入加热模块拍子孔位 - gantryModuleService.clawMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), clawCapGrip);//将夹爪收紧,夹住拍子 - gantryModuleService.gantryZMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), 0);//抬升z轴 - capModuleService.capMotorMoveByNum(-1);//拍子存放模块下降1个拍子位置 - gantryModuleService.gantryMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), capStorageCapClawPoint3D);//将携带拍子的机械臂移动至存放区上方 - gantryModuleService.gantryZMove(capModuleCapMoveHeight);//下降z轴,使夹拍子落入存放区 - gantryModuleService.clawMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), clawCapPick);//将夹爪打开,释放夹取的拍子 - gantryModuleService.gantryZMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), 0);//抬升z轴 - heatModuleService.heaterMotorMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatModuleId, trayLower);//下降加热模块托盘 - }); - } -} - +//package com.iflytop.gd.app.command.debug.step; +// +//import com.iflytop.gd.app.core.BaseCommandHandler; +//import com.iflytop.gd.app.model.bo.Point3D; +//import com.iflytop.gd.app.model.dto.CmdDTO; +//import com.iflytop.gd.app.service.api.DevicePositionService; +//import com.iflytop.gd.app.service.device.module.CapModuleService; +//import com.iflytop.gd.app.service.device.module.GantryModuleService; +//import com.iflytop.gd.app.service.device.module.HeatModuleService; +//import com.iflytop.gd.common.annotation.CommandMapping; +//import com.iflytop.gd.common.enums.HeatModuleCode; +//import com.iflytop.gd.common.enums.data.DevicePositionCode; +//import lombok.RequiredArgsConstructor; +//import lombok.extern.slf4j.Slf4j; +//import org.springframework.stereotype.Component; +// +//import java.util.concurrent.CompletableFuture; +// +///** +// * 指定加热模块拆卸拍子 +// */ +//@Slf4j +//@Component +//@RequiredArgsConstructor +//@CommandMapping("debug_cap_out_heat_area") +//public class DebugCapOutHeatAreaCommand extends BaseCommandHandler { +// private final GantryModuleService gantryModuleService; +// private final HeatModuleService heatModuleService; +// private final CapModuleService capModuleService; +// private final DevicePositionService devicePositionService; +// +// @Override +// public CompletableFuture handle(CmdDTO cmdDTO) throws Exception { +// String heatId = cmdDTO.getStringParam("heatId"); +// HeatModuleCode heatModuleId = HeatModuleCode.valueOf(heatId); +// double clawCapPick = devicePositionService.getPosition(DevicePositionCode.clawCapPick).getDistance(); //获取拍子夹取距离 +// double clawCapGrip = devicePositionService.getPosition(DevicePositionCode.clawCapGrip).getDistance(); //获取拍子夹紧距离 +// double trayLift = devicePositionService.getPosition(DevicePositionCode.trayLift).getDistance(); //托盘升降抬升距离 +// double trayLower = devicePositionService.getPosition(DevicePositionCode.trayLower).getDistance(); //获取加热位下降托盘位置 +// double heatModuleCapMoveHeight = devicePositionService.getPosition(DevicePositionCode.heatModuleCapMoveHeight).getDistance();//加热模块拍子移动高度 +// double capModuleCapMoveHeight = devicePositionService.getPosition(DevicePositionCode.capModuleCapMoveHeight).getDistance();//拍子升降模块拍子z轴移动高度 +// +// Point3D heatAreaCapClawPointPoint3D = heatModuleService.getHeatAreaCapClawPointPoint3D(heatModuleId);//获取指定加热模块拍子上方点位 +// Point3D capStorageCapClawPoint3D = devicePositionService.getPosition(DevicePositionCode.capStorageCapClawPoint).getPoint3D();//获取拍子存放区上方点位; +// +// return runAsync(() -> { +// capModuleService.capUpBalance(cmdDTO.getCommandId(), cmdDTO.getCommand()); //提升拍子存放区至拍子夹取的高度 +// gantryModuleService.gantryMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatAreaCapClawPointPoint3D);//将机械臂移动至加热模块拍子上方 +// heatModuleService.heaterMotorMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatModuleId, trayLift);//抬升指定加热位托盘 +// gantryModuleService.clawMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), clawCapPick);//将夹爪打开,准备夹取拍子 +// gantryModuleService.gantryZMove(heatModuleCapMoveHeight);//下降z轴,使夹爪落入加热模块拍子孔位 +// gantryModuleService.clawMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), clawCapGrip);//将夹爪收紧,夹住拍子 +// gantryModuleService.gantryZMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), 0);//抬升z轴 +// capModuleService.capMotorMoveByNum(-1);//拍子存放模块下降1个拍子位置 +// gantryModuleService.gantryMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), capStorageCapClawPoint3D);//将携带拍子的机械臂移动至存放区上方 +// gantryModuleService.gantryZMove(capModuleCapMoveHeight);//下降z轴,使夹拍子落入存放区 +// gantryModuleService.clawMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), clawCapPick);//将夹爪打开,释放夹取的拍子 +// gantryModuleService.gantryZMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), 0);//抬升z轴 +// heatModuleService.heaterMotorMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatModuleId, trayLower);//下降加热模块托盘 +// }); +// } +//} +// diff --git a/src/main/java/com/iflytop/gd/app/command/debug/step/DebugMoveTrayToHeatAreaCommand.java b/src/main/java/com/iflytop/gd/app/command/debug/step/DebugMoveTrayToHeatAreaCommand.java index 4b32acb..53e0b18 100644 --- a/src/main/java/com/iflytop/gd/app/command/debug/step/DebugMoveTrayToHeatAreaCommand.java +++ b/src/main/java/com/iflytop/gd/app/command/debug/step/DebugMoveTrayToHeatAreaCommand.java @@ -1,61 +1,61 @@ -package com.iflytop.gd.app.command.debug.step; - -import com.iflytop.gd.app.core.BaseCommandHandler; -import com.iflytop.gd.app.model.bo.Point3D; -import com.iflytop.gd.app.model.dto.CmdDTO; -import com.iflytop.gd.app.service.api.DevicePositionService; -import com.iflytop.gd.app.service.device.module.GantryModuleService; -import com.iflytop.gd.app.service.device.module.HeatModuleService; -import com.iflytop.gd.common.annotation.CommandMapping; -import com.iflytop.gd.common.enums.HeatModuleCode; -import com.iflytop.gd.common.enums.data.DevicePositionCode; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Component; - -import java.util.concurrent.CompletableFuture; - -/** - * 将托盘从加液模块移至加热模块 - */ -@Slf4j -@Component -@RequiredArgsConstructor -@CommandMapping("debug_move_tray_to_heat_area") -public class DebugMoveTrayToHeatAreaCommand extends BaseCommandHandler { - private final GantryModuleService gantryModuleService; - private final HeatModuleService heatModuleService; - private final DevicePositionService devicePositionService; - - @Override - public CompletableFuture handle(CmdDTO cmdDTO) throws Exception { - String heatId = cmdDTO.getStringParam("heatId"); - HeatModuleCode heatModuleId = HeatModuleCode.valueOf(heatId); - double clawTrayPick = devicePositionService.getPosition(DevicePositionCode.clawTrayPick).getDistance();//获取夹爪托盘夹取距离 - double clawTrayGrip = devicePositionService.getPosition(DevicePositionCode.clawTrayGrip).getDistance();//获取夹爪托盘夹紧距离 - double trayLift = devicePositionService.getPosition(DevicePositionCode.trayLift).getDistance(); //托盘升降抬升距离 - double trayLower = devicePositionService.getPosition(DevicePositionCode.trayLower).getDistance(); //获取加热位下降托盘位置 - double heatModuleTrayMoveHeight = devicePositionService.getPosition(DevicePositionCode.heatModuleTrayMoveHeight).getDistance();//加热模块托盘z轴移动高度 - double solutionModuleTrayMoveHeight = devicePositionService.getPosition(DevicePositionCode.solutionModuleTrayMoveHeight).getDistance();//加液模块托盘z轴移动高度 - - Point3D liquidAreaTrayPoint3D = devicePositionService.getPosition(DevicePositionCode.liquidAreaTrayPoint).getPoint3D();//获取加液模块上方点位 - Point3D heatAreaTrayClawPoint3D = heatModuleService.getHeatAreaTrayClawPoint3D(heatModuleId);//获取指定加热模块上方点位 - Point3D heatArea4TrayClawPoint3D = heatModuleService.getHeatAreaTrayClawPoint3D(HeatModuleCode.heat_module_04);//获取指定加热模块上方点位 - - return runAsync(() -> { - gantryModuleService.gantryMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), liquidAreaTrayPoint3D); //将机械臂移动至加液模块上方 - gantryModuleService.clawMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), clawTrayPick);//将夹爪打开,准备夹取托盘 - gantryModuleService.gantryZMove(solutionModuleTrayMoveHeight);//下降z轴,使夹爪落入托盘孔位 - gantryModuleService.clawMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), clawTrayGrip);//将夹爪收紧,夹住托盘 - gantryModuleService.gantryZMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), 0);//抬升z轴 - gantryModuleService.gantryMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatArea4TrayClawPoint3D);//将携带托盘的机械臂移动至4号加热模块上方 - gantryModuleService.gantryMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatAreaTrayClawPoint3D);//将携带托盘的机械臂移动至加热模块上方 - heatModuleService.heaterMotorMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatModuleId, trayLift);//抬升加热位托盘 - gantryModuleService.gantryZMove(heatModuleTrayMoveHeight);//下降z轴,使托盘落入加热模块 - gantryModuleService.clawMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), clawTrayPick);//将夹爪打开,释放托盘 - gantryModuleService.gantryZMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), 0);//抬升z轴 - heatModuleService.heaterMotorMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatModuleId, trayLower);//下降加热模块托盘 - }); - } -} - +//package com.iflytop.gd.app.command.debug.step; +// +//import com.iflytop.gd.app.core.BaseCommandHandler; +//import com.iflytop.gd.app.model.bo.Point3D; +//import com.iflytop.gd.app.model.dto.CmdDTO; +//import com.iflytop.gd.app.service.api.DevicePositionService; +//import com.iflytop.gd.app.service.device.module.GantryModuleService; +//import com.iflytop.gd.app.service.device.module.HeatModuleService; +//import com.iflytop.gd.common.annotation.CommandMapping; +//import com.iflytop.gd.common.enums.HeatModuleCode; +//import com.iflytop.gd.common.enums.data.DevicePositionCode; +//import lombok.RequiredArgsConstructor; +//import lombok.extern.slf4j.Slf4j; +//import org.springframework.stereotype.Component; +// +//import java.util.concurrent.CompletableFuture; +// +///** +// * 将托盘从加液模块移至加热模块 +// */ +//@Slf4j +//@Component +//@RequiredArgsConstructor +//@CommandMapping("debug_move_tray_to_heat_area") +//public class DebugMoveTrayToHeatAreaCommand extends BaseCommandHandler { +// private final GantryModuleService gantryModuleService; +// private final HeatModuleService heatModuleService; +// private final DevicePositionService devicePositionService; +// +// @Override +// public CompletableFuture handle(CmdDTO cmdDTO) throws Exception { +// String heatId = cmdDTO.getStringParam("heatId"); +// HeatModuleCode heatModuleId = HeatModuleCode.valueOf(heatId); +// double clawTrayPick = devicePositionService.getPosition(DevicePositionCode.clawTrayPick).getDistance();//获取夹爪托盘夹取距离 +// double clawTrayGrip = devicePositionService.getPosition(DevicePositionCode.clawTrayGrip).getDistance();//获取夹爪托盘夹紧距离 +// double trayLift = devicePositionService.getPosition(DevicePositionCode.trayLift).getDistance(); //托盘升降抬升距离 +// double trayLower = devicePositionService.getPosition(DevicePositionCode.trayLower).getDistance(); //获取加热位下降托盘位置 +// double heatModuleTrayMoveHeight = devicePositionService.getPosition(DevicePositionCode.heatModuleTrayMoveHeight).getDistance();//加热模块托盘z轴移动高度 +// double solutionModuleTrayMoveHeight = devicePositionService.getPosition(DevicePositionCode.solutionModuleTrayMoveHeight).getDistance();//加液模块托盘z轴移动高度 +// +// Point3D liquidAreaTrayPoint3D = devicePositionService.getPosition(DevicePositionCode.liquidAreaTrayPoint).getPoint3D();//获取加液模块上方点位 +// Point3D heatAreaTrayClawPoint3D = heatModuleService.getHeatAreaTrayClawPoint3D(heatModuleId);//获取指定加热模块上方点位 +// Point3D heatArea4TrayClawPoint3D = heatModuleService.getHeatAreaTrayClawPoint3D(HeatModuleCode.heat_module_04);//获取指定加热模块上方点位 +// +// return runAsync(() -> { +// gantryModuleService.gantryMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), liquidAreaTrayPoint3D); //将机械臂移动至加液模块上方 +// gantryModuleService.clawMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), clawTrayPick);//将夹爪打开,准备夹取托盘 +// gantryModuleService.gantryZMove(solutionModuleTrayMoveHeight);//下降z轴,使夹爪落入托盘孔位 +// gantryModuleService.clawMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), clawTrayGrip);//将夹爪收紧,夹住托盘 +// gantryModuleService.gantryZMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), 0);//抬升z轴 +// gantryModuleService.gantryMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatArea4TrayClawPoint3D);//将携带托盘的机械臂移动至4号加热模块上方 +// gantryModuleService.gantryMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatAreaTrayClawPoint3D);//将携带托盘的机械臂移动至加热模块上方 +// heatModuleService.heaterMotorMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatModuleId, trayLift);//抬升加热位托盘 +// gantryModuleService.gantryZMove(heatModuleTrayMoveHeight);//下降z轴,使托盘落入加热模块 +// gantryModuleService.clawMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), clawTrayPick);//将夹爪打开,释放托盘 +// gantryModuleService.gantryZMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), 0);//抬升z轴 +// heatModuleService.heaterMotorMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatModuleId, trayLower);//下降加热模块托盘 +// }); +// } +//} +// diff --git a/src/main/java/com/iflytop/gd/app/command/debug/step/DebugMoveTrayToSolutionAreaCommand.java b/src/main/java/com/iflytop/gd/app/command/debug/step/DebugMoveTrayToSolutionAreaCommand.java index bbe32c6..d7af73a 100644 --- a/src/main/java/com/iflytop/gd/app/command/debug/step/DebugMoveTrayToSolutionAreaCommand.java +++ b/src/main/java/com/iflytop/gd/app/command/debug/step/DebugMoveTrayToSolutionAreaCommand.java @@ -1,62 +1,62 @@ -package com.iflytop.gd.app.command.debug.step; - -import com.iflytop.gd.app.core.BaseCommandHandler; -import com.iflytop.gd.app.model.bo.Point3D; -import com.iflytop.gd.app.model.dto.CmdDTO; -import com.iflytop.gd.app.service.api.DevicePositionService; -import com.iflytop.gd.app.service.device.module.GantryModuleService; -import com.iflytop.gd.app.service.device.module.HeatModuleService; -import com.iflytop.gd.common.annotation.CommandMapping; -import com.iflytop.gd.common.enums.HeatModuleCode; -import com.iflytop.gd.common.enums.data.DevicePositionCode; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Component; - -import java.util.concurrent.CompletableFuture; - -/** - * 将托盘从加热模块移至加液模块 - */ -@Slf4j -@Component -@RequiredArgsConstructor -@CommandMapping("debug_move_tray_to_solution_area") -public class DebugMoveTrayToSolutionAreaCommand extends BaseCommandHandler { - private final GantryModuleService gantryModuleService; - private final HeatModuleService heatModuleService; - private final DevicePositionService devicePositionService; - - @Override - public CompletableFuture handle(CmdDTO cmdDTO) throws Exception { - String heatId = cmdDTO.getStringParam("heatId"); - HeatModuleCode heatModuleId = HeatModuleCode.valueOf(heatId); - double clawTrayPick = devicePositionService.getPosition(DevicePositionCode.clawTrayPick).getDistance();//获取夹爪托盘夹取距离 - double clawTrayGrip = devicePositionService.getPosition(DevicePositionCode.clawTrayGrip).getDistance();//获取夹爪托盘夹紧距离 - double trayLift = devicePositionService.getPosition(DevicePositionCode.trayLift).getDistance(); //托盘升降抬升距离 - double trayLower = devicePositionService.getPosition(DevicePositionCode.trayLower).getDistance(); //获取加热位下降托盘位置 - double heatModuleTrayMoveHeight = devicePositionService.getPosition(DevicePositionCode.heatModuleTrayMoveHeight).getDistance();//加热模块托盘z轴移动高度 - double solutionModuleTrayMoveHeight = devicePositionService.getPosition(DevicePositionCode.solutionModuleTrayMoveHeight).getDistance();//加液模块托盘z轴移动高度 - - Point3D liquidAreaTrayPoint3D = devicePositionService.getPosition(DevicePositionCode.liquidAreaTrayPoint).getPoint3D();//获取加液模块上方点位 - Point3D heatAreaTrayClawPoint3D = heatModuleService.getHeatAreaTrayClawPoint3D(heatModuleId);//获取指定加热模块上方点位 - Point3D heatArea4TrayClawPoint3D = heatModuleService.getHeatAreaTrayClawPoint3D(HeatModuleCode.heat_module_04);//获取指定加热模块上方点位 - - return runAsync(() -> { - gantryModuleService.gantryMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatAreaTrayClawPoint3D);//将机械臂移动至加热模块上方 - heatModuleService.heaterMotorMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatModuleId, trayLift);//抬升指定加热位托盘 - gantryModuleService.clawMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), clawTrayPick);//将夹爪打开,准备夹取托盘 - gantryModuleService.gantryZMove(heatModuleTrayMoveHeight);//下降z轴,使夹爪落入托盘孔位 - gantryModuleService.clawMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), clawTrayGrip);//将夹爪收紧,夹住托盘 - gantryModuleService.gantryZMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), 0);//抬升z轴 - gantryModuleService.gantryMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatArea4TrayClawPoint3D);//将携带托盘的机械臂移动至4号加热模块上方 - gantryModuleService.gantryMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), liquidAreaTrayPoint3D); //将携带托盘的机械臂移动至加液模块上方 - gantryModuleService.gantryZMove(solutionModuleTrayMoveHeight);//下降z轴,使托盘落入加液模块 - gantryModuleService.clawMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), clawTrayPick);//将夹爪打开,释放托盘 - gantryModuleService.gantryZMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), 0);//抬升z轴 - heatModuleService.heaterMotorMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatModuleId, trayLower);//下降加热模块托盘 - - }); - } -} - +//package com.iflytop.gd.app.command.debug.step; +// +//import com.iflytop.gd.app.core.BaseCommandHandler; +//import com.iflytop.gd.app.model.bo.Point3D; +//import com.iflytop.gd.app.model.dto.CmdDTO; +//import com.iflytop.gd.app.service.api.DevicePositionService; +//import com.iflytop.gd.app.service.device.module.GantryModuleService; +//import com.iflytop.gd.app.service.device.module.HeatModuleService; +//import com.iflytop.gd.common.annotation.CommandMapping; +//import com.iflytop.gd.common.enums.HeatModuleCode; +//import com.iflytop.gd.common.enums.data.DevicePositionCode; +//import lombok.RequiredArgsConstructor; +//import lombok.extern.slf4j.Slf4j; +//import org.springframework.stereotype.Component; +// +//import java.util.concurrent.CompletableFuture; +// +///** +// * 将托盘从加热模块移至加液模块 +// */ +//@Slf4j +//@Component +//@RequiredArgsConstructor +//@CommandMapping("debug_move_tray_to_solution_area") +//public class DebugMoveTrayToSolutionAreaCommand extends BaseCommandHandler { +// private final GantryModuleService gantryModuleService; +// private final HeatModuleService heatModuleService; +// private final DevicePositionService devicePositionService; +// +// @Override +// public CompletableFuture handle(CmdDTO cmdDTO) throws Exception { +// String heatId = cmdDTO.getStringParam("heatId"); +// HeatModuleCode heatModuleId = HeatModuleCode.valueOf(heatId); +// double clawTrayPick = devicePositionService.getPosition(DevicePositionCode.clawTrayPick).getDistance();//获取夹爪托盘夹取距离 +// double clawTrayGrip = devicePositionService.getPosition(DevicePositionCode.clawTrayGrip).getDistance();//获取夹爪托盘夹紧距离 +// double trayLift = devicePositionService.getPosition(DevicePositionCode.trayLift).getDistance(); //托盘升降抬升距离 +// double trayLower = devicePositionService.getPosition(DevicePositionCode.trayLower).getDistance(); //获取加热位下降托盘位置 +// double heatModuleTrayMoveHeight = devicePositionService.getPosition(DevicePositionCode.heatModuleTrayMoveHeight).getDistance();//加热模块托盘z轴移动高度 +// double solutionModuleTrayMoveHeight = devicePositionService.getPosition(DevicePositionCode.solutionModuleTrayMoveHeight).getDistance();//加液模块托盘z轴移动高度 +// +// Point3D liquidAreaTrayPoint3D = devicePositionService.getPosition(DevicePositionCode.liquidAreaTrayPoint).getPoint3D();//获取加液模块上方点位 +// Point3D heatAreaTrayClawPoint3D = heatModuleService.getHeatAreaTrayClawPoint3D(heatModuleId);//获取指定加热模块上方点位 +// Point3D heatArea4TrayClawPoint3D = heatModuleService.getHeatAreaTrayClawPoint3D(HeatModuleCode.heat_module_04);//获取指定加热模块上方点位 +// +// return runAsync(() -> { +// gantryModuleService.gantryMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatAreaTrayClawPoint3D);//将机械臂移动至加热模块上方 +// heatModuleService.heaterMotorMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatModuleId, trayLift);//抬升指定加热位托盘 +// gantryModuleService.clawMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), clawTrayPick);//将夹爪打开,准备夹取托盘 +// gantryModuleService.gantryZMove(heatModuleTrayMoveHeight);//下降z轴,使夹爪落入托盘孔位 +// gantryModuleService.clawMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), clawTrayGrip);//将夹爪收紧,夹住托盘 +// gantryModuleService.gantryZMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), 0);//抬升z轴 +// gantryModuleService.gantryMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatArea4TrayClawPoint3D);//将携带托盘的机械臂移动至4号加热模块上方 +// gantryModuleService.gantryMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), liquidAreaTrayPoint3D); //将携带托盘的机械臂移动至加液模块上方 +// gantryModuleService.gantryZMove(solutionModuleTrayMoveHeight);//下降z轴,使托盘落入加液模块 +// gantryModuleService.clawMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), clawTrayPick);//将夹爪打开,释放托盘 +// gantryModuleService.gantryZMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), 0);//抬升z轴 +// heatModuleService.heaterMotorMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatModuleId, trayLower);//下降加热模块托盘 +// +// }); +// } +//} +// diff --git a/src/main/java/com/iflytop/gd/app/command/debug/step/DebugShowSmogCommand.java b/src/main/java/com/iflytop/gd/app/command/debug/step/DebugShowSmogCommand.java index 6a6c88e..0236045 100644 --- a/src/main/java/com/iflytop/gd/app/command/debug/step/DebugShowSmogCommand.java +++ b/src/main/java/com/iflytop/gd/app/command/debug/step/DebugShowSmogCommand.java @@ -48,7 +48,13 @@ public class DebugShowSmogCommand extends BaseCommandHandler { Point3D heatAreaCapClawPointPoint3D = heatModuleService.getHeatAreaCapClawPointPoint3D(heatModuleCode);//获取指定加热模块拍子上方点位 return runAsync(() -> { gantryModuleService.gantryMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatAreaCapClawPointPoint3D);//将机械臂移动至加热模块拍子上方 - heatModuleService.heaterMotorMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatModuleCode, trayLift);//抬升指定加热位托盘 + + double newTrayLift = trayLift; //TODO 临时调整位置 + if(HeatModuleCode.heat_module_05.equals(heatModuleCode)){ + newTrayLift = trayLift - 10; + } + + heatModuleService.heaterMotorMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatModuleCode, newTrayLift);//抬升指定加热位托盘 gantryModuleService.clawMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), clawCapPick);//将夹爪打开,准备夹取拍子 gantryModuleService.gantryZMove(heatModuleCapMoveHeight);//下降z轴,使夹爪落入加热模块拍子孔位 gantryModuleService.clawMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), clawCapGrip);//将夹爪收紧,夹住拍子 diff --git a/src/main/java/com/iflytop/gd/app/command/selftest/TrayOutCommand.java b/src/main/java/com/iflytop/gd/app/command/selftest/TrayOutCommand.java index 3bd38d7..8bd32bd 100644 --- a/src/main/java/com/iflytop/gd/app/command/selftest/TrayOutCommand.java +++ b/src/main/java/com/iflytop/gd/app/command/selftest/TrayOutCommand.java @@ -67,7 +67,13 @@ public class TrayOutCommand extends BaseCommandHandler { solutionModuleService.requestSolutionModule();//申请使用加液区并等待 capModuleService.capUpBalance(cmdDTO.getCommandId(), cmdDTO.getCommand()); //提升拍子存放区至拍子夹取的高度 gantryModuleService.gantryMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatAreaCapClawPointPoint3D);//将机械臂移动至加热模块拍子上方 - heatModuleService.heaterMotorMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatModuleCode, trayLift);//抬升指定加热位托盘 + + double newTrayLift = trayLift; //TODO 临时调整位置 + if(HeatModuleCode.heat_module_05.equals(heatModuleCode)){ + newTrayLift = trayLift - 10; + } + + heatModuleService.heaterMotorMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), heatModuleCode, newTrayLift);//抬升指定加热位托盘 gantryModuleService.clawMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), clawCapPick);//将夹爪打开,准备夹取拍子 gantryModuleService.gantryZMove(heatModuleCapMoveHeight);//下降z轴,使夹爪落入加热模块拍子孔位 gantryModuleService.clawMove(cmdDTO.getCommandId(), cmdDTO.getCommand(), clawCapGrip);//将夹爪收紧,夹住拍子 diff --git a/src/main/java/com/iflytop/gd/app/service/crafts/CraftsStepService.java b/src/main/java/com/iflytop/gd/app/service/crafts/CraftsStepService.java index 986bd3b..2ff3442 100644 --- a/src/main/java/com/iflytop/gd/app/service/crafts/CraftsStepService.java +++ b/src/main/java/com/iflytop/gd/app/service/crafts/CraftsStepService.java @@ -278,8 +278,8 @@ public class CraftsStepService { log.info("工艺{},将携带托盘的机械臂移动至加热模块上方", heatModuleCode); gantryModuleService.gantryMove(heatAreaTrayClawPoint3D);//将携带托盘的机械臂移动至加热模块上方 log.info("工艺{},临时避让完毕,升起", heatModuleCode); - deviceCommandTempUtilService.moveTrayHeatModuleAvoidUpNoWait(heatModuleCode); - Thread.sleep(3200);//TODO 结构有问题临时避让 完毕,可以升起了,顺带提升目标加热模块 + deviceCommandTempUtilService.moveTrayHeatModuleAvoidUpNoWait(heatModuleCode);//TODO 结构有问题临时避让 完毕,可以升起了,顺带提升目标加热模块 + Thread.sleep(3200); log.info("工艺{},下降z轴,使托盘落入加热模块", heatModuleCode); gantryModuleService.gantryZMove(heatModuleTrayMoveHeight);//下降z轴,使托盘落入加热模块 @@ -351,7 +351,13 @@ public class CraftsStepService { gantryModuleService.gantryMove(heatAreaCapClawPointPoint3D);//将机械臂移动至加热模块拍子上方 deviceStateService.getDeviceState().getHeatModuleByCode(heatModuleCode).setTrayUp(1);//将加热模块托盘状态改为抬起 log.info("工艺{},抬升指定加热位托盘", heatModuleCode); - heatModuleService.heaterMotorMove(heatModuleCode, trayLift);//抬升指定加热位托盘 + + double newTrayLift = trayLift; //TODO 临时调整位置 + if(HeatModuleCode.heat_module_05.equals(heatModuleCode)){ + newTrayLift = trayLift - 10; + } + + heatModuleService.heaterMotorMove(heatModuleCode, newTrayLift);//抬升指定加热位托盘 log.info("工艺{},将夹爪打开,准备夹取拍子", heatModuleCode); gantryModuleService.clawMove(clawCapPick);//将夹爪打开,准备夹取拍子 log.info("工艺{},下降z轴,使夹爪落入加热模块拍子孔位", heatModuleCode); diff --git a/src/main/java/com/iflytop/gd/app/service/device/DeviceCommandTempUtilService.java b/src/main/java/com/iflytop/gd/app/service/device/DeviceCommandTempUtilService.java index ea301ee..2ddd2c2 100644 --- a/src/main/java/com/iflytop/gd/app/service/device/DeviceCommandTempUtilService.java +++ b/src/main/java/com/iflytop/gd/app/service/device/DeviceCommandTempUtilService.java @@ -58,13 +58,21 @@ public class DeviceCommandTempUtilService { public void moveTrayHeatModuleAvoidUpNoWait(String cmdId, String cmdCode, HeatModuleCode targetHeatModuleCode, HeatModuleCode... exceptionHeatModuleCodes) throws Exception { double trayLift = devicePositionService.getPosition(DevicePositionCode.trayLift).getDistance(); //托盘升降抬升距离 for (HeatModuleCode heatModuleCode : moveTrayHeatModuleAvoidUpStateList) { + double newTrayLift = trayLift; //TODO 临时调整位置 + if(HeatModuleCode.heat_module_05.equals(heatModuleCode)){ + newTrayLift = trayLift - 10; + } if (!Arrays.stream(exceptionHeatModuleCodes).toList().contains(heatModuleCode)) { - DeviceCommandBundle deviceCommand = getHeaterMotorMoveDeviceCommand(heatModuleCode, trayLift); + DeviceCommandBundle deviceCommand = getHeaterMotorMoveDeviceCommand(heatModuleCode, newTrayLift); deviceCommandService.sendCommand(cmdId, cmdCode, deviceCommand); } } if (targetHeatModuleCode != null) { - DeviceCommandBundle deviceCommand = getHeaterMotorMoveDeviceCommand(targetHeatModuleCode, trayLift); + double newTrayLift = trayLift; //TODO 临时调整位置 + if(HeatModuleCode.heat_module_05.equals(targetHeatModuleCode)){ + newTrayLift = trayLift - 10; + } + DeviceCommandBundle deviceCommand = getHeaterMotorMoveDeviceCommand(targetHeatModuleCode, newTrayLift); deviceCommandService.sendCommand(cmdId, cmdCode, deviceCommand); } for (HeatModuleCode heatModuleCode : moveTrayHeatModuleAvoidUpStateList) { @@ -81,14 +89,22 @@ public class DeviceCommandTempUtilService { double trayLift = devicePositionService.getPosition(DevicePositionCode.trayLift).getDistance(); //托盘升降抬升距离 List futuresList = new ArrayList<>(); for (HeatModuleCode heatModuleCode : moveTrayHeatModuleAvoidUpStateList) { + double newTrayLift = trayLift; //TODO 临时调整位置 + if(HeatModuleCode.heat_module_05.equals(heatModuleCode)){ + newTrayLift = trayLift - 10; + } if (!Arrays.stream(exceptionHeatModuleCodes).toList().contains(heatModuleCode)) { - DeviceCommandBundle deviceCommand = getHeaterMotorMoveDeviceCommand(heatModuleCode, trayLift); + DeviceCommandBundle deviceCommand = getHeaterMotorMoveDeviceCommand(heatModuleCode, newTrayLift); CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdId, cmdCode, deviceCommand); futuresList.add(deviceCommandFuture); } } if (targetHeatModuleCode != null) { - DeviceCommandBundle deviceCommand = getHeaterMotorMoveDeviceCommand(targetHeatModuleCode, trayLift); + double newTrayLift = trayLift; //TODO 临时调整位置 + if(HeatModuleCode.heat_module_05.equals(targetHeatModuleCode)){ + newTrayLift = trayLift - 10; + } + DeviceCommandBundle deviceCommand = getHeaterMotorMoveDeviceCommand(targetHeatModuleCode, newTrayLift); CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdId, cmdCode, deviceCommand); futuresList.add(deviceCommandFuture); } diff --git a/src/main/java/com/iflytop/gd/app/service/device/module/GantryModuleService.java b/src/main/java/com/iflytop/gd/app/service/device/module/GantryModuleService.java index 4e0f6d0..5d33199 100644 --- a/src/main/java/com/iflytop/gd/app/service/device/module/GantryModuleService.java +++ b/src/main/java/com/iflytop/gd/app/service/device/module/GantryModuleService.java @@ -395,7 +395,14 @@ public class GantryModuleService { List futuresList = new ArrayList<>(); for(HeatModuleCode heatModuleCode : HeatModuleCode.values()){ - DeviceCommandBundle deviceCommand = getHeaterMotorMoveDeviceCommand(heatModuleCode, trayLift); + + double newTrayLift = trayLift; //TODO 临时调整位置 + if(HeatModuleCode.heat_module_05.equals(heatModuleCode)){ + newTrayLift = trayLift - 10; + } + + + DeviceCommandBundle deviceCommand = getHeaterMotorMoveDeviceCommand(heatModuleCode, newTrayLift); CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdId, cmdCode, deviceCommand); futuresList.add(deviceCommandFuture); }