| | |
| | | return carModelList; |
| | | } |
| | | |
| | | public static List<Point> getCarPoint(double pitch,double yaw,Point point){ |
| | | public static List<Point> getCarPoint(double pitch,double yaw,Point point,GisCarModel gisCarModel){ |
| | | pitch = 0; |
| | | // yaw = 45; |
| | | Point main_ant = point; |
| | | List<Point> carNew = new ArrayList<>(); |
| | | StringBuffer buffer=FileUtil.readAssetTxtFile(app.getAppContext(),"giscar.json"); |
| | | Log.i(TAG,"giscar="+buffer.toString()); |
| | | GisCarModel gisCarModel= new Gson().fromJson(buffer.toString(),GisCarModel.class); |
| | | // StringBuffer buffer=FileUtil.readAssetTxtFile(app.getAppContext(),"giscar.json"); |
| | | // Log.i(TAG,"giscar="+buffer.toString()); |
| | | // GisCarModel gisCarModel= new Gson().fromJson(buffer.toString(),GisCarModel.class); |
| | | List<Point> pointList = new ArrayList<Point>() ; |
| | | for (int i = 0; i < gisCarModel.getPoint().size(); i++) { |
| | | double x= gisCarModel.getPoint().get(i); |
| | |
| | | } |
| | | double mainAnt_x = gisCarModel.getMain_ant().get(0); |
| | | double mainAnt_y = gisCarModel.getMain_ant().get(1); |
| | | long pretime = System.currentTimeMillis(); |
| | | List<CarModel> carModels = getCarModelData(new Point(mainAnt_x, mainAnt_y),gisCarModel.getAxial(),pointList); |
| | | |
| | | if (carModels != null && carModels.size()>0){ |
| | | |
| | | for (int i = 0; i < carModels.size(); ++i) { |
| | | Log.i(TAG,String.format("位置[%d],distance=%f,angle=%f",i,carModels.get(i).getDistance(),carModels.get(i).getAngle())); |
| | | // Log.i(TAG,String.format("位置[%d],distance=%f,angle=%f",i,carModels.get(i).getDistance(),carModels.get(i).getAngle())); |
| | | double qrx = carModels.get(i).getDistance() * Math.sin(carModels.get(i).getAngle() * Math.PI / 180); |
| | | double qry = carModels.get(i).getDistance() * Math.cos(carModels.get(i).getAngle() * Math.PI / 180) * Math.cos(pitch * Math.PI / 180); |
| | | |
| | |
| | | |
| | | } |
| | | } |
| | | Log.i(TAG,String.format("getCarModelData 耗时=%d毫秒",System.currentTimeMillis()-pretime)); |
| | | return carNew; |
| | | |
| | | |