| | |
| | | @PostMapping("test") |
| | | public ResultMessage test(@RequestBody Map<String, Object> params){ |
| | | //判断是否缺少参数 |
| | | if (!params.containsKey("mac") || !params.containsKey("batch") || !params.containsKey("height")|| !params.containsKey("uvasize")) { |
| | | if (!params.containsKey("mac") || !params.containsKey("batch") || !params.containsKey("height1")|| !params.containsKey("uvasize")|| !params.containsKey("height2")) { |
| | | return ResultMessage.fail(ResponseCodeEnum.PARAMETERS_IS_MISSING.getCode(), ResponseCodeEnum.PARAMETERS_IS_MISSING.getMsg()); |
| | | } |
| | | String uvasize = params.get("uvasize").toString(); |
| | |
| | | |
| | | //获取中心点 |
| | | public static String getResult(ArrayList<String[]> doubleArrayList){ |
| | | // UAVResultDTO uavResultDTO = new UAVResultDTO(); |
| | | |
| | | int total = doubleArrayList.size(); |
| | | double X = 0, Y = 0, Z = 0; |
| | | for (int i = 0; i < total; i++) { |
| | |
| | | double Lon = Math.atan2(Y, X); |
| | | double Hyp = Math.sqrt(X * X + Y * Y); |
| | | double Lat = Math.atan2(Z, Hyp); |
| | | |
| | | DecimalFormat decimalFormat = new DecimalFormat("#.00000000"); |
| | | double rsLon = Lon * 180 / Math.PI; |
| | | double rsLat = Lat * 180 / Math.PI; |
| | | // uavResultDTO.setFlyLon(rsLon); |
| | | // uavResultDTO.setFlyLat(rsLat); |
| | | |
| | | return rsLon+"_"+rsLat; |
| | | // return uavResultDTO; |
| | | return decimalFormat.format(rsLon)+"_"+decimalFormat.format(rsLat); |
| | | } |
| | | |
| | | |