Merge branch 'sha' into dev_robotaxi-d-app-module_290_220715_2.9.0

This commit is contained in:
liujing
2022-07-27 14:58:11 +08:00
13 changed files with 106 additions and 2 deletions

View File

@@ -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())
}

View File

@@ -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) {
}
}

View File

@@ -71,6 +71,16 @@ internal class CanImpl(ctx: Context): IFlow<CanStatus>(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()))

View File

@@ -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) {
}
/**

View File

@@ -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

View File

@@ -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);
}
};
/**

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -42,4 +42,14 @@ interface IMoGoAutopilotVehicleStateListener {
* 车辆加速度
*/
fun onAutopilotAcc(carAcc: Float)
/**
* 油门
*/
fun onAutopilotThrottle(throttle: Float)
/**
* 刹车
*/
fun onAutopilotBrake(brake: Float)
}

View File

@@ -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)
}
}
/**
* 工控机时间回调