diff --git a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoAdasListenerImpl.kt b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoAdasListenerImpl.kt index c86a419ef2..83dbe41e04 100644 --- a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoAdasListenerImpl.kt +++ b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoAdasListenerImpl.kt @@ -155,6 +155,13 @@ class MoGoAdasListenerImpl : OnAdasListener { CallerAutopilotVehicleStateListenerManager.invokeAutopilotSteeringData(vehicleState.steering) //挂挡档位数据 CallerAutopilotVehicleStateListenerManager.invokeAutopilotGearData(vehicleState.gear) + //加速度 + CallerAutopilotVehicleStateListenerManager.invokeAutopilotAcc(vehicleState.accel) + //油门 + CallerAutopilotVehicleStateListenerManager.invokeAutopilotThrottle(vehicleState.throttle) + //刹车 + CallerAutopilotVehicleStateListenerManager.invokeAutopilotThrottle(vehicleState.brake) + } else { CallerAutopilotVehicleStateListenerManager.invokeAutopilotDataException(header.timestamp.toLong()) } diff --git a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoHandAdasMsgManager.java b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoHandAdasMsgManager.java index 5196738729..00962377ac 100644 --- a/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoHandAdasMsgManager.java +++ b/core/function-impl/mogo-core-function-autopilot/src/main/java/com/mogo/eagle/core/function/autopilot/adapter/MoGoHandAdasMsgManager.java @@ -118,7 +118,7 @@ public class MoGoHandAdasMsgManager implements if (!AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) { //小巴不展示 if (gnssInfo != null) { //设置刹车信息 - if (gnssInfo.getAcceleration() < SharedPrefsMgr.getInstance(mContext).getFloat(MoGoConfig.BRAKE_ACCELERATION_THRESHOLD,-2.5F)) { + if (gnssInfo.getAcceleration() < SharedPrefsMgr.getInstance(mContext).getFloat(MoGoConfig.BRAKE_ACCELERATION_THRESHOLD, -2.5F)) { brakeLight = 1; } else { brakeLight = 0; @@ -132,6 +132,7 @@ public class MoGoHandAdasMsgManager implements /** * 车辆方向盘转向角回调 + * * @param steering 方向盘转向角 */ @Override @@ -141,6 +142,7 @@ public class MoGoHandAdasMsgManager implements /** * 车辆挂挡档位 + * * @param gear 档位 */ @Override @@ -156,4 +158,14 @@ public class MoGoHandAdasMsgManager implements public void onAutopilotAcc(float carAcc) { } + + @Override + public void onAutopilotThrottle(float throttle) { + + } + + @Override + public void onAutopilotBrake(float brake) { + + } } \ No newline at end of file diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/flow/can/CanImpl.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/flow/can/CanImpl.kt index 3ac02babae..0e254a00b2 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/flow/can/CanImpl.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/status/flow/can/CanImpl.kt @@ -71,6 +71,16 @@ internal class CanImpl(ctx: Context): IFlow(ctx), IMoGoAutopilotVehic timeOutCheck() } + override fun onAutopilotThrottle(throttle: Float) { + send(CanStatus(isCanEnabled())) + timeOutCheck() + } + + override fun onAutopilotBrake(brake: Float) { + send(CanStatus(isCanEnabled())) + timeOutCheck() + } + override fun onAutopilotGuardian(guardianInfo: MogoReportMessage?) { super.onAutopilotGuardian(guardianInfo) send(CanStatus(isCanEnabled())) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt index c0cf454759..bd5242473c 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/setting/DebugSettingView.kt @@ -1959,7 +1959,21 @@ class DebugSettingView @JvmOverloads constructor( * 车辆加速度 */ override fun onAutopilotAcc(carAcc: Float) { - TODO("Not yet implemented") + + } + + /** + * 油门 + */ + override fun onAutopilotThrottle(throttle: Float) { + + } + + /** + * 刹车 + */ + override fun onAutopilotBrake(brake: Float) { + } /** diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SteeringWheelView.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SteeringWheelView.java index b7b0725c9b..7fb56ed8d9 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SteeringWheelView.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SteeringWheelView.java @@ -158,6 +158,22 @@ public class SteeringWheelView extends ConstraintLayout { private final IMoGoAutopilotVehicleStateListener mIMoGoAutopilotVehicleStateListener = new IMoGoAutopilotVehicleStateListener() { + /** + * @param brake 刹车 + */ + @Override + public void onAutopilotBrake(float brake) { + + } + + /** + * @param throttle 油门 + */ + @Override + public void onAutopilotThrottle(float throttle) { + + } + /** * 车辆转向灯 * @param lightSwitch diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/TrafficDataView.java b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/TrafficDataView.java index fa1b973b0e..07ab15b376 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/TrafficDataView.java +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/TrafficDataView.java @@ -36,6 +36,8 @@ public class TrafficDataView extends ConstraintLayout { private TextView speedTextView; private TextView accTextView; private ImageView speedImage; + private ImageView brakeStatus; + //圆弧颜色 private int mArcColor; @@ -67,6 +69,7 @@ public class TrafficDataView extends ConstraintLayout { speedImage = findViewById(R.id.speedImage); speedTextView = findViewById(R.id.speedTextView); accTextView = findViewById(R.id.speedAccTextView); + brakeStatus = findViewById(R.id.brakeStatus); } private final IMoGoAutopilotVehicleStateListener mIMoGoAutopilotVehicleStateListener = new IMoGoAutopilotVehicleStateListener() { @@ -138,6 +141,18 @@ public class TrafficDataView extends ConstraintLayout { String accStr = myformat.format(carAcc); accTextView.setText("a: " + accStr); } + + @Override + public void onAutopilotBrake(float brake) { + Log.d(TAG, "刹车:" + String.valueOf(brake)); + brakeStatus.setImageResource(R.drawable.traffic_data_brake); + } + + @Override + public void onAutopilotThrottle(float throttle) { + Log.d(TAG, "油门:" + String.valueOf(throttle)); + brakeStatus.setImageResource(R.drawable.traffic_data_accelerator); + } }; /** diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi-2560x1440/traffic_data_accelerator.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi-2560x1440/traffic_data_accelerator.png new file mode 100644 index 0000000000..ef80c1234c Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi-2560x1440/traffic_data_accelerator.png differ diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi-2560x1440/traffic_data_brake.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi-2560x1440/traffic_data_brake.png new file mode 100644 index 0000000000..2e7925ce3e Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi-2560x1440/traffic_data_brake.png differ diff --git a/core/function-impl/mogo-core-function-map/src/main/res/drawable-xhdpi-2560x1440/amap_reset_passenger.png b/core/function-impl/mogo-core-function-map/src/main/res/drawable-xhdpi-2560x1440/amap_reset_passenger.png new file mode 100644 index 0000000000..a0932b7499 Binary files /dev/null and b/core/function-impl/mogo-core-function-map/src/main/res/drawable-xhdpi-2560x1440/amap_reset_passenger.png differ diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotVehicleStateListener.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotVehicleStateListener.kt index 7d6520926d..75bde9e46f 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotVehicleStateListener.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotVehicleStateListener.kt @@ -42,4 +42,14 @@ interface IMoGoAutopilotVehicleStateListener { * 车辆加速度 */ fun onAutopilotAcc(carAcc: Float) + + /** + * 油门 + */ + fun onAutopilotThrottle(throttle: Float) + + /** + * 刹车 + */ + fun onAutopilotBrake(brake: Float) } \ No newline at end of file diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotVehicleStateListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotVehicleStateListenerManager.kt index 3c5fef077a..df4cd2c638 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotVehicleStateListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotVehicleStateListenerManager.kt @@ -112,6 +112,26 @@ object CallerAutopilotVehicleStateListenerManager : CallerBase() { } } + /** + * throttle 油门 + */ + fun invokeAutopilotThrottle(throttle: Float){ + M_AUTOPILOT_VEHICLE_LISTENERS.forEach{ + val listener = it.value + listener.onAutopilotThrottle(throttle) + } + } + + /** + * brake 刹车 + */ + fun invokeAutopilotBrake(brake: Float){ + M_AUTOPILOT_VEHICLE_LISTENERS.forEach{ + val listener = it.value + listener.onAutopilotBrake(brake) + } + } + /** * 工控机时间回调 diff --git a/core/mogo-core-res/src/main/assets/over_view_style_bus.data b/core/mogo-core-res/src/main/assets/over_view_style_bus.data index 4deed98e6a..2fdafcbf19 100644 Binary files a/core/mogo-core-res/src/main/assets/over_view_style_bus.data and b/core/mogo-core-res/src/main/assets/over_view_style_bus.data differ diff --git a/core/mogo-core-res/src/main/assets/over_view_style_extra_bus.data b/core/mogo-core-res/src/main/assets/over_view_style_extra_bus.data index a3c0811e86..01f7f2116e 100644 Binary files a/core/mogo-core-res/src/main/assets/over_view_style_extra_bus.data and b/core/mogo-core-res/src/main/assets/over_view_style_extra_bus.data differ