| | |
| | | if (dockOpt.isPresent() && (DockModeCodeEnum.IDLE == dockMode || DockModeCodeEnum.WORKING == dockMode)) { |
| | | Optional<OsdSubDeviceReceiver> deviceOsd = deviceRedisService.getDeviceOsd(dockOpt.get().getChildDeviceSn(), OsdSubDeviceReceiver.class); |
| | | if (deviceOsd.isEmpty() || deviceOsd.get().getElevation() <= 0) { |
| | | throw new RuntimeException("The drone is not in the sky and cannot enter command flight mode."); |
| | | throw new RuntimeException("无人机不在空中,不能进入指挥飞行模式。"); |
| | | } |
| | | } else { |
| | | throw new RuntimeException("The current state of the dock does not support entering command flight mode."); |
| | | throw new RuntimeException("当前状态不支持进入命令飞行模式。"); |
| | | } |
| | | |
| | | ResponseResult result = controlService.seizeAuthority(dockSn, DroneAuthorityEnum.FLIGHT, null); |