Browse Source

fix:同步延迟时间差一点

master
白凤吉 2 months ago
parent
commit
885feddc76
  1. 22
      src/main/java/com/iflytop/gd/app/service/device/ActionCommandService.java

22
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轴
}
}
Loading…
Cancel
Save