[dev_arch_opt_3.0]

[Change]
[1、拆分汽车底盘数据透出,都采用单个类型数据回调]

Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
donghongyu
2023-01-05 21:21:02 +08:00
parent 22198c92ec
commit 723540b9a4
26 changed files with 333 additions and 325 deletions

View File

@@ -1,6 +1,5 @@
package com.mogo.eagle.core.function.call.autopilot
import chassis.Chassis
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotVehicleStateListener
import com.mogo.eagle.core.function.call.base.CallerBase
@@ -12,59 +11,6 @@ object CallerAutopilotVehicleStateListenerManager : CallerBase<IMoGoAutopilotVeh
@Volatile
private var timeStamp: Long = 0L
/**
* 车辆方向盘转向角回调
* @param steering 方向盘转向角
*/
fun invokeAutopilotSteeringData(steering: Float){
M_LISTENERS.forEach{
val listener = it.value
listener.onAutopilotSteeringData(steering)
}
}
/**
* 车辆挂挡档位
* @param gear 档位
*/
fun invokeAutopilotGearData(gear: Chassis.GearPosition){
M_LISTENERS.forEach{
val listener = it.value
listener.onAutopilotGearData(gear)
}
}
/**
* 车辆加速度
* acc 加速度
*/
fun invokeAutopilotAcc(carAcc: Float){
M_LISTENERS.forEach{
val listener = it.value
listener.onAutopilotAcc(carAcc)
}
}
/**
* throttle 油门
*/
fun invokeAutopilotThrottle(throttle: Float){
M_LISTENERS.forEach{
val listener = it.value
listener.onAutopilotThrottle(throttle)
}
}
/**
* brake 刹车
*/
fun invokeAutopilotBrake(brake: Float){
M_LISTENERS.forEach{
val listener = it.value
listener.onAutopilotBrake(brake)
}
}
/**
* 工控机时间回调
*/

View File

@@ -0,0 +1,22 @@
package com.mogo.eagle.core.function.call.autopilot
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisAccStateListener
import com.mogo.eagle.core.function.call.base.CallerBase
/**
* 车辆加速度 回调监听
*/
object CallerChassisAccStateListenerManager : CallerBase<IMoGoChassisAccStateListener>() {
/**
* 车辆加速度
* acc 加速度
*/
fun invokeAutopilotAcc(carAcc: Float) {
M_LISTENERS.forEach {
val listener = it.value
listener.onAutopilotAcc(carAcc)
}
}
}

View File

@@ -0,0 +1,21 @@
package com.mogo.eagle.core.function.call.autopilot
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisBrakeStateListener
import com.mogo.eagle.core.function.call.base.CallerBase
/**
* 车辆挂挡档位 回调监听
*/
object CallerChassisBrakeStateListenerManager : CallerBase<IMoGoChassisBrakeStateListener>() {
/**
* brake 刹车
*/
fun invokeAutopilotBrake(brake: Float){
M_LISTENERS.forEach{
val listener = it.value
listener.onAutopilotBrake(brake)
}
}
}

View File

@@ -0,0 +1,22 @@
package com.mogo.eagle.core.function.call.autopilot
import chassis.Chassis
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisGearStateListener
import com.mogo.eagle.core.function.call.base.CallerBase
/**
* 车辆挂挡档位 回调监听
*/
object CallerChassisGearStateListenerManager : CallerBase<IMoGoChassisGearStateListener>() {
/**
* 车辆挂挡档位
* @param gear 档位
*/
fun invokeAutopilotGearData(gear: Chassis.GearPosition) {
M_LISTENERS.forEach {
val listener = it.value
listener.onAutopilotGearData(gear)
}
}
}

View File

@@ -1,6 +1,6 @@
package com.mogo.eagle.core.function.call.autopilot
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarStateListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisGnssInfoListener
import com.mogo.eagle.core.function.call.base.CallerBase
import mogo.telematics.pad.MessagePad
@@ -9,7 +9,7 @@ import mogo.telematics.pad.MessagePad
* @date 2021/9/30 5:48 下午
* 车辆状态&定位 数据 数据 回调监听
*/
object CallerAutopilotCarStatusListenerManager : CallerBase<IMoGoAutopilotCarStateListener>() {
object CallerChassisGnssInfoListenerManager : CallerBase<IMoGoChassisGnssInfoListener>() {
@Volatile
private var gnssInfo: MessagePad.GnssInfo? = null
@@ -32,5 +32,4 @@ object CallerAutopilotCarStatusListenerManager : CallerBase<IMoGoAutopilotCarSta
}
}
}

View File

@@ -1,12 +1,12 @@
package com.mogo.eagle.core.function.call.autopilot
import com.mogo.eagle.core.function.api.autopilot.IMoGoSteeringStateListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisSteeringStateListener
import com.mogo.eagle.core.function.call.base.CallerBase
/**
* 车辆方向盘转向角 回调监听
*/
object CallerSteeringStateListenerManager : CallerBase<IMoGoSteeringStateListener>() {
object CallerChassisSteeringStateListenerManager : CallerBase<IMoGoChassisSteeringStateListener>() {
/**
* 车辆方向盘转向角回调

View File

@@ -0,0 +1,20 @@
package com.mogo.eagle.core.function.call.autopilot
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisThrottleStateListener
import com.mogo.eagle.core.function.call.base.CallerBase
/**
* throttle 油门 回调监听
*/
object CallerChassisThrottleStateListenerManager : CallerBase<IMoGoChassisThrottleStateListener>() {
/**
* throttle 油门
*/
fun invokeAutopilotThrottle(throttle: Float) {
M_LISTENERS.forEach {
val listener = it.value
listener.onAutopilotThrottle(throttle)
}
}
}

View File

@@ -17,7 +17,6 @@ object CallerPlanningTrajectoryListenerManager : CallerBase<IMoGoPlanningTraject
*/
@Synchronized
fun invokeAutopilotTrajectory(trajectoryInfo: MutableList<MessagePad.TrajectoryPoint>) {
M_LISTENERS.forEach {
val tag = it.key
val listener = it.value