From 7eebcdc48b081a81fe1c399e627cd9f5785b60b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=AE=8F=E5=AE=87?= Date: Mon, 13 Sep 2021 20:59:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=B5=8B=E8=AF=95=E5=B9=BF?= =?UTF-8?q?=E6=92=AD=E4=B8=AD=E5=AF=B9=E4=BB=96=E8=BD=A6=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../obu/mogo/receiver/ObuTestTriggerReceiver.kt | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/modules/mogo-module-obu-mogo/src/main/java/com/mogo/module/obu/mogo/receiver/ObuTestTriggerReceiver.kt b/modules/mogo-module-obu-mogo/src/main/java/com/mogo/module/obu/mogo/receiver/ObuTestTriggerReceiver.kt index a603ed5f22..2e2127ccba 100644 --- a/modules/mogo-module-obu-mogo/src/main/java/com/mogo/module/obu/mogo/receiver/ObuTestTriggerReceiver.kt +++ b/modules/mogo-module-obu-mogo/src/main/java/com/mogo/module/obu/mogo/receiver/ObuTestTriggerReceiver.kt @@ -12,6 +12,7 @@ import com.zhidao.support.obu.model.advance.MovingObjectInfo import com.zhidao.support.obu.model.advance.Position import com.zhidao.support.obu.model.advance.V2vThreat import com.zhidao.support.obu.model.advance.V2vThreatExt +import kotlin.random.Random /** * @author xiaoyuzhou @@ -62,9 +63,20 @@ class ObuTestTriggerReceiver : BroadcastReceiver() { cvxV2vThreatIndInfo.status = obuStatus cvxV2vThreatIndInfo.vehicle_id = "123321" + // 设置位置 - val position = Position(0, 399739429, 1164115207, 20) - val movingObjectInfo = MovingObjectInfo(0, position, 1800, 60) + val randomLocation = Random.nextInt(100, 2000) + + val position = Position( + 0, (399739429 + randomLocation).toLong(), + (1164115207 + randomLocation).toLong(), 20 + ) + val movingObjectInfo = MovingObjectInfo( + 0, + position, + 1800 +randomLocation, + 6000 +randomLocation + ) cvxV2vThreatIndInfo.basic_info = movingObjectInfo MogoPrivateObuManager.INSTANCE.getMogoObuListener()