Merge branch 'dev_robotaxi-d-app-module_251_220125_2.5.1' into dev_MogoAP_eagle-220_211207_8.0.17_merge
# Conflicts: # core/function-impl/mogo-core-function-map/build.gradle
This commit is contained in:
@@ -206,48 +206,48 @@ class ReminderTest {
|
||||
|
||||
@Test
|
||||
fun testWarningFloatForProject() = runBlocking {
|
||||
launch.onActivity {
|
||||
it.lifecycleScope.launchWhenResumed {
|
||||
for (i in 1..10) {
|
||||
val notificationView = V2XNotificationView(it)
|
||||
notificationView.setWarningIcon(EventTypeEnum.getWarningIcon("10003"))
|
||||
notificationView.setWarningContent("XXXXXX${i}")
|
||||
WarningFloat.with(it)
|
||||
.setTag("tag")
|
||||
.setLayout(notificationView)
|
||||
.setSidePattern(SidePattern.RESULT_TOP)
|
||||
.setCountDownTime(5000)
|
||||
.setGravity(Gravity.CENTER_HORIZONTAL, offsetY = 110)
|
||||
.setImmersionStatusBar(true)
|
||||
.addWarningStatusListener(object : IMoGoWarningStatusListener {
|
||||
override fun onShow() {
|
||||
}
|
||||
})
|
||||
.setAnimator(object : DefaultAnimator() {
|
||||
override fun enterAnim(
|
||||
view: View,
|
||||
params: WindowManager.LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.enterAnim(view, params, windowManager, sidePattern)?.apply {
|
||||
interpolator = OvershootInterpolator()
|
||||
}
|
||||
|
||||
override fun exitAnim(
|
||||
view: View,
|
||||
params: WindowManager.LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.exitAnim(view, params, windowManager, sidePattern)?.setDuration(200)
|
||||
})
|
||||
.show()
|
||||
delay(2000)
|
||||
}
|
||||
}
|
||||
}
|
||||
delay(TimeUnit.SECONDS.toMillis(100))
|
||||
// launch.onActivity {
|
||||
// it.lifecycleScope.launchWhenResumed {
|
||||
// for (i in 1..10) {
|
||||
// val notificationView = V2XNotificationView(it)
|
||||
// notificationView.setWarningIcon(EventTypeEnum.getWarningIcon("10003"))
|
||||
// notificationView.setWarningContent("XXXXXX${i}")
|
||||
// WarningFloat.with(it)
|
||||
// .setTag("tag")
|
||||
// .setLayout(notificationView)
|
||||
// .setSidePattern(SidePattern.RESULT_TOP)
|
||||
// .setCountDownTime(5000)
|
||||
// .setGravity(Gravity.CENTER_HORIZONTAL, offsetY = 110)
|
||||
// .setImmersionStatusBar(true)
|
||||
// .addWarningStatusListener(object : IMoGoWarningStatusListener {
|
||||
// override fun onShow() {
|
||||
// }
|
||||
// })
|
||||
// .setAnimator(object : DefaultAnimator() {
|
||||
// override fun enterAnim(
|
||||
// view: View,
|
||||
// params: WindowManager.LayoutParams,
|
||||
// windowManager: WindowManager,
|
||||
// sidePattern: SidePattern
|
||||
// ): Animator? =
|
||||
// super.enterAnim(view, params, windowManager, sidePattern)?.apply {
|
||||
// interpolator = OvershootInterpolator()
|
||||
// }
|
||||
//
|
||||
// override fun exitAnim(
|
||||
// view: View,
|
||||
// params: WindowManager.LayoutParams,
|
||||
// windowManager: WindowManager,
|
||||
// sidePattern: SidePattern
|
||||
// ): Animator? =
|
||||
// super.exitAnim(view, params, windowManager, sidePattern)?.setDuration(200)
|
||||
// })
|
||||
// .show()
|
||||
// delay(2000)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// delay(TimeUnit.SECONDS.toMillis(100))
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.mogo.functions.test
|
||||
|
||||
import android.os.Debug
|
||||
import android.util.Log
|
||||
import androidx.test.core.app.ActivityScenario
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
import androidx.test.filters.LargeTest
|
||||
import com.mogo.eagle.core.function.main.MainLauncherActivity
|
||||
import io.reactivex.Flowable
|
||||
import io.reactivex.plugins.RxJavaPlugins
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
import java.util.concurrent.TimeUnit
|
||||
import java.util.concurrent.TimeUnit.MILLISECONDS
|
||||
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
@LargeTest
|
||||
class RxJavaBackPressureTest {
|
||||
|
||||
lateinit var launch: ActivityScenario<MainLauncherActivity>
|
||||
|
||||
@Before
|
||||
fun before() {
|
||||
launch = ActivityScenario.launch(MainLauncherActivity::class.java)
|
||||
RxJavaPlugins.setErrorHandler {
|
||||
Log.e("RxJava2", it.message, it)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testIntervalBackPressure() = runBlocking(Dispatchers.Default) {
|
||||
val subscription = Flowable.interval(50, MILLISECONDS).doOnNext {
|
||||
Log.d("RxJava2", "-- do action --")
|
||||
}.subscribeOn(Schedulers.computation()).observeOn(Schedulers.io()).subscribe {
|
||||
Thread.sleep(2000)
|
||||
}
|
||||
repeat(10) {
|
||||
delay(TimeUnit.SECONDS.toMillis(5))
|
||||
try {
|
||||
Debug.dumpHprofData(Date().toFileName())
|
||||
} catch (t: Throwable) {
|
||||
t.printStackTrace()
|
||||
}
|
||||
}
|
||||
delay(TimeUnit.HOURS.toMillis(1))
|
||||
subscription.dispose()
|
||||
}
|
||||
|
||||
private fun Date.toFileName(): String = SimpleDateFormat("yyyyMMdd_HH_mm_ss", Locale.getDefault()).format(this) + ".hprof"
|
||||
}
|
||||
@@ -99,8 +99,8 @@ ext {
|
||||
videoprocessor : "com.zhidao.video:video-processor:1.0.2.1",
|
||||
livesdk : "com.tencent.liteavsdk:LiteAVSDK_Smart:7.4.9211",
|
||||
|
||||
coroutinescore : "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.3",
|
||||
coroutinesandroid : "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.3",
|
||||
coroutinescore : "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2",
|
||||
coroutinesandroid : "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.2",
|
||||
|
||||
aspectj : "org.aspectj:aspectjrt:1.8.9",
|
||||
|
||||
@@ -147,6 +147,7 @@ ext {
|
||||
mogomap : "com.mogo.map:mogo-map:${MOGO_MAP_VERSION}",
|
||||
mogomapapi : "com.mogo.map:mogo-map-api:${MOGO_MAP_API_VERSION}",
|
||||
mogocustommap : "com.zhidaoauto.machine:map:${MAP_SDK_VERSION}",
|
||||
mogocustommapoperational : "com.zhidaoauto.map:operational:${MAP_SDK_OPERATION_VERSION}",
|
||||
|
||||
modulecommon : "com.mogo.module:module-common:${MOGO_MODULE_COMMON_VERSION}",
|
||||
modulemain : "com.mogo.module:module-main:${MOGO_MODULE_MAIN_VERSION}",
|
||||
|
||||
@@ -10,10 +10,12 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.constants.MoGoConfig
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotProvider
|
||||
import com.mogo.eagle.core.function.api.map.collect.IMoGoMapDataCollectProvider
|
||||
import com.mogo.eagle.core.function.autopilot.adapter.MoGoAdasListenerImpl
|
||||
import com.mogo.eagle.core.function.autopilot.adapter.MoGoAdasMsgConnectStatusListenerImpl
|
||||
import com.mogo.eagle.core.function.autopilot.adapter.MoGoHandAdasMsgManager
|
||||
import com.mogo.eagle.core.function.autopilot.server.AsyncDataToAutopilotServer
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapDataCollectorManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
@@ -41,7 +43,7 @@ import java.util.*
|
||||
*/
|
||||
@Route(path = MogoServicePaths.PATH_AUTO_PILOT)
|
||||
class MoGoAutopilotProvider :
|
||||
IMoGoAutopilotProvider {
|
||||
IMoGoAutopilotProvider, IMoGoMapDataCollectProvider.OnMapCollectCmdListener {
|
||||
private val TAG = "MoGoAutoPilotProvider"
|
||||
private var mContext: Context? = null
|
||||
|
||||
@@ -53,8 +55,8 @@ class MoGoAutopilotProvider :
|
||||
Logger.d(TAG, "初始化工控机连接……")
|
||||
mContext = context
|
||||
// 初始化ADAS 域控制器
|
||||
//CupidLogUtils.setEnableLog(false)
|
||||
//CupidLogUtils.setIsWriteLog(false)
|
||||
CupidLogUtils.setEnableLog(false)
|
||||
CupidLogUtils.setIsWriteLog(false)
|
||||
// TODO 临时方案,根据不同的身份标识,连接不同的工控机IP
|
||||
when (FunctionBuildConfig.appIdentityMode) {
|
||||
0 -> // 司机
|
||||
@@ -158,6 +160,7 @@ class MoGoAutopilotProvider :
|
||||
}
|
||||
// 同步数据给工控机的服务
|
||||
AsyncDataToAutopilotServer.INSTANCE.initServer()
|
||||
CallerMapDataCollectorManager.registerOnMapCollectTaskListener(this)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -187,6 +190,16 @@ class MoGoAutopilotProvider :
|
||||
}, 1000, TimeUnit.MILLISECONDS)
|
||||
}
|
||||
|
||||
override fun onMapCollectStart(cmdId: Int, cmdTime: Long) {
|
||||
val result = recordPackage(2, cmdId)
|
||||
Logger.d(TAG, "开始记录包: [$cmdId, $result]")
|
||||
}
|
||||
|
||||
override fun onMapCollectEnd(cmdId: Int, cmdTime: Long) {
|
||||
val result = stopRecord(2, cmdId)
|
||||
Logger.d(TAG, "结束记录包: [$cmdId, $result]")
|
||||
}
|
||||
|
||||
override fun startAutoPilot(result: AutopilotControlParameters) {
|
||||
if (AdasManager.getInstance().isSocketConnect) {
|
||||
val parameter = AutopilotControlCmdParameter("aiCloudToStartAutopilot", result)
|
||||
@@ -213,6 +226,18 @@ class MoGoAutopilotProvider :
|
||||
.recordPackage(1, (System.currentTimeMillis() / 1000).toInt())
|
||||
}
|
||||
|
||||
override fun recordPackage(type: Int, id: Int): Boolean {
|
||||
return AdasManager.getInstance().recordPackage(type, id)
|
||||
}
|
||||
|
||||
override fun recordPackage(type: Int, id: Int, duration: Int): Boolean {
|
||||
return AdasManager.getInstance().recordPackage(type, id, duration)
|
||||
}
|
||||
|
||||
override fun stopRecord(type: Int, id: Int): Boolean {
|
||||
return AdasManager.getInstance().stopRecord(type, id)
|
||||
}
|
||||
|
||||
override fun setEnableLog(isEnableLog: Boolean) {
|
||||
CupidLogUtils.setEnableLog(isEnableLog)
|
||||
}
|
||||
@@ -222,7 +247,7 @@ class MoGoAutopilotProvider :
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
|
||||
CallerMapDataCollectorManager.unRegisterOnMapCollectTaskListener(this)
|
||||
}
|
||||
|
||||
override fun setAutoPilotSpeed(speed: Int): Boolean {
|
||||
|
||||
@@ -329,6 +329,9 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
|
||||
// 推送模块
|
||||
MogoModulePaths.addModule(new MogoModule(PushUIConstants.PATH, "PUSH_UI"));
|
||||
|
||||
// 地图数据收集模块
|
||||
MogoModulePaths.addModuleFunctionServer(new MogoModule(MogoServicePaths.PATH_MAP_DATA_COLLECT_PROVIDER, "MoGoMapDataCollector"));
|
||||
|
||||
if (!DebugConfig.isLauncher()) {
|
||||
PersistentManager
|
||||
.getInstance().initManager(this);
|
||||
|
||||
@@ -50,8 +50,8 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.rxandroid
|
||||
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
// implementation rootProject.ext.dependencies.adasHigh
|
||||
|
||||
//implementation rootProject.ext.dependencies.adasHigh
|
||||
implementation rootProject.ext.dependencies.mogocustommapoperational
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
implementation rootProject.ext.dependencies.mogoserviceapi
|
||||
implementation rootProject.ext.dependencies.modulecommon
|
||||
|
||||
@@ -0,0 +1,175 @@
|
||||
package com.mogo.eagle.core.function.impl.collect
|
||||
|
||||
import android.content.Context
|
||||
import android.text.TextUtils
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.cloud.passport.IMoGoTokenCallback
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClient
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.map.collect.IMoGoMapDataCollectProvider
|
||||
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.zhidaoauto.map.operational.MapCollectionTaskRecive
|
||||
import com.zhidaoauto.map.operational.abs.OnTaskListener
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
import java.util.concurrent.CopyOnWriteArrayList
|
||||
import java.util.concurrent.atomic.AtomicReference
|
||||
|
||||
@Route(path = MogoServicePaths.PATH_MAP_DATA_COLLECT_PROVIDER)
|
||||
class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener, IMoGoMapLocationListener, IMoGoTokenCallback {
|
||||
|
||||
companion object {
|
||||
const val TAG = "MoGoMapDataCollect"
|
||||
}
|
||||
|
||||
private val executor by lazy {
|
||||
AtomicReference<MapCollectionTaskRecive?>(null)
|
||||
}
|
||||
|
||||
private val listeners by lazy {
|
||||
CopyOnWriteArrayList<IMoGoMapDataCollectProvider.OnMapCollectCmdListener>()
|
||||
}
|
||||
|
||||
private val map: MutableMap<Int, Status> by lazy {
|
||||
ConcurrentHashMap()
|
||||
}
|
||||
|
||||
override val functionName: String = TAG
|
||||
|
||||
override fun init(context: Context?) {
|
||||
CallerMapLocationListenerManager.addListener(functionName, this)
|
||||
executor.set(context?.let { MapCollectionTaskRecive(it) })
|
||||
executor.get()?.setOnTaskListener(this)
|
||||
val carSn = MoGoAiCloudClientConfig.getInstance().sn
|
||||
if (!TextUtils.isEmpty(carSn)) {
|
||||
executor.get()?.setCarSn(carSn)
|
||||
}
|
||||
MoGoAiCloudClient.getInstance().addTokenCallbacks(this)
|
||||
Logger.d(TAG, "--------- init --------")
|
||||
Logger.d(TAG, "executor: ${ executor.get()?.hashCode() ?: 0 }")
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
CallerMapLocationListenerManager.removeListener(TAG)
|
||||
Logger.d(TAG, "--------- onDestroy --------")
|
||||
executor.get()?.let {
|
||||
it.setOnTaskListener(null)
|
||||
it.destory()
|
||||
}
|
||||
listeners.clear()
|
||||
map.clear()
|
||||
}
|
||||
|
||||
override fun registerOnMapCollectTaskListener(listener: IMoGoMapDataCollectProvider.OnMapCollectCmdListener?) {
|
||||
Logger.d(TAG, "--------- registerOnMapCollectTaskListener --------")
|
||||
listener ?: return
|
||||
if (listeners.contains(listener)) {
|
||||
return
|
||||
}
|
||||
listeners += listener
|
||||
}
|
||||
|
||||
override fun unRegisterOnMapCollectTaskListener(listener: IMoGoMapDataCollectProvider.OnMapCollectCmdListener?) {
|
||||
Logger.d(TAG, "--------- unRegisterOnMapCollectTaskListener --------")
|
||||
listener ?: return
|
||||
if (!listeners.contains(listener)) {
|
||||
return
|
||||
}
|
||||
listeners.remove(listener)
|
||||
}
|
||||
|
||||
override fun finish(
|
||||
id: Int,
|
||||
state: Int,
|
||||
gpsPath: String,
|
||||
videoPath: String,
|
||||
reason: String
|
||||
) {
|
||||
Logger.d(TAG, "-- finish:[$id, $state, $gpsPath, $videoPath, $reason]")
|
||||
try {
|
||||
if (isInValidStatus()) {
|
||||
Logger.w(TAG, "-- finish: 状态无效")
|
||||
return
|
||||
}
|
||||
if (!map.containsKey(id)) {
|
||||
Logger.w(TAG, "-- finish: 无相关指令")
|
||||
return
|
||||
}
|
||||
Logger.d(TAG, "-- finish: 结束任务[$id]")
|
||||
executor.get()?.finishTask(id, state, gpsPath, videoPath, reason)
|
||||
} catch (e : Throwable) {
|
||||
e.printStackTrace()
|
||||
Logger.e(TAG, "-- finish:\n$e");
|
||||
} finally {
|
||||
map[id] = Status.FINISH
|
||||
}
|
||||
}
|
||||
|
||||
override fun onTaskFinish(id: Int, time: Long) {
|
||||
Logger.d(TAG, "地图模块下发结束采集指令 -> [$id, $time]")
|
||||
if (!map.containsKey(id) || map[id] == Status.FINISH) {
|
||||
Logger.w(TAG, "地图模块下发结束采集指令 -> 任务[$id]已经提前完成,无需再次请求自动驾驶模块结束采集")
|
||||
return
|
||||
}
|
||||
Logger.d(TAG, "地图模块下发结束采集指令 -> [$id, $time] -> 调用自动驾驶模块,结束数据采集")
|
||||
listeners.forEach {
|
||||
it.onMapCollectEnd(id, time)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onTaskStart(id: Int, time: Long) {
|
||||
Logger.d(TAG, "地图模块下发开始采集指令 -> [$id, $time]")
|
||||
map[id] = Status.INIT
|
||||
listeners.forEach {
|
||||
it.onMapCollectStart(id, time)
|
||||
}
|
||||
map[id] = Status.START
|
||||
}
|
||||
|
||||
|
||||
override fun onLocationChanged(location: MogoLocation?) {
|
||||
location ?: return
|
||||
executor.get()?.onMapChange(
|
||||
location.longitude,
|
||||
location.latitude,
|
||||
location.bearing,
|
||||
location.speed,
|
||||
location.provider == "GPS_SELF")
|
||||
}
|
||||
|
||||
|
||||
private fun isInValidStatus(): Boolean {
|
||||
if (map.isEmpty()) {
|
||||
return true
|
||||
}
|
||||
val iterator = map.iterator()
|
||||
while (iterator.hasNext()) {
|
||||
val next = iterator.next()
|
||||
if (next.value == Status.FINISH) {
|
||||
iterator.remove()
|
||||
}
|
||||
}
|
||||
if (map.filter { it.value == Status.START }.isEmpty()) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
override fun onTokenGot(token: String?, sn: String?) {
|
||||
Logger.d(TAG, "-- onTokenGot --> $sn")
|
||||
sn?.let {
|
||||
executor.get()?.setCarSn(it)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onError(code: Int, msg: String?) = Unit
|
||||
|
||||
private sealed class Status {
|
||||
object INIT : Status() //初始状态
|
||||
object START : Status() //开始状态
|
||||
object FINISH : Status() //完成状态
|
||||
}
|
||||
}
|
||||
@@ -57,5 +57,5 @@ object FunctionBuildConfig {
|
||||
* false - 不忽略
|
||||
*/
|
||||
@JvmField
|
||||
var isIgnoreConditionsDrawAutopilotTrajectoryData = true
|
||||
var isIgnoreConditionsDrawAutopilotTrajectoryData = false
|
||||
}
|
||||
@@ -268,4 +268,10 @@ public class MogoServicePaths {
|
||||
@Keep
|
||||
@Deprecated
|
||||
public static final String PATH_DEVA_TOOLS = "/deva/tools";
|
||||
|
||||
/**
|
||||
* 地图数据更新输助类
|
||||
*/
|
||||
@Keep
|
||||
public static final String PATH_MAP_DATA_COLLECT_PROVIDER = "/map_x/collect";
|
||||
}
|
||||
|
||||
@@ -41,6 +41,33 @@ interface IMoGoAutopilotProvider : IMoGoFunctionServerProvider {
|
||||
*/
|
||||
fun recordPackage(): Boolean
|
||||
|
||||
/**
|
||||
* 开启域控制器录制bag包
|
||||
*
|
||||
* @return true-成功,false-失败
|
||||
* @param type 录制类型 1: badcase 2:map 3:rests
|
||||
* @param id 指令/任务 ID
|
||||
*/
|
||||
fun recordPackage(type: Int, id: Int): Boolean
|
||||
|
||||
/**
|
||||
* 开启域控制器录制bag包
|
||||
*
|
||||
* @return true-成功,false-失败
|
||||
* @param type 录制类型 1: badcase 2:map 3:rests
|
||||
* @param id 指令/任务 ID
|
||||
* @param duration 录制时长
|
||||
*/
|
||||
fun recordPackage(type: Int, id: Int, duration: Int): Boolean
|
||||
|
||||
/**
|
||||
* 结束录制
|
||||
* @param type 录制类型 1: badcase 2:map 3:rests
|
||||
* @param id 指令/任务 ID
|
||||
* @return true: 成功; false 失败
|
||||
*/
|
||||
fun stopRecord(type: Int, id: Int): Boolean
|
||||
|
||||
/**
|
||||
* Log 是否显示
|
||||
*
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.mogo.eagle.core.function.api.map.collect
|
||||
|
||||
import com.mogo.eagle.core.function.api.base.IMoGoFunctionServerProvider
|
||||
|
||||
/**
|
||||
* @author renwj
|
||||
* @date 2021/11/10 10:00 上午
|
||||
* 此类主要用来同步自动驾驶定位信息给各业务方
|
||||
*/
|
||||
interface IMoGoMapDataCollectProvider: IMoGoFunctionServerProvider {
|
||||
|
||||
/**
|
||||
* 注册地图组下发收集数据任务指令监听,通知自动驾驶模块开始数据采集
|
||||
*/
|
||||
fun registerOnMapCollectTaskListener(listener: OnMapCollectCmdListener?)
|
||||
|
||||
/**
|
||||
* 移除任务指令监听
|
||||
*/
|
||||
fun unRegisterOnMapCollectTaskListener(listener: OnMapCollectCmdListener?)
|
||||
|
||||
/**
|
||||
* 此接口是自动驾驶模块使用,用于把自动驾驶模块收集的数据给地图组
|
||||
*/
|
||||
fun finish(id: Int, state: Int, gpsPath: String, videoPath: String, reason: String)
|
||||
|
||||
interface OnMapCollectCmdListener {
|
||||
|
||||
/**
|
||||
* 地图组下发地图数据收集开始指令
|
||||
* @param cmdId 指令ID
|
||||
* @param cmdTime 指令下发时间
|
||||
*/
|
||||
fun onMapCollectStart(cmdId: Int, cmdTime: Long)
|
||||
|
||||
/**
|
||||
* 地图组下发地图数据收集结束指令
|
||||
* @param cmdId 指令ID
|
||||
* @param cmdTime 指令下发时间
|
||||
*/
|
||||
fun onMapCollectEnd(cmdId: Int, cmdTime: Long)
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.mogo.eagle.core.function.call.autopilot
|
||||
|
||||
import android.os.SystemClock
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotProvider
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import com.mogo.eagle.core.utilcode.util.LogUtils
|
||||
import kotlin.random.Random
|
||||
|
||||
/**
|
||||
*@author xiaoyuzhou
|
||||
@@ -60,7 +63,15 @@ object CallerAutoPilotManager {
|
||||
* 开启域控制器录制bag包
|
||||
*/
|
||||
fun recordPackage() {
|
||||
providerApi?.recordPackage()
|
||||
providerApi?.recordPackage(1, Random(SystemClock.elapsedRealtime()).nextInt())
|
||||
}
|
||||
|
||||
fun recordPackage(type: Int, id: Int) {
|
||||
providerApi?.recordPackage(type, id)
|
||||
}
|
||||
|
||||
fun recordPackage(type: Int, id: Int, duration: Int) {
|
||||
providerApi?.recordPackage(type, id, duration)
|
||||
}
|
||||
|
||||
fun setEnableLog(isEnableLog: Boolean) {
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.mogo.eagle.core.function.call.map
|
||||
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths.PATH_MAP_DATA_COLLECT_PROVIDER
|
||||
import com.mogo.eagle.core.function.api.map.collect.IMoGoMapDataCollectProvider
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
|
||||
/**
|
||||
* @author renwj
|
||||
* @date 2021/11/10 10:30 上午
|
||||
* 此类主要提供给各业务方使用,便于业务层管理数据收集
|
||||
*/
|
||||
object CallerMapDataCollectorManager {
|
||||
|
||||
private val provider: IMoGoMapDataCollectProvider? by lazy {
|
||||
CallerBase.getApiInstance(IMoGoMapDataCollectProvider::class.java, PATH_MAP_DATA_COLLECT_PROVIDER)
|
||||
}
|
||||
|
||||
fun registerOnMapCollectTaskListener(listener: IMoGoMapDataCollectProvider.OnMapCollectCmdListener?) {
|
||||
provider?.registerOnMapCollectTaskListener(listener)
|
||||
}
|
||||
|
||||
fun unRegisterOnMapCollectTaskListener(listener: IMoGoMapDataCollectProvider.OnMapCollectCmdListener?) {
|
||||
provider?.unRegisterOnMapCollectTaskListener(listener)
|
||||
}
|
||||
|
||||
fun finish(id: Int, state: Int, gpsPath: String, videoPath: String, reason: String) {
|
||||
provider?.finish(id, state, gpsPath, videoPath, reason)
|
||||
}
|
||||
}
|
||||
@@ -82,7 +82,8 @@ MOGO_LOCATION_VERSION=1.3.19-beta
|
||||
MOGO_TELEMATIC_VERSION=1.3.19-beta
|
||||
######## MogoAiCloudSDK Version ########
|
||||
# 自研地图
|
||||
MAP_SDK_VERSION=2.0.0.24
|
||||
MAP_SDK_VERSION=2.0.1
|
||||
MAP_SDK_OPERATION_VERSION=1.0.11
|
||||
# websocket
|
||||
WEBSOCKET_VERSION=1.1.7
|
||||
## 产品库必备配置,产品库自动对versionCode和versionName版本进行升级
|
||||
|
||||
@@ -130,6 +130,10 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
if (options != null) {
|
||||
//设置手势是否可以缩放 isCanZoom true 可缩放 false 不可缩放
|
||||
options.setZoomGesturesEnabled(true);
|
||||
options.setScaleVRMode(true);
|
||||
if (options.getMyLocationStyle() != null) {
|
||||
options.getMyLocationStyle().setDisplayAnimEnable(false);
|
||||
}
|
||||
// 设置自车的图片对象
|
||||
//options.setMyLocationStyle(options.getMyLocationStyle().myLocationIcon(DEFAULT_OPTION.getCarCursorRes()));
|
||||
}
|
||||
@@ -335,24 +339,6 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
moveToCenter(latLng, true);
|
||||
}
|
||||
|
||||
private void setUIMode(EnumMapUI ui) {
|
||||
this.mCurrentCarUIMode = ui;
|
||||
if (mMapView.getMapAutoViewHelper() != null) {
|
||||
switch (ui) {
|
||||
case CarUp_2D:
|
||||
case CarUp_3D:
|
||||
mMapView.getMapAutoViewHelper().setMapViewPerspective(MapAutoApi.MAP_PERSPECTIVE_UP_CAR);
|
||||
break;
|
||||
case NorthUP_2D:
|
||||
if (mCurrentUI == EnumMapUI.Type_VR) {
|
||||
return;
|
||||
}
|
||||
mMapView.getMapAutoViewHelper().setMapViewPerspective(MapAutoApi.MAP_PERSPECTIVE_UP_NORTH);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean checkAMapView() {
|
||||
if (mMapView == null || mMapView.getMapAutoViewHelper() == null) {
|
||||
Logger.e(TAG, "自研mapView实例为空,请检查");
|
||||
|
||||
@@ -15,7 +15,6 @@ import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.commons.debug.DebugConfig;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotCarStateInfo;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData;
|
||||
@@ -28,8 +27,6 @@ import com.mogo.eagle.core.utilcode.util.ThreadUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils;
|
||||
import com.mogo.map.marker.IMogoMarker;
|
||||
import com.mogo.map.marker.MogoMarkerOptions;
|
||||
import com.mogo.map.navi.IMogoNaviListener;
|
||||
import com.mogo.map.navi.MogoNaviInfo;
|
||||
import com.mogo.map.search.geo.IMogoGeoSearch;
|
||||
import com.mogo.map.search.geo.IMogoGeoSearchListener;
|
||||
import com.mogo.map.search.geo.MogoGeocodeResult;
|
||||
|
||||
Reference in New Issue
Block a user