Merge remote-tracking branch 'origin/dev_robotaxi-d-app-module_2130_221116_2.13.0' into test_robotaxi-d-app-module_2130_221116_2.13.0.1

This commit is contained in:
renwj
2022-12-15 05:51:54 +08:00
4 changed files with 49 additions and 17 deletions

View File

@@ -47,6 +47,8 @@ public class BusAnalyticsManager {
}
private void triggerStartAutopilotFailureEvent(String failCode, String failMsg){
if (mStartAutopilotParams.isEmpty()) return;
CallerLogger.INSTANCE.e( M_BUS + "triggerStartAutopilotFailureEvent", failMsg );
mStartAutopilotParams.put(BusConst.EVENT_PARAM_START_RESULT
, CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState() ==
@@ -54,6 +56,8 @@ public class BusAnalyticsManager {
mStartAutopilotParams.put(BusConst.EVENT_PARAM_START_FAILURE_CODE, failCode);
mStartAutopilotParams.put(BusConst.EVENT_PARAM_START_FAILURE_MSG, failMsg);
AnalyticsManager.INSTANCE.track(mStartAutopilotKey, mStartAutopilotParams);
clearStartAutopilotParams();//清空参数数据,防止误传
}
@SuppressLint("NewApi")
@@ -69,6 +73,10 @@ public class BusAnalyticsManager {
mStartAutopilotParams.put(BusConst.EVENT_PARAM_START_FAILURE_MSG, "");
}
private void clearStartAutopilotParams(){
mStartAutopilotParams.clear();
}
/**
* 触发'开启自动驾驶'埋点流程
* 开启自动驾驶15s内成功则发送成功埋点否则发送失败埋点
@@ -99,6 +107,8 @@ public class BusAnalyticsManager {
removeWaitingCallback();
mStartAutopilotParams.put(BusConst.EVENT_PARAM_START_RESULT, true);
AnalyticsManager.INSTANCE.track(mStartAutopilotKey, mStartAutopilotParams);
clearStartAutopilotParams();//清空参数数据,防止误传
} else {
UiThreadHandler.postDelayed(startAutopilotRunnable, BusConst.LOOP_PERIOD_15S);
}

View File

@@ -52,12 +52,20 @@ public class TaxiAnalyticsManager {
}
private void triggerStartAutopilotFailureEvent(String failCode, String failMsg){
if (mStartAutopilotParams.isEmpty()) return;
CallerLogger.INSTANCE.e(M_TAXI + "triggerStartAutopilotFailureEvent", failMsg);
mStartAutopilotParams.put(TaxiConst.EVENT_PARAM_START_RESULT, false);
mStartAutopilotParams.put(TaxiConst.EVENT_PARAM_START_FAILURE_CODE, failCode);
mStartAutopilotParams.put(TaxiConst.EVENT_PARAM_START_FAILURE_MSG,
failMsg);
AnalyticsManager.INSTANCE.track(mStartAutopilotKey, mStartAutopilotParams);
clearStartAutopilotParams();//清空参数数据,防止误传
}
private void clearStartAutopilotParams(){
mStartAutopilotParams.clear();
}
public void clearStartAutopilotFailureMSG(){
@@ -97,6 +105,8 @@ public class TaxiAnalyticsManager {
removeWaitingCallback();
mStartAutopilotParams.put(TaxiConst.EVENT_PARAM_START_RESULT, true);
AnalyticsManager.INSTANCE.track(mStartAutopilotKey, mStartAutopilotParams);
clearStartAutopilotParams();//清空参数数据,防止误传
} else {
UiThreadHandler.postDelayed(startAutopilotRunnable, TaxiConst.LOOP_PERIOD_15S);
}

View File

@@ -55,12 +55,14 @@ dependencies {
implementation rootProject.ext.dependencies.mogo_core_utils
implementation rootProject.ext.dependencies.mogo_core_function_api
implementation rootProject.ext.dependencies.mogoserviceapi
implementation rootProject.ext.dependencies.mogocommons
} else {
implementation project(':libraries:mogo-adas')
implementation project(':core:mogo-core-data')
implementation project(':core:mogo-core-utils')
implementation project(':core:mogo-core-function-api')
implementation project(':services:mogo-service-api')
implementation project(':foudations:mogo-commons')
}
}

View File

@@ -9,6 +9,7 @@ import androidx.lifecycle.Lifecycle.Event
import androidx.lifecycle.Lifecycle.Event.ON_DESTROY
import androidx.lifecycle.LifecycleEventObserver
import androidx.lifecycle.LifecycleOwner
import com.mogo.cloud.commons.utils.CoordinateUtils
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.map.*
import com.mogo.eagle.core.data.map.MapRoadInfo.StopLine
@@ -64,39 +65,48 @@ object CallerVisualAngleManager {
private val beginLocation = AtomicReference<MogoLocation>()
private val distanceOfCarToStopLine = AtomicReference<Double>()
private val listener = object : OnRoadListener {
private var roadId = ""
override fun onRoadIdInfo(roadId: String) {
val oldRoadId = this.roadId
Log.d("RWJ", "-- onRoadIdInfo --: prev: ${this.roadId} -> curr: $roadId")
if (oldRoadId != roadId) {
if (hasCrossRoad) {
Log.d(TAG, "-- onRoadIdInfo --: prev: ${this.roadId} -> curr: $roadId")
val startLoc = beginLocation.get()
val currLoc = CallerMapLocationListenerManager.getCurrentLocation()
var triggerClose = false
val distance = distanceOfCarToStopLine.get()
if (hasCrossRoad && distance > 0 && oldRoadId != roadId && startLoc != null && currLoc != null && CoordinateUtils.calculateLineDistance(startLoc.longitude, startLoc.latitude, currLoc.longitude, currLoc.latitude).also {
Log.d(TAG, "d1: $it, d2: $distance")
} >= distance) {
distanceOfCarToStopLine.set(0.0)
hasCrossRoad = false
Log.d(TAG, "-- onRoadIdInfo --: trigger close --")
triggerClose = true
}
if (!triggerClose && hasCrossRoad && oldRoadId == roadId) {
val beginLoc = beginLocation.get()
val endLoc = CallerMapLocationListenerManager.getCurrentLocation()
if (beginLoc != null && endLoc != null && abs(beginLoc.bearing - endLoc.bearing) >= 170) {
Log.d(TAG, "-- onRoadIdInfo --: trigger close 2 --")
triggerClose = true
hasCrossRoad = false
changeVisualAngle(CrossRoad(false))
}
} else {
if (hasCrossRoad) {
val beginLoc = beginLocation.get()
val endLoc = CallerMapLocationListenerManager.getCurrentLocation()
if (beginLoc != null && endLoc != null && abs(beginLoc.bearing - endLoc.bearing) >= 170) {
Log.d("RWJ", "-- onRoadIdInfo XX--: prev: ${this.roadId} -> curr: $roadId")
hasCrossRoad = false
changeVisualAngle(CrossRoad(false))
}
beginLocation.set(null)
}
}
if (triggerClose) {
changeVisualAngle(CrossRoad(false))
}
this.roadId = roadId
}
override fun onStopLineInfo(info: StopLine) {
Log.d("RWJ", "-- onStopLineInfo --: ${info.distanceOfCarToStopLine}")
Log.d(TAG, "-- onStopLineInfo --: ${info.distanceOfCarToStopLine}")
if (!hasCrossRoad && info.distanceOfCarToStopLine <= 30.0) {
hasCrossRoad = true
distanceOfCarToStopLine.set(info.distanceOfCarToStopLine)
beginLocation.set(CallerMapLocationListenerManager.getCurrentLocation())
changeVisualAngle(CrossRoad(true))
}