Merge branch 'dev_robotaxi-d-app-module_2120_221017_2.12.0' into dev_robotaxi-d-app-module_212-_221017_2.12.0_code_style_opt

This commit is contained in:
zhongchao
2022-11-08 11:07:32 +08:00
18 changed files with 147 additions and 32 deletions

View File

@@ -65,6 +65,9 @@ class BusConst {
const val EVENT_PARAM_START_RESULT = "start_autopilot" // true/false
const val EVENT_PARAM_PLATE_NUM = "plate_number" // 车牌号
const val EVENT_PARAM_ENV_ONLINE = "env_online" // 是否线上环境true/false
// 埋点key开启自动驾驶前已识别的异常会导致无法开启自驾
const val EVENT_KEY_AP_UNABLE_START_REASON = "event_key_och_bus_ap_unable_start_reason"
const val EVENT_PARAM_UNABLE_START_REASON = "unable_start_reason";
/**
* 订单起终点Marker类型

View File

@@ -532,6 +532,7 @@ public class BusOrderModel {
if (!FunctionBuildConfig.isDemoMode && !OCHAdasAbilityManager.getInstance().getAutopilotAbilityStatus()){
ToastUtils.showLong(OCHAdasAbilityManager.getInstance().getAutopilotUnAbilityReason() +
", 请稍候重试");
triggerUnableStartAPReasonEvent();
return;
}
@@ -976,6 +977,17 @@ public class BusOrderModel {
currentStation.getName(), nextStation.getName(), currentLineId);
}
public void triggerUnableStartAPReasonEvent() {
if (stationList == null || backgroundCurrentStationIndex >= stationList.size()-1) {
return;
}
BusStationBean currentStation = stationList.get( backgroundCurrentStationIndex);
BusStationBean nextStation = stationList.get( backgroundCurrentStationIndex +1);
BusAnalyticsManager.getInstance().triggerUnableStartAPReasonEvent(
currentStation.getName(), nextStation.getName(), currentLineId,
OCHAdasAbilityManager.getInstance().getAutopilotUnAbilityReason());
}
public BusRoutesResult getBusRoutesResult() {
return busRoutesResult;
}

View File

@@ -79,4 +79,31 @@ public class BusAnalyticsManager {
UiThreadHandler.postDelayed(startAutopilotRunnable, BusConst.LOOP_PERIOD_15S);
}
}
/**
* 触发"无法开启自驾已知异常"埋点
* @param startName
* @param endName
* @param lineId
*/
public void triggerUnableStartAPReasonEvent(String startName, String endName, int lineId,
String reason) {
String sn = MoGoAiCloudClientConfig.getInstance().getSn();
String plateNum = AppConfigInfo.INSTANCE.getPlateNumber();
String dateTime = DateTimeUtils.getTimeText(
System.currentTimeMillis(), DateTimeUtils.yyyy_MM_dd_HH_mm_ss);
HashMap<String, Object> params = new HashMap<>();
params.put(BusConst.EVENT_PARAM_SN, sn);
params.put(BusConst.EVENT_PARAM_PLATE_NUM, TextUtils.isEmpty(plateNum) ? "" : plateNum);
params.put(BusConst.EVENT_PARAM_ENV_ONLINE,
DebugConfig.getNetMode() == DebugConfig.NET_MODE_RELEASE ? true : false);
params.put(BusConst.EVENT_PARAM_TIME, dateTime);
params.put(BusConst.EVENT_PARAM_START_NAME, startName);
params.put(BusConst.EVENT_PARAM_END_NAME, endName);
params.put(BusConst.EVENT_PARAM_LINE_ID, lineId);
params.put(BusConst.EVENT_PARAM_UNABLE_START_REASON, reason);
AnalyticsManager.INSTANCE.track(BusConst.EVENT_KEY_AP_UNABLE_START_REASON, params);
}
}

View File

@@ -67,6 +67,9 @@ class TaxiConst {
const val EVENT_PARAM_START_RESULT = "start_autopilot" // true/false
const val EVENT_PARAM_PLATE_NUM = "plate_number" // 车牌号
const val EVENT_PARAM_ENV_ONLINE = "env_online" // 是否线上环境true/false
// 埋点key开启自动驾驶前已识别的异常会导致无法开启自驾
const val EVENT_KEY_AP_UNABLE_START_REASON = "event_key_och_taxi_ap_unable_start_reason"
const val EVENT_PARAM_UNABLE_START_REASON = "unable_start_reason";
// 实时计算当前剩余里程和时间 间隔 2秒
const val LOOP_CALCULATEROUTE_2S = 2 * 1000L

View File

@@ -809,6 +809,7 @@ public class TaxiModel {
}
if (mCurrentOCHOrder.orderStatus == TaxiOrderStatusEnum.ArriveAtEnd.getCode()){
if (FunctionBuildConfig.isDemoMode) {
CallerLogger.INSTANCE.d(M_TAXI + TAG, "setIPCDemoModefalse");
CallerAutoPilotManager.INSTANCE.setIPCDemoMode(false);
}
@@ -883,6 +884,9 @@ public class TaxiModel {
if (!FunctionBuildConfig.isDemoMode && !OCHAdasAbilityManager.getInstance().getAutopilotAbilityStatus()){
ToastUtils.showLong(OCHAdasAbilityManager.getInstance().getAutopilotUnAbilityReason() +
", 请稍候重试");
TaxiAnalyticsManager.getInstance().triggerUnableStartAPReasonEvent(
mCurrentOCHOrder.startSiteAddr, mCurrentOCHOrder.endSiteAddr, mCurrentOCHOrder.orderNo,
OCHAdasAbilityManager.getInstance().getAutopilotUnAbilityReason());
return;
}

View File

@@ -620,6 +620,7 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment
public void onCurrentOrderCancelDone() {
//去除起终点
saveOrderState = -1;
if (mCurrentOrder != null){
setOrRemoveMapMaker(false, TaxiConst.TAXI_START_MAP_MAKER,mCurrentOrder.startSitePoint,R.raw.star_marker);
setOrRemoveMapMaker(false, TaxiConst.TAXI_END_MAP_MAKER,mCurrentOrder.endSitePoint,R.raw.end_marker);

View File

@@ -79,4 +79,31 @@ public class TaxiAnalyticsManager {
UiThreadHandler.postDelayed(startAutopilotRunnable, TaxiConst.LOOP_PERIOD_15S);
}
}
/**
* 触发"无法开启自驾已知异常"埋点
* @param startName
* @param endName
* @param orderNo
*/
public void triggerUnableStartAPReasonEvent(String startName, String endName, String orderNo,
String reason) {
String sn = MoGoAiCloudClientConfig.getInstance().getSn();
String plateNum = AppConfigInfo.INSTANCE.getPlateNumber();
String dateTime = DateTimeUtils.getTimeText(
System.currentTimeMillis(), DateTimeUtils.yyyy_MM_dd_HH_mm_ss);
HashMap<String, Object> params = new HashMap<>();
params.put(TaxiConst.EVENT_PARAM_SN, sn);
params.put(TaxiConst.EVENT_PARAM_PLATE_NUM, TextUtils.isEmpty(plateNum) ? "" : plateNum);
params.put(TaxiConst.EVENT_PARAM_ENV_ONLINE,
DebugConfig.getNetMode() == DebugConfig.NET_MODE_RELEASE ? true : false);
params.put(TaxiConst.EVENT_PARAM_TIME, dateTime);
params.put(TaxiConst.EVENT_PARAM_START_NAME, startName);
params.put(TaxiConst.EVENT_PARAM_END_NAME, endName);
params.put(TaxiConst.EVENT_PARAM_ORDER_NUMBER, orderNo);
params.put(TaxiConst.EVENT_PARAM_UNABLE_START_REASON, reason);
AnalyticsManager.INSTANCE.track(TaxiConst.EVENT_KEY_AP_UNABLE_START_REASON, params);
}
}

View File

@@ -107,8 +107,24 @@ internal object BadCaseManager : LifecycleEventObserver {
if(ClickUtils.isFastClick()){
if(NetworkUtils.isConnected()){
if(BadCaseConfig.dockerVersion!=null){
val caseListDialog = CaseListDialog(activity)
caseListDialog.show()
//兼容老MAP版本
if(BadCaseConfig.dockerVersion!!.contains("2.3.0")
|| BadCaseConfig.dockerVersion!!.contains("2.4.0")
|| BadCaseConfig.dockerVersion!!.contains("2.5.0")
|| BadCaseConfig.dockerVersion!!.contains("2.6.0")
|| BadCaseConfig.dockerVersion!!.contains("2.8.0")){
val initiativeBadCaseWindow = InitiativeBadCaseWindow(activity)
initiativeBadCaseWindow.setClickListener(object: InitiativeBadCaseWindow.ClickListener{
override fun closeWindow() {
initiativeBadCaseWindow.hideFloatWindow()
}
})
initiativeBadCaseWindow.showFloatWindow(null)
}else{
val caseListDialog = CaseListDialog(activity)
caseListDialog.show()
}
}else{
ToastUtils.showShort("工控机连接状态异常")
}

View File

@@ -174,19 +174,27 @@ internal class BadCaseConfigView @JvmOverloads constructor(
override fun onAutopilotRecordConfig(config: MessagePad.RecordDataConfig) {
super.onAutopilotRecordConfig(config)
ThreadUtils.runOnUiThread {
config.recordTypesList.iterator().forEach {
if (it.id != 99){
val topicList = ArrayList<TopicEntity>()
it.topicsList.iterator().forEach {
topicList.add(TopicEntity(it,true,false))
if(BadCaseConfig.dockerVersion!!.contains("2.3.0")
|| BadCaseConfig.dockerVersion!!.contains("2.4.0")
|| BadCaseConfig.dockerVersion!!.contains("2.5.0")
|| BadCaseConfig.dockerVersion!!.contains("2.6.0")
|| BadCaseConfig.dockerVersion!!.contains("2.8.0")){
rvTemplate.visibility = View.GONE
}else{
config.recordTypesList.iterator().forEach {
if (it.id != 99){
val topicList = ArrayList<TopicEntity>()
it.topicsList.iterator().forEach {
topicList.add(TopicEntity(it,true,false))
}
recordTypesList.add(RecordTypeEntity(it.id,it.desc,topicList))
}
recordTypesList.add(RecordTypeEntity(it.id,it.desc,topicList))
}
}
if(recordTypesList.size>1){
rvTemplate.visibility = View.VISIBLE
recordTemplateAdapter?.setData(recordTypesList)
recordTemplateAdapter?.notifyDataSetChanged()
if(recordTypesList.size>1){
rvTemplate.visibility = View.VISIBLE
recordTemplateAdapter?.setData(recordTypesList)
recordTemplateAdapter?.notifyDataSetChanged()
}
}
}
}

View File

@@ -167,17 +167,17 @@ public class CaseTopicListDialog extends Dialog implements IMoGoAutopilotRecordL
BadCaseConfig.customTopicList.addAll(addTopicList);
}
addTopicList.clear();
recordType.getTopicsList().removeAll(allTopicList);
dismiss();
}else{
ToastUtils.showShort("Topic设置失败");
}
}
});
tvCancel.setOnClickListener(v -> {
dismiss();
recordType.getTopicsList().removeAll(allTopicList);
dismiss();
});
}
@@ -185,11 +185,13 @@ public class CaseTopicListDialog extends Dialog implements IMoGoAutopilotRecordL
@Override
public void onAutopilotRecordConfig(MessagePad.RecordDataConfig config) {
ThreadUtils.runOnUiThread(() -> {
Log.i("houyanli","AllTopicsCount="+config.getAllTopicsCount());
if(config.getAllTopicsCount()>0){
for(int index=0;index<config.getAllTopicsCount();index++){
if(!recordType.getTopicsList().contains(config.getAllTopics(index))){
allTopicList.add(new TopicEntity(config.getAllTopics(index),false,true));
}
Log.i("houyanli","topic="+config.getAllTopics(index));
}
recordType.getTopicsList().addAll(allTopicList);
topicListAdapter.setData(recordType.getTopicsList());

View File

@@ -331,7 +331,7 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
return true
}
fun showFloatWindow(recordCaseEntity: RecordCaseEntity) {
fun showFloatWindow(recordCaseEntity: RecordCaseEntity?) {
if (mFloatLayout.parent == null) {
val metrics = DisplayMetrics()
// 默认固定位置,靠屏幕右边缘的中间
@@ -340,8 +340,13 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
mWindowParams!!.y = metrics.heightPixels / 2 - getSysBarHeight(mActivity)-350
mWindowManager!!.addView(mFloatLayout, mWindowParams)
//开启录包
CallerAutoPilotManager.recordPackage(recordCaseEntity.caseId,Random(SystemClock.elapsedRealtime()).nextInt(),
BadCaseConfig.totalDuration, BadCaseConfig.previousDuration,recordCaseEntity.topicList)
if(recordCaseEntity!=null){
CallerAutoPilotManager.recordPackage(recordCaseEntity.caseId,Random(SystemClock.elapsedRealtime()).nextInt(),
BadCaseConfig.totalDuration, BadCaseConfig.previousDuration,recordCaseEntity.topicList)
}else{
CallerAutoPilotManager.recordPackage(BadCaseConfig.type,Random(SystemClock.elapsedRealtime()).nextInt(),
BadCaseConfig.totalDuration, BadCaseConfig.previousDuration)
}
}
}

View File

@@ -10,6 +10,7 @@ import com.elegant.utils.UiThreadHandler;
import com.mogo.cloud.socket.SocketBuildConfig;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.voice.AIAssist;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.data.constants.MoGoConfig;
import com.mogo.eagle.core.data.constants.MogoServicePaths;
@@ -55,6 +56,7 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
initCrashConfig();
initLogConfig();
initTipToast();
AIAssist.getInstance(this);
initModules();
if (DebugConfig.isDebug()) {
initKoom();

View File

@@ -66,6 +66,6 @@ interface IMoGoAutopilotStatusListener {
/**
* 平行驾驶
*/
const val STATUS_PARALLEL_DRIVING = 3
const val STATUS_PARALLEL_DRIVING = 7
}
}

View File

@@ -85,7 +85,7 @@ MOGO_LOCATION_VERSION=1.4.3.26
MOGO_TELEMATIC_VERSION=1.4.3.26
######## MogoAiCloudSDK Version ########
# 自研地图
MAP_SDK_VERSION=2.6.1.1
MAP_SDK_VERSION=2.7.0.9
MAP_SDK_OPERATION_VERSION=1.1.3.5
# websocket
WEBSOCKET_VERSION=1.1.7

View File

@@ -23,6 +23,7 @@ enum PilotMode {
MODE_AUTO_DRIVE = 1;
MODE_STEER_ONLY = 2;
MODE_SPEED_ONLY = 3;
MODE_REMOTE_DRIVE = 6;
}
enum LongitudeDrivingMode {

View File

@@ -143,11 +143,11 @@ message GnssInfo
// message definition for MessageType: MsgTypeAutopilotState
message AutopilotState
{
uint32 state = 1; //0: 不可用(abandoned), 1:ready, 2:自动驾驶中,3:平行驾驶
uint32 state = 1; //0: 不可用(abandoned), 1:ready, 2:自动驾驶中, 7:平行驾驶
uint32 camera = 2; //camera节点状态 1:开启0:关闭
uint32 radar = 3; //雷达节点状态 1:开启0:关闭
uint32 rtk = 4; //RTK节点状态 1:开启0:关闭
uint32 autopilotMode = 5; //自动驾驶状态 0: 非自动驾驶1: 自动驾驶2平行驾驶
uint32 autopilotMode = 5; //自动驾驶状态 0: 非自动驾驶1: 自动驾驶
double speed = 6; //惯导车速 m/s
string reason = 7; //不可用原因(abandoned)
}

View File

@@ -15,6 +15,8 @@ import system_master.SystemStatusInfo;
* 是否可以启动自动驾驶能力检测
* 目前监控了底盘的一些状态和查询节点状态应答的数据
* 没有使用监控事件报告的原因是因为,部分异常没进行正常恢复通知,例如收到了异常监控数据,但是异常恢复之后没有恢复的通知
*
* 此定时器不能停止 鹰眼中存在UI更新依赖循环查询系统状态
*/
public class AutopilotAbilityManager {
private static final String TAG = AutopilotAbilityManager.class.getSimpleName();

View File

@@ -73,15 +73,17 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
@Override
public void destroy() {
if ( mMogoMarkerOptions != null ) {
mMogoMarkerOptions.deleteObservers();
mMogoMarkerOptions = null;
}
if ( mMarker != null ) {
mMarker.remove();
mMarker.setMObject( null );
mMarker.setOnInfoWindowClickListener( null );
mMarker = null;
synchronized (this) {
if ( mMogoMarkerOptions != null ) {
mMogoMarkerOptions.deleteObservers();
mMogoMarkerOptions = null;
}
if ( mMarker != null ) {
mMarker.remove();
mMarker.setMObject( null );
mMarker.setOnInfoWindowClickListener( null );
mMarker = null;
}
}
mMogoInfoWindowAdapter = null;
mMogoMarkerClickListener = null;