Merge branch 'dev_robotaxi-d_241112_6.8.0' into dev_robotaxi-d_241112_6.8.1_dev
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.zhjt.mogo.adas.data.bean;
|
||||
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import fsm.Fsm2024;
|
||||
@@ -18,7 +19,7 @@ public class AutopilotStatistics {
|
||||
/**
|
||||
* 成功
|
||||
*/
|
||||
int SUCCESSFUL = 0;
|
||||
int SUCCEED = 0;
|
||||
/**
|
||||
* 失败
|
||||
*/
|
||||
@@ -29,6 +30,14 @@ public class AutopilotStatistics {
|
||||
int CANCEL = 2;
|
||||
}
|
||||
|
||||
public enum Source {
|
||||
LIB,//ADAS库 [用在下取消]
|
||||
REPORT,//系统监控 [用在失败]
|
||||
FSM, //老版FSM [用在成功]
|
||||
FSM2024, //新版FSM [用在成功和失败]
|
||||
CHASSIS//底盘 [用在成功]
|
||||
}
|
||||
|
||||
/**
|
||||
* 启动自动驾驶后状态
|
||||
* 0 成功
|
||||
@@ -62,9 +71,16 @@ public class AutopilotStatistics {
|
||||
@Nullable
|
||||
public final MogoReportMsg.MogoReportMessage failedMessage;
|
||||
|
||||
public AutopilotStatistics(int status, long usedTime, @Nullable MessagePad.SetAutopilotModeReq req, @Nullable Fsm2024.FSMStateMsg fsmState, @Nullable MogoReportMsg.MogoReportMessage failedMessage) {
|
||||
/**
|
||||
* 数据来源
|
||||
*/
|
||||
@NonNull
|
||||
public final Source source;
|
||||
|
||||
public AutopilotStatistics(int status, long usedTime, @NonNull Source source, @Nullable MessagePad.SetAutopilotModeReq req, @Nullable Fsm2024.FSMStateMsg fsmState, @Nullable MogoReportMsg.MogoReportMessage failedMessage) {
|
||||
this.status = status;
|
||||
this.usedTime = usedTime;
|
||||
this.source = source;
|
||||
this.req = req;
|
||||
this.fsmState = fsmState;
|
||||
this.failedMessage = failedMessage;
|
||||
|
||||
@@ -41,10 +41,10 @@ public class AutopilotReview {
|
||||
void onReview(AutopilotStatistics statistics);
|
||||
}
|
||||
|
||||
private void onCallback(@Define.AutopilotStartStatus int status) {
|
||||
private void onCallback(@Define.AutopilotStartStatus int status, @NonNull AutopilotStatistics.Source source) {
|
||||
long usedTime = SystemClock.elapsedRealtime() - startTime;
|
||||
if (listener != null) {
|
||||
listener.onReview(new AutopilotStatistics(status, usedTime, startReq, fsmState, failedMessage));
|
||||
listener.onReview(new AutopilotStatistics(status, usedTime, source, startReq, fsmState, failedMessage));
|
||||
}
|
||||
startTime = 0;
|
||||
startReq = null;
|
||||
@@ -68,7 +68,7 @@ public class AutopilotReview {
|
||||
startReq = null;
|
||||
failedMessage = null;
|
||||
fsmState = null;
|
||||
onCallback(AutopilotStatistics.AUTOPILOT_START_STATUS.CANCEL);
|
||||
onCallback(AutopilotStatistics.AUTOPILOT_START_STATUS.CANCEL, AutopilotStatistics.Source.LIB);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,26 +82,38 @@ public class AutopilotReview {
|
||||
if (AutopilotAbilityManager.getInstance().getFsm2024Version() >= 20) {
|
||||
return;
|
||||
}
|
||||
if (startReq != null && message != null) {
|
||||
failedMessage = message;
|
||||
onCallback(AutopilotStatistics.AUTOPILOT_START_STATUS.FAILED);
|
||||
failedMessage = message;
|
||||
if (message != null) {
|
||||
if (startReq == null) {
|
||||
this.failedMessage = null;
|
||||
} else {
|
||||
onCallback(AutopilotStatistics.AUTOPILOT_START_STATUS.FAILED, AutopilotStatistics.Source.REPORT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void setFSM2024State(Fsm2024.FSMStateMsg fsmState) {
|
||||
public void setFSM2024State(Fsm2024.FSMStateMsg fsmState, int autopilotState) {
|
||||
this.fsmState = fsmState;
|
||||
if (startReq != null && fsmState != null) {
|
||||
if (fsmState.hasSession()) {
|
||||
Fsm2024.Session session = fsmState.getSession();
|
||||
if (session.hasSessionActiveMode() && session.hasSessionResult()) {
|
||||
if (session.getSessionActiveMode() == Fsm2024.ActiveMode.PILOT_ACTIVE &&
|
||||
session.getSessionResult() == Fsm2024.SessionResult.REQUEST_FAILED) {
|
||||
onCallback(AutopilotStatistics.AUTOPILOT_START_STATUS.FAILED);
|
||||
if (fsmState != null) {
|
||||
if (startReq == null) {
|
||||
this.fsmState = null;
|
||||
} else {
|
||||
if (fsmState.hasSession()) {
|
||||
Fsm2024.Session session = fsmState.getSession();
|
||||
if (session.hasSessionActiveMode() && session.hasSessionResult()) {
|
||||
if (session.getSessionActiveMode() == Fsm2024.ActiveMode.PILOT_ACTIVE) {
|
||||
if (session.getSessionResult() == Fsm2024.SessionResult.REQUEST_SUCCEED) {
|
||||
onCallback(AutopilotStatistics.AUTOPILOT_START_STATUS.SUCCEED, AutopilotStatistics.Source.FSM2024);
|
||||
} else if (session.getSessionResult() == Fsm2024.SessionResult.REQUEST_FAILED) {
|
||||
onCallback(AutopilotStatistics.AUTOPILOT_START_STATUS.FAILED, AutopilotStatistics.Source.FSM2024);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
onAutopilotResult(autopilotState, AutopilotStatistics.Source.FSM2024);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -109,9 +121,13 @@ public class AutopilotReview {
|
||||
*
|
||||
* @param autopilotState
|
||||
*/
|
||||
public void onAutopilotResult(int autopilotState) {
|
||||
public void onAutopilotResult(int autopilotState, @NonNull AutopilotStatistics.Source source) {
|
||||
//FSM2024版本大于等于2.0时使用FSM的数据进行判断是否失败
|
||||
if (AutopilotAbilityManager.getInstance().getFsm2024Version() >= 20) {
|
||||
return;
|
||||
}
|
||||
if (startReq != null && autopilotState == 2) {
|
||||
onCallback(AutopilotStatistics.AUTOPILOT_START_STATUS.SUCCESSFUL);
|
||||
onCallback(AutopilotStatistics.AUTOPILOT_START_STATUS.SUCCEED, source);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ public final class Define {
|
||||
public @interface SubscribeType {
|
||||
}
|
||||
|
||||
@IntDef(flag = true, value = {AutopilotStatistics.AUTOPILOT_START_STATUS.SUCCESSFUL,
|
||||
@IntDef(flag = true, value = {AutopilotStatistics.AUTOPILOT_START_STATUS.SUCCEED,
|
||||
AutopilotStatistics.AUTOPILOT_START_STATUS.FAILED,
|
||||
AutopilotStatistics.AUTOPILOT_START_STATUS.CANCEL})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.zhidao.support.adas.high.common.CupidLogUtils;
|
||||
import com.zhidao.support.adas.high.common.ParallelDrivingManager;
|
||||
import com.zhidao.support.adas.high.protocol.RawData;
|
||||
import com.zhjt.mogo.adas.data.AdasConstants;
|
||||
import com.zhjt.mogo.adas.data.bean.AutopilotStatistics;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
@@ -39,7 +40,7 @@ public class AutopilotStateMessage extends MyAbstractMessageHandler {
|
||||
if (AdasManager.getInstance().getNodeStateInfo(AdasConstants.NodeName.FSM2024).getExistState() != AdasConstants.NodeExistState.NODE_EXIST_NORMAL) {
|
||||
ParallelDrivingManager.getInstance().setAutopilotState(autopilotState.getState());
|
||||
if (autopilotReview != null) {
|
||||
autopilotReview.onAutopilotResult(autopilotState.getState());
|
||||
autopilotReview.onAutopilotResult(autopilotState.getState(), AutopilotStatistics.Source.CHASSIS);
|
||||
}
|
||||
}
|
||||
AdasChannel.calculateTimeConsumingBusiness("自动驾驶状态", nowTime);
|
||||
|
||||
@@ -35,8 +35,7 @@ public class FSM2024StateMessage extends MyAbstractMessageHandler {
|
||||
nowTime = SystemClock.elapsedRealtime();
|
||||
ParallelDrivingManager.getInstance().setAutopilotState(autopilotState);
|
||||
if (autopilotReview != null) {
|
||||
autopilotReview.setFSM2024State(fsmState);
|
||||
autopilotReview.onAutopilotResult(autopilotState);
|
||||
autopilotReview.setFSM2024State(fsmState, autopilotState);
|
||||
}
|
||||
if (adasListener != null) {
|
||||
if (fsmState.getRepeatedPilotNotStandbyReasonCount() == 0) {
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.zhidao.support.adas.high.common.CupidLogUtils;
|
||||
import com.zhidao.support.adas.high.common.ParallelDrivingManager;
|
||||
import com.zhidao.support.adas.high.common.autopilot.ability.AutopilotAbilityManager;
|
||||
import com.zhidao.support.adas.high.protocol.RawData;
|
||||
import com.zhjt.mogo.adas.data.bean.AutopilotStatistics;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -107,7 +108,7 @@ public class FunctionStatesMessage extends MyAbstractMessageHandler {
|
||||
adasListener.onAutopilotState(header.toBuilder().setMsgType(MessagePad.MessageType.MsgTypeAutopilotState).build(), autopilotState);
|
||||
ParallelDrivingManager.getInstance().setAutopilotState(autopilotState.getState());
|
||||
if (autopilotReview != null) {
|
||||
autopilotReview.onAutopilotResult(autopilotState.getState());
|
||||
autopilotReview.onAutopilotResult(autopilotState.getState(), AutopilotStatistics.Source.FSM);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user