From 417586241aacdda6c8ceb7c04ba2952d0dcaeee8 Mon Sep 17 00:00:00 2001 From: zhongchao Date: Thu, 5 Jan 2023 19:42:19 +0800 Subject: [PATCH] [2.13.2] add mock data of ai identify --- .../business/ai/AiCloudIdentifyData.kt | 38 +++++++++ .../eagle/core/function/map/MapFragment.java | 3 + foudations/mogo-commons/build.gradle | 2 +- .../com/mogo/commons/module/MogoServices.java | 3 - .../src/main/proto/SocketDownDataProto3.proto | 78 ------------------- 5 files changed, 42 insertions(+), 82 deletions(-) create mode 100644 core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/ai/AiCloudIdentifyData.kt delete mode 100644 libraries/mogo-adas-data/src/main/proto/SocketDownDataProto3.proto diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/ai/AiCloudIdentifyData.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/ai/AiCloudIdentifyData.kt new file mode 100644 index 0000000000..fca6942f1e --- /dev/null +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/business/ai/AiCloudIdentifyData.kt @@ -0,0 +1,38 @@ +package com.mogo.eagle.core.function.business.ai + +import android.content.Context +import com.mogo.cloud.socket.entity.SocketDownData + +import com.mogo.commons.debug.DebugConfig +import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger +import com.mogo.realtime.api.MoGoAiCloudRealTime +import com.mogo.realtime.socket.IMogoCloudOnMsgListener + +class AiCloudIdentifyData{ + + companion object{ + private const val TAG = "AiCloudIdentifyData" + + @JvmStatic + val aiCloudIdentifyData by lazy(LazyThreadSafetyMode.SYNCHRONIZED){ + AiCloudIdentifyData() + } + } + + fun init(mContext:Context){ + //todo emArrow + MoGoAiCloudRealTime.startRealTime(mContext, DebugConfig.getSocketAppId()) + MoGoAiCloudRealTime.registerOnMsgListener(object :IMogoCloudOnMsgListener { + override fun onMsgSend(id: Long) { + } + + override fun onMsgReceived(mogoSnapshotSetData: SocketDownData.LauncherSnapshotProto?) { + mogoSnapshotSetData?.let { + CallerLogger.d(TAG,"mogoSnapshotSetData : $mogoSnapshotSetData") + } + } + + }) + } + +} \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapFragment.java b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapFragment.java index 4add2174dc..69bbf943ca 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapFragment.java +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/map/MapFragment.java @@ -9,12 +9,14 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.alibaba.android.arouter.facade.annotation.Route; +import com.mogo.commons.AbsMogoApplication; import com.mogo.commons.mvp.MvpFragment; import com.mogo.eagle.core.data.constants.MoGoFragmentPaths; import com.mogo.eagle.core.data.map.CenterLine; import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningListener; import com.mogo.eagle.core.function.api.map.hd.IMoGoMapFragmentProvider; import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener; +import com.mogo.eagle.core.function.business.ai.AiCloudIdentifyData; import com.mogo.eagle.core.function.business.identify.MapIdentifySubscriber; import com.mogo.eagle.core.function.business.MapPointCloudSubscriber; import com.mogo.eagle.core.function.business.routeoverlay.MogoRouteOverlayManager; @@ -191,6 +193,7 @@ public class MapFragment extends MvpFragment MapIdentifySubscriber.Companion.getInstance(); MogoRouteOverlayManager.getInstance().init(); MapPointCloudSubscriber.Companion.getInstance(); + AiCloudIdentifyData.Companion.getAiCloudIdentifyData().init(AbsMogoApplication.getApp()); } private void queryInfStructure() { diff --git a/foudations/mogo-commons/build.gradle b/foudations/mogo-commons/build.gradle index 296811e92f..c8fe582aea 100644 --- a/foudations/mogo-commons/build.gradle +++ b/foudations/mogo-commons/build.gradle @@ -41,7 +41,7 @@ dependencies { implementation rootProject.ext.dependencies.arouter annotationProcessor rootProject.ext.dependencies.aroutercompiler implementation rootProject.ext.dependencies.rxjava - implementation rootProject.ext.dependencies.mogoaicloudrealtime + api rootProject.ext.dependencies.mogoaicloudrealtime implementation rootProject.ext.dependencies.amapnavi3dmap if (Boolean.valueOf(USE_MAVEN_PACKAGE)) { diff --git a/foudations/mogo-commons/src/main/java/com/mogo/commons/module/MogoServices.java b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/MogoServices.java index 5926f0af9d..bfd828a29b 100644 --- a/foudations/mogo-commons/src/main/java/com/mogo/commons/module/MogoServices.java +++ b/foudations/mogo-commons/src/main/java/com/mogo/commons/module/MogoServices.java @@ -58,9 +58,6 @@ public class MogoServices implements IMogoIntentListener { intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES); mContext.sendBroadcast(intent); -// if (DebugConfig.isNeedUploadCoordinatesDurationInTime()) { -// MoGoAiCloudRealTime.startRealTime(mContext, DebugConfig.getSocketAppId()); -// } } private void registerMogoReceiver(Context context) { diff --git a/libraries/mogo-adas-data/src/main/proto/SocketDownDataProto3.proto b/libraries/mogo-adas-data/src/main/proto/SocketDownDataProto3.proto deleted file mode 100644 index b101f6234c..0000000000 --- a/libraries/mogo-adas-data/src/main/proto/SocketDownDataProto3.proto +++ /dev/null @@ -1,78 +0,0 @@ -syntax = "proto3"; -package mogo.yycp.service; -option java_package = "mogo.yycp.api.proto"; -option java_outer_classname = "SocketDownData"; -/* -message xxx { - // 字段规则:required -> 字段只能也必须出现 1 次 - // 字段规则:optional -> 字段可出现 0 次或1次 - // 字段规则:repeated -> 字段可出现任意多次(包括 0) - // 类型:int32、int64、sint32、sint64、string、32-bit .... - // 字段编号:0 ~ 536870911(除去 19000 到 19999 之间的数字) - 字段规则 类型 名称 = 字段编号; -} -*/ -//返回车机主实体 -message SocketDownDataProto { - uint64 seq = 1; - uint32 msgType = 2; - string sn = 3; - LauncherSnapshotProto data = 4; - uint64 utcTime = 5; - uint64 upUtcTime = 6; - string cityCode = 7; -} - -//LauncherSnapshot数据响应VO -message LauncherSnapshotProto { - //总数据集合 RoadDataVo - repeated CloudRoadDataProto allList = 1; - //前方50米数据集合 RoadDataVo - repeated CloudRoadDataProto nearList = 2; - //摄像头 RoadDataVo - CloudRoadDataProto camera = 3; - string msgId = 4; - uint64 time = 5; - //过期时间 - uint64 expire = 6; -} -//RoadDataVo -message CloudRoadDataProto { - /**物体类型 1-人 2-自行车 3-小轿车 4-摩托车 5-红绿灯 6-bus 8-truck 9-路边摄像头*/ - uint32 type = 1; - /**数据来源 1,"自车数据" 2,"ADAS数据" 3,"路测设备识别数据" */ - uint32 fromType = 2; - /** - * 车机上行pgs坐标给lat,lon两个成员变量 - * - * 在下发车机时计算高德经纬度 - * 1.将gps(lat,lon)给wgslat,wgalon - * 2.高德算法算出高德经纬度,给lat,lon - */ - double lat = 3; //gps->gd - double lon = 4; //gps->gd - double wgslat = 5; //原gps - double wgslon = 6; //原gps - //车机sn - string sn = 7; - //车辆UUID - string uuid = 8; - /** 车牌号 */ - string cardId = 9; - /**速度*/ - double speed = 10; - /**方向*/ - double heading = 11; - /** 系统时间 */ - uint64 systemTime = 12; - /** 星历时间 */ - uint64 satelliteTime = 13; - /**红绿灯状态 1红 2绿 3黄*/ - uint32 lightStatus = 14; - /**红绿灯剩余时间 读秒*/ - uint32 lightLeftTime = 15; - /**视频流直播地址*/ - string rtmpUrl = 16; - /**距离*/ - double distance = 17; -}