[6.6.0] find bug of pb to json
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
|
||||
|
||||
Reference in New Issue
Block a user