[644][adas] 能否启动自驾 添加原始数据日志
This commit is contained in:
@@ -12,7 +12,7 @@ import com.zhjt.mogo.adas.data.AiCloudTask;
|
||||
import com.zhjt.mogo.adas.data.bean.AdasParam;
|
||||
import com.zhjt.mogo.adas.data.bean.AutopilotStatistics;
|
||||
import com.zhjt.mogo.adas.data.bean.ReceivedAck;
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchData;
|
||||
import com.zhjt.mogo.adas.data.bean.LaunchConditionData;
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason;
|
||||
import com.zhjt.mogo.adas.data.sweeper.bootable.SweeperBootable;
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.SweeperTask;
|
||||
@@ -492,10 +492,10 @@ public interface OnAdasListener {
|
||||
* 是否有能力启动自动驾驶
|
||||
*
|
||||
* @param isAutopilotAbility 是否能启动自动驾驶
|
||||
* @param unableLaunchData 原始数据
|
||||
* @param launchConditionData 原始数据
|
||||
* @param unableAutopilotReasons 不能启动自动驾驶原因
|
||||
*/
|
||||
void onAutopilotAbility(boolean isAutopilotAbility, @NonNull UnableLaunchData unableLaunchData, @Nullable ArrayList<UnableLaunchReason> unableAutopilotReasons);
|
||||
void onAutopilotAbility(boolean isAutopilotAbility, @NonNull LaunchConditionData launchConditionData, @Nullable ArrayList<UnableLaunchReason> unableAutopilotReasons);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.zhidao.support.adas.high.common.autopilot.ability;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchData;
|
||||
import com.zhjt.mogo.adas.data.bean.LaunchConditionData;
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -30,7 +30,7 @@ public class AutopilotAbility230 extends BaseAutopilotAbilityChassis {
|
||||
unableAutopilotReasons = onCallbackChassis(unableAutopilotReasons);
|
||||
if (listener != null) {
|
||||
boolean isAutopilotAbility = unableAutopilotReasons == null || unableAutopilotReasons.isEmpty();//是否能启动自动驾驶
|
||||
listener.onAutopilotAbility(isAutopilotAbility, new UnableLaunchData(this.getClass().getSimpleName(), null, null, null), unableAutopilotReasons);
|
||||
listener.onAutopilotAbility(isAutopilotAbility, new LaunchConditionData(this.getClass().getSimpleName(), chassisStates, oldSteering, getLightSwitch(), null, null, null), unableAutopilotReasons);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import androidx.annotation.NonNull;
|
||||
|
||||
import com.zhidao.support.adas.high.AdasManager;
|
||||
import com.zhidao.support.adas.high.common.CupidLogUtils;
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchData;
|
||||
import com.zhjt.mogo.adas.data.bean.LaunchConditionData;
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -107,7 +107,7 @@ public class AutopilotAbility250 extends BaseAutopilotAbilityChassis {
|
||||
unableAutopilotReasons = onCallbackChassis(unableAutopilotReasons);
|
||||
if (listener != null) {
|
||||
boolean isAutopilotAbility = unableAutopilotReasons == null || unableAutopilotReasons.isEmpty();//是否能启动自动驾驶
|
||||
listener.onAutopilotAbility(isAutopilotAbility, new UnableLaunchData(this.getClass().getSimpleName(), statusInfo, null, null), unableAutopilotReasons);
|
||||
listener.onAutopilotAbility(isAutopilotAbility, new LaunchConditionData(this.getClass().getSimpleName(), chassisStates, oldSteering, getLightSwitch(), statusInfo, null, null), unableAutopilotReasons);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import androidx.annotation.NonNull;
|
||||
|
||||
import com.zhidao.support.adas.high.AdasManager;
|
||||
import com.zhidao.support.adas.high.common.CupidLogUtils;
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchData;
|
||||
import com.zhjt.mogo.adas.data.bean.LaunchConditionData;
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -138,7 +138,7 @@ public class AutopilotAbility330 {
|
||||
}
|
||||
}
|
||||
if (listener != null) {
|
||||
listener.onAutopilotAbility(isAutopilotAbility, new UnableLaunchData(this.getClass().getSimpleName(), statusInfo, null, fsmStatusReasonRespond), unableAutopilotReasons);
|
||||
listener.onAutopilotAbility(isAutopilotAbility, new LaunchConditionData(this.getClass().getSimpleName(), statusInfo, null, fsmStatusReasonRespond), unableAutopilotReasons);
|
||||
}
|
||||
fsmStatusReasonRespond = null;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import androidx.annotation.NonNull;
|
||||
|
||||
import com.zhidao.support.adas.high.AdasManager;
|
||||
import com.zhidao.support.adas.high.common.CupidLogUtils;
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchData;
|
||||
import com.zhjt.mogo.adas.data.bean.LaunchConditionData;
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -88,7 +88,7 @@ public class AutopilotAbility350And360 extends BaseAutopilotAbilityChassis {
|
||||
unableAutopilotReasons = onCallbackChassis(unableAutopilotReasons);
|
||||
if (listener != null) {
|
||||
boolean isAutopilotAbility = unableAutopilotReasons == null || unableAutopilotReasons.isEmpty();//是否能启动自动驾驶
|
||||
listener.onAutopilotAbility(isAutopilotAbility, new UnableLaunchData(this.getClass().getSimpleName(), null, statusInfo, null), unableAutopilotReasons);
|
||||
listener.onAutopilotAbility(isAutopilotAbility, new LaunchConditionData(this.getClass().getSimpleName(), chassisStates, oldSteering, getLightSwitch(), null, statusInfo, null), unableAutopilotReasons);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import androidx.annotation.NonNull;
|
||||
|
||||
import com.zhidao.support.adas.high.AdasManager;
|
||||
import com.zhidao.support.adas.high.common.CupidLogUtils;
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchData;
|
||||
import com.zhjt.mogo.adas.data.bean.LaunchConditionData;
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -117,7 +117,7 @@ public class AutopilotAbility360 {
|
||||
}
|
||||
}
|
||||
if (listener != null) {
|
||||
listener.onAutopilotAbility(isAutopilotAbility, new UnableLaunchData(this.getClass().getSimpleName(), null, statusInfo, fsmStatusReasonRespond), unableAutopilotReasons);
|
||||
listener.onAutopilotAbility(isAutopilotAbility, new LaunchConditionData(this.getClass().getSimpleName(), null, statusInfo, fsmStatusReasonRespond), unableAutopilotReasons);
|
||||
}
|
||||
fsmStatusReasonRespond = null;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import com.zhidao.support.adas.high.AdasManager;
|
||||
import com.zhidao.support.adas.high.OnAdasListener;
|
||||
import com.zhidao.support.adas.high.common.CupidLogUtils;
|
||||
import com.zhjt.mogo.adas.data.AdasConstants;
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchData;
|
||||
import com.zhjt.mogo.adas.data.bean.LaunchConditionData;
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -131,9 +131,9 @@ public class AutopilotAbilityManager implements OnAutopilotAbilityListener {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotAbility(boolean isAutopilotAbility, @NonNull UnableLaunchData unableLaunchData, @Nullable ArrayList<UnableLaunchReason> unableAutopilotReasons) {
|
||||
public void onAutopilotAbility(boolean isAutopilotAbility, @NonNull LaunchConditionData launchConditionData, @Nullable ArrayList<UnableLaunchReason> unableAutopilotReasons) {
|
||||
if (listener != null) {
|
||||
listener.onAutopilotAbility(isAutopilotAbility, unableLaunchData, unableAutopilotReasons);
|
||||
listener.onAutopilotAbility(isAutopilotAbility, launchConditionData, unableAutopilotReasons);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ public abstract class BaseAutopilotAbilityChassis {
|
||||
private static final String REASON_CHASSIS_STEERING = "方向盘";
|
||||
@NonNull
|
||||
protected final AutopilotAbilityManager manager;
|
||||
private ChassisStatesOuterClass.ChassisStates chassisStates;
|
||||
protected ChassisStatesOuterClass.ChassisStates chassisStates;
|
||||
protected OnAutopilotAbilityListener listener;
|
||||
protected int mapVersion = -1;//工控机版本
|
||||
protected boolean isJinlv = false;//是否是金旅小巴
|
||||
@@ -39,7 +39,7 @@ public abstract class BaseAutopilotAbilityChassis {
|
||||
*/
|
||||
private Set<Chassis.GearPosition> launchAutopilotGear;
|
||||
|
||||
private float oldThrottle = Float.MAX_VALUE;//方向盘转角
|
||||
protected float oldSteering = Float.MAX_VALUE;//方向盘转角
|
||||
|
||||
public BaseAutopilotAbilityChassis(@NonNull AutopilotAbilityManager manager) {
|
||||
this.manager = manager;
|
||||
@@ -60,6 +60,9 @@ public abstract class BaseAutopilotAbilityChassis {
|
||||
currentLight.set(light);
|
||||
}
|
||||
|
||||
protected Chassis.LightSwitch getLightSwitch() {
|
||||
return currentLight.get();
|
||||
}
|
||||
|
||||
public void setLaunchAutopilotGear(Set<Chassis.GearPosition> launchAutopilotGear) {
|
||||
this.launchAutopilotGear = launchAutopilotGear;
|
||||
@@ -138,13 +141,13 @@ public abstract class BaseAutopilotAbilityChassis {
|
||||
if (chassisStates.hasSteerSystemStates()) {
|
||||
ChassisStatesOuterClass.SteerSystemStates steerSystemStates = chassisStates.getSteerSystemStates();
|
||||
if (steerSystemStates.hasSteeringWheelAngle()) {
|
||||
float throttle = steerSystemStates.getSteeringWheelAngle();
|
||||
if (oldThrottle == Float.MAX_VALUE) {
|
||||
oldThrottle = throttle;
|
||||
float steering = steerSystemStates.getSteeringWheelAngle();
|
||||
if (oldSteering == Float.MAX_VALUE) {
|
||||
oldSteering = steering;
|
||||
} else {
|
||||
// CupidLogUtils.log(TAG, "方向盘当前角度=" + oldThrottle + " 方向盘1秒前角度=" + throttle);
|
||||
boolean isTurning = Math.abs(throttle - oldThrottle) > 8.0F;
|
||||
oldThrottle = throttle;
|
||||
// CupidLogUtils.log(TAG, "方向盘当前角度=" + oldSteering + " 方向盘1秒前角度=" + steering);
|
||||
boolean isTurning = Math.abs(steering - oldSteering) > 8.0F;
|
||||
oldSteering = steering;
|
||||
// CupidLogUtils.log(TAG, "方向盘是否转动=" + isTurning);
|
||||
if (isTurning) {
|
||||
unableAutopilotReasons = manager.addUnableAutopilotReason(unableAutopilotReasons, UnableLaunchReason.SourceType.CHASSIS, UnableLaunchReason.UnableType.CHASSIS_STEERING, REASON_CHASSIS_STEERING);
|
||||
|
||||
@@ -3,11 +3,11 @@ package com.zhidao.support.adas.high.common.autopilot.ability;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchData;
|
||||
import com.zhjt.mogo.adas.data.bean.LaunchConditionData;
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
interface OnAutopilotAbilityListener {
|
||||
void onAutopilotAbility(boolean isAutopilotAbility, @NonNull UnableLaunchData unableLaunchData, @Nullable ArrayList<UnableLaunchReason> unableAutopilotReasons);
|
||||
void onAutopilotAbility(boolean isAutopilotAbility, @NonNull LaunchConditionData launchConditionData, @Nullable ArrayList<UnableLaunchReason> unableAutopilotReasons);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user