Merge remote-tracking branch 'origin/dev_minibus-d_230425_3.2.0' into dev_minibus-d_230425_3.2.0
This commit is contained in:
@@ -466,10 +466,6 @@ public class BusPassengerModel {
|
||||
if (autopilotStatusInfo == null) return;
|
||||
int state = autopilotStatusInfo.getState();
|
||||
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
|
||||
//2022.7.20 自动驾驶更换成带档位的
|
||||
if(state != mPreAutoStatus && null != routesResult){
|
||||
CallerAutoPilotControlManager.INSTANCE.getGlobalPath();
|
||||
}
|
||||
if (mADASStatusCallback != null) mADASStatusCallback.onAutopilotRunning();
|
||||
} else if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE) {
|
||||
if(state != mPreAutoStatus){
|
||||
|
||||
@@ -238,19 +238,6 @@ object CharterPassengerModel {
|
||||
mAutoStatusChnageListener.forEach {
|
||||
it.value.onAutoStatusChange(state)
|
||||
}
|
||||
when (state) {
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING -> {
|
||||
RxUtils.createSubscribe {
|
||||
cleanRoutePoints()
|
||||
CallerLogger.d(M_BUS_P + TAG,"请求底盘轨迹")
|
||||
CallerAutoPilotControlManager.getGlobalPath()
|
||||
}
|
||||
}
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE -> {}
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE -> {}
|
||||
IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING -> {}
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
}
|
||||
override fun onAutopilotArriveAtStation(arrivalNotification: MessagePad.ArrivalNotification?) {
|
||||
|
||||
@@ -305,9 +305,6 @@ class PM2DrivingModel private constructor() {
|
||||
|
||||
}else{//自驾状态 2
|
||||
mAutoStatusCallback?.updateAutoStatus(true)
|
||||
if (routesResult != null){
|
||||
CallerAutoPilotControlManager.getGlobalPath()
|
||||
}
|
||||
}
|
||||
mCurrentAutoStatus = status
|
||||
}
|
||||
@@ -502,10 +499,6 @@ class PM2DrivingModel private constructor() {
|
||||
}
|
||||
|
||||
fun dynamicCalculateRouteInfo(){
|
||||
//如果轨迹点为空发送一次获取轨迹指令
|
||||
if (mRoutePoints.size == 0){
|
||||
CallerAutoPilotControlManager.getGlobalPath()
|
||||
}
|
||||
//计算当前位置和下一站的剩余点集合
|
||||
//计算剩余点总里程和时间
|
||||
d(SceneConstant.M_BUS_P + TAG, "och-rotting==mTwoStationsRouts.size() = " + mTwoStationsRouts.size)
|
||||
|
||||
@@ -531,8 +531,6 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
// 当高频返回autopilot 2时,不重复调用订单状态变更
|
||||
mPrevAPStatus = state; // 每个状态单独赋值,解决无订单时已经是2的状态导致的新订单来时无法进入此逻辑更新状态
|
||||
startServicePilotDone();
|
||||
|
||||
CallerAutoPilotControlManager.INSTANCE.getGlobalPath();
|
||||
}
|
||||
} else if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE) {
|
||||
mPrevAPStatus = state;
|
||||
|
||||
@@ -151,7 +151,13 @@ object ConfigStartUp {
|
||||
HDTypes.GUARDBAR.type,
|
||||
HDTypes.TRAFFIC_DEVICE.type,
|
||||
HDTypes.CABLE.type,
|
||||
HDTypes.SIGNAL_LINE.type
|
||||
HDTypes.SIGNAL_LINE.type,
|
||||
HDTypes.building.type,
|
||||
HDTypes.streetLight.type,
|
||||
HDTypes.area.type,
|
||||
HDTypes.regional.type,
|
||||
HDTypes.geometricLinear.type,
|
||||
HDTypes.geometricSurface.type
|
||||
)
|
||||
)
|
||||
// .setZoom( 20 )
|
||||
|
||||
@@ -302,9 +302,6 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
autopilotStatusInfo.state = autopilotState.state
|
||||
autopilotStatusInfo.pilotmode = autopilotState.autopilotMode
|
||||
autopilotStatusInfo.reason = autopilotState.reason
|
||||
autopilotStatusInfo.camera = autopilotState.camera
|
||||
autopilotStatusInfo.rtk = autopilotState.rtk
|
||||
autopilotStatusInfo.radar = autopilotState.radar
|
||||
autopilotStatusInfo.version = AdasManager.getInstance().adasVersion
|
||||
if (autopilotStatusInfo.connectIP == null) {
|
||||
autopilotStatusInfo.connectIP = AdasManager.getInstance().ipcConnectedIp
|
||||
|
||||
@@ -1,10 +1,24 @@
|
||||
package com.mogo.eagle.core.function.datacenter.autopilot.server
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
|
||||
import com.mogo.eagle.core.data.biz.trafficlight.TrafficLightResult
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.datacenter.union.IMoGoTrafficLightListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.zhidao.support.adas.high.AdasManager
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
import com.zhjt.service.chain.TracingConstants.Endpoint.Companion.PAD
|
||||
import io.reactivex.Observable
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.Disposable
|
||||
import java.util.concurrent.TimeUnit
|
||||
import java.util.concurrent.atomic.AtomicInteger
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
@@ -14,7 +28,8 @@ import com.zhidao.support.adas.high.AdasManager
|
||||
* 异步同步数据给 Autopilot 控制器
|
||||
* 数据源(不限于):OBU、网络等
|
||||
*/
|
||||
class AsyncDataToAutopilotServer private constructor() : IMoGoTrafficLightListener {
|
||||
class AsyncDataToAutopilotServer private constructor() : IMoGoTrafficLightListener,
|
||||
IMoGoAutopilotStatusListener {
|
||||
companion object {
|
||||
const val TAG = "AsyncDataToAutopilotServer"
|
||||
val INSTANCE: AsyncDataToAutopilotServer by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {
|
||||
@@ -22,10 +37,41 @@ class AsyncDataToAutopilotServer private constructor() : IMoGoTrafficLightListen
|
||||
}
|
||||
}
|
||||
|
||||
private var mPreAutoStatus = AtomicInteger(-1)
|
||||
private var createSubscribe: Disposable? = null
|
||||
|
||||
fun initServer() {
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
CallerTrafficLightListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {
|
||||
super.onAutopilotStatusResponse(autoPilotStatusInfo)
|
||||
val state = autoPilotStatusInfo.state
|
||||
if (mPreAutoStatus.get() != state) {
|
||||
mPreAutoStatus.set(state)
|
||||
createSubscribe?.let {
|
||||
if (!it.isDisposed) {
|
||||
bizLog(SceneConstant.M_ADAS_IMPL + TAG, "自动驾驶状态变化,取消前置轨迹请求,间隔2s重新请求底盘轨迹")
|
||||
createSubscribe?.dispose()
|
||||
}
|
||||
}
|
||||
|
||||
when (state) {
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING -> {
|
||||
createSubscribe = Observable.timer(2000L, TimeUnit.MILLISECONDS)
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe {
|
||||
bizLog(SceneConstant.M_ADAS_IMPL + TAG, "请求底盘轨迹")
|
||||
CallerAutoPilotControlManager.getGlobalPath()
|
||||
}
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onTrafficLightStatus(trafficLightResult: TrafficLightResult) {
|
||||
var version = -1
|
||||
if (AdasManager.getInstance().carConfig != null) {
|
||||
@@ -34,4 +80,16 @@ class AsyncDataToAutopilotServer private constructor() : IMoGoTrafficLightListen
|
||||
if (version > -1 && version < 290)
|
||||
CallerAutoPilotControlManager.sendTrafficLightData(trafficLightResult)
|
||||
}
|
||||
|
||||
@ChainLog(
|
||||
linkChainLog = ChainConstant.CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT,
|
||||
linkCode = ChainConstant.CHAIN_LINK_ADAS,
|
||||
endpoint = PAD,
|
||||
nodeAliasCode = ChainConstant.CHAIN_ALIAS_CODE_ADAS_MESSAGE_AUTOPILOT_BIZ,
|
||||
paramIndexes = [0, 1],
|
||||
clientPkFileName = "sn"
|
||||
)
|
||||
private fun bizLog(tag: String, msg: String) {
|
||||
CallerLogger.d(tag, msg)
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,6 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener
|
||||
import com.mogo.eagle.core.function.business.ai.net.AiCloudIdentifyNetWorkModel.Companion.aiCloudIdentifyNetWorkModel
|
||||
import com.mogo.eagle.core.function.business.identify.MapIdentifySubscriber
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager
|
||||
@@ -51,7 +50,6 @@ class AiCloudIdentifyDataManager : IMogoMapListener,
|
||||
MogoMapListenerHandler.mogoMapListenerHandler.registerHostMapListener(TAG, this)
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
CallerPlanningRottingListenerManager.addListener(TAG,this)
|
||||
CallerAutoPilotControlManager.getGlobalPath()
|
||||
MogoAiCloudSocketManager.getInstance(mContext)
|
||||
.registerOnMessageListener(
|
||||
0x040003, //低频数据
|
||||
@@ -166,8 +164,6 @@ class AiCloudIdentifyDataManager : IMogoMapListener,
|
||||
super.onAutopilotRouteLineId(lineId)
|
||||
if (lineId == 0L) {
|
||||
updateRomaStyle(true)
|
||||
}else{
|
||||
CallerAutoPilotControlManager.getGlobalPath()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -86,12 +86,33 @@ object MarkerDrawerManager {
|
||||
}
|
||||
}
|
||||
|
||||
fun updateRoutePoints(routePoints: List<MessagePad.Location>?, context: Context) {
|
||||
/**
|
||||
* 存储全局轨迹用于轮询计算车已走过的轨迹index
|
||||
*/
|
||||
fun updateGDRoutePoints(routePoints: List<LatLng>?) {
|
||||
if (routePoints == null || routePoints.isEmpty()) return
|
||||
val latLngModels = coordinateConverterWgsToGcjListCommon(context, routePoints)
|
||||
planningPoints.clear()
|
||||
planningPoints.addAll(latLngModels)
|
||||
// float remainingSumLength = calculateRemainingSumLength(mRoutePoints);
|
||||
synchronized(this) {
|
||||
planningPoints.clear()
|
||||
planningPoints.addAll(routePoints)
|
||||
}
|
||||
}
|
||||
|
||||
fun resetStatus() {
|
||||
synchronized(this) {
|
||||
planningPoints.clear()
|
||||
}
|
||||
lastArrivedIndex = -1
|
||||
}
|
||||
|
||||
/**
|
||||
* 转为高德定位对象
|
||||
*/
|
||||
fun change2GDPoints(routePoints: List<MessagePad.Location>?, context: Context): List<LatLng> {
|
||||
return if (routePoints == null || routePoints.isEmpty()) {
|
||||
emptyList()
|
||||
} else {
|
||||
coordinateConverterWgsToGcjListCommon(context, routePoints)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -111,11 +132,15 @@ object MarkerDrawerManager {
|
||||
if (routePoints.isNotEmpty()) {
|
||||
//基础点
|
||||
val baseLatLng = routePoints[0]
|
||||
newPoints.add(baseLatLng)
|
||||
var baseDiffDis = CoordinateUtils.calculateLineDistance(
|
||||
realLon, realLat, baseLatLng.longitude, baseLatLng.latitude
|
||||
) // lon,lat, prelon, prelat
|
||||
for (i in 1 until routePoints.size) {
|
||||
val size = routePoints.size
|
||||
for (i in 1 until size) {
|
||||
val latLng = routePoints[i]
|
||||
// 深拷贝数据用于高德地图上轨迹线的绘制
|
||||
newPoints.add(LatLng(latLng.latitude, latLng.longitude))
|
||||
val diff = CoordinateUtils.calculateLineDistance(
|
||||
realLon, realLat, latLng.longitude, latLng.latitude
|
||||
)
|
||||
@@ -136,11 +161,12 @@ object MarkerDrawerManager {
|
||||
}
|
||||
Log.d("MarkerDrawerManager", "当次计算已走过的点的索引为:$currentIndex,存储的上次索引为:$lastArrivedIndex")
|
||||
if (currentIndex < lastArrivedIndex) {
|
||||
currentIndex = lastArrivedIndex
|
||||
if (lastArrivedIndex < size) {
|
||||
currentIndex = lastArrivedIndex
|
||||
}
|
||||
} else {
|
||||
lastArrivedIndex = currentIndex
|
||||
}
|
||||
newPoints.addAll(routePoints)
|
||||
newPoints.add(currentIndex + 1, LatLng(realLat, realLon))
|
||||
return currentIndex + 1
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@ import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.getGlobalPath
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager
|
||||
@@ -296,10 +295,10 @@ class SmallMapView @JvmOverloads constructor(
|
||||
endLatLng.latitude, endLatLng.longitude,
|
||||
currentLatLng.latitude, currentLatLng.longitude
|
||||
)
|
||||
CallerLogger.d(
|
||||
SceneConstant.M_MAP + TAG,
|
||||
"calculateDistance=$calculateDistance"
|
||||
)
|
||||
// CallerLogger.d(
|
||||
// SceneConstant.M_MAP + TAG,
|
||||
// "calculateDistance=$calculateDistance"
|
||||
// )
|
||||
if (calculateDistance <= 5) {
|
||||
CallerLogger.d(
|
||||
SceneConstant.M_MAP + TAG, "onChassisLocationGCJ02 -----> calculateDistance <= 5 ")
|
||||
@@ -325,8 +324,6 @@ class SmallMapView @JvmOverloads constructor(
|
||||
UiThreadHandler.post {
|
||||
clearPolyline()
|
||||
}
|
||||
} else if (tempStatus == 1 && autoPilotStatus == 0) {
|
||||
getGlobalPath()
|
||||
}
|
||||
autoPilotStatus = tempStatus
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Liste
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoV2XListener
|
||||
import com.mogo.eagle.core.function.api.biz.IFuncBizProvider
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.getGlobalPath
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerV2XListenerManager
|
||||
@@ -38,21 +37,18 @@ import com.mogo.eagle.core.function.map.R
|
||||
import com.mogo.eagle.core.function.smp.MakerWithCount
|
||||
import com.mogo.eagle.core.function.smp.MarkerDrawerManager
|
||||
import com.mogo.eagle.core.function.smp.MarkerDrawerManager.callback
|
||||
import com.mogo.eagle.core.function.smp.MarkerDrawerManager.change2GDPoints
|
||||
import com.mogo.eagle.core.function.smp.MarkerDrawerManager.coordinateConverterWgsToGcj
|
||||
import com.mogo.eagle.core.function.smp.MarkerDrawerManager.lastArrivedIndex
|
||||
import com.mogo.eagle.core.function.smp.MarkerDrawerManager.lonLatHeading
|
||||
import com.mogo.eagle.core.function.smp.MarkerDrawerManager.planningPoints
|
||||
import com.mogo.eagle.core.function.smp.MarkerDrawerManager.startLoopCalCarLocation
|
||||
import com.mogo.eagle.core.function.smp.MarkerDrawerManager.updateRoutePoints
|
||||
import com.mogo.eagle.core.function.smp.MarkerDrawerManager.updateGDRoutePoints
|
||||
import com.mogo.eagle.core.function.smp.V2XMarkerView
|
||||
import com.mogo.eagle.core.utilcode.mogo.MapAssetStyleUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.zhidaoauto.map.sdk.open.tools.ThreadPoolUtils
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import mogo.v2x.MogoV2X
|
||||
import java.util.concurrent.ExecutorService
|
||||
import java.util.concurrent.Executors
|
||||
import kotlin.math.pow
|
||||
|
||||
@@ -128,10 +124,16 @@ class OverMapView @JvmOverloads constructor(
|
||||
@Volatile
|
||||
private var isInit = false
|
||||
|
||||
@Volatile
|
||||
private var isFirst = true
|
||||
|
||||
// 用来绘制轨迹线
|
||||
private val singlePool by lazy {
|
||||
Executors.newSingleThreadExecutor()
|
||||
}
|
||||
|
||||
private var allPoints: List<LatLng>? = null
|
||||
|
||||
companion object {
|
||||
const val TAG = "OverMapView"
|
||||
}
|
||||
@@ -335,8 +337,9 @@ class OverMapView @JvmOverloads constructor(
|
||||
mStartMarker?.isVisible = false
|
||||
mEndMarker?.isVisible = false
|
||||
MarkerDrawerManager.stopLoopCalCarLocation()
|
||||
planningPoints.clear()
|
||||
lastArrivedIndex = -1
|
||||
ThreadUtils.getIoPool().execute {
|
||||
MarkerDrawerManager.resetStatus()
|
||||
}
|
||||
isInit = false
|
||||
}
|
||||
|
||||
@@ -414,8 +417,6 @@ class OverMapView @JvmOverloads constructor(
|
||||
}
|
||||
})
|
||||
CallerV2XListenerManager.addListener(TAG, this)
|
||||
// 主动查一次全局路径规划的数据
|
||||
getGlobalPath()
|
||||
}
|
||||
|
||||
private fun setUpMap() {
|
||||
@@ -473,37 +474,50 @@ class OverMapView @JvmOverloads constructor(
|
||||
Log.d(TAG, "全局路径规划轨迹为空")
|
||||
return
|
||||
}
|
||||
Log.d(TAG, "全局路径规划轨迹下发")
|
||||
isFirst = true
|
||||
MarkerDrawerManager.resetStatus()
|
||||
val list: List<MessagePad.Location> = locationList
|
||||
// 转成高德坐标系并存储
|
||||
updateRoutePoints(list, mContext!!)
|
||||
val planningPointList: List<LatLng> = planningPoints
|
||||
UiThreadHandler.post ({
|
||||
displayCustomOverView()
|
||||
drawStartAndEndMarker(planningPointList)
|
||||
}, UiThreadHandler.MODE.QUEUE)
|
||||
if (!isInit) {
|
||||
callback = object : MarkerDrawerManager.Callback {
|
||||
override fun onLocationChanged(planningPoints: List<LatLng>, locIndex: Int) {
|
||||
// 每1s刷新一下轨迹线
|
||||
UiThreadHandler.post ({
|
||||
if (planningPoints.isNotEmpty()) {
|
||||
drawPolyline(planningPoints, locIndex)
|
||||
// 转成高德定位对象并存储
|
||||
val planningPointList = change2GDPoints(list, mContext!!)
|
||||
updateGDRoutePoints(planningPointList)
|
||||
synchronized(this::class.java) {
|
||||
if (!isInit) {
|
||||
var timeStamp = 0L
|
||||
callback = object : MarkerDrawerManager.Callback {
|
||||
override fun onLocationChanged(points: List<LatLng>, locIndex: Int) {
|
||||
if (points.isNotEmpty()) {
|
||||
// 每1s刷新一下轨迹线
|
||||
singlePool.execute {
|
||||
if (isFirst) {
|
||||
Log.d(TAG, "第一次!")
|
||||
isFirst = false
|
||||
allPoints = points
|
||||
displayCustomOverView()
|
||||
drawStartAndEndMarker(points)
|
||||
}
|
||||
timeStamp = System.currentTimeMillis()
|
||||
drawPolyline(points, locIndex)
|
||||
Log.d(TAG, "绘制轨迹线的时间为:${System.currentTimeMillis() - timeStamp}ms")
|
||||
}
|
||||
}
|
||||
}, UiThreadHandler.MODE.QUEUE)
|
||||
}
|
||||
}
|
||||
startLoopCalCarLocation()
|
||||
isInit = true
|
||||
}
|
||||
startLoopCalCarLocation()
|
||||
isInit = true
|
||||
}
|
||||
UiThreadHandler.post({
|
||||
if (geoHashInfMap.isNullOrEmpty()) {
|
||||
UiThreadHandler.postDelayed({
|
||||
if (geoHashInfMap.isNullOrEmpty()) {
|
||||
UiThreadHandler.postDelayed({
|
||||
singlePool.execute {
|
||||
drawInfrastructureMarkers(locationList)
|
||||
}, 1000, UiThreadHandler.MODE.QUEUE)
|
||||
} else {
|
||||
}
|
||||
}, 1000, UiThreadHandler.MODE.QUEUE)
|
||||
} else {
|
||||
singlePool.execute {
|
||||
drawInfrastructureMarkers(locationList)
|
||||
}
|
||||
}, UiThreadHandler.MODE.QUEUE)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -665,33 +679,35 @@ class OverMapView @JvmOverloads constructor(
|
||||
* 进入自定义全览模式
|
||||
*/
|
||||
fun displayCustomOverView() {
|
||||
val linePointsLatLng = planningPoints
|
||||
if (linePointsLatLng.size > 1 && mLocation != null) {
|
||||
//圈定地图显示范围
|
||||
//存放经纬度
|
||||
val boundsBuilder = LatLngBounds.Builder()
|
||||
for (i in linePointsLatLng.indices) {
|
||||
boundsBuilder.include(linePointsLatLng[i])
|
||||
}
|
||||
val currentLatLng = LatLng(mLocation!!.latitude, mLocation!!.longitude)
|
||||
boundsBuilder.include(currentLatLng)
|
||||
val cameraPosition = CameraPosition.Builder().tilt(mTilt).build()
|
||||
//第二个参数为四周留空宽度
|
||||
mAMap!!.moveCamera(
|
||||
CameraUpdateFactory.newLatLngBoundsRect(
|
||||
boundsBuilder.build(),
|
||||
AutoSizeUtils.dp2px(context, leftPadding.toFloat()),
|
||||
AutoSizeUtils.dp2px(context, rightPadding.toFloat()),
|
||||
AutoSizeUtils.dp2px(context, topPadding.toFloat()),
|
||||
AutoSizeUtils.dp2px(context, bottomPadding.toFloat())
|
||||
singlePool.execute {
|
||||
val linePointsLatLng = allPoints
|
||||
if (linePointsLatLng != null && linePointsLatLng.size > 1 && mLocation != null) {
|
||||
//圈定地图显示范围
|
||||
//存放经纬度
|
||||
val boundsBuilder = LatLngBounds.Builder()
|
||||
for (i in linePointsLatLng.indices) {
|
||||
boundsBuilder.include(linePointsLatLng[i])
|
||||
}
|
||||
val currentLatLng = LatLng(mLocation!!.latitude, mLocation!!.longitude)
|
||||
boundsBuilder.include(currentLatLng)
|
||||
val cameraPosition = CameraPosition.Builder().tilt(mTilt).build()
|
||||
//第二个参数为四周留空宽度
|
||||
mAMap!!.moveCamera(
|
||||
CameraUpdateFactory.newLatLngBoundsRect(
|
||||
boundsBuilder.build(),
|
||||
AutoSizeUtils.dp2px(context, leftPadding.toFloat()),
|
||||
AutoSizeUtils.dp2px(context, rightPadding.toFloat()),
|
||||
AutoSizeUtils.dp2px(context, topPadding.toFloat()),
|
||||
AutoSizeUtils.dp2px(context, bottomPadding.toFloat())
|
||||
)
|
||||
)
|
||||
)
|
||||
mAMap!!.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition))
|
||||
} else {
|
||||
//设置希望展示的地图缩放级别
|
||||
val cameraPosition = CameraPosition.Builder()
|
||||
.target(mCarMarker!!.position).tilt(mTilt).zoom(zoomLevel.toFloat()).build()
|
||||
mAMap!!.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition))
|
||||
mAMap!!.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition))
|
||||
} else {
|
||||
//设置希望展示的地图缩放级别
|
||||
val cameraPosition = CameraPosition.Builder()
|
||||
.target(mCarMarker!!.position).tilt(mTilt).zoom(zoomLevel.toFloat()).build()
|
||||
mAMap!!.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -721,6 +737,7 @@ class OverMapView @JvmOverloads constructor(
|
||||
mStartMarker?.isVisible = false
|
||||
mEndMarker?.isVisible = false
|
||||
if (coordinates.size > 2) {
|
||||
Log.d(TAG, "绘制起终点")
|
||||
// 设置开始结束Marker位置
|
||||
val startLatLng = coordinates[0]
|
||||
val endLatLng = coordinates[coordinates.size - 1]
|
||||
@@ -728,6 +745,8 @@ class OverMapView @JvmOverloads constructor(
|
||||
mEndMarker?.position = endLatLng
|
||||
mStartMarker?.isVisible = true
|
||||
mEndMarker?.isVisible = true
|
||||
} else {
|
||||
Log.d(TAG, "不绘制起终点")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -737,8 +756,7 @@ class OverMapView @JvmOverloads constructor(
|
||||
* @param coordinates
|
||||
* @param locIndex
|
||||
*/
|
||||
@MainThread
|
||||
fun drawPolyline(coordinates: List<LatLng>, locIndex: Int) {
|
||||
private fun drawPolyline(coordinates: List<LatLng>, locIndex: Int) {
|
||||
if (textureList.size > 0) {
|
||||
textureList.clear()
|
||||
}
|
||||
@@ -822,49 +840,51 @@ class OverMapView @JvmOverloads constructor(
|
||||
* 站点轨迹集合被包含在地图显示范围内
|
||||
*/
|
||||
fun includeSitePointsAndUpdateCamera(coordinates: List<LatLng>?) {
|
||||
val linePointsLatLng = planningPoints
|
||||
val boundsBuilder = LatLngBounds.Builder()
|
||||
var isOnlyCarLocation = true
|
||||
singlePool.execute {
|
||||
val linePointsLatLng = allPoints
|
||||
val boundsBuilder = LatLngBounds.Builder()
|
||||
var isOnlyCarLocation = true
|
||||
|
||||
if (linePointsLatLng.size > 1) {
|
||||
// 圈定地图显示范围(自动驾驶轨迹)
|
||||
for (i in linePointsLatLng.indices) {
|
||||
boundsBuilder.include(linePointsLatLng[i])
|
||||
if (linePointsLatLng != null && linePointsLatLng.size > 1) {
|
||||
// 圈定地图显示范围(自动驾驶轨迹)
|
||||
for (i in linePointsLatLng.indices) {
|
||||
boundsBuilder.include(linePointsLatLng[i])
|
||||
}
|
||||
isOnlyCarLocation = false
|
||||
}
|
||||
isOnlyCarLocation = false
|
||||
}
|
||||
|
||||
if (mLocation != null) {
|
||||
// 自车坐标
|
||||
boundsBuilder.include(LatLng(mLocation!!.latitude, mLocation!!.longitude))
|
||||
}
|
||||
|
||||
coordinates?.let {
|
||||
// 站点轨迹被包含在地图显示范围内
|
||||
for (i in it.indices) {
|
||||
boundsBuilder.include(it[i])
|
||||
if (mLocation != null) {
|
||||
// 自车坐标
|
||||
boundsBuilder.include(LatLng(mLocation!!.latitude, mLocation!!.longitude))
|
||||
}
|
||||
isOnlyCarLocation = false
|
||||
}
|
||||
|
||||
if (!isOnlyCarLocation) {
|
||||
val cameraPosition = CameraPosition.Builder().tilt(mTilt).build()
|
||||
//第二个参数为四周留空宽度
|
||||
mAMap!!.moveCamera(
|
||||
CameraUpdateFactory.newLatLngBoundsRect(
|
||||
boundsBuilder.build(),
|
||||
AutoSizeUtils.dp2px(context, leftPadding.toFloat()),
|
||||
AutoSizeUtils.dp2px(context, rightPadding.toFloat()),
|
||||
AutoSizeUtils.dp2px(context, topPadding.toFloat()),
|
||||
AutoSizeUtils.dp2px(context, bottomPadding.toFloat())
|
||||
coordinates?.let {
|
||||
// 站点轨迹被包含在地图显示范围内
|
||||
for (i in it.indices) {
|
||||
boundsBuilder.include(it[i])
|
||||
}
|
||||
isOnlyCarLocation = false
|
||||
}
|
||||
|
||||
if (!isOnlyCarLocation) {
|
||||
val cameraPosition = CameraPosition.Builder().tilt(mTilt).build()
|
||||
//第二个参数为四周留空宽度
|
||||
mAMap!!.moveCamera(
|
||||
CameraUpdateFactory.newLatLngBoundsRect(
|
||||
boundsBuilder.build(),
|
||||
AutoSizeUtils.dp2px(context, leftPadding.toFloat()),
|
||||
AutoSizeUtils.dp2px(context, rightPadding.toFloat()),
|
||||
AutoSizeUtils.dp2px(context, topPadding.toFloat()),
|
||||
AutoSizeUtils.dp2px(context, bottomPadding.toFloat())
|
||||
)
|
||||
)
|
||||
)
|
||||
mAMap!!.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition))
|
||||
} else {
|
||||
//设置希望展示的地图缩放级别
|
||||
val cameraPosition = CameraPosition.Builder()
|
||||
.target(mCarMarker!!.position).tilt(mTilt).zoom(zoomLevel.toFloat()).build()
|
||||
mAMap!!.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition))
|
||||
mAMap!!.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition))
|
||||
} else {
|
||||
//设置希望展示的地图缩放级别
|
||||
val cameraPosition = CameraPosition.Builder()
|
||||
.target(mCarMarker!!.position).tilt(mTilt).zoom(zoomLevel.toFloat()).build()
|
||||
mAMap!!.moveCamera(CameraUpdateFactory.newCameraPosition(cameraPosition))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -888,7 +908,7 @@ class OverMapView @JvmOverloads constructor(
|
||||
*/
|
||||
override fun onAutopilotRotting(globalPathResp: MessagePad.GlobalPathResp?) {
|
||||
globalPathResp?.let {
|
||||
singlePool.execute {
|
||||
ThreadUtils.getIoPool().execute {
|
||||
handlePlanningData(it.wayPointsList)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,21 +56,6 @@ open class AutopilotStatusInfo : Serializable, Cloneable {
|
||||
*/
|
||||
var reason: String? = null
|
||||
|
||||
/**
|
||||
* 摄像头状态 1代表开启,0代表关闭
|
||||
*/
|
||||
var camera = 0
|
||||
|
||||
/**
|
||||
* 雷达状态 1代表开启,0代表关闭
|
||||
*/
|
||||
var radar = 0
|
||||
|
||||
/**
|
||||
* RTK状态 1代表开启,0代表关闭
|
||||
*/
|
||||
var rtk = 0
|
||||
|
||||
/**
|
||||
* 底盘的自动驾驶状态 0非自动驾驶,1自动驾驶
|
||||
*/
|
||||
@@ -89,8 +74,8 @@ open class AutopilotStatusInfo : Serializable, Cloneable {
|
||||
return "connectIP=$connectIP, connectPort=$connectPort, " +
|
||||
"connectStatus=$connectStatus, connectDescribe=$connectStatusDescribe, version=$version, dockVersion=$dockVersion," +
|
||||
" locationStatus=$locationStatus), locationLat=$locationLat, locationLon=$locationLon," +
|
||||
" satelliteTime=$satelliteTime, state=$state, reason=$reason, camera=$camera," +
|
||||
" radar=$radar, rtk=$rtk, pilotmode=$pilotmode, ipcConnStatus=$ipcConnStatus, autopilotControlParameters=$autopilotControlParameters"
|
||||
" satelliteTime=$satelliteTime, state=$state, reason=$reason, " +
|
||||
" pilotmode=$pilotmode, ipcConnStatus=$ipcConnStatus, autopilotControlParameters=$autopilotControlParameters"
|
||||
}
|
||||
|
||||
public override fun clone(): AutopilotStatusInfo {
|
||||
|
||||
@@ -60,7 +60,7 @@ class ChainConstant {
|
||||
const val CHAIN_ALIAS_CODE_ADAS_MESSAGE_PLANNING_OBJECTS = "CHAIN_ALIAS_CODE_ADAS_MESSAGE_PLANNING_OBJECTS"
|
||||
const val CHAIN_ALIAS_CODE_ADAS_MESSAGE_PLANNING_ACTIONS = "CHAIN_ALIAS_CODE_ADAS_MESSAGE_PLANNING_ACTIONS"
|
||||
const val CHAIN_ALIAS_CODE_ADAS_STATUS_QUERY_RESP = "CHAIN_ALIAS_CODE_ADAS_STATUS_QUERY_RESP"
|
||||
const val CHAIN_ALIAS_CODE_ADAS_MESSAGE_AUTOPILOT_WARN = "PAD_ADAS_MESSAGE_AUTOPILOT_WARN"
|
||||
const val CHAIN_ALIAS_CODE_ADAS_MESSAGE_AUTOPILOT_BIZ = "CHAIN_ALIAS_CODE_ADAS_MESSAGE_AUTOPILOT_BIZ"
|
||||
|
||||
const val CHAIN_ALIAS_CODE_RECORD_NATIVE_LEAK = "CHAIN_ALIAS_CODE_RECORD_NATIVE_LEAK"
|
||||
const val CHAIN_ALIAS_CODE_RECORD_ANR = "CHAIN_ALIAS_CODE_RECORD_ANR"
|
||||
|
||||
@@ -13,7 +13,7 @@ import system_master.*
|
||||
interface IMoGoAutopilotStatusListener {
|
||||
|
||||
/**
|
||||
* 自动驾驶状态信息
|
||||
* 自动驾驶状态信息 TODO 接口优化,拆分业务属性字段
|
||||
*
|
||||
* @param autoPilotStatusInfo 状态信息
|
||||
*/
|
||||
|
||||
@@ -366,7 +366,8 @@ message GlobalPathReq
|
||||
// message definition for MsgTypeGlobalPathResp
|
||||
message GlobalPathResp
|
||||
{
|
||||
repeated Location wayPoints = 1;
|
||||
repeated Location wayPoints = 1;
|
||||
uint64 lineId = 2; //路线id
|
||||
}
|
||||
|
||||
// message definition for MsgTypeTrafficLightData
|
||||
|
||||
@@ -121,10 +121,6 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
private EnumMapUI mCurrentUI = EnumMapUI.MAP_STYLE_NIGHT_VR;
|
||||
private VisualAngleMode mVisualAngleMode = MODE_MEDIUM_SIGHT;
|
||||
|
||||
private boolean mMapLoaded = false;
|
||||
private boolean mIsFirstLocated = true;
|
||||
private boolean mIsDelayed = false;
|
||||
|
||||
private IHdCacheListener hdCacheListener;
|
||||
|
||||
public AMapViewWrapper(MapAutoView mMapView) {
|
||||
@@ -174,6 +170,7 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
//设置手势是否可以缩放 isCanZoom true 可缩放 false 不可缩放
|
||||
options.setZoomGesturesEnabled(true);
|
||||
options.setScaleVRMode(true);
|
||||
options.setWeatherEnable(false);
|
||||
// options.setAllGesturesEnabled(false); //禁止全部手势
|
||||
if (options.getMyLocationStyle() != null) {
|
||||
options.getMyLocationStyle().setDisplayAnimEnable(true);
|
||||
@@ -757,7 +754,6 @@ public class AMapViewWrapper implements IMogoMapView,
|
||||
@Override
|
||||
public void onMapLoaded() {
|
||||
CallerLogger.INSTANCE.i(M_MAP + TAG, "autoop--onMapLoaded: ");
|
||||
mMapLoaded = true;
|
||||
if (checkAMapView()) {
|
||||
CameraPosition cameraPosition = mMapView.getMapAutoViewHelper().getCameraPosition();
|
||||
Trace.beginSection("timer.onCameraChangeFinish");
|
||||
|
||||
Reference in New Issue
Block a user