Browse Source

fix:打开夹爪指令增加distance

master
白凤吉 3 months ago
parent
commit
78ca4af7ae
  1. 3
      src/main/java/com/iflytop/gd/app/cmd/debug/HoldingJawOpenCommandHandler.java

3
src/main/java/com/iflytop/gd/app/cmd/debug/HoldingJawOpenCommandHandler.java

@ -27,12 +27,13 @@ public class HoldingJawOpenCommandHandler extends BaseCommandHandler {
public CompletableFuture<Void> handle(CmdDTO cmdDTO) { public CompletableFuture<Void> handle(CmdDTO cmdDTO) {
return runAsync(() -> { return runAsync(() -> {
Double velocity = cmdDTO.getDoubleParam("velocity"); Double velocity = cmdDTO.getDoubleParam("velocity");
Double distance = cmdDTO.getDoubleParam("distance");
if(velocity != null) { if(velocity != null) {
DeviceCommandBundle deviceCommand = DeviceCommandGenerator.clawSet(velocity); DeviceCommandBundle deviceCommand = DeviceCommandGenerator.clawSet(velocity);
CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand);
commandWait(deviceCommandFuture); commandWait(deviceCommandFuture);
} }
DeviceCommandBundle deviceCommand = DeviceCommandGenerator.clawMove(100.0);
DeviceCommandBundle deviceCommand = DeviceCommandGenerator.clawMove(distance);
CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand); CommandFuture deviceCommandFuture = deviceCommandService.sendCommand(cmdDTO.getCommandId(), cmdDTO.getCommand(), deviceCommand);
commandWait(deviceCommandFuture); commandWait(deviceCommandFuture);
}); });

Loading…
Cancel
Save