[自动滑动出发+部分跳站]
This commit is contained in:
yangyakun
2026-03-18 11:19:16 +08:00
parent df373cec15
commit cf10a6a706
24 changed files with 211 additions and 39 deletions

View File

@@ -9,12 +9,22 @@ public class TaskContinueNotification {
* 当前站点
*/
private VehicleSite curStation;
private VehicleSite nextStation;
public TaskContinueNotification() {
}
public TaskContinueNotification(VehicleSite curStation) {
public VehicleSite getNextStation() {
return nextStation;
}
public void setNextStation(VehicleSite nextStation) {
this.nextStation = nextStation;
}
public TaskContinueNotification(VehicleSite curStation, VehicleSite nextStation) {
this.curStation = curStation;
this.nextStation = nextStation;
}
public VehicleSite getCurStation() {
@@ -38,14 +48,20 @@ public class TaskContinueNotification {
public static class Builder {
private VehicleSite curStation;
private VehicleSite nextStation;
public Builder curStation(VehicleSite curStation) {
this.curStation = curStation;
return this;
}
public Builder nextStation(VehicleSite nextStation) {
this.nextStation = nextStation;
return this;
}
public TaskContinueNotification build() {
return new TaskContinueNotification(curStation);
return new TaskContinueNotification(curStation, nextStation);
}
}
}

View File

@@ -1,6 +1,12 @@
package com.zhjt.mogo.adas.unmanned.task.dto.cmd;
import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.zhjt.mogo.adas.unmanned.task.enums.MessageCmdEnum;
import java.util.List;
import java.util.Objects;
/**
* 车端发送车辆启动结果
@@ -26,17 +32,20 @@ public class TaskStartNotification {
* 错误码
*/
private List<Integer> errCodes;
/**
* 当前站点
*/
private VehicleSite curStation;
/**
* 下一个站点
*/
private VehicleSite nextStation;
/**
* 前一个任务名称
*/
private String lastTaskCmdType;
public TaskStartNotification() {
}
public TaskStartNotification(VehicleSite curLocation, boolean autopilotResult, double stationTimeLeft, String errMsg, List<Integer> errCodes) {
this.curLocation = curLocation;
this.autopilotResult = autopilotResult;
this.stationTimeLeft = stationTimeLeft;
this.errMsg = errMsg;
this.errCodes = errCodes;
}
public TaskStartNotification() {}
public VehicleSite getCurLocation() {
return curLocation;
@@ -78,6 +87,30 @@ public class TaskStartNotification {
this.errCodes = errCodes;
}
public VehicleSite getCurStation() {
return curStation;
}
public void setCurStation(VehicleSite curStation) {
this.curStation = curStation;
}
public VehicleSite getNextStation() {
return nextStation;
}
public void setNextStation(VehicleSite nextStation) {
this.nextStation = nextStation;
}
public String getLastTaskCmdType() {
return lastTaskCmdType;
}
public void setLastTaskCmdType(String lastTaskCmdType) {
this.lastTaskCmdType = lastTaskCmdType;
}
@Override
public String toString() {
return "TaskStartNotification{" +
@@ -86,6 +119,19 @@ public class TaskStartNotification {
", stationTimeLeft=" + stationTimeLeft +
", errMsg='" + errMsg + '\'' +
", errCodes=" + errCodes +
", curStation=" + curStation +
", nextStation=" + nextStation +
", lastTaskCmdType=" + lastTaskCmdType +
'}';
}
public boolean isCloseDoorStartAuto(){
if(Objects.equals(lastTaskCmdType, MessageCmdEnum.TaskStartNotification.getCode()) ||
Objects.equals(lastTaskCmdType, MessageCmdEnum.TaskContinueNotification.getCode()) ){
return false;
}
return true;
}
}

View File

@@ -3436,19 +3436,13 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
*
* @param trackId
* @param taskId
* @param stationId
* @param stationName
* @param stationSeq
* @param lon
* @param lat
* @param startStation
* @param endStation
* @return
*/
@Override
public long sendTaskManagerAutopilotContinue(Long trackId, Long taskId, Long stationId, String stationName, Integer stationSeq, double lon, double lat) {
VehicleSite vehicleSite = VehicleSite.builder().stationId(stationId).stationName(stationName)
.station(StationEnum.SITE.getCode()).stationSeq(stationSeq)
.point(AutopilotPoint.builder().x(lon).y(lat).build()).coordinateType(AutopilotCoordinateTypeEnum.WGS84.getCode()).build();
TaskContinueNotification taskContinueNotification = TaskContinueNotification.builder().curStation(vehicleSite).build();
public long sendTaskManagerAutopilotContinue(Long trackId, Long taskId,VehicleSite startStation,VehicleSite endStation) {
TaskContinueNotification taskContinueNotification = TaskContinueNotification.builder().curStation(startStation).nextStation(endStation).build();
CmdDto<TaskContinueNotification> cmdDto = CmdDto.<TaskContinueNotification>builder().cmdType(MessageCmdEnum.TaskContinueNotification.getCode()).taskId(taskId).lineId(trackId).timestamp(System.currentTimeMillis()).data(taskContinueNotification).build();
return sendTaskManager(cmdDto);
}

View File

@@ -29,6 +29,7 @@ import com.zhjt.mogo.adas.data.sweeper.task.confirm.SweeperTaskConfirm;
import com.zhjt.mogo.adas.data.sweeper.task.s_r.SweeperTaskSuspendResume;
import com.zhjt.mogo.adas.data.sweeper.task.stop.SweeperTaskStop;
import com.zhjt.mogo.adas.unmanned.task.dto.cmd.Trajectory;
import com.zhjt.mogo.adas.unmanned.task.dto.cmd.VehicleSite;
import java.util.HashSet;
import java.util.List;
@@ -2098,8 +2099,8 @@ public class AdasManager implements IAdasNetCommApi {
}
@Override
public long sendTaskManagerAutopilotContinue(Long trackId, Long taskId, Long stationId, String stationName, Integer stationSeq, double lon, double lat) {
return mChannel == null ? -1L : mChannel.sendTaskManagerAutopilotContinue(trackId, taskId, stationId, stationName, stationSeq, lon, lat);
public long sendTaskManagerAutopilotContinue(Long trackId, Long taskId, VehicleSite startStation, VehicleSite endStation) {
return mChannel == null ? -1L : mChannel.sendTaskManagerAutopilotContinue(trackId, taskId, startStation, endStation);
}
@Override

View File

@@ -17,6 +17,7 @@ import com.zhjt.mogo.adas.data.sweeper.task.confirm.SweeperTaskConfirm;
import com.zhjt.mogo.adas.data.sweeper.task.s_r.SweeperTaskSuspendResume;
import com.zhjt.mogo.adas.data.sweeper.task.stop.SweeperTaskStop;
import com.zhjt.mogo.adas.unmanned.task.dto.cmd.Trajectory;
import com.zhjt.mogo.adas.unmanned.task.dto.cmd.VehicleSite;
import java.util.List;
import java.util.Map;
@@ -1547,7 +1548,7 @@ public interface IAdasNetCommApi {
long sendTaskManagerRunningInfo();
long sendTaskManagerAutopilotStart(Long taskId, Trajectory traj);
long sendTaskManagerAutopilotContinue(Long trackId, Long taskId, Long stationId, String stationName, Integer stationSeq, double lon, double lat);
long sendTaskManagerAutopilotContinue(Long trackId, Long taskId, VehicleSite startStation, VehicleSite endStation);
long sendTaskManagerAutopilotCancel(Long taskId);

View File

@@ -34,6 +34,7 @@ import com.zhjt.mogo.adas.data.sweeper.task.s_r.SweeperTaskSuspendResume;
import com.zhjt.mogo.adas.data.sweeper.task.status.SweeperTaskStatus;
import com.zhjt.mogo.adas.data.sweeper.task.stop.SweeperTaskStop;
import com.zhjt.mogo.adas.unmanned.task.dto.cmd.TaskLocationQueryResponse;
import com.zhjt.mogo.adas.unmanned.task.dto.cmd.TaskStartNotification;
import java.math.BigDecimal;
import java.util.ArrayList;
@@ -816,8 +817,9 @@ public interface OnAdasListener {
* @param ack
* @param reason
* @param stationTimeLeft
* @param closeDoorStartAuto
*/
void onAdasTaskManagerDeparture(Long taskId, Long siteId, Integer sequence, boolean ack, String reason, double stationTimeLeft);
void onAdasTaskManagerDeparture(Long taskId, TaskStartNotification taskStartNotification);
/**
* 域控任务管理到站通知

View File

@@ -3,6 +3,7 @@ package com.zhidao.support.adas.high.msg;
import android.os.SystemClock;
import android.util.Log;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.google.gson.reflect.TypeToken;
@@ -66,7 +67,7 @@ public class TaskManagerMessage extends MyAbstractMessageHandler {
TaskStartNotification taskStartNotification = cmdDto.getData();
VehicleSite vehicleSite = taskStartNotification.getCurLocation();
adasListener.onAdasTaskManagerDeparture(cmdDto.getTaskId(), vehicleSite.getStationId(), vehicleSite.getStationSeq(), taskStartNotification.isAutopilotResult(), taskStartNotification.getErrMsg(), taskStartNotification.getStationTimeLeft());
adasListener.onAdasTaskManagerDeparture(cmdDto.getTaskId(), taskStartNotification);
}
} else if (messageCmdEnum == MessageCmdEnum.TaskArrivalNotification) {//到站通知