Merge remote-tracking branch 'origin/dev_robotaxi-d_230711_3.4.0' into dev_robotaxi-d_230711_3.4.0
This commit is contained in:
@@ -214,7 +214,7 @@ ext {
|
||||
//========================= autosize ======================
|
||||
androidautoSize : 'com.github.JessYanCoding:AndroidAutoSize:v1.2.1',
|
||||
|
||||
thread_opt : "com.mogo.thread.opt:lib:${plugin_version}",
|
||||
thread_opt : "com.mogo.thread.opt:lib:10.1.2_mogo",
|
||||
|
||||
weak_network : "com.mogo.weak:network:1.0.0",
|
||||
btrace : "com.bytedance.btrace:rhea-core:2.0.0",
|
||||
|
||||
@@ -160,7 +160,7 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
|
||||
if (isNeedChangeAngle()) {
|
||||
MarkerLocation location = content.getLocation();
|
||||
if (location != null) {
|
||||
CallerVisualAngleManager.INSTANCE.changeAngle(new RoadEvent(content.getLocation().getLon(), content.getLocation().getLat(), content.getLocation().getAngle()));
|
||||
CallerVisualAngleManager.INSTANCE.changeAngle(new RoadEvent(content.getLocation().getLon(), content.getLocation().getLat(), content.getLocation().getAngle(), false));
|
||||
}
|
||||
}
|
||||
if (entity.isNeedAddLine() && !EventTypeEnumNew.TYPE_SOCKET_ROAD_CONGESTION.getPoiType().equals(content.getPoiType())) {
|
||||
|
||||
@@ -111,17 +111,14 @@ class M1LookAroundView: SurfaceView, SurfaceHolder.Callback, Runnable, IMoGoChas
|
||||
override fun run() {
|
||||
var isTimedBlock = false
|
||||
try {
|
||||
Log.d(TAG, "--- 1 ---")
|
||||
if (!isSurfaceValid) {
|
||||
isTimedBlock = true
|
||||
return
|
||||
}
|
||||
if (this.surfaceWidth <= 0 || this.surfaceHeight <= 0) {
|
||||
Log.d(TAG, "--- 2 ---")
|
||||
isTimedBlock = true
|
||||
return
|
||||
}
|
||||
Log.d(TAG, "--- 3 ---")
|
||||
val data = this.data ?: return
|
||||
val targetX = data.targetX
|
||||
val targetY = data.targetY
|
||||
@@ -134,28 +131,21 @@ class M1LookAroundView: SurfaceView, SurfaceHolder.Callback, Runnable, IMoGoChas
|
||||
val bytes = data.data
|
||||
if (bytes == null) {
|
||||
isTimedBlock = true
|
||||
Log.d(TAG, "--- 4 ---")
|
||||
return
|
||||
}
|
||||
Log.d(TAG, "--- 5 ---")
|
||||
val canvas = holder.lockCanvas()
|
||||
try {
|
||||
if (canvas == null) {
|
||||
Log.d(TAG, "--- 6 ---")
|
||||
isTimedBlock = true
|
||||
return
|
||||
}
|
||||
//1. 绘制图片
|
||||
var startTime = SystemClock.elapsedRealtime()
|
||||
val bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.size)
|
||||
Log.d(TAG, "--- cost for decode bitmap: ${SystemClock.elapsedRealtime() - startTime}ms.")
|
||||
if (bitmap == null) {
|
||||
Log.d(TAG, "--- 7 ---")
|
||||
isTimedBlock = true
|
||||
return
|
||||
}
|
||||
try {
|
||||
startTime = SystemClock.elapsedRealtime()
|
||||
canvas.save()
|
||||
canvas.scale(scaleX, scaleY)
|
||||
canvas.drawBitmap(bitmap, 0f, 0f, bitmapPaint)
|
||||
@@ -164,10 +154,8 @@ class M1LookAroundView: SurfaceView, SurfaceHolder.Callback, Runnable, IMoGoChas
|
||||
if (!bitmap.isRecycled) {
|
||||
bitmap.recycle()
|
||||
}
|
||||
Log.d(TAG, "--- draw decoded bitmap cost: ${SystemClock.elapsedRealtime() - startTime}ms.")
|
||||
}
|
||||
//2. 绘制车的信息
|
||||
Log.d(TAG, "--- 8 ---")
|
||||
val newTargetX = targetX * scaleX
|
||||
val newTargetY = targetY * scaleY
|
||||
val newTargetWidth = targetWidth * scaleX
|
||||
@@ -238,7 +226,6 @@ class M1LookAroundView: SurfaceView, SurfaceHolder.Callback, Runnable, IMoGoChas
|
||||
//2.2 绘制车周围盲区标定
|
||||
canvas.save()
|
||||
canvas.translate(newTargetX + newTargetWidth * 0.5f, newTargetY)
|
||||
Log.d(TAG, "--- 9 ---:[$targetX:$newTargetX, $targetY:$newTargetY, $targetWidth:$newTargetWidth, $targetHeight:$newTargetHeight]")
|
||||
val halfTargetWidth = newTargetWidth * 0.5f
|
||||
var startX = -halfTargetWidth
|
||||
var startY = BROKE_LINE_LENGTH
|
||||
@@ -341,7 +328,6 @@ class M1LookAroundView: SurfaceView, SurfaceHolder.Callback, Runnable, IMoGoChas
|
||||
}
|
||||
|
||||
override fun onAutopilotSteeringData(steering: Float) {
|
||||
Log.d(TAG, "--- onAutopilotSteeringData --: steering: $steering")
|
||||
this.steering = steering
|
||||
}
|
||||
}
|
||||
@@ -7,21 +7,14 @@ import androidx.lifecycle.*
|
||||
import androidx.lifecycle.Lifecycle.Event
|
||||
import androidx.lifecycle.Lifecycle.Event.ON_DESTROY
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.eagle.core.data.config.*
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.data.map.*
|
||||
import com.mogo.eagle.core.function.api.map.angle.*
|
||||
import com.mogo.eagle.core.function.api.map.angle.Scene
|
||||
import com.mogo.eagle.core.function.call.autopilot.*
|
||||
import com.mogo.eagle.core.function.call.map.*
|
||||
import com.mogo.eagle.core.utilcode.kotlin.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.*
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.*
|
||||
import com.zhidaoauto.map.sdk.open.tools.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.android.*
|
||||
import java.util.*
|
||||
import java.util.concurrent.atomic.*
|
||||
|
||||
@Route(path = MogoServicePaths.PATH_VISUAL_ANGLE)
|
||||
class MoGoVisualAngleChangeProvider: IMoGoVisualAngleChangeProvider {
|
||||
@@ -193,31 +186,26 @@ class MoGoVisualAngleChangeProvider: IMoGoVisualAngleChangeProvider {
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(InternalCoroutinesApi::class)
|
||||
private fun doChangeAngle(record: Record) {
|
||||
val angle = record.target.angle
|
||||
CallerMapUIServiceManager.getMapUIController()?.also {
|
||||
Log.d(TAG, "--- doChangeAngle ---: ${record.target}")
|
||||
if (record.target !is Default) {
|
||||
record.isDisplay = true
|
||||
kotlinx.coroutines.internal.synchronized(queue) {
|
||||
synchronized(queue) {
|
||||
queue += record
|
||||
}
|
||||
}
|
||||
if (record.target is Default && roadEventFlag) {
|
||||
roadEventFlag = false
|
||||
//it.setLockMode(true)
|
||||
it.setLockMode(true)
|
||||
}
|
||||
if (record.target is RoadEvent) {
|
||||
it.setLockMode(false)
|
||||
roadEventFlag = true
|
||||
Log.d("TTTTTT", "scene:${record.target}")
|
||||
// scope.launch {
|
||||
// delay(500)
|
||||
// it.changeMapVisualAngle(angle, null)
|
||||
// }
|
||||
it.animateTo(record.target.poi_lon, record.target.poi_lat, record.target.poi_angle.toFloat(), 1000, true)
|
||||
// it.animateTo(record.target.poi_lon, record.target.poi_lat, 0f, 1000, true)
|
||||
scope.launch {
|
||||
it.animateTo(0.0 ,0.0,1f, 0f ,11.5f,28f,3000,true)
|
||||
}
|
||||
|
||||
} else {
|
||||
it.changeMapVisualAngle(angle, null)
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
package com.mogo.eagle.core.function.startup.stageone
|
||||
|
||||
import android.content.*
|
||||
import android.os.Process
|
||||
import com.mogo.thread.ext.core.*
|
||||
import com.mogo.thread.ext.core.config.*
|
||||
import com.mogo.thread.ext.core.config.priority.*
|
||||
import com.rousetime.android_startup.*
|
||||
import java.io.*
|
||||
import java.text.*
|
||||
import java.util.*
|
||||
import java.util.concurrent.TimeUnit.SECONDS
|
||||
|
||||
class ThreadOptStartup: AndroidStartup<Boolean>() {
|
||||
@@ -11,7 +16,13 @@ class ThreadOptStartup: AndroidStartup<Boolean>() {
|
||||
override fun create(context: Context): Boolean {
|
||||
ThreadManager
|
||||
.init(ThreadConfig.Builder()
|
||||
.maxKeepAliveTime(5, SECONDS)
|
||||
.maxKeepAliveTime(10, SECONDS)
|
||||
.minKeepAliveTime(1, SECONDS)
|
||||
.priorityConfig(PriorityConfig.Builder()
|
||||
.checkInterval(1, SECONDS)
|
||||
.setPriority("GLThread\\s+\\d+", Process.THREAD_PRIORITY_BACKGROUND)
|
||||
.setPriority("Dispatch-\\w+", Process.THREAD_PRIORITY_BACKGROUND)
|
||||
.build())
|
||||
/*.dump(DumpConfig.Builder()
|
||||
.dumpLogFilePath(File(context.getExternalFilesDir(null), "thread_dump_log_${ SimpleDateFormat("yyyy-MM-dd-HH-mm-ss", Locale.ROOT).format(Date()) }.txt").absolutePath)
|
||||
.dumpPeriod(5, SECONDS)
|
||||
|
||||
@@ -9,17 +9,17 @@ import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
*/
|
||||
interface IMsgBoxEventListener {
|
||||
//汇总事件点击监听
|
||||
fun onSummaryClickEvent()
|
||||
fun onSummaryClickEvent(){}
|
||||
|
||||
//更新提示红点视图
|
||||
fun onUpdateTipEvent(isShow: Boolean)
|
||||
fun onUpdateTipEvent(isShow: Boolean){}
|
||||
|
||||
//气泡态运营平台事件点击监听
|
||||
fun onBubbleOperationClickEvent(msgBoxBean: MsgBoxBean)
|
||||
fun onBubbleOperationClickEvent(msgBoxBean: MsgBoxBean){}
|
||||
|
||||
//气泡态V2X消息事件点击监听
|
||||
fun onBubbleV2XClickEvent(msgBoxBean: MsgBoxBean)
|
||||
fun onBubbleV2XClickEvent(msgBoxBean: MsgBoxBean){}
|
||||
|
||||
//气泡态上报消息事件点击监听
|
||||
fun onBubbleReportClickEvent(msgBoxBean: MsgBoxBean)
|
||||
fun onBubbleReportClickEvent(msgBoxBean: MsgBoxBean){}
|
||||
}
|
||||
@@ -37,14 +37,14 @@ class Default(val delay: Long = 2, val unit: TimeUnit = SECONDS): Scene() {
|
||||
/**
|
||||
* 道路事件
|
||||
*/
|
||||
class RoadEvent(val poi_lon: Double, val poi_lat: Double, val poi_angle: Double): Scene() {
|
||||
class RoadEvent(val poi_lon: Double, val poi_lat: Double, val poi_angle: Double, val isGps: Boolean = true): Scene() {
|
||||
|
||||
override val angle: VisualAngleMode = VisualAngleMode.MODE_LONG_SIGHT
|
||||
|
||||
override val priority: Int = 5
|
||||
|
||||
override val displayThreshold: Long
|
||||
get() = SECONDS.toMillis(5)
|
||||
get() = SECONDS.toMillis(8)
|
||||
|
||||
override fun toString(): String {
|
||||
return "RoadEvent(priority=${priority}, displayThreshold: ${displayThreshold}, priority=${priority}, lon: $poi_lon, lat: $poi_lat, angle: $poi_angle)"
|
||||
|
||||
@@ -389,4 +389,17 @@ public interface IMogoMapUIController {
|
||||
* @param isGps 是否是高精坐标
|
||||
*/
|
||||
void animateTo(double lon, double lat, float rotateAngle, int duration, boolean isGps);
|
||||
|
||||
|
||||
/**
|
||||
* 自动切换视角到指定点,包含过渡动画,并持续指定duration毫秒
|
||||
*
|
||||
* @param lon 经度
|
||||
* @param lat 纬度
|
||||
* @param v1 旋转角度
|
||||
* @param v2 持续时间
|
||||
* @param v3
|
||||
* @param v4
|
||||
*/
|
||||
void animateTo(double lon, double lat, float v1, float v2, float v3, float v4, int duration, boolean isGps);
|
||||
}
|
||||
|
||||
@@ -1161,4 +1161,11 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
mMapView.getMapAutoViewHelper().animateTo(lon, lat, rotateAngle, duration, isGps);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void animateTo(double lon, double lat, float v1, float v2, float v3, float v4, int duration, boolean isGps) {
|
||||
if (mMapView.getMapAutoViewHelper() != null) {
|
||||
mMapView.getMapAutoViewHelper().animateTo(lon, lat, v1, v2, v3, v4, duration, isGps);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -512,4 +512,11 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
mDelegate.animateTo(lon, lat, rotateAngle, duration, isGps);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void animateTo(double lon, double lat, float v1, float v2, float v3, float v4, int duration, boolean isGps) {
|
||||
if (mDelegate != null) {
|
||||
mDelegate.animateTo(lon, lat, v1, v2, v3, v4, duration, isGps);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -449,4 +449,11 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
mClient.animateTo(lon, lat, rotateAngle, duration, isGps);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void animateTo(double lon, double lat, float v1, float v2, float v3, float v4, int duration, boolean isGps) {
|
||||
if (mClient != null) {
|
||||
mClient.animateTo(lon, lat, v1, v2, v3, v4, duration, isGps);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user