[dev_robotaxi-d-app-module_2132_221223_2.13.2_sop] 删除老obu
This commit is contained in:
@@ -51,7 +51,6 @@ dependencies {
|
||||
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
|
||||
implementation rootProject.ext.dependencies.mogoami
|
||||
implementation rootProject.ext.dependencies.mogoaicloudtelematic
|
||||
|
||||
if (Boolean.valueOf(USE_MAVEN_PACKAGE)) {
|
||||
|
||||
@@ -71,8 +71,6 @@ dependencies {
|
||||
implementation rootProject.ext.dependencies.arouter
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
|
||||
implementation rootProject.ext.dependencies.mogoami
|
||||
|
||||
implementation rootProject.ext.dependencies.android_start_up
|
||||
implementation rootProject.ext.dependencies.cicle_indicator
|
||||
implementation rootProject.ext.dependencies.koomnative
|
||||
|
||||
@@ -80,7 +80,6 @@ import com.mogo.map.uicontroller.VisualAngleMode.*
|
||||
import com.mogo.eagle.core.function.business.routeoverlay.*
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
|
||||
import com.mogo.eagle.core.utilcode.kotlin.lifecycleOwner
|
||||
import com.zhidao.easysocket.utils.L
|
||||
import com.zhidao.support.adas.high.other.permission.BackgrounderPermission
|
||||
import com.zhjt.mogo_core_function_devatools.env.*
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.*
|
||||
@@ -1314,7 +1313,7 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
* 设置是否输出OBU日志 true-打印日志,false-不打印日志
|
||||
*/
|
||||
tbObuLog.setOnCheckedChangeListener { _, isChecked ->
|
||||
L.setEnableLog(isChecked)
|
||||
CallerOBUManager.setObuLog(isChecked)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -37,7 +37,6 @@ import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
|
||||
import com.mogo.eagle.core.utilcode.util.ProcessUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.SPUtils;
|
||||
import com.mogo.map.MapApiPath;
|
||||
import com.zhidao.support.obu.ami.AmiClientManager;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Field;
|
||||
@@ -60,7 +59,6 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
|
||||
return;
|
||||
}
|
||||
start = System.currentTimeMillis();
|
||||
connectAmiIp();
|
||||
// Crash 日志收集
|
||||
initCrashConfig();
|
||||
initLogConfig();
|
||||
@@ -202,14 +200,6 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
|
||||
OverviewDb.Companion.getDb(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* 连接ami
|
||||
*/
|
||||
private void connectAmiIp() {
|
||||
String ipAddress = SharedPrefsMgr.getInstance(AbsMogoApplication.getApp().getBaseContext()).getString(MoGoConfig.OBU_IP, "192.168.1.199");
|
||||
AmiClientManager.getInstance().setObuIp(ipAddress);
|
||||
}
|
||||
|
||||
private void initModules() {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "initModules");
|
||||
//och模块
|
||||
|
||||
@@ -66,7 +66,6 @@ dependencies {
|
||||
implementation project(':core:mogo-core-function-call')
|
||||
}
|
||||
|
||||
implementation rootProject.ext.dependencies.mogoobuold
|
||||
implementation rootProject.ext.dependencies.mogoobu
|
||||
|
||||
}
|
||||
|
||||
@@ -75,19 +75,19 @@ class MoGoObuProvider : IMoGoObuProvider {
|
||||
ipAddress,
|
||||
CommonUtils.getIpAddressString()
|
||||
)
|
||||
|
||||
//连接old obu
|
||||
MogoPrivateObuManager.INSTANCE.connectObu(it, ipAddress)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun disConnect() {
|
||||
MogoPrivateObuManager.INSTANCE.disConnectObu()
|
||||
MogoPrivateObuNewManager.INSTANCE.disConnectObu()
|
||||
}
|
||||
|
||||
override fun isConnected(): Boolean {
|
||||
return MogoPrivateObuManager.INSTANCE.isConnected()
|
||||
return MogoPrivateObuNewManager.INSTANCE.isConnected()
|
||||
}
|
||||
|
||||
override fun setObuLibLog(isSet: Boolean) {
|
||||
MogoPrivateObuNewManager.INSTANCE.setObuLog(isSet)
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,6 @@
|
||||
package com.mogo.eagle.core.function.obu.mogo
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||
import com.mogo.eagle.core.data.enums.*
|
||||
@@ -30,10 +29,12 @@ import com.mogo.support.obu.MogoObuManager
|
||||
import com.mogo.support.obu.OnMogoObuListener
|
||||
import com.mogo.support.obu.constants.MogoObuComType
|
||||
import com.mogo.support.obu.constants.MogoObuConstants
|
||||
import com.mogo.support.obu.constants.MogoObuLogLevel
|
||||
import com.mogo.support.obu.constants.MogoObuTopicId
|
||||
import com.mogo.support.obu.model.*
|
||||
import com.mogo.support.obu.model.advance.SpatLight
|
||||
import com.mogo.support.obu.option.MogoObuCom
|
||||
import com.mogo.support.obu.option.MogoObuLog
|
||||
import com.mogo.support.obu.option.MogoObuOptions
|
||||
import org.json.JSONObject
|
||||
|
||||
@@ -75,7 +76,7 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
.build()
|
||||
|
||||
//每次连接的时候如果连接连接了,先断开
|
||||
if (MogoObuManager.getInstance().connectStatus == 1) {
|
||||
if (MogoObuManager.getInstance().connectStatus == MogoObuConstants.CONNECT_STATUS.CONNECTED) {
|
||||
try {
|
||||
MogoObuManager.getInstance().disconnect()
|
||||
} catch (e: Exception) {
|
||||
@@ -86,6 +87,35 @@ class MogoPrivateObuNewManager private constructor() {
|
||||
MogoObuManager.getInstance().connect(options)
|
||||
}
|
||||
|
||||
/**
|
||||
* 断开新obu
|
||||
*/
|
||||
fun disConnectObu() {
|
||||
try {
|
||||
MogoObuManager.getInstance().disconnect()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新obu是否连接
|
||||
*/
|
||||
fun isConnected(): Boolean {
|
||||
return MogoObuManager.getInstance().connectStatus == MogoObuConstants.CONNECT_STATUS.CONNECTED
|
||||
}
|
||||
|
||||
fun setObuLog(isChecked: Boolean) {
|
||||
MogoObuManager.getInstance().setEnableLog(isChecked)
|
||||
|
||||
val builder: com.mogo.support.obu.option.MogoObuLog.Builder =
|
||||
MogoObuLog.newBuilder().setEnableStdio(isChecked)
|
||||
if (isChecked) {
|
||||
builder.setStdioLevel(MogoObuLogLevel.DBG)
|
||||
}
|
||||
MogoObuManager.getInstance().logConfig(builder.build())
|
||||
}
|
||||
|
||||
fun getMogoObuListener(): OnMogoObuListener {
|
||||
return mogoObuListener
|
||||
}
|
||||
|
||||
@@ -1,133 +0,0 @@
|
||||
package com.mogo.eagle.core.function.obu.mogo.utils
|
||||
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData
|
||||
import com.mogo.eagle.core.data.enums.TrafficTypeEnum
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
|
||||
import com.zhidao.support.obu.constants.ObuConstants
|
||||
import com.zhidao.support.obu.model.CvxPtcThreatIndInfo
|
||||
import com.zhidao.support.obu.model.CvxRtiThreatIndInfo
|
||||
import com.zhidao.support.obu.model.CvxRvInfoIndInfo
|
||||
import com.zhidao.support.obu.model.CvxV2vThreatIndInfo
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
* @date 2021/8/18 2:30 下午
|
||||
*/
|
||||
object TrafficDataConvertUtils {
|
||||
val TAG = "TrafficDataConvertUtils"
|
||||
|
||||
/**
|
||||
* OBU 远车 转换交通元素数据
|
||||
*/
|
||||
fun cvxRvInfoIndInfo2TrafficData(info: CvxRvInfoIndInfo): TrafficData? {
|
||||
if (info.basic_info == null || info.basic_info.position == null) {
|
||||
CallerLogger.e("$M_OBU$TAG", "cvxRvInfoIndInfo2TrafficData 数据转换异常,请检查参数是否齐全")
|
||||
return null
|
||||
}
|
||||
val trafficData = TrafficData()
|
||||
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_TA_CHE
|
||||
trafficData.uuid = info.vehicle_id
|
||||
trafficData.lat = info.basic_info.position.latitude
|
||||
trafficData.lon = info.basic_info.position.longitude
|
||||
trafficData.heading = info.basic_info.heading
|
||||
trafficData.speed = info.basic_info.speed
|
||||
|
||||
return trafficData
|
||||
}
|
||||
|
||||
/**
|
||||
* OBU RSU道路事件预警信息 转换交通元素数据
|
||||
*/
|
||||
fun cvxRtiThreatIndInfo2TrafficData(info: CvxRtiThreatIndInfo): TrafficData? {
|
||||
// 这里只处理道路施工
|
||||
if(info.ext_info.rti_type != 0x7){
|
||||
return null
|
||||
}
|
||||
if (info.rti_id == null || info.ext_info == null
|
||||
|| info.zones_info == null || info.zones_info.first() == null
|
||||
|| info.zones_info.first().path_points.first() == null
|
||||
|| info.threat_info == null
|
||||
) {
|
||||
CallerLogger.e("$M_OBU$TAG", "数据转换异常,请检查参数是否齐全")
|
||||
return null
|
||||
}
|
||||
val trafficData = TrafficData()
|
||||
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_DAO_LU_SHI_GONG
|
||||
trafficData.uuid = info.rti_id
|
||||
|
||||
trafficData.lat = info.zones_info.first().path_points.first().latitude
|
||||
trafficData.lon = info.zones_info.first().path_points.first().longitude
|
||||
|
||||
trafficData.threatLevel = info.threat_info.threat_level
|
||||
|
||||
return trafficData
|
||||
}
|
||||
|
||||
/**
|
||||
* OBU 预警事件 转换交通元素数据
|
||||
*/
|
||||
fun cvxV2vThreatIndInfo2TrafficData(info: CvxV2vThreatIndInfo): TrafficData? {
|
||||
if (info.basic_info == null || info.basic_info.position == null || info.threat_info == null) {
|
||||
CallerLogger.e("$M_OBU$TAG", "数据转换异常,请检查参数是否齐全")
|
||||
return null
|
||||
}
|
||||
val trafficData = TrafficData()
|
||||
trafficData.uuid = info.vehicle_id
|
||||
trafficData.lat = info.basic_info.position.latitude
|
||||
trafficData.lon = info.basic_info.position.longitude
|
||||
trafficData.heading = info.basic_info.heading
|
||||
trafficData.speed = info.basic_info.speed
|
||||
// 判断车辆V2X预警级别,调整车辆颜色
|
||||
trafficData.threatLevel = info.threat_info.threat_level
|
||||
|
||||
if (info.threat_info.app_id == ObuConstants.USE_CASE_ID.EVW) {
|
||||
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_SPECIAL_VEHICLE
|
||||
} else {
|
||||
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_TA_CHE
|
||||
}
|
||||
|
||||
return trafficData
|
||||
}
|
||||
|
||||
/**
|
||||
* OBU 弱势交通参与者信息 转换交通元素数据 TODO
|
||||
*/
|
||||
fun cvxPtcThreatIndInfo2TrafficData(info: CvxPtcThreatIndInfo): TrafficData? {
|
||||
if (info.ptc_pos == null || info.threat_info == null) {
|
||||
CallerLogger.e("$M_OBU$TAG", "数据转换异常,请检查参数是否齐全")
|
||||
return null
|
||||
}
|
||||
val trafficData = TrafficData()
|
||||
|
||||
trafficData.uuid = info.ptc_id
|
||||
trafficData.lat = info.ptc_pos.latitude
|
||||
trafficData.lon = info.ptc_pos.longitude
|
||||
// trafficData.heading = info.ptc_pos.heading
|
||||
// trafficData.speed = info.ptc_pos.speed
|
||||
|
||||
when (info.ptc_type) {
|
||||
// 未知
|
||||
0x0 -> {
|
||||
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_WEI_ZHI
|
||||
}
|
||||
// 非机动车
|
||||
0x1 -> {
|
||||
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_MOTO
|
||||
}
|
||||
// 行人
|
||||
0x2 -> {
|
||||
trafficData.type = TrafficTypeEnum.TYPE_TRAFFIC_ID_PEOPLE
|
||||
}
|
||||
}
|
||||
|
||||
// 判断车辆V2X预警级别,调整车辆颜色
|
||||
if (info.threat_info != null) {
|
||||
trafficData.threatLevel = info.threat_info.threat_level
|
||||
}
|
||||
|
||||
return trafficData
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user