Merge branch 'dev_robotaxi-d_230809_6.0.0' of gitlab.zhidaoauto.com:SCA/L4HA/AndroidApp/MoGoEagleEye into dev_robotaxi-d_230809_6.0.0
This commit is contained in:
@@ -92,7 +92,7 @@ object TrajectoryAndDistanceManager: IMoGoPlanningRottingListener{
|
||||
d(M_OCHCOMMON + TAG, "onAutopilotRotting: 收到轨迹")
|
||||
globalPathResp?.wayPointsList?.let {
|
||||
if (it.size > 0) {
|
||||
d(M_OCHCOMMON + TAG, "收到轨迹:${it.size}第一个点${it[0]}最后一个点:${it.last()}")
|
||||
d(M_OCHCOMMON + TAG, "收到轨迹:轨迹个数${it.size}第一个点${it[0]}最后一个点:${it.last()} 轨迹id:${globalPathResp.lineId}")
|
||||
if(globalPathResp.lineId!=null) {// 适配低版本不传递lineId
|
||||
if (globalPathResp.lineId == lineId && !mRoutePoints.isNullOrEmpty()) {
|
||||
d(M_OCHCOMMON + TAG, "重复轨迹")
|
||||
|
||||
@@ -134,7 +134,6 @@ class CommonAmapNaviVIew @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
override fun onNaviCancel() {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override fun onNaviBackClick(): Boolean {
|
||||
@@ -170,11 +169,11 @@ class CommonAmapNaviVIew @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
override fun onMapTypeChanged(p0: Int) {
|
||||
TODO("Not yet implemented")
|
||||
|
||||
}
|
||||
|
||||
override fun onNaviViewShowMode(p0: Int) {
|
||||
TODO("Not yet implemented")
|
||||
|
||||
}
|
||||
|
||||
fun onCreate(savedInstanceState : Bundle?){
|
||||
|
||||
@@ -96,8 +96,10 @@ class TaxiPassengerBaseFragment() :
|
||||
ck_setting.visibility = View.VISIBLE
|
||||
if (DeviceUtils.isLenovoModel() || DeviceUtils.isEB5Model()) {
|
||||
romaPView.visibility = View.VISIBLE
|
||||
romaDistanceView.visibility = View.VISIBLE
|
||||
} else {
|
||||
romaPView.visibility = View.GONE
|
||||
romaDistanceView.visibility = View.GONE
|
||||
}
|
||||
rv_location_center.visibility = View.VISIBLE
|
||||
pcnActionView.visibility = View.VISIBLE
|
||||
@@ -111,6 +113,7 @@ class TaxiPassengerBaseFragment() :
|
||||
presenter?.setItineraryVisibility()
|
||||
ck_setting.visibility = View.VISIBLE
|
||||
romaPView.visibility = View.GONE
|
||||
romaDistanceView.visibility = View.GONE
|
||||
rv_location_center.visibility = View.VISIBLE
|
||||
pcnActionView.visibility = View.VISIBLE
|
||||
CallerHmiManager.showTrafficLightView()
|
||||
@@ -124,6 +127,7 @@ class TaxiPassengerBaseFragment() :
|
||||
ck_setting.visibility = View.GONE
|
||||
ck_setting.isChecked = false
|
||||
romaPView.visibility = View.GONE
|
||||
romaDistanceView.visibility = View.GONE
|
||||
rv_location_center.visibility = View.GONE
|
||||
pcnActionView.visibility = View.GONE
|
||||
CallerHmiManager.hideTrafficLightView()
|
||||
|
||||
@@ -82,6 +82,7 @@
|
||||
app:roma_open="@drawable/taxi_p_roma_checked" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.RomaDistanceView
|
||||
android:id="@+id/romaDistanceView"
|
||||
android:layout_width="@dimen/dp_334"
|
||||
android:layout_height="@dimen/dp_120"
|
||||
android:layout_marginStart="@dimen/dp_50"
|
||||
|
||||
@@ -592,6 +592,7 @@ abstract class BaseTaxiTabFragment<V : IView, P : Presenter<V>> : MvpFragment<V,
|
||||
|
||||
fun showRoutingToStationFragment(isShow: Boolean) {
|
||||
val transaction: FragmentTransaction = childFragmentManager.beginTransaction()
|
||||
closeRoutingViewIfHadAdd()
|
||||
if (isShow) {
|
||||
closeAmapViewIFHadeAdd()
|
||||
taxiRoutingNaviFragment = TaxiRoutingNaviFragment.newInstance()
|
||||
@@ -605,7 +606,6 @@ abstract class BaseTaxiTabFragment<V : IView, P : Presenter<V>> : MvpFragment<V,
|
||||
module_mogo_och_navi_panel_container.visibility = View.VISIBLE
|
||||
smallMapView.visibility = View.GONE
|
||||
} else {
|
||||
closeRoutingViewIfHadAdd()
|
||||
taxi_close_navi_icon.visibility = View.GONE
|
||||
module_mogo_och_navi_panel_container.visibility = View.INVISIBLE //2023.9.4高德导航由gone设置成INVISIBLE,保留导航实例,避免导航被挂起
|
||||
smallMapView.visibility = View.VISIBLE
|
||||
|
||||
@@ -74,6 +74,7 @@ class TaxiMapDirectionView @JvmOverloads constructor(
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
// 注册定位监听
|
||||
clearPolyline()
|
||||
CallerChassisLocationGCJ02ListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
@@ -215,6 +216,7 @@ class TaxiMapDirectionView @JvmOverloads constructor(
|
||||
texIndexList.add(1)
|
||||
}
|
||||
if (mPolyline != null) {
|
||||
d(SceneConstant.M_TAXI + TAG, "mPolyline != null")
|
||||
mPolyline!!.points = allPoints
|
||||
mPolyline!!.options.customTextureIndex = texIndexList
|
||||
return
|
||||
@@ -234,10 +236,12 @@ class TaxiMapDirectionView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
// 绘制线
|
||||
d(SceneConstant.M_TAXI + TAG, "绘制线mPolyline = mAMap.addPolyline(polylineOptions)")
|
||||
mPolyline = mAMap.addPolyline(polylineOptions)
|
||||
}
|
||||
|
||||
override fun clearPolyline() {
|
||||
d(SceneConstant.M_TAXI + TAG, "clearPolyline")
|
||||
if (mPolyline != null) {
|
||||
mPolyline!!.remove()
|
||||
mPolyline = null
|
||||
|
||||
@@ -267,7 +267,7 @@ class TaxiCurrentTaskViewModel : BaseViewModel<UnmannedState, TaskUiIntent>(),
|
||||
driveToNearestStationTask: StartServiceRespBean.Result?,
|
||||
currentTaskWithOrder: QueryCurrentTaskRespBean.Result?
|
||||
) {
|
||||
if (currentTaskWithOrder?.endSite != null && currentTaskWithOrder.startSite != null
|
||||
if (currentTaskWithOrder?.endSite != null
|
||||
&& (currentTaskWithOrder.currentStatus < TaskStatusEnum.CompleteTask.code
|
||||
||currentTaskWithOrder.order != null)
|
||||
) {
|
||||
|
||||
@@ -706,7 +706,8 @@ object TaxiTaskModel {
|
||||
|
||||
if (result.order != null && result.currentStatus == TaskStatusEnum.CompleteTask.code
|
||||
&& result.servingStatus == 1){
|
||||
if (result.order!!.orderStatus <= TaxiOrderStatusEnum.ArriveAtStart.code) {
|
||||
if (result.taskType <= TaskTypeEnum.VirtualTask.code
|
||||
&& result.order!!.orderStatus < TaxiOrderStatusEnum.ArriveAtStart.code) {
|
||||
VoiceNotice.showNotice("已为您接到订单")
|
||||
}
|
||||
if (result.taskType == TaskTypeEnum.ToOrderStartTask.code
|
||||
|
||||
@@ -287,7 +287,7 @@ public class TaxiTrajectoryManager {
|
||||
}
|
||||
|
||||
if (mPreAutoPilotLine != null){
|
||||
DebugView.Companion.printInfoMsg("[下发轨迹] sendTrajectoryDownloadReq, lindId=" + mPreAutoPilotLine.getLineId() + ", lineName=" + mPreAutoPilotLine.getLineName());
|
||||
DebugView.Companion.printInfoMsg("[下发预加载轨迹] sendTrajectoryDownloadReq, lindId=" + mPreAutoPilotLine.getLineId() + ", lineName=" + mPreAutoPilotLine.getLineName());
|
||||
CallerAutoPilotControlManager.INSTANCE.sendTrajectoryDownloadReq(mPreAutoPilotLine, PRE_LOADING);
|
||||
}else {
|
||||
CallerLogger.e(M_TAXI + TAG, "sendTrajectoryReq(): mPreAutoPilotLine is null!!!");
|
||||
|
||||
@@ -95,8 +95,10 @@ class TaxiPassengerBaseFragment() :
|
||||
ck_setting.visibility = View.VISIBLE
|
||||
if (DeviceUtils.isLenovoModel() || DeviceUtils.isEB5Model()) {
|
||||
romaPView.visibility = View.VISIBLE
|
||||
romaDistanceView.visibility = View.VISIBLE
|
||||
} else {
|
||||
romaPView.visibility = View.GONE
|
||||
romaDistanceView.visibility = View.GONE
|
||||
}
|
||||
rv_location_center.visibility = View.VISIBLE
|
||||
pcnActionView.visibility = View.VISIBLE
|
||||
@@ -110,6 +112,7 @@ class TaxiPassengerBaseFragment() :
|
||||
presenter?.setItineraryVisibility()
|
||||
ck_setting.visibility = View.VISIBLE
|
||||
romaPView.visibility = View.GONE
|
||||
romaDistanceView.visibility = View.GONE
|
||||
rv_location_center.visibility = View.VISIBLE
|
||||
pcnActionView.visibility = View.VISIBLE
|
||||
CallerHmiManager.showTrafficLightView()
|
||||
@@ -123,6 +126,7 @@ class TaxiPassengerBaseFragment() :
|
||||
ck_setting.visibility = View.GONE
|
||||
ck_setting.isChecked = false
|
||||
romaPView.visibility = View.GONE
|
||||
romaDistanceView.visibility = View.GONE
|
||||
rv_location_center.visibility = View.GONE
|
||||
pcnActionView.visibility = View.GONE
|
||||
CallerHmiManager.hideTrafficLightView()
|
||||
|
||||
@@ -80,6 +80,7 @@
|
||||
app:roma_open="@drawable/taxi_p_roma_checked" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.RomaDistanceView
|
||||
android:id="@+id/romaDistanceView"
|
||||
android:layout_width="@dimen/dp_334"
|
||||
android:layout_height="@dimen/dp_120"
|
||||
android:layout_marginStart="@dimen/dp_50"
|
||||
|
||||
@@ -122,7 +122,7 @@ class MoGoAutopilotControlProvider :
|
||||
// .setSubscribeInterfaceOptions(subscribeInterfaceOptions)//
|
||||
.build()
|
||||
|
||||
AdasManager.getInstance().create(options, MoGoAdasMsgConnectStatusListenerImpl())
|
||||
AdasManager.getInstance().create(context, options, MoGoAdasMsgConnectStatusListenerImpl())
|
||||
//////////////////////////////////注意先后顺序,AdasManager.getInstance().create后才可以设置监听/////////////////////////////////////////////
|
||||
// 监听ADAS-SDK获取到的工控机数据
|
||||
AdasManager.getInstance().setOnAdasListener(MoGoAdasListenerImpl())
|
||||
@@ -209,7 +209,7 @@ class MoGoAutopilotControlProvider :
|
||||
UiThreadHandler.post {
|
||||
if (isSupportMulti) {
|
||||
// 直连工控机
|
||||
directConnect()
|
||||
directConnect(context)
|
||||
} else {
|
||||
val options = AdasOptions
|
||||
.Builder()
|
||||
@@ -217,7 +217,7 @@ class MoGoAutopilotControlProvider :
|
||||
.setUnableLaunchAutopilotGear(FunctionBuildConfig.unableLaunchAutopilotGear)
|
||||
.build()
|
||||
AdasManager.getInstance()
|
||||
.create(options, MoGoAdasMsgConnectStatusListenerImpl())
|
||||
.create(context, options, MoGoAdasMsgConnectStatusListenerImpl())
|
||||
// 监听ADAS-SDK获取到的工控机数据
|
||||
AdasManager.getInstance().setOnAdasListener(MoGoAdasListenerImpl())
|
||||
// 接收司机屏发过来的感知、定位等数据
|
||||
@@ -240,7 +240,7 @@ class MoGoAutopilotControlProvider :
|
||||
}
|
||||
}
|
||||
|
||||
private fun directConnect() {
|
||||
private fun directConnect(context: Context) {
|
||||
val options = AdasOptions
|
||||
.Builder()
|
||||
.setIpcConnectionMode(AdasOptions.IPC_CONNECTION_MODE.FIXATION)
|
||||
@@ -248,7 +248,7 @@ class MoGoAutopilotControlProvider :
|
||||
.setClient(false)// 乘客端直连工控机改为false
|
||||
.setUnableLaunchAutopilotGear(FunctionBuildConfig.unableLaunchAutopilotGear)
|
||||
.build()
|
||||
AdasManager.getInstance().create(options, MoGoAdasMsgConnectStatusListenerImpl())
|
||||
AdasManager.getInstance().create(context, options, MoGoAdasMsgConnectStatusListenerImpl())
|
||||
//////////////////////////////////注意先后顺序,AdasManager.getInstance().create后才可以设置监听/////////////////////////////////////////////
|
||||
// 监听ADAS-SDK获取到的工控机数据
|
||||
AdasManager.getInstance().setOnAdasListener(MoGoAdasListenerImpl())
|
||||
|
||||
@@ -80,7 +80,7 @@ MOGO_LOCATION_VERSION=1.4.7.16
|
||||
MOGO_TELEMATIC_VERSION=1.4.7.16
|
||||
######## MogoAiCloudSDK Version ########
|
||||
# 自研地图
|
||||
MAP_SDK_VERSION=2.14.3.9
|
||||
MAP_SDK_VERSION=2.14.3.10
|
||||
MAP_SDK_OPERATION_VERSION=1.1.4.1
|
||||
# websocket
|
||||
WEBSOCKET_VERSION=1.1.7
|
||||
|
||||
@@ -3,4 +3,5 @@
|
||||
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
</manifest>
|
||||
|
||||
@@ -11,6 +11,7 @@ import static com.zhidao.support.adas.high.chain.AdasChain.CHAIN_SOURCE_ADAS;
|
||||
import static com.zhidao.support.adas.high.chain.AdasChain.CHAIN_TYPE_INIT_STATUS;
|
||||
import static com.zhidao.support.adas.high.chain.AdasChain.CHAIN_TYPE_SOCKET_AUTOPILOT;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.os.SystemClock;
|
||||
@@ -138,6 +139,7 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
*/
|
||||
private SubscribeInterface subscribeInterface;
|
||||
private Timer carConfigReqTimer;//车辆基础信息请求 多次请求防止无法收到基础信息情况出现
|
||||
private Context context;
|
||||
|
||||
public void setOnMultiDeviceListener(OnMultiDeviceListener onMultiDeviceListener) {
|
||||
this.onMultiDeviceListener = onMultiDeviceListener;
|
||||
@@ -169,7 +171,8 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
* @param options
|
||||
* @param onAdasConnectStatusListener
|
||||
*/
|
||||
AdasChannel(AdasOptions options, OnAdasConnectStatusListener onAdasConnectStatusListener) {
|
||||
AdasChannel(Context context, AdasOptions options, OnAdasConnectStatusListener onAdasConnectStatusListener) {
|
||||
this.context = context;
|
||||
this.adasConnectStatusListener = onAdasConnectStatusListener;
|
||||
//配置为null默认是乘客屏幕
|
||||
if (options == null) {
|
||||
@@ -279,7 +282,8 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
nodeAliasCode = CHAIN_CODE_ADAS_INIT,
|
||||
paramIndexes = {-1})
|
||||
private void initSocket() {
|
||||
mSocket = new FpgaSocket();
|
||||
mSocket = new FpgaSocket(context);
|
||||
context = null;
|
||||
mSocket.setWebSocketListener(this);
|
||||
if (isUseQueue) {
|
||||
WebSocketQueueManager.getInstance().registerWebSocketListener(this);
|
||||
|
||||
@@ -103,13 +103,13 @@ public class AdasManager implements IAdasNetCommApi {
|
||||
* @param options 连接参数
|
||||
* @param onAdasConnectStatusListener 连接状态监听
|
||||
*/
|
||||
public synchronized void create(AdasOptions options, OnAdasConnectStatusListener onAdasConnectStatusListener) {
|
||||
public synchronized void create(Context context, AdasOptions options, OnAdasConnectStatusListener onAdasConnectStatusListener) {
|
||||
if (mChannel != null) {
|
||||
mChannel.disconnect();
|
||||
carConfig = null;
|
||||
mChannel = null;
|
||||
}
|
||||
mChannel = new AdasChannel(options, onAdasConnectStatusListener);
|
||||
mChannel = new AdasChannel(context, options, onAdasConnectStatusListener);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,15 @@
|
||||
package com.zhidao.support.adas.high.common;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.Network;
|
||||
import android.net.NetworkRequest;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
@@ -13,15 +23,17 @@ public class ReconnectManager {
|
||||
private final AtomicBoolean isReconnection = new AtomicBoolean(false);//是否正在重连
|
||||
private final OnReconnectListener listener;
|
||||
private volatile Timer timer;
|
||||
private final Context context;
|
||||
private final AtomicBoolean isRegisterNetworkCallback = new AtomicBoolean(false);
|
||||
|
||||
public interface OnReconnectListener {
|
||||
void onReconnection();
|
||||
void onReconnection(String tag);
|
||||
}
|
||||
|
||||
|
||||
public ReconnectManager(OnReconnectListener listener) {
|
||||
public ReconnectManager(Context context, OnReconnectListener listener) {
|
||||
this.context = context;
|
||||
this.listener = listener;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -36,6 +48,12 @@ public class ReconnectManager {
|
||||
if (!isReconnection.get()) {
|
||||
CupidLogUtils.i(TAG, "开始重连");
|
||||
isReconnection.set(true);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
ConnectivityManager connMgr = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
NetworkRequest networkRequest = new NetworkRequest.Builder().build();
|
||||
connMgr.registerNetworkCallback(networkRequest, networkCallback);
|
||||
isRegisterNetworkCallback.set(true);
|
||||
}
|
||||
if (timer == null) {
|
||||
timer = new Timer();
|
||||
timer.schedule(new TimerTask() {
|
||||
@@ -43,7 +61,7 @@ public class ReconnectManager {
|
||||
public void run() {
|
||||
if (isReconnection.get()) {
|
||||
if (listener != null)
|
||||
listener.onReconnection();
|
||||
listener.onReconnection("定时器");
|
||||
}
|
||||
}
|
||||
}, 0, RECONNECT_INTERVAL);//延时
|
||||
@@ -54,11 +72,26 @@ public class ReconnectManager {
|
||||
public synchronized void stop() {
|
||||
CupidLogUtils.i(TAG, "停止重连");
|
||||
isReconnection.set(false);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && isRegisterNetworkCallback.get()) {
|
||||
ConnectivityManager connMgr = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
connMgr.unregisterNetworkCallback(networkCallback);
|
||||
isRegisterNetworkCallback.set(false);
|
||||
}
|
||||
if (timer != null) {
|
||||
timer.cancel();
|
||||
timer = null;
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
private final ConnectivityManager.NetworkCallback networkCallback = new ConnectivityManager.NetworkCallback() {
|
||||
@Override
|
||||
public void onAvailable(@NonNull Network network) {
|
||||
super.onAvailable(network);
|
||||
Log.i(TAG, "网络连接成功");
|
||||
if (listener != null)
|
||||
listener.onReconnection("网络监听");
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import static com.zhidao.support.adas.high.chain.AdasChain.CHAIN_TYPE_INIT_STATU
|
||||
import static com.zhidao.support.adas.high.common.Constants.RESOURCE_PATH;
|
||||
import static com.zhidao.support.adas.high.common.Constants.WS_IP_HOST_HEAD;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.SystemClock;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
@@ -79,11 +80,11 @@ public class FpgaSocket implements IWebSocket {
|
||||
*/
|
||||
private volatile String receiveTimeoutReason = null;
|
||||
|
||||
public FpgaSocket() {
|
||||
init();
|
||||
public FpgaSocket(Context context) {
|
||||
init(context);
|
||||
}
|
||||
|
||||
private void init() {
|
||||
private void init(Context context) {
|
||||
listener = new EchoWebSocketListener();
|
||||
OkHttpClient.Builder okBuilder = new OkHttpClient.Builder();
|
||||
okBuilder.writeTimeout(4, TimeUnit.SECONDS)
|
||||
@@ -96,10 +97,10 @@ public class FpgaSocket implements IWebSocket {
|
||||
onPassiveClose(1001, receiveTimeoutReason);
|
||||
}
|
||||
});
|
||||
reconnectManager = new ReconnectManager(new ReconnectManager.OnReconnectListener() {
|
||||
reconnectManager = new ReconnectManager(context, new ReconnectManager.OnReconnectListener() {
|
||||
@Override
|
||||
public void onReconnection() {
|
||||
connect("重连中");
|
||||
public void onReconnection(String tag) {
|
||||
connect("重连中(" + tag + ")");
|
||||
}
|
||||
});
|
||||
client = okBuilder.build();
|
||||
|
||||
Reference in New Issue
Block a user