| | |
| | | package com.ard.tianyu.controller; |
| | | |
| | | import com.ard.common.core.domain.AjaxResult; |
| | | import com.ard.tianyu.model.dto.manual.ReturnHomeDTO; |
| | | import com.ard.tianyu.model.dto.manual.SwitchUavControlDTO; |
| | | import com.ard.tianyu.model.dto.manual.TakeOffDTO; |
| | | import com.ard.tianyu.domain.dto.manual.*; |
| | | import com.ard.tianyu.service.ITyService; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import io.swagger.annotations.Api; |
| | |
| | | tyService.switchUavControl(switchUavControlDTO); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "起飞", notes = "起飞高度height取值范围:1.2~100,误差:+-0.4米") |
| | | @ApiOperationSupport(order = 2) |
| | | @PostMapping("/takeOff") |
| | |
| | | tyService.returnHome(returnHomeDTO); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @ApiOperation("取消返航") |
| | | @ApiOperationSupport(order = 4) |
| | | @PostMapping("/returnHomeCancel") |
| | | public AjaxResult returnHomeCancel(@RequestBody ReturnHomeCancelDTO returnHomeCancelDTO) { |
| | | tyService.returnHomeCancel(returnHomeCancelDTO); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @ApiOperation("降落") |
| | | @ApiOperationSupport(order = 5) |
| | | @PostMapping("/land") |
| | | public AjaxResult land(@RequestBody LandDTO landDTO) { |
| | | tyService.land(landDTO); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @ApiOperation("取消降落") |
| | | @ApiOperationSupport(order = 6) |
| | | @PostMapping("/landCancel") |
| | | public AjaxResult landCancel(@RequestBody LandCancelDTO landCancelDTO) { |
| | | tyService.landCancel(landCancelDTO); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "强制降落",notes = "强制无人机在当前位置降落,不理会蔽障信息,调用此指令时需人工确定降落地点安全") |
| | | @ApiOperationSupport(order = 7) |
| | | @PostMapping("/landForced") |
| | | public AjaxResult landForced(@RequestBody LandForcedDTO landForcedDTO) { |
| | | tyService.landForced(landForcedDTO); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "方向控制", notes = "前后速度frSpeed:【前0至30 后0至-30】单位m/s " + |
| | | "左右速度lrSpeed:【右0至30 左0至-30】单位m/s " + |
| | | "上下速度udSpeed:【上0至5 后0至-5 】单位m/s 偏航角yaw:-150~150 deg/s") |
| | | @ApiOperationSupport(order = 8) |
| | | @PostMapping("/flyControl") |
| | | public AjaxResult flyControl(@RequestBody FlyControlDTO flyControlDTO) { |
| | | tyService.flyControl(flyControlDTO); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "开始指点飞行", notes = "速度speed:0~20 单位m/s " + |
| | | "飞行模式flyMode:0-节能模式【飞机直线飞到目标点,需飞机在空中】," + |
| | | "1-安全模式【飞机飞行至目标点高度再平飞到目标点,飞机可以在地面或空中】 默认为节能模式") |
| | | @ApiOperationSupport(order = 9) |
| | | @PostMapping("/flyPointControl") |
| | | public AjaxResult flyPointControl(@RequestBody FlyPointControlDTO flyPointControlDTO) { |
| | | tyService.flyPointControl(flyPointControlDTO); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @ApiOperation("停止指点飞行") |
| | | @ApiOperationSupport(order = 10) |
| | | @PostMapping("/flyPointControlCancel") |
| | | public AjaxResult flyPointControlCancel(@RequestBody FlyPointControlCancelDTO flyPointControlCancelDTO) { |
| | | tyService.flyPointControlCancel(flyPointControlCancelDTO); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @ApiOperation(value = "紧急制动", notes = "动作参数actionParam: 0-解除紧急制动 1-紧急制动") |
| | | @ApiOperationSupport(order = 11) |
| | | @PostMapping("/emeragencyBrake") |
| | | public AjaxResult emeragencyBrake(@RequestBody EmeragencyBrakeDTO emeragencyBrakeDTO) { |
| | | tyService.emeragencyBrake(emeragencyBrakeDTO); |
| | | return AjaxResult.success(); |
| | | } |
| | | } |