Merge remote-tracking branch 'origin/dev_20230708_unmanned_3.5.0' into dev_20230708_unmanned_3.5.0

This commit is contained in:
wangmingjun
2023-08-09 17:28:08 +08:00
13 changed files with 172 additions and 37 deletions

View File

@@ -142,11 +142,11 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
if (controller != null) {
//切换地图的远近视图
if (controller.getCurrentMapVisualAngle().isLongSight()) {
Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(true);
//Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(true);
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
} else if (controller.getCurrentMapVisualAngle().isMediumSight()) {
Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(false);
//Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(false);
controller.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_long);
} else {

View File

@@ -109,13 +109,13 @@ abstract class CharterBaseFragment<V : IView?, P : Presenter<V>?>() :
if (controller != null) {
//切换地图的远近视图
if (controller.currentMapVisualAngle.isLongSight) {
Objects.requireNonNull(getMapUIController())
?.setLockMode(true)
//Objects.requireNonNull(getMapUIController())
// ?.setLockMode(true)
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
mSwitchMapModeImage!!.setImageResource(R.drawable.bus_switch_map_medium)
} else if (controller.currentMapVisualAngle.isMediumSight) {
Objects.requireNonNull(getMapUIController())
?.setLockMode(false)
//Objects.requireNonNull(getMapUIController())
// ?.setLockMode(false)
controller.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null)
mSwitchMapModeImage!!.setImageResource(R.drawable.bus_switch_map_long)
} else {

View File

@@ -1,13 +1,54 @@
package com.mogo.och.common.module.manager.distancemamager
data class DistanceDegree(var distance:Float,var degree:Double?,var isNext:Boolean?):Comparable<DistanceDegree>{
data class DistanceDegree(var distance: Float, var degree: Double?, var isNext: Boolean?) :
Comparable<DistanceDegree> {
override fun compareTo(other: DistanceDegree): Int {
// 对比距离
if(distance == other.distance){
if (distance == other.distance) {
return 0;
} else if(distance < other.distance){
} else if (distance < other.distance) {
return -1;
}
return 1;
}
var next: DistanceDegree? = null
fun recycle() {
synchronized(sPoolSync) {
if (sPoolSize < MAX_POOL_SIZE) {
next = sPool
sPool = this
sPoolSize++
}
//Logger.d("DistanceDegree","缓存对象个数${sPoolSize}个")
}
}
companion object {
var sPoolSync = Any()
private var sPool: DistanceDegree? = null
private var sPoolSize = 0
private var MAX_POOL_SIZE = 20
fun obtain(distance: Float, degree: Double?, isNext: Boolean?): DistanceDegree {
synchronized(sPoolSync) {
if (sPool != null) {
val m: DistanceDegree = sPool!!
sPool = m.next
m.next = null
m.distance = distance
m.degree = degree
m.isNext = isNext
sPoolSize--
//Logger.d("DistanceDegree","取出一个对象个数${sPoolSize}个")
return m
}
//Logger.d("DistanceDegree","创建一个对象 ${sPoolSize}个")
return DistanceDegree(distance, degree, isNext)
}
}
}
}

View File

@@ -601,6 +601,7 @@ object CoordinateCalculateRouteUtil {
type:Int,
size:Int = 4
): Triple<Int,Boolean?,Float> {
val startTime = System.currentTimeMillis()
Logger.d(SceneConstant.M_OCHCOMMON + "calculateRouteSumLength",
"参数:[$preIndex $endIndex) mRoutePoints:${mRoutePoints.size} type:$type size:$size" +
" location:(${location.latitude},${location.longitude},${location.heading})")
@@ -615,9 +616,9 @@ object CoordinateCalculateRouteUtil {
latLngIndex.longitude,
latLngIndex.latitude
)
distanceMap[DistanceDegree(distance, null,null)] = index
distanceMap[DistanceDegree.obtain(distance, null,null)] = index
if (distanceMap.size > size) {
distanceMap.pollLastEntry()
distanceMap.pollLastEntry()?.key?.recycle()
}
}
distanceMap.forEach {
@@ -687,6 +688,12 @@ object CoordinateCalculateRouteUtil {
// 通过航向角过滤一遍
if(distanceDegree.degree!=null&&DrivingDirectionUtils.getAngleDiff(location.heading, distanceDegree.degree!!)<90){
currentIndex = pointIndex
val iterator1 = distanceMap.iterator()
while (iterator1.hasNext()) {
iterator1.next().key.recycle()
iterator1.remove()
}
distanceMap.clear()
return Triple(currentIndex,distanceDegree.isNext,distanceDegree.distance)
}
}
@@ -701,12 +708,14 @@ object CoordinateCalculateRouteUtil {
val next = iterator.next()
val key = next.key
if (key.degree == null) {
key.recycle()
iterator.remove()
} else {
if (location.heading != 0.0) {
key.degree?.let {
val dexAngle = DrivingDirectionUtils.getAngleDiff(location.heading, it)
if (dexAngle > 90) {
key.recycle()
iterator.remove()
}
}
@@ -715,6 +724,14 @@ object CoordinateCalculateRouteUtil {
}
if(distanceMap.size==0&&size<16){
val iterator1 = distanceMap.iterator()
while (iterator1.hasNext()) {
iterator1.next().key.recycle()
iterator1.remove()
}
distanceMap.clear()
Logger.d(SceneConstant.M_OCHCOMMON + "calculateRouteSumLength",
"计算时间:${startTime-System.currentTimeMillis()}")
return getNearestPointInfo(preIndex,endIndex,mRoutePoints,location,type,size+2)
}
@@ -734,9 +751,25 @@ object CoordinateCalculateRouteUtil {
if(preIndexDistance!=null&&preIndexNextDistance!=null){
if(preIndexDistance!!.distance<preIndexNextDistance!!.distance){
currentIndex = preIndex
val iterator1 = distanceMap.iterator()
while (iterator1.hasNext()) {
iterator1.next().key.recycle()
iterator1.remove()
}
distanceMap.clear()
Logger.d(SceneConstant.M_OCHCOMMON + "calculateRouteSumLength",
"计算时间:${startTime-System.currentTimeMillis()}")
return Triple(currentIndex,preIndexDistance?.isNext,preIndexDistance!!.distance)
}else{
currentIndex = preIndex+1
val iterator1 = distanceMap.iterator()
while (iterator1.hasNext()) {
iterator1.next().key.recycle()
iterator1.remove()
}
distanceMap.clear()
Logger.d(SceneConstant.M_OCHCOMMON + "calculateRouteSumLength",
"计算时间:${startTime-System.currentTimeMillis()}")
return Triple(currentIndex,preIndexNextDistance?.isNext,preIndexNextDistance!!.distance)
}
}
@@ -763,6 +796,7 @@ object CoordinateCalculateRouteUtil {
val next = iteratorRemove.next()
val key = next.key
if(next.value>middleVale){
key.recycle()
iteratorRemove.remove()
}
}
@@ -773,6 +807,7 @@ object CoordinateCalculateRouteUtil {
val next = iteratorRemove.next()
val key = next.key
if(next.value<middleVale){
key.recycle()
iteratorRemove.remove()
}
}
@@ -789,6 +824,14 @@ object CoordinateCalculateRouteUtil {
// 排除没有第一个值0是
if(value==preIndex+1&&preIndex!=0){
currentIndex = value
val iterator1 = distanceMap.iterator()
while (iterator1.hasNext()) {
iterator1.next().key.recycle()
iterator1.remove()
}
distanceMap.clear()
Logger.d(SceneConstant.M_OCHCOMMON + "calculateRouteSumLength",
"计算时间:${startTime-System.currentTimeMillis()}")
return Triple(currentIndex,key.isNext,key.distance)
}
key.distance.let {
@@ -799,7 +842,14 @@ object CoordinateCalculateRouteUtil {
}
}
}
val iterator1 = distanceMap.iterator()
while (iterator1.hasNext()) {
iterator1.next().key.recycle()
iterator1.remove()
}
distanceMap.clear()
Logger.d(SceneConstant.M_OCHCOMMON + "calculateRouteSumLength",
"计算时间:${startTime-System.currentTimeMillis()}")
return Triple(currentIndex,isNext,tempDistance)
}
}

View File

@@ -145,11 +145,11 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
if (controller != null) {
//切换地图的远近视图
if (controller.getCurrentMapVisualAngle().isLongSight()) {
Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(true);
//Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(true);
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
} else if (controller.getCurrentMapVisualAngle().isMediumSight()) {
Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(false);
//Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(false);
controller.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_long);
} else {

View File

@@ -155,12 +155,20 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<androidx.constraintlayout.widget.Guideline
android:id="@+id/gl_horizontal_center"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/actv_front_right_door"
android:gravity="center"
android:visibility="gone"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="@+id/gl_horizontal_center"
app:layout_constraintBottom_toBottomOf="@+id/gl_horizontal_center"
app:layout_constraintStart_toStartOf="@+id/gl_vertical_center"
android:layout_marginStart="@dimen/dp_106"
android:text="右前车门未关"
@@ -174,8 +182,8 @@
android:id="@+id/actv_front_left_door"
android:gravity="center"
android:visibility="gone"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="@+id/gl_horizontal_center"
app:layout_constraintBottom_toBottomOf="@+id/gl_horizontal_center"
app:layout_constraintEnd_toStartOf="@+id/gl_vertical_center"
android:layout_marginEnd="@dimen/dp_106"
android:text="左前车门未关"
@@ -191,9 +199,9 @@
android:gravity="center"
android:visibility="gone"
app:layout_constraintEnd_toStartOf="@+id/gl_vertical_center"
app:layout_constraintTop_toBottomOf="@+id/actv_front_left_door"
app:layout_constraintTop_toBottomOf="@+id/gl_horizontal_center"
android:layout_marginEnd="@dimen/dp_135"
android:layout_marginTop="@dimen/dp_87"
android:layout_marginTop="@dimen/dp_142"
android:text="左后车门未关"
android:textSize="@dimen/dp_35"
android:textColor="@color/taxi_p_2B364B"
@@ -206,9 +214,9 @@
android:gravity="center"
android:visibility="gone"
app:layout_constraintStart_toEndOf="@+id/gl_vertical_center"
app:layout_constraintTop_toBottomOf="@+id/actv_front_left_door"
app:layout_constraintTop_toBottomOf="@+id/gl_horizontal_center"
android:layout_marginStart="@dimen/dp_135"
android:layout_marginTop="@dimen/dp_87"
android:layout_marginTop="@dimen/dp_142"
android:text="右后车门未关"
android:textSize="@dimen/dp_35"
android:textColor="@color/taxi_p_2B364B"

View File

@@ -193,11 +193,11 @@ public abstract class BaseTaxiTabFragment<V extends IView, P extends Presenter<V
if (controller != null) {
//切换地图的远近视图
if (controller.getCurrentMapVisualAngle().isLongSight()) {
Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(true);
//Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(true);
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
mSwitchBtnIcon.setImageResource(R.drawable.taxi_switch_map_medium);
} else if (controller.getCurrentMapVisualAngle().isMediumSight()) {
Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(false);
//Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(false);
controller.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
mSwitchBtnIcon.setImageResource(R.drawable.taxi_switch_map_long);
} else {

View File

@@ -54,7 +54,7 @@
app:layout_constraintLeft_toLeftOf="@+id/taxi_p_autopilot_btn_bg"
app:layout_constraintRight_toRightOf="@+id/taxi_p_autopilot_btn_bg" />
<View
app:layout_constraintBottom_toBottomOf="parent"
android:background="@drawable/taxi_p_start_autopilot_bottom_bg"
@@ -73,7 +73,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<View
android:id="@+id/v_xiaozhi_belt_info_bg"
app:layout_constraintBottom_toTopOf="@+id/iv_xiaozhi_belt"
@@ -155,12 +155,20 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<androidx.constraintlayout.widget.Guideline
android:id="@+id/gl_horizontal_center"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/actv_front_right_door"
android:gravity="center"
android:visibility="gone"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="@+id/gl_horizontal_center"
app:layout_constraintBottom_toBottomOf="@+id/gl_horizontal_center"
app:layout_constraintStart_toStartOf="@+id/gl_vertical_center"
android:layout_marginStart="@dimen/dp_106"
android:text="右前车门未关"
@@ -174,8 +182,8 @@
android:id="@+id/actv_front_left_door"
android:gravity="center"
android:visibility="gone"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="@+id/gl_horizontal_center"
app:layout_constraintBottom_toBottomOf="@+id/gl_horizontal_center"
app:layout_constraintEnd_toStartOf="@+id/gl_vertical_center"
android:layout_marginEnd="@dimen/dp_106"
android:text="左前车门未关"
@@ -191,9 +199,9 @@
android:gravity="center"
android:visibility="gone"
app:layout_constraintEnd_toStartOf="@+id/gl_vertical_center"
app:layout_constraintTop_toBottomOf="@+id/actv_front_left_door"
app:layout_constraintTop_toBottomOf="@+id/gl_horizontal_center"
android:layout_marginEnd="@dimen/dp_135"
android:layout_marginTop="@dimen/dp_87"
android:layout_marginTop="@dimen/dp_142"
android:text="左后车门未关"
android:textSize="@dimen/dp_35"
android:textColor="@color/taxi_p_2B364B"
@@ -206,9 +214,9 @@
android:gravity="center"
android:visibility="gone"
app:layout_constraintStart_toEndOf="@+id/gl_vertical_center"
app:layout_constraintTop_toBottomOf="@+id/actv_front_left_door"
app:layout_constraintTop_toBottomOf="@+id/gl_horizontal_center"
android:layout_marginStart="@dimen/dp_135"
android:layout_marginTop="@dimen/dp_87"
android:layout_marginTop="@dimen/dp_142"
android:text="右后车门未关"
android:textSize="@dimen/dp_35"
android:textColor="@color/taxi_p_2B364B"

View File

@@ -132,7 +132,7 @@ object ConfigStartUp {
}
val mapParams = MapParams.init()
mapParams.setDebugMode(DebugConfig.isDebug()) // 1-使用本地地图数据0-使用在线地图数据
mapParams.setDebugMode(false) // 1-使用本地地图数据0-使用在线地图数据
//.setDataFileSource(1)
.setIsRecordLogs(false)
.setIsWeatherEnable(false)

View File

@@ -40,6 +40,8 @@ object V2xObuEventManager : IMoGoObuSaveMessageListener {
*/
override fun onMoGoObuSaveMessage(type: String, content: String, tts: String, sourceType: DataSourceType,communicationType: CommunicationType) {
if (content.isNotEmpty()) {
//消息埋点
V2XEventAnalyticsManager.receiveV2XEvent(type,content,tts,sourceType,communicationType)
if (obuDataMap.containsKey(type)) {
val oldTime = obuDataMap[type]
oldTime?.let {

View File

@@ -22,6 +22,7 @@ object V2XEventAnalyticsManager: IMoGoChassisLocationWGS84Listener,IFuncBizProvi
private const val TAG = "V2XEventAnalyticsManager"
private val hasInit by lazy { AtomicBoolean(false) }
private const val EVENT_KEY_RECEIVE_V2X_MSG ="event_key_receive_v2x_msg" //鹰眼接收到的V2X事件埋点关键字
private const val EVENT_KEY_V2X_MSG_EVENT = "event_key_v2x_msg_event" //消息盒子播报V2X事件埋点关键字
private const val EVENT_PARAMS_POI_TYPE = "poiType" //事件类型
@@ -71,7 +72,29 @@ object V2XEventAnalyticsManager: IMoGoChassisLocationWGS84Listener,IFuncBizProvi
}
/**
* 触发V2X消息埋点
* 收到V2X消息埋点(鹰眼收到事件)
*/
fun receiveV2XEvent(poiType: String,content: String?,ttsContent: String?,
dataSource: DataSourceType,communicationType: CommunicationType){
val msgEventParams = HashMap<String,Any>()
msgEventParams[EVENT_PARAMS_POI_TYPE] = poiType //事件类型
msgEventParams[EVENT_PARAMS_CONTENT] = content?:"" //事件内容
msgEventParams[EVENT_PARAMS_TTS_CONTENT] = ttsContent?:"" //语音播报内容
msgEventParams[EVENT_PARAMS_DISPLAY_TIME] = DateTimeUtils.getTimeText(
System.currentTimeMillis(), DateTimeUtils.yyyy_MM_dd_HH_mm_ss) //展示时间
msgEventParams[EVENT_PARAMS_DATA_SOURCE] = dataSource.name //数据来源
msgEventParams[EVENT_PARAMS_COMMUNICATION_TYPE] = communicationType.name //通信类型
msgEventParams[EVENT_PARAMS_PLATE_NUMBER] = AppConfigInfo.plateNumber //车牌号
msgEventParams[EVENT_PARAMS_CAR_SN] = MoGoAiCloudClientConfig.getInstance().sn //鹰眼SN
msgEventParams[EVENT_PARAMS_EYE_VERSION] = AppUtils.getAppVersionName() //鹰眼版本
msgEventParams[EVENT_PARAMS_LONGITUDE] = "$longitude" //经度
msgEventParams[EVENT_PARAMS_LATITUDE] = "$latitude" //纬度
msgEventParams[EVENT_PARAMS_HEADING] = "$heading" //航向角
MogoAnalyticUtils.track(EVENT_KEY_RECEIVE_V2X_MSG,msgEventParams)
}
/**
* 触发V2X消息埋点(播报事件)
*/
fun triggerV2XEvent(poiType: String,content: String?,ttsContent: String?,
dataSource: DataSourceType,communicationType: CommunicationType){

View File

@@ -325,6 +325,9 @@ class SmallMapView @JvmOverloads constructor(
super.onAutopilotRouteLineId(lineId)
if(lineId == 0L){
this.globalPathResp = null
UiThreadHandler.post {
clearPolyline()
}
}
}

View File

@@ -85,7 +85,7 @@ MOGO_LOCATION_VERSION=1.4.7.12
MOGO_TELEMATIC_VERSION=1.4.7.12
######## MogoAiCloudSDK Version ########
# 自研地图
MAP_SDK_VERSION=2.14.1.5
MAP_SDK_VERSION=2.14.2.8
MAP_SDK_OPERATION_VERSION=1.1.4.1
# websocket
WEBSOCKET_VERSION=1.1.7