[3.3.0] och各端定位频率优化

This commit is contained in:
wangmingjun
2023-06-09 15:05:01 +08:00
committed by zhongchao
parent f5e0399c5b
commit 47396cbe3b
15 changed files with 25 additions and 33 deletions

View File

@@ -29,7 +29,6 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener;
import com.mogo.eagle.core.function.api.telematic.IReceivedMsgListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager;
@@ -351,7 +350,7 @@ public class BusPassengerModel {
IntentManager.getInstance().registerIntentListener(ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener );
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener );
// 定位监听
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG, mMapLocationListener); //todo yakun 优化
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG, 10,mMapLocationListener);
//2021.11.1 自动驾驶路线规划接口
CallerPlanningRottingListenerManager.INSTANCE.addListener(TAG,moGoAutopilotPlanningListener);

View File

@@ -32,7 +32,6 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Liste
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.och.bus.passenger.R;
import com.mogo.och.bus.passenger.callback.IBusPassengerMapViewCallback;
import com.mogo.och.bus.passenger.utils.BusPassengerMapAssetStyleUtil;
import java.util.ArrayList;
@@ -103,7 +102,7 @@ public class BusPassengerMapDirectionView
initAMapView();
// 注册定位监听
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG, this);
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG, 10,this);
}
@Override

View File

@@ -94,8 +94,6 @@ public class OrderModel {
private int backgroundCurrentStationIndex = 0;//A->B 此处值是A站点索引
private static volatile OrderModel sInstance;
public double mLongitude = 0;
public double mLatitude = 0;
private Context mContext;
private final List<BusStationBean> stationList = new ArrayList<>();
private BusRoutesResult busRoutesResult = null;
@@ -153,7 +151,7 @@ public class OrderModel {
mContext = AbsMogoApplication.getApp();
loginService = (LoginService) ARouter.getInstance().build(OchCommonConst.LOGINSERVICE).navigation();
// 定位监听
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG, mMapLocationListener);
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG,10, mMapLocationListener);
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
@@ -382,10 +380,8 @@ public class OrderModel {
@Override
public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) {
if (null == gnssInfo) return;
mLongitude = gnssInfo.getLongitude();
mLatitude = gnssInfo.getLatitude();
if (mControllerStatusCallback != null) {
mControllerStatusCallback.onCarLocationChanged(gnssInfo); //todo mingjun 优化
mControllerStatusCallback.onCarLocationChanged(gnssInfo);
}
//是否到站的围栏判断 离站状态并且自动驾驶还未触发到站
@@ -1113,6 +1109,8 @@ public class OrderModel {
// 车机端上传心跳数据(只在出车状态时上传)
public void runCarHeartbeat() {
double mLatitude = CallerChassisLocationGCJ02ListenerManager.INSTANCE.getChassisLocationGCJ02().getLatitude();
double mLongitude =CallerChassisLocationGCJ02ListenerManager.INSTANCE.getChassisLocationGCJ02().getLongitude();
OrderServiceManager.runCarHeartbeat(mContext, mLongitude, mLatitude,
new OchCommonServiceCallback<BaseData>() {
@Override
@@ -1138,6 +1136,8 @@ public class OrderModel {
// 登出
public void logout() {
double mLatitude = CallerChassisLocationGCJ02ListenerManager.INSTANCE.getChassisLocationGCJ02().getLatitude();
double mLongitude =CallerChassisLocationGCJ02ListenerManager.INSTANCE.getChassisLocationGCJ02().getLongitude();
loginService.loginOut(mLatitude, mLongitude);
}

View File

@@ -110,8 +110,7 @@ class DriverM1Model {
fun init(context: Context) {
mContext = context
// 定位监听
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, mMapLocationListener) //todo mingjun 优化
// CallerChassisLocationGCJ02ListenerManager.setListenerHz(TAG,2)
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 10,mMapLocationListener)
//开启自驾后 异常信息返回
OCHAdasAbilityManager.getInstance().setAdasStartFailureCallback(mAdasStartFailureListener)

View File

@@ -346,7 +346,7 @@ public class BusPassengerModel {
IntentManager.getInstance().registerIntentListener(ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener );
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener );
// 定位监听
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG, mMapLocationListener);
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG, 10,mMapLocationListener);
//2021.11.1 自动驾驶路线规划接口
CallerPlanningRottingListenerManager.INSTANCE.addListener(TAG,moGoAutopilotPlanningListener);

View File

@@ -103,7 +103,7 @@ public class BusPassengerMapDirectionView
initAMapView();
// 注册定位监听
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG, this);
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG, 10,this);
}
@Override

View File

@@ -118,9 +118,8 @@ class PM2DrivingModel private constructor() {
//自动驾驶状态监听
CallerAutoPilotStatusListenerManager.addListener(TAG, mAutoPilotStatusListener)
// 定位监听 //todo yakun 优化
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, mMapLocationListener)
// CallerChassisLocationGCJ02ListenerManager.setListenerHz(TAG,2)//设置2hz, 1s返回2次
// 定位监听
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 10,mMapLocationListener)
//司乘屏通信监听
CallerTelematicListenerManager.addListener(TAG,mReceivedMsgListener)

View File

@@ -163,8 +163,7 @@ public class OrderModel {
mContext = AbsMogoApplication.getApp();
loginService = (LoginService) ARouter.getInstance().build(OchCommonConst.LOGINSERVICE).navigation();
// 定位监听
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG,mMapLocationListener); //todo yakun 优化
// CallerChassisLocationGCJ02ListenerManager.INSTANCE.setListenerHz(TAG,2);//设置5hz, 1s返回一次
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG,10,mMapLocationListener);
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);

View File

@@ -241,7 +241,7 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
IntentManager.getInstance().registerIntentListener( ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener );
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
// 定位监听
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG,mMapLocationListener);
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG,10,mMapLocationListener);
//2021.11.1 自动驾驶路线规划接口
CallerPlanningRottingListenerManager.INSTANCE.addListener(TAG,moGoAutopilotPlanningListener);

View File

@@ -104,7 +104,7 @@ public class TaxiPassengerMapDirectionView
initAMapView();
// 注册定位监听
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG, this);
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG, 10,this);
}
@Override

View File

@@ -223,7 +223,7 @@ public class TaxiModel {
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
//定位监听, 传false是高德坐标系
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG,mMapLocationLIstener); //todo mingjun 优化
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG,10,mMapLocationLIstener);
//2021.11.1 自动驾驶路线规划接口
CallerPlanningRottingListenerManager.INSTANCE.addListener(TAG, moGoAutopilotPlanningListener);

View File

@@ -329,7 +329,6 @@ public class TaxiPresenter extends Presenter<TaxiFragment> implements ITaxiADASS
if (null != location){
runOnUIThread(() -> {
mView.updateSpeedView((float) location.getGnssSpeed());
mView.updateLocation(location.getLatitude(),location.getLongitude());
});
}
}

View File

@@ -20,6 +20,7 @@ import com.amap.api.navi.model.NaviLatLng;
import com.mogo.eagle.core.data.map.CenterLine;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager;
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.DateTimeUtils;
@@ -344,8 +345,12 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment
private void startNaviToStation(boolean isVoicePlay, double stationLat, double stationLng) {
AmapNaviToDestinationModel.getInstance(getContext()).destroyAmaNavi();
CallerLogger.INSTANCE.d(M_TAXI + TAG, "currentLatLng=" + mTaxiFragment.mCurLatitude + " " + mTaxiFragment.mCurLongitude);
NaviLatLng startNaviLatLng = new NaviLatLng(mTaxiFragment.mCurLatitude, mTaxiFragment.mCurLongitude); //todo mingjun 优化
double mCurLatitude = CallerChassisLocationGCJ02ListenerManager.INSTANCE.getChassisLocationGCJ02().getLatitude();
double mCurLongitude =CallerChassisLocationGCJ02ListenerManager.INSTANCE.getChassisLocationGCJ02().getLongitude();
CallerLogger.INSTANCE.d(M_TAXI + TAG, "currentLatLng=" + mCurLatitude + " " +mCurLongitude);
NaviLatLng startNaviLatLng = new NaviLatLng(mCurLatitude, mCurLongitude); //todo mingjun 优化
NaviLatLng endNaviLatLng = new NaviLatLng(stationLat, stationLng);
AmapNaviToDestinationModel.getInstance(getContext()).initAMapNavi(startNaviLatLng, endNaviLatLng);
AmapNaviToDestinationModel.getInstance(getContext()).setVoiceIsMute(isVoicePlay);

View File

@@ -61,8 +61,6 @@ public class TaxiFragment extends BaseTaxiTabFragment<TaxiFragment, TaxiPresente
private TaxiGrabOrderFragment grabOrderFragment;
private TaxiServerOrdersFragment serverOrdersFragment;
private WeakReference<TaxiPersonalDialogFragment> personalDialogFragment = null;
protected double mCurLatitude = 0.0;
protected double mCurLongitude = 0.0;
private LoginService loginService;
@Override
@@ -342,11 +340,6 @@ public class TaxiFragment extends BaseTaxiTabFragment<TaxiFragment, TaxiPresente
serverOrdersFragment.onCurrentOrderDistToEndChanged(meters, timeInSecond);
}
public void updateLocation(double latitude, double longitude) {
this.mCurLatitude = latitude;
this.mCurLongitude = longitude;
}
/**
* 订单流转debug START
*/

View File

@@ -98,7 +98,7 @@ public class TaxiMapDirectionView
initAMapView();
// 注册定位监听
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG, this);
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG, 10,this);
}
@Override