|
@@ -287,7 +287,6 @@ public class InitServiceImpl implements InitService {
|
|
removeInitDataStep2(sceneCode);
|
|
removeInitDataStep2(sceneCode);
|
|
|
|
|
|
String path = init.getPath();
|
|
String path = init.getPath();
|
|
-// String laserDataPath = path + "/laserData";
|
|
|
|
String laserDataPath = path;
|
|
String laserDataPath = path;
|
|
log.info("laserDataPath: {}", laserDataPath);
|
|
log.info("laserDataPath: {}", laserDataPath);
|
|
|
|
|
|
@@ -306,14 +305,16 @@ public class InitServiceImpl implements InitService {
|
|
// step2 处理could.js、创建sitModel, 使用的是代码初始化,创建site_model, 处理原点、中心点、最大点、最小点
|
|
// step2 处理could.js、创建sitModel, 使用的是代码初始化,创建site_model, 处理原点、中心点、最大点、最小点
|
|
processCould(sceneCode, laserDataPath, calculateEntity);
|
|
processCould(sceneCode, laserDataPath, calculateEntity);
|
|
|
|
|
|
|
|
+ // step7 创建t_datasets表, 使用的是代码, 需要处理原点之后执行
|
|
|
|
+ DataSetPo dataSet = createDataSet(sceneCode, laserDataPath, calculateEntity.getRotation2(), from);
|
|
|
|
+
|
|
// step1: vision.txt 漫游点处理,2021-12-30 处理vision.txt 创建filter表, 处理特殊点:firstView, 需要使用原点
|
|
// step1: vision.txt 漫游点处理,2021-12-30 处理vision.txt 创建filter表, 处理特殊点:firstView, 需要使用原点
|
|
- createFilter(sceneCode, laserDataPath, calculateEntity, from);
|
|
|
|
|
|
+ createFilter(sceneCode, laserDataPath, calculateEntity, from, dataSet);
|
|
|
|
|
|
// step6 创建t_configs表, 使用的是模板数据 , 需要firstView;
|
|
// step6 创建t_configs表, 使用的是模板数据 , 需要firstView;
|
|
createConfig(sceneCode);
|
|
createConfig(sceneCode);
|
|
|
|
|
|
- // step7 创建t_datasets表, 使用的是代码, 需要处理原点之后执行
|
|
|
|
- DataSetPo dataSet = createDataSet(sceneCode, laserDataPath, calculateEntity.getRotation2(), from);
|
|
|
|
|
|
+
|
|
|
|
|
|
// step 10 创建平面图 t_tiled_map表, 需要用到dataSet数据
|
|
// step 10 创建平面图 t_tiled_map表, 需要用到dataSet数据
|
|
tiledMapService.init(sceneCode, from);
|
|
tiledMapService.init(sceneCode, from);
|
|
@@ -517,8 +518,6 @@ public class InitServiceImpl implements InitService {
|
|
controlPointService.saveEntity(entity);
|
|
controlPointService.saveEntity(entity);
|
|
log.info("算法控制点保存完成");
|
|
log.info("算法控制点保存完成");
|
|
|
|
|
|
-// // 执行initData2 初始化
|
|
|
|
-// this.initDataStep2(sceneCode, "age", isUploadImag);
|
|
|
|
|
|
|
|
log.info("controlPoint控制点初始化完成");
|
|
log.info("controlPoint控制点初始化完成");
|
|
}
|
|
}
|
|
@@ -593,60 +592,60 @@ public class InitServiceImpl implements InitService {
|
|
return Result.success();
|
|
return Result.success();
|
|
}
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
|
- public void testInitDataStep2(String sceneCode, String from) {
|
|
|
|
-
|
|
|
|
- Optional<InitEntity> optional = initMapper.findById(sceneCode);
|
|
|
|
- if (!optional.isPresent()) {
|
|
|
|
- throw new BaseRuntimeException(MsgCode.e3001, "此场景的数据初始化不存在");
|
|
|
|
- }
|
|
|
|
- InitEntity init = optional.get();
|
|
|
|
-
|
|
|
|
- // 输入控制点,需要删除旧数据,重新初始化
|
|
|
|
- removeInitDataStep2(sceneCode);
|
|
|
|
-
|
|
|
|
- String path = "F:\\test\\project\\age_laser";
|
|
|
|
- String laserDataPath = path + "/laserData";
|
|
|
|
- log.info("laserDataPath: {}", laserDataPath);
|
|
|
|
-
|
|
|
|
- // step:0 获取控制点
|
|
|
|
- ControlPointEntity controlPoint = getControlPoint(sceneCode);
|
|
|
|
- // 2021-09-13 初始化控制点计算,并保存数据库
|
|
|
|
- ControlPointCalculateEntity calculateEntity = GisCoordinateUtil.calculateVariable(controlPoint);
|
|
|
|
- calculateEntity.setId(sceneCode);
|
|
|
|
- controlPointCalculateService.saveEntity(calculateEntity);
|
|
|
|
- log.info("更新控制点计算完成");
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- // step2 处理could.js 使用的是代码初始化,创建site_model, 处理原点、中心点、最大点、最小点
|
|
|
|
- processCould(sceneCode, laserDataPath, calculateEntity);
|
|
|
|
-
|
|
|
|
- // step1: 2021-12-30 处理vision.txt 创建filter表, 处理特殊点:firstView, 需要使用原点
|
|
|
|
- createFilter(sceneCode, laserDataPath, calculateEntity, from);
|
|
|
|
-
|
|
|
|
- // step6 创建t_configs表, 使用的是模板数据 , 需要firstView;
|
|
|
|
- createConfig(sceneCode);
|
|
|
|
-
|
|
|
|
- // step7 创建t_datasets表, 使用的是代码, 需要处理原点之后执行, dataSet.orientation: 计算控制点结果rotation2
|
|
|
|
- // 2021-09-23 会初始化一条信息到合并场景信息表t_merge_info, 存dataSet数据
|
|
|
|
- DataSetPo dataSet = createDataSet(sceneCode, laserDataPath, calculateEntity.getRotation2(), from);
|
|
|
|
-
|
|
|
|
- // Route数据重新计算, 并保存数据库
|
|
|
|
-// routeService.updateRouteByControlPointCalculate(dataSet.getLocation(), dataSet.getOrientation(), sceneCode, calculateEntity, laserDataPath);
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- // step8 目录pano、pano_depth、webcloud上传oss,
|
|
|
|
-// ossUploadDir(sceneCode, laserDataPath);
|
|
|
|
-
|
|
|
|
- // 更新 initDataStep2 状态
|
|
|
|
- init.setUpdateTime(LocalDateTime.now());
|
|
|
|
- init.setStatus(1);
|
|
|
|
- initMapper.save(init);
|
|
|
|
- log.info("initDataStep_2处理完成");
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
|
|
+// @Override
|
|
|
|
+// public void testInitDataStep2(String sceneCode, String from) {
|
|
|
|
+//
|
|
|
|
+// Optional<InitEntity> optional = initMapper.findById(sceneCode);
|
|
|
|
+// if (!optional.isPresent()) {
|
|
|
|
+// throw new BaseRuntimeException(MsgCode.e3001, "此场景的数据初始化不存在");
|
|
|
|
+// }
|
|
|
|
+// InitEntity init = optional.get();
|
|
|
|
+//
|
|
|
|
+// // 输入控制点,需要删除旧数据,重新初始化
|
|
|
|
+// removeInitDataStep2(sceneCode);
|
|
|
|
+//
|
|
|
|
+// String path = "F:\\test\\project\\age_laser";
|
|
|
|
+// String laserDataPath = path + "/laserData";
|
|
|
|
+// log.info("laserDataPath: {}", laserDataPath);
|
|
|
|
+//
|
|
|
|
+// // step:0 获取控制点
|
|
|
|
+// ControlPointEntity controlPoint = getControlPoint(sceneCode);
|
|
|
|
+// // 2021-09-13 初始化控制点计算,并保存数据库
|
|
|
|
+// ControlPointCalculateEntity calculateEntity = GisCoordinateUtil.calculateVariable(controlPoint);
|
|
|
|
+// calculateEntity.setId(sceneCode);
|
|
|
|
+// controlPointCalculateService.saveEntity(calculateEntity);
|
|
|
|
+// log.info("更新控制点计算完成");
|
|
|
|
+//
|
|
|
|
+//
|
|
|
|
+//
|
|
|
|
+// // step2 处理could.js 使用的是代码初始化,创建site_model, 处理原点、中心点、最大点、最小点
|
|
|
|
+// processCould(sceneCode, laserDataPath, calculateEntity);
|
|
|
|
+//
|
|
|
|
+// // step1: 2021-12-30 处理vision.txt 创建filter表, 处理特殊点:firstView, 需要使用原点
|
|
|
|
+// createFilter(sceneCode, laserDataPath, calculateEntity, from);
|
|
|
|
+//
|
|
|
|
+// // step6 创建t_configs表, 使用的是模板数据 , 需要firstView;
|
|
|
|
+// createConfig(sceneCode);
|
|
|
|
+//
|
|
|
|
+// // step7 创建t_datasets表, 使用的是代码, 需要处理原点之后执行, dataSet.orientation: 计算控制点结果rotation2
|
|
|
|
+// // 2021-09-23 会初始化一条信息到合并场景信息表t_merge_info, 存dataSet数据
|
|
|
|
+// DataSetPo dataSet = createDataSet(sceneCode, laserDataPath, calculateEntity.getRotation2(), from);
|
|
|
|
+//
|
|
|
|
+// // Route数据重新计算, 并保存数据库
|
|
|
|
+//// routeService.updateRouteByControlPointCalculate(dataSet.getLocation(), dataSet.getOrientation(), sceneCode, calculateEntity, laserDataPath);
|
|
|
|
+//
|
|
|
|
+//
|
|
|
|
+//
|
|
|
|
+// // step8 目录pano、pano_depth、webcloud上传oss,
|
|
|
|
+//// ossUploadDir(sceneCode, laserDataPath);
|
|
|
|
+//
|
|
|
|
+// // 更新 initDataStep2 状态
|
|
|
|
+// init.setUpdateTime(LocalDateTime.now());
|
|
|
|
+// init.setStatus(1);
|
|
|
|
+// initMapper.save(init);
|
|
|
|
+// log.info("initDataStep_2处理完成");
|
|
|
|
+//
|
|
|
|
+// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -659,7 +658,7 @@ public class InitServiceImpl implements InitService {
|
|
* @param calculateEntity
|
|
* @param calculateEntity
|
|
* @param from
|
|
* @param from
|
|
*/
|
|
*/
|
|
- private void createFilter(String sceneCode, String path, ControlPointCalculateEntity calculateEntity, String from) {
|
|
|
|
|
|
+ private void createFilter(String sceneCode, String path, ControlPointCalculateEntity calculateEntity, String from, DataSetPo dataSet) {
|
|
path = path + "/vision.txt";
|
|
path = path + "/vision.txt";
|
|
if (!cn.hutool.core.io.FileUtil.isFile(path)) {
|
|
if (!cn.hutool.core.io.FileUtil.isFile(path)) {
|
|
throw new BaseRuntimeException(MsgCode.e3001, "vision.txt不存在");
|
|
throw new BaseRuntimeException(MsgCode.e3001, "vision.txt不存在");
|
|
@@ -668,7 +667,10 @@ public class InitServiceImpl implements InitService {
|
|
// 2021-12-30 根据场景码查询特殊点的原点
|
|
// 2021-12-30 根据场景码查询特殊点的原点
|
|
SpecialPointEntity sp = specialPointService.findBySceneCodeAndPoiKey(sceneCode, TypeConstant.POI_ORIGIN);
|
|
SpecialPointEntity sp = specialPointService.findBySceneCodeAndPoiKey(sceneCode, TypeConstant.POI_ORIGIN);
|
|
|
|
|
|
- JSONArray jsonArray = convertToVision.createFilter(sceneCode, path, calculateEntity, from, false, sp);
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ JSONArray jsonArray = convertToVision.createFilter(sceneCode, path, calculateEntity, from, false,
|
|
|
|
+ sp.getGpsPoi(), dataSet.getOrientation(), dataSet.getLocation());
|
|
FilterEntity entity = new FilterEntity();
|
|
FilterEntity entity = new FilterEntity();
|
|
entity.setId(sceneCode);
|
|
entity.setId(sceneCode);
|
|
entity.setCreateTime(LocalDateTime.now());
|
|
entity.setCreateTime(LocalDateTime.now());
|
|
@@ -680,6 +682,7 @@ public class InitServiceImpl implements InitService {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 处理could.js 并做相应的计算
|
|
* 处理could.js 并做相应的计算
|
|
*
|
|
*
|
|
@@ -916,7 +919,6 @@ public class InitServiceImpl implements InitService {
|
|
*
|
|
*
|
|
* @param sceneCode
|
|
* @param sceneCode
|
|
*/
|
|
*/
|
|
-// private void createDataSet(String sceneCode, String laserDataPath, double orientation, String from) {
|
|
|
|
private DataSetPo createDataSet(String sceneCode, String laserDataPath, double orientation, String from) {
|
|
private DataSetPo createDataSet(String sceneCode, String laserDataPath, double orientation, String from) {
|
|
log.info("run createDataSet");
|
|
log.info("run createDataSet");
|
|
DataSetEntity entity = new DataSetEntity();
|
|
DataSetEntity entity = new DataSetEntity();
|
|
@@ -926,7 +928,8 @@ public class InitServiceImpl implements InitService {
|
|
List<SpecialPointEntity> spList = specialPointService.findBySceneCode(sceneCode);
|
|
List<SpecialPointEntity> spList = specialPointService.findBySceneCode(sceneCode);
|
|
log.info("特殊点数量:{}", spList.size());
|
|
log.info("特殊点数量:{}", spList.size());
|
|
// 正常是5条记录: db.getCollection('t_special_point').find({"sceneCode":"t97"})
|
|
// 正常是5条记录: db.getCollection('t_special_point').find({"sceneCode":"t97"})
|
|
- if (spList.size() != 5) {
|
|
|
|
|
|
+ // 目前还没有firstView 初始点
|
|
|
|
+ if (spList.size() < 4) {
|
|
throw new BaseRuntimeException(MsgCode.e3001, "特殊点表坐标异常");
|
|
throw new BaseRuntimeException(MsgCode.e3001, "特殊点表坐标异常");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -956,7 +959,11 @@ public class InitServiceImpl implements InitService {
|
|
|
|
|
|
mergeDto.setPath(laserDataPath);
|
|
mergeDto.setPath(laserDataPath);
|
|
|
|
|
|
- // 处理弧度, 使用计算控制点的rotation2
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 处理弧度, 使用计算控制点的rotation2
|
|
|
|
+ * 2022-1-5 这一块跟自研不一样
|
|
|
|
+ */
|
|
|
|
+ log.info("dataSet.orientation: {}", orientation);
|
|
if ("web".equals(from)) {
|
|
if ("web".equals(from)) {
|
|
mergeDto.setOrientation(orientation);
|
|
mergeDto.setOrientation(orientation);
|
|
} else {
|
|
} else {
|
|
@@ -964,6 +971,7 @@ public class InitServiceImpl implements InitService {
|
|
mergeDto.setOrientation(0.0);
|
|
mergeDto.setOrientation(0.0);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
DataSetPo po = ModifyDataSets.mergeDataSetPo(map, mergeDto);
|
|
DataSetPo po = ModifyDataSets.mergeDataSetPo(map, mergeDto);
|
|
entity.setData(Arrays.asList(po));
|
|
entity.setData(Arrays.asList(po));
|
|
dataSetService.save(entity);
|
|
dataSetService.save(entity);
|
|
@@ -1001,7 +1009,6 @@ public class InitServiceImpl implements InitService {
|
|
Double[] poi = sp.getPoi();
|
|
Double[] poi = sp.getPoi();
|
|
log.info("firstView: {}", sp.getPoi());
|
|
log.info("firstView: {}", sp.getPoi());
|
|
|
|
|
|
-// String content = MyFileUtils.getResourceContent("data/config.json");
|
|
|
|
String content = cn.hutool.core.io.FileUtil.readUtf8String(configConstant.templatePath + "/config.json");
|
|
String content = cn.hutool.core.io.FileUtil.readUtf8String(configConstant.templatePath + "/config.json");
|
|
|
|
|
|
List<ConfigDto> dtoList = com.alibaba.fastjson.JSONArray.parseArray(content, ConfigDto.class);
|
|
List<ConfigDto> dtoList = com.alibaba.fastjson.JSONArray.parseArray(content, ConfigDto.class);
|
|
@@ -1035,7 +1042,7 @@ public class InitServiceImpl implements InitService {
|
|
*/
|
|
*/
|
|
private void createRoute(String sceneCode, String path) {
|
|
private void createRoute(String sceneCode, String path) {
|
|
List<String> list = new ArrayList<>();
|
|
List<String> list = new ArrayList<>();
|
|
-//
|
|
|
|
|
|
+
|
|
String routePath = path + "/final_freespace.csv";
|
|
String routePath = path + "/final_freespace.csv";
|
|
log.info("routePath: {}", routePath);
|
|
log.info("routePath: {}", routePath);
|
|
if (!cn.hutool.core.io.FileUtil.isFile(routePath)) {
|
|
if (!cn.hutool.core.io.FileUtil.isFile(routePath)) {
|