Merge branch 'dev_robotaxi-d_230912_6.1.0' into dev_minibus-d_230919_6.1.0

This commit is contained in:
yangyakun
2023-09-22 19:04:08 +08:00
16 changed files with 100 additions and 183 deletions

View File

@@ -6,7 +6,6 @@ import androidx.annotation.Nullable;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotActionsListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatisticsListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoParallelDrivingActionsListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotActionsListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotStatisticsListenerManager;
@@ -24,7 +23,7 @@ import java.util.ArrayList;
* 工控机状态信息回调(判断是否能否启动自动驾驶的回调)
* 目前定的是3秒回调一次
*/
public class OCHAdasAbilityManager implements IMoGoAutopilotActionsListener, IMoGoAutopilotStatisticsListener, IMoGoParallelDrivingActionsListener {
public class OCHAdasAbilityManager implements IMoGoAutopilotActionsListener, IMoGoAutopilotStatisticsListener {
private static final String TAG = OCHAdasAbilityManager.class.getSimpleName();
@@ -89,8 +88,6 @@ public class OCHAdasAbilityManager implements IMoGoAutopilotActionsListener, IMo
//2022.10.9 工控机状态信息回调(判断是否能否启动自动驾驶的回调), 目前定的是3秒回调一次
CallerAutopilotActionsListenerManager.INSTANCE.addListener(TAG, this);
CallerAutopilotStatisticsListenerManager.INSTANCE.addListener(TAG,this);
//map3.6.0且是东风或者红旗的时候返回
CallerParallelDrivingActionsListenerManager.INSTANCE.addListener(TAG,this);
}
private void releaseListeners() {
@@ -115,7 +112,6 @@ public class OCHAdasAbilityManager implements IMoGoAutopilotActionsListener, IMo
}
}
@Override
public void onAutopilotStatistics(@Nullable AutopilotStatistics statistics) {
if (statistics == null) return;
@@ -129,20 +125,6 @@ public class OCHAdasAbilityManager implements IMoGoAutopilotActionsListener, IMo
}
}
@Override
public void onParallelDrivingAbility(boolean isParallelDrivingAbility, @Nullable ArrayList<UnableLaunchReason> unableParallelDrivingReasons) {
if (unableParallelDrivingReasons != null && getMapVersion() >= 30600) {
//刹车变化回调
Logger.d(TAG,"onParallelDrivingAbility = " + isParallelDrivingAbility +
" unableParallelDrivingReasons =" + unableParallelDrivingReasons.toString());
if (unableParallelDrivingReasons.toString().contains(UnableLaunchReason.SourceType.CHASSIS.name())
&& unableParallelDrivingReasons.toString().contains(UnableLaunchReason.UnableType.BRAKE.name())) {
failureCallback.brakeStatusChanged(isParallelDrivingAbility);
}
}
}
private int getMapVersion(){
return ParseVersionUtils.parseVersion(true, CallerAutoPilotStatusListenerManager.INSTANCE.getDockerVersion());
}

View File

@@ -283,12 +283,12 @@ class TaxiFragment : BaseTaxiTabFragment<TaxiFragment, TaxiPresenter>(),
findViewById<View>(R.id.test_bar_route)?.setOnClickListener {
testRouteInfoUpload()
}
findViewById<View>(R.id.test_brake)?.setOnClickListener {
TaxiTaskModel.handleBrakeStatusChange(false)
}
findViewById<View>(R.id.test_resume_brake)?.setOnClickListener {
TaxiTaskModel.handleBrakeStatusChange(true)
}
// findViewById<View>(R.id.test_brake)?.setOnClickListener {
// TaxiTaskModel.handleBrakeStatusChange(false)
// }
// findViewById<View>(R.id.test_resume_brake)?.setOnClickListener {
// TaxiTaskModel.handleBrakeStatusChange(true)
// }
findViewById<View>(R.id.test_parallel_driver)?.setOnClickListener {
stopAutoStartAutopilot()
}

View File

@@ -117,18 +117,14 @@ class TaxiCurrentTaskFragment : BaseFragment(),
TAG,
"hasCurrentTask = $hasCurrentTask"
)
try {
if (hasCurrentTask) {
noTaskData.visibility = View.GONE
mCurrentTaskLayout.visibility = View.VISIBLE
} else {
noTaskData.visibility = View.VISIBLE
noOrderDataTv.text = "暂无进行中订单"
mCurrentTaskLayout.visibility = View.GONE
taskOtherInfo.text = "距离 -- 公里, 用时 -- 分钟"
}
} catch (e: NullPointerException) { //可能会出现订单信息已经轮询回来,但进行中页面控件还未初始化完成的情况
TaxiTaskModel.clearCurrentOCHOrder()
if (hasCurrentTask) {
noTaskData.visibility = View.GONE
mCurrentTaskLayout.visibility = View.VISIBLE
} else {
noTaskData.visibility = View.VISIBLE
noOrderDataTv.text = "暂无进行中订单"
mCurrentTaskLayout.visibility = View.GONE
taskOtherInfo.text = "距离 -- 公里, 用时 -- 分钟"
}
}

View File

@@ -88,6 +88,7 @@ import system_master.SsmInfo
import system_master.SystemStatusInfo
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.TimeUnit
import kotlin.math.ceil
/**
* @author: wangmingjun
@@ -270,6 +271,7 @@ object TaxiTaskModel {
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {}
override fun onAutopilotStatusResponse(state: Int) {
i(TAG, "onAutopilotStatusResponse autopilotsState= $state")
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
DebugView.printInfoMsg("[自驾状态变化] afterValue=STATUS_AUTOPILOT_RUNNINGmeaning=自动驾驶中")
mADASStatusCallback?.onAutopilotRunning()
@@ -442,8 +444,8 @@ object TaxiTaskModel {
}
override fun brakeStatusChanged(isBrakeAvailable: Boolean) {
//刹车: true 松开, false 踩下
handleBrakeStatusChange(isBrakeAvailable)
//刹车: true 松开, false 踩下 2020.9.23刹车需求暂时下掉
// handleBrakeStatusChange(isBrakeAvailable)
}
}
@@ -724,6 +726,7 @@ object TaxiTaskModel {
listener.onTaskWithOrderDataChanged(null)
}
}
clearCurrentOCHOrder()
return
}
@@ -856,7 +859,7 @@ object TaxiTaskModel {
val listener = it.value
listener.onOrderTripInfoChanged(
data.data.mileage,
data.data.duration.toInt()
ceil(data.data.duration.toDouble()).toInt() //向上取整
)
}
}
@@ -1329,18 +1332,14 @@ object TaxiTaskModel {
* 清除任务订单信息
*/
fun clearCurrentOCHOrder() {
mCurrentTaskWithOrder = null
mDriveToNearestStationTask = null
clearAutopilotControlParameters()
TaxiTrajectoryManager.getInstance().syncTrajectoryInfo()
SharedPrefsMgr.getInstance(mContext).remove(TaxiUnmannedConst.SP_KEY_OCH_TAXI_ORDER)
isRestartAutopilot = false
if (FunctionBuildConfig.isDemoMode) {
// 当美化模式(演示模式)开启时: 取消或订单已完成时置false
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false
CallerAutoPilotControlManager.setIgnoreConditionDraw(false)
CallerAutoPilotControlManager.setIPCDemoMode(false)
d(TAG, "美化模式-ignore置为false已完成or清除当前订单")
d(TAG, "美化模式-ignore置为false已完成or清除当前任务")
}
}

View File

@@ -30,24 +30,24 @@ object MapMakerManager {
.anchor(0.5f, 0.5f)
.set3DMode(true)
.isUseGps(true)
.controlAngle(true)
.controlAngle(false)
.icon3DRes(resourceId)
.latitude(lat)
.longitude(lon)
val mapUIController =
CallerMapUIServiceManager.getMapUIController()
if (mapUIController != null) {
val centerLine =
mapUIController.getCenterLineInfo(
lon, lat, -1f
)
if (null != centerLine) { // 有可能鹰眼map为空没有角度。判空使用后可能造成maker角度跟道路角度不一致
val angle = centerLine.angle
if (angle != null) {
builder.rotate(angle.toFloat())
}
}
}
// val mapUIController =
// CallerMapUIServiceManager.getMapUIController()
// if (mapUIController != null) {
// val centerLine =
// mapUIController.getCenterLineInfo(
// lon, lat, -1f
// )
// if (null != centerLine) { // 有可能鹰眼map为空没有角度。判空使用后可能造成maker角度跟道路角度不一致
// val angle = centerLine.angle
// if (angle != null) {
// builder.rotate(angle.toFloat())
// }
// }
// }
val overlayManager =
CallerMapUIServiceManager.getOverlayManager()
overlayManager?.showOrUpdatePoint(builder.build())

View File

@@ -57,6 +57,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Mock刹车"
android:visibility="gone"
android:textSize="12sp" />
<Button
@@ -64,6 +65,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Mock松开刹车"
android:visibility="gone"
android:textSize="12sp" />
<Button

View File

@@ -89,7 +89,7 @@ ext {
// obu sdk
obusdk : "com.zhidao.enterprise.smartv2x:smartv2x:1.0.0.3",
mogoobu : 'com.mogo.support.obu:mogo-obu:1.1.1',
mogoobu : 'com.mogo.support.obu:mogo-obu:1.1.2',
// google
googlezxing : "com.google.zxing:core:3.3.3",

View File

@@ -1,6 +1,5 @@
package com.mogo.eagle.core.function.datacenter.autopilot.adapter
import android.util.Log
import bag_manager.BagManagerOuterClass
import chassis.ChassisStatesOuterClass
import chassis.VehicleStateOuterClass
@@ -164,9 +163,6 @@ class MoGoAdasListenerImpl : OnAdasListener {
vehicleState: VehicleStateOuterClass.VehicleState?
) {
if (vehicleState != null) {
Log.i(
"xfk",
"底盘 onVehicleState 刹车=${vehicleState.brake}")
//转向灯数据
CallerChassisLamplightListenerManager.invokeAutopilotLightSwitchData(vehicleState.light)
//刹车灯数据
@@ -256,9 +252,6 @@ class MoGoAdasListenerImpl : OnAdasListener {
CallerChassisThrottleStateListenerManager.invokeAutopilotThrottle(it.throttleResponsePosition)
}
chassisStates.brakeSystemStates?.let {
Log.i(
"xfk",
"底盘 onVehicleState 刹车=${it.brakePedalResponsePosition}")
//刹车
CallerChassisBrakeStateListenerManager.invokeAutopilotBrake(it.brakePedalResponsePosition)
}

View File

@@ -1,6 +1,7 @@
package com.mogo.eagle.core.function.datacenter.obu
import android.content.Context
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.config.HmiBuildConfig
import com.mogo.eagle.core.data.enums.CommunicationType
import com.mogo.eagle.core.data.enums.DataSourceType
@@ -62,25 +63,25 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
}
override fun onMoGoObuRsiWarning(rsiWarningData: ObuScene.RsiWarningData) {
if (HmiBuildConfig.isShowObuV2iView) {
if (FunctionBuildConfig.v2xMainSwitch && HmiBuildConfig.isShowObuV2iView) {
onMogoObuDcRsiWarning(rsiWarningData)
}
}
override fun onMoGoObuRsmWarning(rsmWarningData: ObuScene.RsmWarningData) {
if (HmiBuildConfig.isShowObuV2iView) {
if (FunctionBuildConfig.v2xMainSwitch && HmiBuildConfig.isShowObuV2iView) {
onMogoObuDcRsmWarning(rsmWarningData)
}
}
override fun onMoGoObuSpatWarning(spatWarningData: ObuScene.SpatWarningData) {
if (HmiBuildConfig.isShowObuV2iView) {
if (FunctionBuildConfig.v2xMainSwitch && HmiBuildConfig.isShowObuV2iView) {
onMogoObuDcSpatWarning(spatWarningData)
}
}
override fun onMoGoObuMapMath(mapMatchData: ObuScene.MapMatchData) {
if (HmiBuildConfig.isShowObuV2iView) {
if (FunctionBuildConfig.v2xMainSwitch && HmiBuildConfig.isShowObuV2iView) {
onMogoObuMapMath(mapMatchData)
}
}
@@ -561,7 +562,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
}
1 -> { //闯红灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_RED_LIGHT 一个红灯周期只显示一次
if(HmiBuildConfig.isShowObuV2iView){
if(FunctionBuildConfig.v2xMainSwitch && HmiBuildConfig.isShowObuV2iView){
if (HmiBuildConfig.isShowRunRedLightView) {
if (!isShowRunRedLight) {
isShowRunRedLight = true
@@ -594,7 +595,7 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
}
2 -> { //绿波通行引导 V2I_RLVW_VIOLATION_TYPE_NO_VIOLATION 一个绿灯周期只显示一次
if (HmiBuildConfig.isShowGreenWaveView) {
if (FunctionBuildConfig.v2xMainSwitch && FunctionBuildConfig.v2nMainSwitch && HmiBuildConfig.isShowGreenWaveView) {
if (!isShowGreenWave) {
isShowGreenWave = true
CallerLogger.d(
@@ -602,14 +603,14 @@ class MogoObuDcCombineManager private constructor() : IMoGoObuWarningRsiListener
"MogoObuDcCombineManager 绿波通行引导 --------> speed_min = ${currentLight.suggestMinSpeed} --speed_max = ${currentLight.suggestMaxSpeed}"
)
var minSpeedTemp = Math.round(currentLight.suggestMinSpeed * 3.6)
var maxSpeedTemp = Math.round(currentLight.suggestMaxSpeed * 3.6)
val maxSpeedTemp = Math.round(currentLight.suggestMaxSpeed * 3.6)
if (minSpeedTemp == maxSpeedTemp) {
minSpeedTemp -= 5
}
val maxSpeed = currentLight.suggestMaxSpeed
if (maxSpeed > 0) {
var currentSpeed =
val currentSpeed =
CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02().gnssSpeed.toDouble()
if (currentSpeed > 0) {
ttsContentNew =

View File

@@ -346,7 +346,7 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
* 红绿灯预警信息 CvxIvpThreatIndInfo
*/
override fun onObuSpatWarning(data: ObuScene.SpatWarningData) {
if (HmiBuildConfig.isShowObuV2iView) {
if (FunctionBuildConfig.v2xMainSwitch && HmiBuildConfig.isShowObuV2iView) {
handlerTrafficLight(
data.warningType,
data.status,
@@ -359,7 +359,7 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
* RSI预警信息 onMogoObuRsiWarning交通标志预警前方限速、前方学校等等交通事件预警前方拥堵、前方积水等等
*/
override fun onObuRsiWarning(data: ObuScene.RsiWarningData) {
if (HmiBuildConfig.isShowObuV2iView) {
if (FunctionBuildConfig.v2xMainSwitch && HmiBuildConfig.isShowObuV2iView) {
if (data.warningMsgList != null && data.warningMsgList.size > 0) {
var alertContent = ""
var ttsContent = ""
@@ -632,7 +632,7 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
"onMogoObuRsmWarning ------> ${data?.toString()}"
)
if (HmiBuildConfig.isShowObuV2iView) {
if (FunctionBuildConfig.v2xMainSwitch && HmiBuildConfig.isShowObuV2iView) {
if (HmiBuildConfig.isShowObuWeaknessTrafficView) {
// 交通参与者类型 0x0:未知 UNKNOWN | 1机动车 2:非机动车 NON_MOTOR | 3:行人 PEDESTRIAN 4:obu
if (data != null && data.participant != null) {
@@ -725,7 +725,7 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
* 地图匹配 是OBU算法输出地图匹配结果主车匹配道路哪条路或者哪条车道
*/
override fun onObuMapMath(data: ObuScene.MapMatchData?) {
if (HmiBuildConfig.isShowObuV2iView) {
if (FunctionBuildConfig.v2xMainSwitch && HmiBuildConfig.isShowObuV2iView) {
if (data != null) {
CallerLogger.d(
"$M_OBU${MogoObuConst.TAG_MOGO_NEW_OBU}",
@@ -1042,7 +1042,7 @@ class MogoPrivateObuNewManager private constructor() : OnUpgradeListener {
}
1 -> {//闯红灯 V2I_RLVW_VIOLATION_TYPE_RUNNING_RED_LIGHT 一个红灯周期只显示一次
if(HmiBuildConfig.isShowObuV2iView){
if(FunctionBuildConfig.v2xMainSwitch && HmiBuildConfig.isShowObuV2iView){
if (HmiBuildConfig.isShowRunRedLightView) {
if (!isShowRunRedLight) {
isShowRunRedLight = true

View File

@@ -96,10 +96,12 @@ class BagManagerListAdapter: RecyclerView.Adapter<RecyclerView.ViewHolder>() {
//已上报
holder.tvBagReportStatus.text = "已上报"
holder.tvBagReportStatus.setBackgroundResource(R.drawable.bag_reported_button_bg)
holder.tvBagReportStatus.isClickable = false
}else{
//未上报
holder.tvBagReportStatus.text = "上报"
holder.tvBagReportStatus.setBackgroundResource(R.drawable.bag_report_button_bg)
holder.tvBagReportStatus.isClickable = true
holder.tvBagReportStatus.setOnClickListener {
bagClickListener?.uploadBI(bagInfoEntity)
}
@@ -127,11 +129,15 @@ class BagManagerListAdapter: RecyclerView.Adapter<RecyclerView.ViewHolder>() {
holder.tvBagSize.text = "${bagSize}G"
//时间
bagInfoEntity.timestamp?.let { time->
val hour = time.substring(8,10)
val min = time.substring(10,12)
val second = time.substring(12,14)
holder.tvBagTime.text = "${hour}:${min}:${second}"
bagInfoEntity.timestamp.let { time->
try {
val hour = time.substring(8,10)
val min = time.substring(10,12)
val second = time.substring(12,14)
holder.tvBagTime.text = "${hour}:${min}:${second}"
}catch (e: Exception){
e.printStackTrace()
}
}
}
}

View File

@@ -382,7 +382,12 @@ internal class SOPSettingView @JvmOverloads constructor(
}
//自车光圈
scCarAperture.isChecked = FunctionBuildConfig.isDisplayAnimEnable
if(FunctionBuildConfig.isDrawPointCloudData){
//如果点云效果是打开的,则自车光圈也跟随打开
scCarAperture.isChecked = true
}else{
scCarAperture.isChecked = FunctionBuildConfig.isDisplayAnimEnable
}
scCarAperture.setOnCheckedChangeListener { compoundButton, isChecked ->
CallerMapUIServiceManager.getMapUIController()?.setDisplayAnimEnable(isChecked)
hmiAction("SOP 是否展示自车光圈,",isChecked)

View File

@@ -30,14 +30,10 @@ import system_master.SystemStatusInfo;
public class MogoRouteOverlayManager implements
IMoGoPlanningTrajectoryListener,
IMoGoAutopilotStatusListener,
IMoGoChassisLocationGCJ02Listener {
private static volatile MogoRouteOverlayManager sInstance;
private static final String TAG = "Route";
private final AtomicBoolean isArriveAtStation = new AtomicBoolean(false);
private final AtomicInteger autopilotMode = new AtomicInteger(0);
private final LinkedList<List<MessagePad.TrajectoryPoint>> queue = new LinkedList<>();
private MogoRouteOverlayManager() {
@@ -46,7 +42,6 @@ public class MogoRouteOverlayManager implements
public void init() {
CallerPlanningTrajectoryListenerManager.INSTANCE.addListener(TAG, this);
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, this);
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG, 20,this);
}
@@ -75,14 +70,16 @@ public class MogoRouteOverlayManager implements
if (gnssInfo == null) {
return;
}
Log.d(TAG, "-- onChassisLocationGCJ02 -- 1 ---" + ":auto-mode:" + autopilotMode.get() + ", isArriveAtStation: " + isArriveAtStation.get());
if (isArriveAtStation.get() && autopilotMode.get() != 2) {
int autoPilotState = CallerAutoPilotStatusListenerManager.INSTANCE.getState();
boolean isArriveAtStation = CallerAutoPilotStatusListenerManager.INSTANCE.isArriveAtStation();
Log.d(TAG, "-- onChassisLocationGCJ02 -- 1 ---" + ":auto-mode:" + autoPilotState + ", isArriveAtStation: " + isArriveAtStation);
if (isArriveAtStation && autoPilotState != 2) {
RouteOverlayDrawer.getInstance().clearMogoRouteOverlay();
return;
}
Log.d(TAG, "-- onChassisLocationGCJ02 -- 2 ---" + "auto-mode:" + autopilotMode.get() + ", isDemoMode:" + FunctionBuildConfig.isDemoMode + ", force:" + FunctionBuildConfig.isForceDrawAutopilotTrajectoryByDebugSettingView);
Log.d(TAG, "-- onChassisLocationGCJ02 -- 2 ---" + "auto-mode:" + autoPilotState + ", isDemoMode:" + FunctionBuildConfig.isDemoMode + ", force:" + FunctionBuildConfig.isForceDrawAutopilotTrajectoryByDebugSettingView);
boolean force = FunctionBuildConfig.isForceDrawAutopilotTrajectoryByDebugSettingView || FunctionBuildConfig.isDemoMode && FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData;
if (!force && autopilotMode.get() != 2) {
if (!force && autoPilotState != 2) {
RouteOverlayDrawer.getInstance().clearMogoRouteOverlay();
return;
}
@@ -96,66 +93,4 @@ public class MogoRouteOverlayManager implements
}
}
}
@Override
public void onAutopilotStatusResponse(int state) {
if (state == 2) {
isArriveAtStation.set(false);
}
Log.d(TAG, "-- onAutopilotStatusResponse ---: state:" + state);
this.autopilotMode.set(state);
}
@Override
public void onAutopilotStatusResponse(@NotNull AutopilotStatusInfo autoPilotStatusInfo) {
}
@Override
public void onAutopilotArriveAtStation(MessagePad.ArrivalNotification arrivalNotification) {
Log.d(TAG, "-- onAutopilotArriveAtStation --- 1 ---");
if (arrivalNotification == null) {
return;
}
Log.d(TAG, "-- onAutopilotArriveAtStation --- 2 ---");
if(!HdMapBuildConfig.isMapLoaded){
return;
}
Log.d(TAG, "-- onAutopilotArriveAtStation --- 3 ---");
if (!isArriveAtStation.get()) {
isArriveAtStation.set(true);
}
}
@Override
public void onAutopilotSNRequest() {
}
@Override
public void onAutopilotGuardian(MogoReportMsg.MogoReportMessage guardianInfo) {
}
@Override
public void onAutopilotIpcConnectStatusChanged(int status, @androidx.annotation.Nullable String reason) {
}
@Override
public void onAutopilotStatusRespByQuery(@NonNull SystemStatusInfo.StatusInfo status) {
}
@Override
public void onSystemStatus(@NonNull SsmInfo.SsmStatusInf statusInf) {
}
@Override
public void onAutopilotRouteLineId(long lineId) {
}
@Override
public void onAutopilotDockerInfo(@NonNull String dockerVersion) {
}
}

View File

@@ -70,6 +70,12 @@ open class AutopilotStatusInfo : Serializable, Cloneable {
@Volatile
var autopilotControlParameters: AutopilotControlParameters? = null
/**
* 是否到站
*/
@Volatile
var isArriveAtStation: Boolean = false
override fun toString(): String {
return "connectIP=$connectIP, connectPort=$connectPort, " +
"connectStatus=$connectStatus, connectDescribe=$connectStatusDescribe, version=$version, dockVersion=$dockVersion," +

View File

@@ -34,6 +34,7 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
private var autopilotState: Int by Delegates.observable(0) { _, oldValue, newValue ->
if (oldValue != newValue) {
fixAtStationState(newValue)
M_LISTENERS.forEach {
val listener = it.value
listener.onAutopilotStatusResponse(newValue)
@@ -41,6 +42,19 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
}
}
private fun fixAtStationState(autoPilotMode: Int) {
if (autoPilotMode == 2) {
//自驾状态下将到站状态置为false
mAutopilotStatusInfo.isArriveAtStation = false
} else {
//其它状态下, 将到站状态置为false
val arriveAtStation = mAutopilotStatusInfo.isArriveAtStation
if (arriveAtStation) {
mAutopilotStatusInfo.isArriveAtStation = false
}
}
}
private var dockerV: String by Delegates.observable("") { _, oldValue, newValue ->
if (!oldValue.contentEquals(newValue)) {
M_LISTENERS.forEach {
@@ -105,6 +119,8 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
fun getAutoPilotReportMessageContent(): String = autoPilotMessageContent
fun isArriveAtStation(): Boolean = mAutopilotStatusInfo.isArriveAtStation
/**
* 通过Gnss定位更新来同步更新自动驾驶状态
*/
@@ -156,6 +172,7 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
*/
@Synchronized
fun invokeArriveAtStation(arrivalNotification: MessagePad.ArrivalNotification?) {
mAutopilotStatusInfo.isArriveAtStation = true
M_LISTENERS.forEach {
val listener = it.value
listener.onAutopilotArriveAtStation(arrivalNotification)

View File

@@ -1,6 +1,5 @@
package com.mogo.eagle.core.function.call.autopilot
import android.util.Log
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotActionsListener
import com.mogo.eagle.core.function.call.base.CallerBase
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason
@@ -18,7 +17,6 @@ object CallerAutopilotActionsListenerManager : CallerBase<IMoGoAutopilotActionsL
init {
isAutopilotAbility = false
unableAutopilotReasons = disconnectedReason()
// printLog("初始化")
}
private fun disconnectedReason(): ArrayList<UnableLaunchReason> {
@@ -54,7 +52,6 @@ object CallerAutopilotActionsListenerManager : CallerBase<IMoGoAutopilotActionsL
this.isAutopilotAbility = isConnected
unableAutopilotReasons = if (isConnected) null else disconnectedReason()
notification()
// printLog("更新数据 连接状态变更")
}
}
@@ -62,9 +59,6 @@ object CallerAutopilotActionsListenerManager : CallerBase<IMoGoAutopilotActionsL
fun invokeAutopilotAbility(
isAutopilotAbility: Boolean, unableAutopilotReasons: ArrayList<UnableLaunchReason>?
) {
Log.i(
"xfk",
"CallerAutopilotActionsListenerManager invokeAutopilotAbility=${CallerAutopilotActionsListenerManager.isAutopilotAbility} ${(if (CallerAutopilotActionsListenerManager.unableAutopilotReasons == null) null else CallerAutopilotActionsListenerManager.unableAutopilotReasons.toString())}")
if (isConnected) {
var isEquals: Boolean = true
if (unableAutopilotReasons != null && this.unableAutopilotReasons != null) {
@@ -73,41 +67,22 @@ object CallerAutopilotActionsListenerManager : CallerBase<IMoGoAutopilotActionsL
this.unableAutopilotReasons?.let { old ->
old.sortWith(compareBy(UnableLaunchReason::hashCode));
isEquals = onw.toTypedArray() contentEquals old.toTypedArray()
// Log.i(
// "ddd",
// "都不为null时=${isEquals}=${this.isAutopilotAbility} ${(if (this.unableAutopilotReasons == null) null else this.unableAutopilotReasons.toString())}"
// )
}
}
} else isEquals =
!(unableAutopilotReasons != null || this.unableAutopilotReasons != null)
// Log.i(
// "ddd",
// " 两个List是否相同=${isEquals} 新是否能启动自驾=${isAutopilotAbility} 老是否能启动自驾=${this.isAutopilotAbility} 新List是否为空=${unableAutopilotReasons == null} 老List是否为空=${this.unableAutopilotReasons == null}"
// )
if (this.isAutopilotAbility != isAutopilotAbility || !isEquals) {
this.isAutopilotAbility = isAutopilotAbility
this.unableAutopilotReasons = unableAutopilotReasons
notification()
// printLog("更新数据")
}
}
}
private fun notification() {
Log.i(
"xfk",
"CallerAutopilotActionsListenerManager 通知=${isAutopilotAbility} ${(if (unableAutopilotReasons == null) null else unableAutopilotReasons.toString())}")
M_LISTENERS.forEach {
val listener = it.value
listener.onAutopilotAbility(isAutopilotAbility, unableAutopilotReasons)
}
}
// fun printLog(tag: String) {
// Log.i(
// "xfk",
// "${tag}=${isAutopilotAbility} ${(if (unableAutopilotReasons == null) null else unableAutopilotReasons.toString())}"
// )
// }
}