feat:航线增加新的航点动作保存

This commit is contained in:
gyb 2026-03-10 17:30:33 +08:00
parent 0fd39cf7f3
commit 73e1deae4e
3 changed files with 131 additions and 0 deletions

View File

@ -158,4 +158,18 @@ public class KmlActionActuatorFuncParam {
@XStreamAlias("wpml:recordPointCloudOperate")
private String recordPointCloudOperate;
// 间隔拍照参数
@XStreamAlias("wpml:photoTime")
private String photoTime;
@XStreamAlias("wpml:photoDistance")
private String photoDistance;
@XStreamAlias("wpml:photoType")
private String photoType;
@XStreamAlias("wpml:droneYaw")
private String droneYaw;
}

View File

@ -165,6 +165,29 @@ public class WayPointUitls {
case 20: // 返航 使用的是第一个航点的经纬度和高度
return String.format("%d\t0\t3\t20\t0\t0\t0\t0\t%s\t%s\t%d.000000\t1", index, point.getLat(), point.getLon(), point.getAlt());
case 4000: // 飞行器偏航角
return String.format(Locale.US,
"%d\t0\t3\t531\t0\t%s\t0\t0\t0\t0\t0.000000\t1",
index, point.getDroneYaw());
case 5000: // 开始等时间隔拍照
return String.format(Locale.US,
"%d\t0\t3\t205\t%s\t0\t%s\t0\t0\t0\t0.000000\t1",
index, point.getPhotoTime(), point.getPhotoType());
case 6000: // 开始等间距隔拍照
return String.format(Locale.US,
"%d\t0\t3\t205\t%s\t0\t%s\t0\t0\t0\t0.000000\t1",
index, point.getPhotoDistance(), point.getPhotoType());
case 7000: // 结束间隔拍照
return String.format(Locale.US,
"%d\t0\t3\t2501\t0\t0\t0\t0\t0\t0\t0.000000\t1", index);
case 8000: // 全景拍照
return String.format(Locale.US,
"%d\t0\t3\t2501\t0\t0\t0\t0\t0\t0\t0.000000\t1", index);
default:
throw new IllegalArgumentException("未知命令: " + point.getCommand());
}
@ -274,6 +297,66 @@ public class WayPointUitls {
));
break;
case "panoPhoto":
// 全景拍照命令8000
linePoints.add(buildPoint(
8000,
"0", "0", 0,
"0", "0", "0", "0",
0, 0, 0
));
break;
case "startTimeIntervalPhoto":
// 开始等时间隔拍照命令5000
linePoints.add(buildPoint(
5000,
"0", "0", 0,
"0", "0", "0", "0",
0, 0, 0,
actionActuatorFuncParam.getPhotoTime(),
null,
actionActuatorFuncParam.getPhotoType(),
null
));
break;
case "startDistanceIntervalPhoto":
// 开始等间距隔拍照命令6000
linePoints.add(buildPoint(
6000,
"0", "0", 0,
"0", "0", "0", "0",
0, 0, 0,
null,
actionActuatorFuncParam.getPhotoDistance(),
actionActuatorFuncParam.getPhotoType(),
null
));
break;
case "stopIntervalPhoto":
// 结束间隔拍照命令7000
linePoints.add(buildPoint(
7000,
"0", "0", 0,
"0", "0", "0", "0",
0, 0, 0
));
break;
case "aircraftYaw":
// 飞行器偏航角命令4000
linePoints.add(buildPoint(
4000,
"0", "0", 0,
"0", "0", "0", "0",
0, 0, 0,
null, null, null,
actionActuatorFuncParam.getDroneYaw()
));
break;
default:
log.error("未知动作类型: {}", actionType);
}
@ -299,5 +382,19 @@ public class WayPointUitls {
return point;
}
//构建waypoint航点带间隔拍照参数
public static AirLinePointDTO buildPoint(int command, String lat, String lon, int alt,
String loiterTime, String cameraPitch, String cameraRoll, String cameraYaw,
int sessionControl, int zoomAbsolute, int rotateDirection,
String photoTime, String photoDistance, String photoType, String droneYaw) {
AirLinePointDTO point = buildPoint(command, lat, lon, alt, loiterTime, cameraPitch, cameraRoll, cameraYaw,
sessionControl, zoomAbsolute, rotateDirection);
point.setPhotoTime(photoTime);
point.setPhotoDistance(photoDistance);
point.setPhotoType(photoType);
point.setDroneYaw(droneYaw);
return point;
}
}

View File

@ -75,4 +75,24 @@ public class AirLinePointDTO implements Serializable {
* 转动方向 -1逆时针 1相对机场方向 硬件定义的
*/
private Integer rotateDirection;
/**
* 间隔拍照时间- 命令5000
*/
private String photoTime;
/**
* 间隔拍照距离- 命令6000
*/
private String photoDistance;
/**
* 照片类型数组1,2,3- 命令5000/6000
*/
private String photoType;
/**
* 飞行器偏航角 - 命令4000
*/
private String droneYaw;
}