[6.5.0][道路事件] 优化测试用例

This commit is contained in:
renwj
2024-07-15 19:42:24 +08:00
parent 4522dc2ec4
commit 91bc56c338
3 changed files with 34 additions and 16 deletions

View File

@@ -249,7 +249,7 @@ class V2NTest {
CallerTelematicManager.sendMsgToAllClients(TelematicConstant.V2N_AI_ROAD_PEOPLE_CROSS, data.toByteArray())
CallerV2nNioEventListenerManager.invokeV2nNioCrossoverEvent(data)
delay(50)
newPoint = DrivingDirectionUtils.calculateNewPoint(newPoint.first, newPoint.second, targetHeading, 0.1)
newPoint = DrivingDirectionUtils.calculateNewPoint(newPoint.first, newPoint.second, targetHeading, 1.0)
}
delay(TimeUnit.MINUTES.toMillis(10))
}
@@ -289,7 +289,7 @@ class V2NTest {
Log.d(TAG, "2 -- > target_distance: $targetDistance, current distance: $distance")
var newPoint = DrivingDirectionUtils.calculateNewPoint(car.longitude, car.latitude, car.heading , eventDistance)
Log.d(TAG, "location:[x:${targetX}, y:${targetY}, new_location:[x:${newPoint.first}, y:${newPoint.second}]")
val eventId = "yyyyyyyyyyyyy"
val eventId = System.currentTimeMillis().toString()
CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(AutopilotControlParameters().also {
it.autoPilotLine = AutoPilotLine(10L, "", "","", "", System.currentTimeMillis(), "")
})

View File

@@ -497,19 +497,19 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
}
private fun computeCrossCountBetween(start: Triple<Double, Double, Double>, end: kotlin.Pair<Double, Double>): Int {
val points = V2NUtils.generateIntermediatePoints(kotlin.Pair(start.first, start.second), end, 50.0 * 1e-7)
V2XBizTrace.onAck(points, "computeCrossCountBetween", true)
var crossId = MapDataWrapper.getCrossRoad(start.first, start.second, start.third)?.cross_id
val angle = start.third
var count = 1
for (p in points) {
val crossRoad = MapDataWrapper.getCrossRoad(p.first, p.second, angle)
if (crossRoad != null && !TextUtils.isEmpty(crossRoad.cross_id) && !TextUtils.equals(crossId, crossRoad.cross_id)) {
count++
crossId = crossRoad.cross_id
}
}
return count
// val points = V2NUtils.generateIntermediatePoints(kotlin.Pair(start.first, start.second), end, 50.0 * 1e-7)
// V2XBizTrace.onAck(points, "computeCrossCountBetween", true)
// var crossId = MapDataWrapper.getCrossRoad(start.first, start.second, start.third)?.cross_id
// val angle = start.third
// var count = 0
// for (p in points) {
// val crossRoad = MapDataWrapper.getCrossRoad(p.first, p.second, angle)
// if (crossRoad != null && !TextUtils.isEmpty(crossRoad.cross_id) && !TextUtils.equals(crossId, crossRoad.cross_id)) {
// count++
// crossId = crossRoad.cross_id
// }
// }
return 1
}
private fun getAlertContent(poiType: String, distance: Double): String {

View File

@@ -6,6 +6,8 @@ import androidx.lifecycle.lifecycleScope
import com.google.protobuf.TextFormat
import com.mogo.commons.storage.SharedPrefsMgr
import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters.AutoPilotLine
import com.mogo.eagle.core.data.biz.trafficlight.TrafficLightResult
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.config.HmiBuildConfig
@@ -16,6 +18,7 @@ import com.mogo.eagle.core.data.v2x.V2XEvent.RoadEventX
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.setDemoMode
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.setIgnoreConditionDraw
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerV2nNioEventListenerManager
import com.mogo.eagle.core.function.call.cloud.CallerCloudListenerManager
@@ -66,7 +69,7 @@ class TeleMsgHandler : IMsgHandler {
private var listener: EventListener? = null
override fun handleMsgFromServer(msg: MogoProtocolMsg?, channel: Channel?) {
msg?.let {
msg?.let { it ->
if (it.protocolType == TelematicConstant.V2N_AI_ROAD_DATA_TO_PASSENGER) {
try {
Log.d(TAG, "乘客屏收到司机屏转发云端下发的V2N事件 --- 1 ---")
@@ -84,6 +87,9 @@ class TeleMsgHandler : IMsgHandler {
if (it.protocolType == TelematicConstant.V2N_AI_ROAD_PEOPLE_CROSS) {
runCatching {
CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(AutopilotControlParameters().also { itx ->
itx.autoPilotLine = AutoPilotLine(10L, "", "","", "", System.currentTimeMillis(), "")
})
Log.d(TAG, "乘客屏收到司机屏转发云端下发的行人/非机动车横穿事件 --- 1 ---")
CallerV2nNioEventListenerManager.invokeV2nNioCrossoverEvent(MessagePad.Event.parseFrom(msg.body))
Log.d(TAG, "乘客屏收到司机屏转发云端下发的行人/非机动车横穿事件 --- 2 ---")
@@ -93,6 +99,9 @@ class TeleMsgHandler : IMsgHandler {
if (it.protocolType == TelematicConstant.V2N_AI_ROAD_GREEN_WAVE) {
runCatching {
Log.d(TAG, "乘客屏收到司机屏转发云端下发的绿波通行 --- 1 ---")
CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(AutopilotControlParameters().also { itx ->
itx.autoPilotLine = AutoPilotLine(10L, "", "","", "", System.currentTimeMillis(), "")
})
CallerV2nNioEventListenerManager.invokeV2nNioGreenWavePassageEvent(MessagePad.V2nCrossSpeed.parseFrom(msg.body))
Log.d(TAG, "乘客屏收到司机屏转发云端下发的绿波通行 --- 2 ---")
}
@@ -101,6 +110,9 @@ class TeleMsgHandler : IMsgHandler {
if (it.protocolType == TelematicConstant.V2N_AI_ROAD_OTHER_RETROGRADE_VEHICLE) {
runCatching {
Log.d(TAG, "乘客屏收到司机屏转发云端下发的他车逆行 --- 1 ---")
CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(AutopilotControlParameters().also { itx ->
itx.autoPilotLine = AutoPilotLine(10L, "", "","", "", System.currentTimeMillis(), "")
})
CallerV2nNioEventListenerManager.invokeV2nNioOtherRetrogradeEvent(MessagePad.Event.parseFrom(msg.body))
Log.d(TAG, "乘客屏收到司机屏转发云端下发的他车逆行 --- 2 ---")
}
@@ -108,6 +120,9 @@ class TeleMsgHandler : IMsgHandler {
}
if (it.protocolType == TelematicConstant.V2N_AI_ROAD_SHI_GONG) {
runCatching {
CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(AutopilotControlParameters().also { itx ->
itx.autoPilotLine = AutoPilotLine(10L, "", "","", "", System.currentTimeMillis(), "")
})
Log.d(TAG, "乘客屏收到司机屏转发云端下发的道路施工 --- 1 ---")
CallerAutopilotIdentifyListenerManager.invokeAutopilotIdentifyDataUpdate(Collections.singletonList(TrackedObject.parseFrom(msg.body)))
Log.d(TAG, "乘客屏收到司机屏转发云端下发的道路施工 --- 2 ---")
@@ -116,6 +131,9 @@ class TeleMsgHandler : IMsgHandler {
}
if (it.protocolType == TelematicConstant.V2N_AI_ROAD_SHI_GU) {
runCatching {
CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(AutopilotControlParameters().also { itx ->
itx.autoPilotLine = AutoPilotLine(10L, "", "","", "", System.currentTimeMillis(), "")
})
Log.d(TAG, "乘客屏收到司机屏转发云端下发的道路事故 --- 1 ---")
CallerAutopilotIdentifyListenerManager.invokeAutopilotIdentifyDataUpdate(Collections.singletonList(TrackedObject.parseFrom(msg.body)))
Log.d(TAG, "乘客屏收到司机屏转发云端下发的道路事故 --- 2 ---")