|
@ -29,7 +29,8 @@ public class HoldingJawOpenCommandHandler extends BaseCommandHandler { |
|
|
this.stop = false; |
|
|
this.stop = false; |
|
|
return runAsync(() -> { |
|
|
return runAsync(() -> { |
|
|
Double velocity = cmdDTO.getDoubleParam("velocity"); |
|
|
Double velocity = cmdDTO.getDoubleParam("velocity"); |
|
|
Double distance = cmdDTO.getDoubleParam("distance"); |
|
|
|
|
|
|
|
|
Double openDistance = cmdDTO.getDoubleParam("openDistance"); |
|
|
|
|
|
Double closeDistance = cmdDTO.getDoubleParam("closeDistance"); |
|
|
Integer times = cmdDTO.getIntegerParam("times"); |
|
|
Integer times = cmdDTO.getIntegerParam("times"); |
|
|
if (velocity != null) { |
|
|
if (velocity != null) { |
|
|
DeviceCommandBundle deviceCommand = DeviceCommandGenerator.clawSet(velocity); |
|
|
DeviceCommandBundle deviceCommand = DeviceCommandGenerator.clawSet(velocity); |
|
@ -41,16 +42,16 @@ public class HoldingJawOpenCommandHandler extends BaseCommandHandler { |
|
|
if (stop) { |
|
|
if (stop) { |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
DeviceCommandBundle deviceCommand = DeviceCommandGenerator.clawMove(distance); |
|
|
|
|
|
|
|
|
DeviceCommandBundle deviceCommand = DeviceCommandGenerator.clawMove(openDistance); |
|
|
CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); |
|
|
CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); |
|
|
commandWait(deviceCommandFuture); |
|
|
commandWait(deviceCommandFuture); |
|
|
|
|
|
|
|
|
DeviceCommandBundle backDeviceCommand = DeviceCommandGenerator.clawMove(-distance); |
|
|
|
|
|
|
|
|
DeviceCommandBundle backDeviceCommand = DeviceCommandGenerator.clawMove(closeDistance); |
|
|
CommandFuture backDeviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), backDeviceCommand); |
|
|
CommandFuture backDeviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), backDeviceCommand); |
|
|
commandWait(backDeviceCommandFuture); |
|
|
commandWait(backDeviceCommandFuture); |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
DeviceCommandBundle deviceCommand = DeviceCommandGenerator.clawMove(distance); |
|
|
|
|
|
|
|
|
DeviceCommandBundle deviceCommand = DeviceCommandGenerator.clawMove(openDistance); |
|
|
CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); |
|
|
CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); |
|
|
commandWait(deviceCommandFuture); |
|
|
commandWait(deviceCommandFuture); |
|
|
} |
|
|
} |
|
|