[6.6.0] merge
This commit is contained in:
@@ -5,7 +5,8 @@ import chassis.VehicleStateOuterClass
|
||||
import com.google.protobuf.TextFormat
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotActionsListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_D_C
|
||||
import com.zhjt.mogo.adas.data.bean.LaunchConditionData
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason
|
||||
import org.json.JSONException
|
||||
@@ -247,8 +248,8 @@ object CallerAutopilotActionsListenerManager : CallerBase<IMoGoAutopilotActionsL
|
||||
}
|
||||
|
||||
private fun notification() {
|
||||
Logger.d(
|
||||
"CallerAutopilotActionsListenerManager",
|
||||
CallerLogger.d(
|
||||
"$M_D_C CallerAutopilotActionsListenerManager",
|
||||
"是否可以启动自动驾驶=" + isAutopilotAbility + " 原因=" + (unableAutopilotReasons?.toString()) + " 原始数据=" + launchConditionData?.json
|
||||
)
|
||||
M_LISTENERS.forEach {
|
||||
|
||||
@@ -9,40 +9,17 @@ import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
*/
|
||||
object CallerChassisLamplightListenerManager : CallerBase<IMoGoChassisLamplightListener>() {
|
||||
|
||||
private var turnLightTimes = 0
|
||||
private var isOnTurnLight = false
|
||||
|
||||
/**
|
||||
* 车辆转向灯数据回调
|
||||
* @param lightSwitch
|
||||
*/
|
||||
fun invokeAutopilotLightSwitchData(lightSwitch: Chassis.LightSwitch) {
|
||||
// val switch = getTurnLightState(lightSwitch)
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.onAutopilotLightSwitchData(lightSwitch)
|
||||
}
|
||||
}
|
||||
|
||||
private fun getTurnLightState(turn_light: Chassis.LightSwitch): Chassis.LightSwitch? {
|
||||
if (turn_light.number == Chassis.LightSwitch.LIGHT_NONE.number) {
|
||||
if (isOnTurnLight) {
|
||||
if (turnLightTimes >= 10) {
|
||||
isOnTurnLight = false
|
||||
return turn_light
|
||||
}
|
||||
turnLightTimes++
|
||||
return null
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
} else {
|
||||
turnLightTimes = 0
|
||||
isOnTurnLight = true
|
||||
return turn_light
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 车辆刹车灯数据回调
|
||||
* @param brakeLight
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.mogo.eagle.core.function.call.autopilot
|
||||
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningActionsListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import com.mogo.eagle.core.function.call.trace.CallerTrace
|
||||
import mogo.telematics.pad.MessagePad
|
||||
|
||||
/**
|
||||
@@ -9,12 +10,22 @@ import mogo.telematics.pad.MessagePad
|
||||
*/
|
||||
object CallerPlanningActionsListenerManager : CallerBase<IMoGoAutopilotPlanningActionsListener>() {
|
||||
|
||||
private var state = 0
|
||||
private var action = 0
|
||||
|
||||
/**
|
||||
* pnc actions 决策回调
|
||||
* @param planningActionMsg 具体决策
|
||||
*/
|
||||
@Synchronized
|
||||
fun invokePNCActions(planningActionMsg: MessagePad.PlanningActionMsg) {
|
||||
val s = planningActionMsg.actionMsg.drivingState.number
|
||||
val a = planningActionMsg.actionMsg.drivingAction.number
|
||||
if(s != state || a != action){
|
||||
state = s
|
||||
action = a
|
||||
CallerTrace.write("PncActions", mapOf("state" to state, "action" to action))
|
||||
}
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.pncActions(planningActionMsg)
|
||||
|
||||
@@ -21,6 +21,10 @@ object CallerMsgBoxManager {
|
||||
providerApi?.queryAllMessages(context)
|
||||
}
|
||||
|
||||
fun saveMsgBoxNoTrace(bean: MsgBoxBean){
|
||||
providerApi?.saveMsg(bean)
|
||||
}
|
||||
|
||||
/**
|
||||
* 存储数据到消息盒子
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user