[dev_arch_opt_3.0]
[Change] [1、拆分汽车底盘数据透出,都采用单个类型数据回调] Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 工控机时间回调
|
||||
*/
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -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>() {
|
||||
|
||||
/**
|
||||
* 车辆方向盘转向角回调
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user