合并dev_MogoAP_eagle-930_210926_8.0.12分支,并将规划全局路径以及引导线按照新架构中的监听合并,测试可用,在工控机上执行sh roadPlanning.sh 使用带有引导线的数据包
Signed-off-by: 董宏宇 <martindhy@gmail.com>
This commit is contained in:
@@ -6,7 +6,6 @@ import com.mogo.eagle.core.data.traffic.TrafficData
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.obu.IMoGoObuStatusListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.mogo.eagle.core.utilcode.util.GsonUtils
|
||||
|
||||
/**
|
||||
@@ -126,20 +125,6 @@ object CallerAutoPilotStatusListenerManager : CallerBase() {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动驾驶路径 回调
|
||||
* @param routeInfo
|
||||
*/
|
||||
@Synchronized
|
||||
fun invokeAutopilotRoute(routeInfo: AutopilotRouteInfo?) {
|
||||
//Logger.d(TAG, "$routeInfo")
|
||||
M_AUTOPILOT_STATUS_LISTENERS.forEach {
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
//Logger.d(TAG, "tag:$tag listener:$listener")
|
||||
listener.onAutopilotRoute(routeInfo)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 工控机获取SN 回调
|
||||
@@ -173,7 +158,7 @@ object CallerAutoPilotStatusListenerManager : CallerBase() {
|
||||
* 识别交通元素数据发生更新 回调
|
||||
*/
|
||||
@Synchronized
|
||||
fun invokeAutopilotIdentifyDataUpdate(trafficData: List<TrafficData>?) {
|
||||
fun invokeAutopilotIdentifyDataUpdate(trafficData: ArrayList<TrafficData>?) {
|
||||
//Logger.d(TAG, "$trafficData")
|
||||
M_AUTOPILOT_STATUS_LISTENERS.forEach {
|
||||
val tag = it.key
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
package com.mogo.eagle.core.function.call.autopilot
|
||||
|
||||
import androidx.annotation.Nullable
|
||||
import com.mogo.eagle.core.data.autopilot.ADASTrajectoryInfo
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotRouteInfo
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningListener
|
||||
import com.mogo.eagle.core.function.api.obu.IMoGoObuStatusListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
* @date 2021/9/30 5:48 下午
|
||||
* 规划路径相关回调
|
||||
*/
|
||||
object CallerAutopilotPlanningListenerManager : CallerBase() {
|
||||
private val TAG = "CallerAutopilotPlanningListenerManager"
|
||||
|
||||
// 存储所有注册了监听的对象,invokeXXXX进行遍历回调,将信息同步
|
||||
private val M_AUTOPILOT_PLANNING_LISTENER: HashMap<String, IMoGoAutopilotPlanningListener> =
|
||||
HashMap()
|
||||
|
||||
|
||||
/**
|
||||
* 添加监听
|
||||
* @param tag 标记,用来注销监听使用
|
||||
* @param listener 监听回调
|
||||
*/
|
||||
fun addListener(
|
||||
@Nullable tag: String,
|
||||
@Nullable listener: IMoGoAutopilotPlanningListener
|
||||
) {
|
||||
M_AUTOPILOT_PLANNING_LISTENER[tag] = listener
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除监听
|
||||
* @param tag 标记,用来注销监听使用
|
||||
*/
|
||||
fun removeListener(@Nullable tag: String) {
|
||||
M_AUTOPILOT_PLANNING_LISTENER.remove(tag)
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除自动驾驶按钮选中监听
|
||||
* @param listener 要删除的监听对象
|
||||
*/
|
||||
fun removeListener(@Nullable listener: IMoGoObuStatusListener) {
|
||||
M_AUTOPILOT_PLANNING_LISTENER.forEach {
|
||||
if (it.value == listener) {
|
||||
M_AUTOPILOT_PLANNING_LISTENER.remove(it.key)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 车前引导线 回调
|
||||
* @param trajectoryInfo 自动驾驶状态信息
|
||||
*/
|
||||
@Synchronized
|
||||
fun invokeAutopilotTrajectory(trajectoryInfo: ArrayList<ADASTrajectoryInfo>) {
|
||||
//Logger.d(TAG, "$trajectoryInfo")
|
||||
M_AUTOPILOT_PLANNING_LISTENER.forEach {
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
//Logger.d(TAG, "tag:$tag listener:$listener")
|
||||
listener.onAutopilotTrajectory(trajectoryInfo)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 路径规划 回调
|
||||
* @param routeList 自动驾驶网约车回调数据
|
||||
*/
|
||||
@Synchronized
|
||||
fun invokeAutopilotRotting(routeList: AutopilotRouteInfo) {
|
||||
//Logger.d(TAG, "$routeList")
|
||||
M_AUTOPILOT_PLANNING_LISTENER.forEach {
|
||||
val tag = it.key
|
||||
val listener = it.value
|
||||
//Logger.d(TAG, "tag:$tag listener:$listener")
|
||||
listener.onAutopilotRotting(routeList)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user