[3.3.0]merge
This commit is contained in:
@@ -351,7 +351,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, mMapLocationListener); //todo yakun 优化
|
||||
|
||||
//2021.11.1 自动驾驶路线规划接口
|
||||
CallerPlanningRottingListenerManager.INSTANCE.addListener(TAG,moGoAutopilotPlanningListener);
|
||||
@@ -430,14 +430,11 @@ public class BusPassengerModel {
|
||||
}
|
||||
};
|
||||
|
||||
private final IMoGoChassisLocationGCJ02Listener mMapLocationListener = new IMoGoChassisLocationGCJ02Listener() {
|
||||
@Override
|
||||
public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) {
|
||||
if (null == gnssInfo) return;
|
||||
mLocation = gnssInfo;
|
||||
for (IBusPassengerControllerStatusCallback callback :mControllerStatusCallbackMap.values()){
|
||||
callback.onCarLocationChanged(gnssInfo);
|
||||
}
|
||||
private final IMoGoChassisLocationGCJ02Listener mMapLocationListener = gnssInfo -> {
|
||||
if (null == gnssInfo) return;
|
||||
mLocation = gnssInfo;
|
||||
for (IBusPassengerControllerStatusCallback callback :mControllerStatusCallbackMap.values()){
|
||||
callback.onCarLocationChanged(gnssInfo);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -385,7 +385,7 @@ public class OrderModel {
|
||||
mLongitude = gnssInfo.getLongitude();
|
||||
mLatitude = gnssInfo.getLatitude();
|
||||
if (mControllerStatusCallback != null) {
|
||||
mControllerStatusCallback.onCarLocationChanged(gnssInfo);
|
||||
mControllerStatusCallback.onCarLocationChanged(gnssInfo); //todo mingjun 优化
|
||||
}
|
||||
|
||||
//是否到站的围栏判断 离站状态并且自动驾驶还未触发到站
|
||||
|
||||
@@ -110,7 +110,7 @@ class DriverM1Model {
|
||||
fun init(context: Context) {
|
||||
mContext = context
|
||||
// 定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, mMapLocationListener)
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, mMapLocationListener) //todo mingjun 优化
|
||||
// CallerChassisLocationGCJ02ListenerManager.setListenerHz(TAG,2)
|
||||
|
||||
//开启自驾后 异常信息返回
|
||||
|
||||
@@ -118,7 +118,7 @@ class PM2DrivingModel private constructor() {
|
||||
//自动驾驶状态监听
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, mAutoPilotStatusListener)
|
||||
|
||||
// 定位监听
|
||||
// 定位监听 //todo yakun 优化
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, mMapLocationListener)
|
||||
// CallerChassisLocationGCJ02ListenerManager.setListenerHz(TAG,2)//设置2hz, 1s返回2次
|
||||
|
||||
|
||||
@@ -163,7 +163,7 @@ public class OrderModel {
|
||||
mContext = AbsMogoApplication.getApp();
|
||||
loginService = (LoginService) ARouter.getInstance().build(OchCommonConst.LOGINSERVICE).navigation();
|
||||
// 定位监听
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG,mMapLocationListener);
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG,mMapLocationListener); //todo yakun 优化
|
||||
// CallerChassisLocationGCJ02ListenerManager.INSTANCE.setListenerHz(TAG,2);//设置5hz, 1s返回一次
|
||||
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
|
||||
@@ -477,7 +477,7 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
|
||||
// 自车定位
|
||||
private final IMoGoChassisLocationGCJ02Listener mMapLocationListener = new IMoGoChassisLocationGCJ02Listener() {
|
||||
@Override
|
||||
public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) {
|
||||
public void onChassisLocationGCJ02(@Nullable MogoLocation gnssInfo) { //todo mingjun 优化
|
||||
//位置变化时,通过围栏判断是否到达x点
|
||||
if (null == gnssInfo) return;
|
||||
if (checkCurrentOCHOrder()) {
|
||||
|
||||
@@ -223,7 +223,7 @@ public class TaxiModel {
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.VR_MODE, mMogoStatusChangedListener);
|
||||
|
||||
//定位监听, 传false是高德坐标系
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG,mMapLocationLIstener);
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG,mMapLocationLIstener); //todo mingjun 优化
|
||||
|
||||
//2021.11.1 自动驾驶路线规划接口
|
||||
CallerPlanningRottingListenerManager.INSTANCE.addListener(TAG, moGoAutopilotPlanningListener);
|
||||
|
||||
@@ -345,7 +345,7 @@ 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);
|
||||
NaviLatLng startNaviLatLng = new NaviLatLng(mTaxiFragment.mCurLatitude, mTaxiFragment.mCurLongitude); //todo mingjun 优化
|
||||
NaviLatLng endNaviLatLng = new NaviLatLng(stationLat, stationLng);
|
||||
AmapNaviToDestinationModel.getInstance(getContext()).initAMapNavi(startNaviLatLng, endNaviLatLng);
|
||||
AmapNaviToDestinationModel.getInstance(getContext()).setVoiceIsMute(isVoicePlay);
|
||||
|
||||
@@ -36,7 +36,7 @@ import com.zhjt.mogo.adas.data.bean.MogoReport
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import mogo_msg.MogoReportMsg
|
||||
|
||||
|
||||
//todo emArrow 添加biz链路日志
|
||||
//负责监听自动驾驶状态并进行状态上报,自动驾驶路线上报,接收调度指令展示指令弹窗
|
||||
class DispatchAutoPilotManager private constructor() :
|
||||
IMogoOnMessageListener<DispatchAdasAutoPilotLocReceiverBean>,
|
||||
|
||||
@@ -10,20 +10,23 @@ import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
|
||||
import com.mogo.eagle.core.data.autopilot.toAutoPilotLine
|
||||
import com.mogo.eagle.core.data.autopilot.toRouteInfo
|
||||
import com.mogo.eagle.core.data.deva.badcase.BagManagerEntity
|
||||
import com.mogo.eagle.core.data.biz.trafficlight.TrafficLightResult
|
||||
import com.mogo.eagle.core.data.biz.trafficlight.toTrafficLightDetail
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.constants.MoGoConfig
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.data.deva.badcase.BagManagerEntity
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_CODE_MULTI_CONNECT
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_SOURCE_ADAS
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_TYPE_INIT_STATUS
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_TYPE_SOCKET_AUTOPILOT
|
||||
import com.mogo.eagle.core.data.biz.trafficlight.TrafficLightResult
|
||||
import com.mogo.eagle.core.data.biz.trafficlight.toTrafficLightDetail
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarConfigListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotControlProvider
|
||||
import com.mogo.eagle.core.function.api.map.collect.IMoGoMapDataCollectProvider
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarConfigListenerManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapDataCollectorManager
|
||||
import com.mogo.eagle.core.function.datacenter.autopilot.adapter.MoGoAdasListenerImpl
|
||||
import com.mogo.eagle.core.function.datacenter.autopilot.adapter.MoGoAdasMsgConnectStatusListenerImpl
|
||||
import com.mogo.eagle.core.function.datacenter.autopilot.server.AsyncDataToAutopilotServer
|
||||
@@ -342,8 +345,10 @@ class MoGoAutopilotControlProvider :
|
||||
@ChainLog(
|
||||
linkChainLog = CHAIN_TYPE_SOCKET_AUTOPILOT,
|
||||
linkCode = CHAIN_SOURCE_ADAS,
|
||||
parentNodeAliasCode = ChainConstant.CHAIN_CODE_EAGLE_START_AUTOPILOT,
|
||||
nodeAliasCode = ChainConstant.CHAIN_CODE_EAGLE_START_AUTOPILOT_RESULT,
|
||||
paramIndexes = [0]
|
||||
|
||||
)
|
||||
private fun invokeAutoPilotResult(status: String) {
|
||||
CallerLogger.e("$M_ADAS_IMPL$TAG", status)
|
||||
@@ -528,9 +533,9 @@ class MoGoAutopilotControlProvider :
|
||||
* @return boolean
|
||||
*/
|
||||
override fun sendDetouring(isEnable: Boolean): Boolean {
|
||||
return if(isEnable){
|
||||
return if (isEnable) {
|
||||
AdasManager.getInstance().sendDetouring(1)
|
||||
}else{
|
||||
} else {
|
||||
AdasManager.getInstance().sendDetouring(0)
|
||||
}
|
||||
}
|
||||
@@ -551,9 +556,9 @@ class MoGoAutopilotControlProvider :
|
||||
* @return boolean
|
||||
*/
|
||||
override fun sendWeakNetSlowDown(isEnable: Boolean): Boolean {
|
||||
return if(isEnable){
|
||||
return if (isEnable) {
|
||||
AdasManager.getInstance().sendWeakNetSlowDown(1)
|
||||
}else{
|
||||
} else {
|
||||
AdasManager.getInstance().sendWeakNetSlowDown(0)
|
||||
}
|
||||
}
|
||||
@@ -565,7 +570,7 @@ class MoGoAutopilotControlProvider :
|
||||
* @return boolean
|
||||
*/
|
||||
override fun sendGetAllParamReq(): Boolean {
|
||||
return AdasManager.getInstance().sendGetAllParamReq()
|
||||
return AdasManager.getInstance().sendGetAllParamReq()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -615,7 +620,7 @@ class MoGoAutopilotControlProvider :
|
||||
bagManager.descReq = descReq.build()
|
||||
|
||||
// 空间使用信息,获取响应且reqType=1时有效
|
||||
for(diskSpaceInfoEntity in bagManagerEntity.spaceInfoResp){
|
||||
for (diskSpaceInfoEntity in bagManagerEntity.spaceInfoResp) {
|
||||
val spaceInfoResp = BagManagerOuterClass.BagSpaceInfo
|
||||
.newBuilder()
|
||||
val diskSpaceInfo = BagManagerOuterClass.SpaceInfo
|
||||
@@ -627,7 +632,7 @@ class MoGoAutopilotControlProvider :
|
||||
.build()
|
||||
spaceInfoResp
|
||||
.setHost(diskSpaceInfoEntity.host).diskSpaceInfo = diskSpaceInfo
|
||||
for(entity in diskSpaceInfoEntity.BagDirsSpaceInfo){
|
||||
for (entity in diskSpaceInfoEntity.BagDirsSpaceInfo) {
|
||||
val bagDirsSpaceInfo = BagManagerOuterClass.SpaceInfo
|
||||
.newBuilder()
|
||||
.setDirectory(entity.directory)
|
||||
@@ -641,8 +646,8 @@ class MoGoAutopilotControlProvider :
|
||||
}
|
||||
|
||||
// 包信息列表,获取响应且reqType=2时有效
|
||||
for(bagsInfoRespEntity in bagManagerEntity.bagsInfoResp){
|
||||
if(bagsInfoRespEntity.itemType == 0){
|
||||
for (bagsInfoRespEntity in bagManagerEntity.bagsInfoResp) {
|
||||
if (bagsInfoRespEntity.itemType == 0) {
|
||||
// 包描述信息
|
||||
val bagDescription = BagManagerOuterClass.BagDescription
|
||||
.newBuilder()
|
||||
@@ -664,7 +669,7 @@ class MoGoAutopilotControlProvider :
|
||||
.setDescription(bagDescription.build())
|
||||
|
||||
// 子包信息
|
||||
for(subBagEntity in bagsInfoRespEntity.subBags){
|
||||
for (subBagEntity in bagsInfoRespEntity.subBags) {
|
||||
val subBag = BagManagerOuterClass.SubBag
|
||||
.newBuilder()
|
||||
.setKey(subBagEntity.key)
|
||||
@@ -850,15 +855,18 @@ class MoGoAutopilotControlProvider :
|
||||
}
|
||||
msgHandler.synMsgToAllClients()
|
||||
} else {// 乘客屏
|
||||
CallerDevaToolsManager.getBindingCarInfo( carConfigResp.macAddress, MoGoAiCloudClientConfig.getInstance().sn)
|
||||
CallerDevaToolsManager.getBindingCarInfo(
|
||||
carConfigResp.macAddress,
|
||||
MoGoAiCloudClientConfig.getInstance().sn
|
||||
)
|
||||
invokeNettyConnResult("乘客屏车牌号:${carConfigResp.plateNumber},Mac地址为:${carConfigResp.macAddress}")
|
||||
}
|
||||
|
||||
if(carConfigResp.dockVersion.isNotEmpty()){
|
||||
if(carConfigResp.dockVersion.contains("taxi")){
|
||||
if (carConfigResp.dockVersion.isNotEmpty()) {
|
||||
if (carConfigResp.dockVersion.contains("taxi")) {
|
||||
//修改雨天模式开关默认状态为开启(仅针对taxi320及以上的版本)-sop 215
|
||||
val num = ParseVersionUtils.parseVersion(true,carConfigResp.dockVersion)
|
||||
if(num >= 30200){
|
||||
val num = ParseVersionUtils.parseVersion(true, carConfigResp.dockVersion)
|
||||
if (num >= 30200) {
|
||||
FunctionBuildConfig.isRainMode = true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.mogo.eagle.core.function.datacenter.location
|
||||
|
||||
import android.util.Log
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
@@ -52,6 +53,7 @@ object MoGoLocationDispatcher :
|
||||
|
||||
override fun onChassisGnss(gnssInfo: MessagePad.GnssInfo) {
|
||||
// 更新GNSS 信息
|
||||
Log.d("emArrow","高精 heading:${gnssInfo.heading}")
|
||||
lastGnssLocation.gnssInfo = gnssInfo
|
||||
lastGnssLocation.lastReceiveTime = TimeUtils.getNowMills()
|
||||
// 将高德中的一些用于业务的数据进行融合,例如:CityCode、address等
|
||||
@@ -102,7 +104,7 @@ object MoGoLocationDispatcher :
|
||||
override fun onMoGoLocationChanged(mogoLocation: MogoLocation) {
|
||||
// 更新GaoDe 信息
|
||||
lastGaoDeLocation = mogoLocation
|
||||
|
||||
Log.d("emArrow","高德 heading:${mogoLocation.heading}")
|
||||
// 计算最后一次工控机同步的定位是否超时,如果超时则切换为高德地图定位,暂定超过30秒需要切换
|
||||
if (1 == FunctionBuildConfig.gpsProvider) {
|
||||
if (TimeUtils.getNowMills() - lastGnssLocation.lastReceiveTime > 10000) {
|
||||
|
||||
@@ -241,7 +241,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
// 开启定时查询速度
|
||||
isRunCheck = true
|
||||
Timer().schedule(timerTaskRefresh, Date(), 300)
|
||||
Timer().schedule(timerTaskRefresh, Date(), 500)
|
||||
if (AppConfigInfo.isConnectAutopilot && (AppConfigInfo.plateNumber.isNullOrEmpty() || AppConfigInfo.iPCMacAddress.isNullOrEmpty())) {
|
||||
//查询工控机基础配置信息
|
||||
CallerAutoPilotControlManager.getCarConfig()
|
||||
@@ -1909,7 +1909,7 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
if (accelerationList.size > 9) {
|
||||
accelerationList.removeLast()
|
||||
}
|
||||
gnssInfo?.acceleration?.let {
|
||||
gnssInfo.acceleration.let {
|
||||
if (accelerationList.isEmpty()) {
|
||||
accelerationList.add(
|
||||
AccelerationEntity(
|
||||
@@ -2011,7 +2011,6 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 车辆方向盘转向角回调
|
||||
* @param steering 方向盘转向角
|
||||
@@ -2032,36 +2031,6 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 车辆加速度
|
||||
*/
|
||||
override fun onAutopilotAcc(carAcc: Float) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 油门
|
||||
*/
|
||||
override fun onAutopilotThrottle(throttle: Float) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 刹车
|
||||
*/
|
||||
override fun onAutopilotBrake(brake: Float) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 清扫车(福田)清扫控制系统状态
|
||||
*/
|
||||
override fun onSweeperFutianCleanSystemState(cleanSystemState: ChassisStatesOuterClass.SweeperFuTianTaskSystemStates) {
|
||||
|
||||
}
|
||||
override fun onSweeperFutianTaskIndexData(roboSweeperTaskIndex: RoboSweeperTaskIndexOuterClass.RoboSweeperTaskIndex) {
|
||||
|
||||
}
|
||||
/**
|
||||
* 吐司提示
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.widget;
|
||||
|
||||
import static com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING;
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
@@ -152,11 +153,11 @@ public class TrafficDataView extends ConstraintLayout implements
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotSteeringData(float steering) {
|
||||
CallerLogger.INSTANCE.d(TAG, "steering原始值====" + steering);
|
||||
CallerLogger.INSTANCE.d(M_HMI +TAG, "steering原始值====" + steering);
|
||||
if (Math.abs(steering) < 1) {
|
||||
steering = 0;
|
||||
}
|
||||
CallerLogger.INSTANCE.d(TAG, "steering忽略小数点后====" + (int) steering);
|
||||
CallerLogger.INSTANCE.d(M_HMI +TAG, "steering忽略小数点后====" + (int) steering);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -165,7 +166,7 @@ public class TrafficDataView extends ConstraintLayout implements
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotGearData(@NotNull Chassis.GearPosition gear) {
|
||||
CallerLogger.INSTANCE.d(TAG, "司机屏档位" + gear.toString());
|
||||
CallerLogger.INSTANCE.d(M_HMI +TAG, "司机屏档位" + gear);
|
||||
ThreadUtils.runOnUiThread(() -> {
|
||||
if (tapPositionView != null) {
|
||||
tapPositionView.updateWithGear(gear);
|
||||
@@ -175,13 +176,13 @@ public class TrafficDataView extends ConstraintLayout implements
|
||||
|
||||
@Override
|
||||
public void onAutopilotBrake(float brake) {
|
||||
CallerLogger.INSTANCE.d(TAG, "刹车:" + brake);
|
||||
CallerLogger.INSTANCE.d(M_HMI +TAG, "刹车:" + brake);
|
||||
mBrake = brake;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotThrottle(float throttle) {
|
||||
CallerLogger.INSTANCE.d(TAG, "油门:" + throttle);
|
||||
CallerLogger.INSTANCE.d(M_HMI +TAG, "油门:" + throttle);
|
||||
mThrottle = throttle;
|
||||
}
|
||||
/**
|
||||
|
||||
@@ -10,11 +10,11 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
|
||||
import com.mogo.eagle.core.function.api.map.collect.IMoGoMapDataCollectProvider
|
||||
import com.mogo.eagle.core.function.business.cachemap.CacheHDMapManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MAP
|
||||
import com.zhidaoauto.map.operational.open.GatherApi
|
||||
@@ -27,7 +27,7 @@ import java.util.concurrent.atomic.AtomicReference
|
||||
|
||||
@Route(path = MogoServicePaths.PATH_MAP_DATA_COLLECT_PROVIDER)
|
||||
class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener,
|
||||
IMoGoChassisLocationGCJ02Listener, IMoGoTokenCallback,
|
||||
IMoGoChassisLocationWGS84Listener, IMoGoTokenCallback,
|
||||
IMoGoAutopilotRecordListener {
|
||||
|
||||
companion object {
|
||||
@@ -53,7 +53,7 @@ class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener,
|
||||
|
||||
override fun init(context: Context?) {
|
||||
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, this)
|
||||
CallerChassisLocationWGS84ListenerManager.addListener(TAG, this)
|
||||
CallerAutopilotRecordListenerManager.addListener(TAG, this)
|
||||
|
||||
executor.set(context?.let {
|
||||
@@ -79,7 +79,7 @@ class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener,
|
||||
|
||||
override fun onDestroy() {
|
||||
CallerLogger.d("$M_MAP$TAG", "--------- onDestroy --------")
|
||||
CallerChassisLocationGCJ02ListenerManager.removeListener(TAG)
|
||||
CallerChassisLocationWGS84ListenerManager.removeListener(TAG)
|
||||
CallerAutopilotRecordListenerManager.removeListener(TAG)
|
||||
executor.get()?.setOnTaskListener(null)
|
||||
listeners.clear()
|
||||
@@ -181,15 +181,18 @@ class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener,
|
||||
}
|
||||
}
|
||||
|
||||
override fun onChassisLocationGCJ02(gnssInfo: MogoLocation?) {
|
||||
if (gnssInfo != null) {
|
||||
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
|
||||
if (gnssInfo.gnssInfo != null
|
||||
&& gnssInfo.gnssInfo.longitude != 0.0
|
||||
&& gnssInfo.gnssInfo.latitude != 0.0
|
||||
) {
|
||||
executor.get()?.updateLocation(
|
||||
gnssInfo.longitude,
|
||||
gnssInfo.latitude,
|
||||
gnssInfo.altitude,
|
||||
gnssInfo.heading.toFloat(),
|
||||
gnssInfo.gnssSpeed,
|
||||
false
|
||||
gnssInfo.gnssInfo.longitude,
|
||||
gnssInfo.gnssInfo.latitude,
|
||||
gnssInfo.gnssInfo.altitude,
|
||||
gnssInfo.gnssInfo.heading.toFloat(),
|
||||
gnssInfo.gnssInfo.gnssSpeed.toFloat(),
|
||||
true
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -225,4 +228,5 @@ class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener,
|
||||
object START : Status() //开始状态
|
||||
object FINISH : Status() //完成状态
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,6 +8,6 @@ interface IMoGoChassisAccStateListener {
|
||||
/**
|
||||
* 车辆加速度
|
||||
*/
|
||||
fun onAutopilotAcc(carAcc: Float)
|
||||
fun onAutopilotAcc(carAcc: Float){}
|
||||
|
||||
}
|
||||
@@ -8,5 +8,5 @@ interface IMoGoChassisBrakeStateListener {
|
||||
/**
|
||||
* 刹车
|
||||
*/
|
||||
fun onAutopilotBrake(brake: Float)
|
||||
fun onAutopilotBrake(brake: Float){}
|
||||
}
|
||||
@@ -8,5 +8,5 @@ interface IMoGoChassisThrottleStateListener {
|
||||
/**
|
||||
* 油门
|
||||
*/
|
||||
fun onAutopilotThrottle(throttle: Float)
|
||||
fun onAutopilotThrottle(throttle: Float){}
|
||||
}
|
||||
@@ -10,11 +10,10 @@ interface IMoGoSweeperFutianCleanSystemListener {
|
||||
/**
|
||||
* 清扫车(福田)清扫控制系统状态
|
||||
*/
|
||||
fun onSweeperFutianCleanSystemState(cleanSystemState: ChassisStatesOuterClass.SweeperFuTianTaskSystemStates)
|
||||
|
||||
fun onSweeperFutianCleanSystemState(cleanSystemState: ChassisStatesOuterClass.SweeperFuTianTaskSystemStates){}
|
||||
|
||||
/**
|
||||
* 清扫车(福田)指标数据 贴边数据
|
||||
*/
|
||||
fun onSweeperFutianTaskIndexData(roboSweeperTaskIndex: RoboSweeperTaskIndexOuterClass.RoboSweeperTaskIndex)
|
||||
fun onSweeperFutianTaskIndexData(roboSweeperTaskIndex: RoboSweeperTaskIndexOuterClass.RoboSweeperTaskIndex){}
|
||||
}
|
||||
@@ -69,7 +69,8 @@ object CallerAutoPilotControlManager {
|
||||
linkChainLog = CHAIN_TYPE_SOCKET_AUTOPILOT,
|
||||
linkCode = CHAIN_SOURCE_ADAS,
|
||||
nodeAliasCode = CHAIN_CODE_EAGLE_START_AUTOPILOT,
|
||||
paramIndexes = [0]
|
||||
paramIndexes = [0],
|
||||
endPoint = false
|
||||
)
|
||||
fun startAutoPilot(controlParameters: AutopilotControlParameters?) {
|
||||
if (controlParameters == null) {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.mogo.eagle.core.function.call.autopilot
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||
@@ -109,11 +108,6 @@ object CallerChassisLocationGCJ02ListenerManager : CallerBase<IMoGoChassisLocati
|
||||
M_LISTENERS_HZ_LAST_SEND_TIME[tag] = TimeUtils.getNowMills()
|
||||
val listener = it.value
|
||||
listener.onChassisLocationGCJ02(mogoLocation)
|
||||
// FileUtils.writeToFile(
|
||||
// "/sdcard/Download/",
|
||||
// "location_gcj02.txt",
|
||||
// "${mogoLocation.longitude},${mogoLocation.latitude},${sourceType}\n"
|
||||
// )
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -94,11 +94,6 @@ object CallerChassisLocationWGS84ListenerManager : CallerBase<IMoGoChassisLocati
|
||||
M_LISTENERS_HZ_LAST_SEND_TIME[tag] = TimeUtils.getNowMills()
|
||||
val listener = it.value
|
||||
listener.onChassisLocationWGS84(mogoLocation)
|
||||
// FileUtils.writeToFile(
|
||||
// "/sdcard/Download/",
|
||||
// "location_wgs84.txt",
|
||||
// "${mogoLocation.longitude},${mogoLocation.latitude},${sourceType}\n"
|
||||
// )
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,20 +2,32 @@ package com.mogo.eagle.core.function.call.autopilot
|
||||
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisSteeringStateListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
/**
|
||||
* 车辆方向盘转向角 回调监听
|
||||
*/
|
||||
object CallerChassisSteeringStateListenerManager : CallerBase<IMoGoChassisSteeringStateListener>() {
|
||||
|
||||
//todo emArrow 总结
|
||||
private var steering: Float? by Delegates.observable(0.0f) { _, oldValue, newValue ->
|
||||
if (newValue == null) {
|
||||
return@observable
|
||||
}
|
||||
if (oldValue == newValue) {
|
||||
return@observable
|
||||
}
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.onAutopilotSteeringData(newValue)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 车辆方向盘转向角回调
|
||||
* @param steering 方向盘转向角
|
||||
*/
|
||||
fun invokeAutopilotSteeringData(steering: Float){
|
||||
M_LISTENERS.forEach{
|
||||
val listener = it.value
|
||||
listener.onAutopilotSteeringData(steering)
|
||||
}
|
||||
fun invokeAutopilotSteeringData(steering: Float) {
|
||||
this.steering = steering
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,6 @@ import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.commons.module.intent.IntentManager;
|
||||
|
||||
@@ -46,11 +45,9 @@ public class MogoReceiver extends BroadcastReceiver {
|
||||
if (TextUtils.equals(VOICE_ACTION, action)) {
|
||||
String cmd = intent.getStringExtra(PARAM_COMMAND);
|
||||
if (!TextUtils.isEmpty(cmd)) {
|
||||
Log.i("emArrow","MogoReceiver cmd:" + cmd);
|
||||
mMogoIntentManager.invoke(cmd, intent);
|
||||
}
|
||||
} else {
|
||||
Log.i("emArrow","MogoReceiver action:" + action);
|
||||
mMogoIntentManager.invoke(action, intent);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user