Merge branch 'dev_robotaxi-d-app-module_251_220125_2.5.1' into dev_MogoAP_eagle-220_211207_8.0.17_merge

This commit is contained in:
donghongyu
2022-02-24 18:40:49 +08:00
12 changed files with 102 additions and 46 deletions

View File

@@ -29,6 +29,7 @@ import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
import com.mogo.eagle.core.function.call.check.CallerCheckManager
import com.mogo.eagle.core.function.call.map.CallerMapDataCollectorManager
import com.mogo.eagle.core.function.call.monitor.CallerMonitorManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.function.hmi.WaringConst
@@ -285,6 +286,9 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
}
}
}
if (record.type == 2 && (record.stat == 101 || record.stat == 100)) {
CallerMapDataCollectorManager.finish(record.id, record.stat, "", record.fileName ?: "", record.note ?: "")
}
}
override fun onDestroyView() {

View File

@@ -64,12 +64,14 @@ class SpeedPanelView @JvmOverloads constructor(
private val timerTask = object : TimerTask() {
override fun run() {
if (mLatLng != null) {
mSpeedLimmit = mMogoServiceApis.mapServiceApi.mapUIController.getSpeedLimmit(mLatLng!!.longitude, mLatLng!!.latitude, mLatLng!!.bearing)
UiThreadHandler.post {
val speed = (mLatLng!!.speed * 3.6f).toInt()
mSpeedChartView.setArcColor(Color.parseColor(if (speed > mSpeedLimmit) "#DB3137" else "#3E77F6"))
mSpeedChartView.setValues(speed)
setBackgroundResource(if (speed > mSpeedLimmit) R.drawable.yi_biao_pan_bg_speeding else R.drawable.yi_biao_pan_bg_nor)
if (mMogoServiceApis.mapServiceApi != null && mMogoServiceApis.mapServiceApi.mapUIController != null) {
mSpeedLimmit = mMogoServiceApis.mapServiceApi.mapUIController.getSpeedLimmit(mLatLng!!.longitude, mLatLng!!.latitude, mLatLng!!.bearing)
UiThreadHandler.post {
val speed = (mLatLng!!.speed * 3.6f).toInt()
mSpeedChartView.setArcColor(Color.parseColor(if (speed > mSpeedLimmit) "#DB3137" else "#3E77F6"))
mSpeedChartView.setValues(speed)
setBackgroundResource(if (speed > mSpeedLimmit) R.drawable.yi_biao_pan_bg_speeding else R.drawable.yi_biao_pan_bg_nor)
}
}
}
}

View File

@@ -6,14 +6,17 @@ import com.alibaba.android.arouter.facade.annotation.Route
import com.mogo.cloud.passport.IMoGoTokenCallback
import com.mogo.cloud.passport.MoGoAiCloudClient
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.commons.debug.DebugConfig
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.map.collect.IMoGoMapDataCollectProvider
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
import com.zhidaoauto.map.operational.MapCollectionTaskRecive
import com.zhidaoauto.map.operational.abs.OnTaskListener
import com.zhidaoauto.map.operational.open.GatherApi
import com.zhidaoauto.map.operational.open.GatherParams
import com.zhidaoauto.map.operational.open.GatherParams.Companion
import com.zhidaoauto.map.operational.open.abs.OnTaskListener
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.CopyOnWriteArrayList
import java.util.concurrent.atomic.AtomicReference
@@ -26,7 +29,7 @@ class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener,
}
private val executor by lazy {
AtomicReference<MapCollectionTaskRecive?>(null)
AtomicReference<GatherApi>(null)
}
private val listeners by lazy {
@@ -39,9 +42,18 @@ class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener,
override val functionName: String = TAG
@Volatile
private var hasInit = false
override fun init(context: Context?) {
CallerMapLocationListenerManager.addListener(functionName, this)
executor.set(context?.let { MapCollectionTaskRecive(it) })
executor.set(context?.let {
GatherApi.also { itx ->
itx.init(it,
GatherParams.init()
.setDebugMode(DebugConfig.isDebug())
.setCoordinateType(GatherParams.COORDINATETYPE_GCJ02))
} })
executor.get()?.setOnTaskListener(this)
val carSn = MoGoAiCloudClientConfig.getInstance().sn
if (!TextUtils.isEmpty(carSn)) {
@@ -55,10 +67,7 @@ class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener,
override fun onDestroy() {
CallerMapLocationListenerManager.removeListener(TAG)
Logger.d(TAG, "--------- onDestroy --------")
executor.get()?.let {
it.setOnTaskListener(null)
it.destory()
}
executor.get()?.setOnTaskListener(null)
listeners.clear()
map.clear()
}
@@ -129,10 +138,19 @@ class MoGoMapDataCollectProvider : IMoGoMapDataCollectProvider, OnTaskListener,
map[id] = Status.START
}
override fun setIsInit() {
if (!hasInit) {
executor.get()?.also {
hasInit = true
Logger.d(TAG, "告之地图sdk定义数据可以用了")
it.setIsInit()
}
}
}
override fun onLocationChanged(location: MogoLocation?) {
location ?: return
executor.get()?.onMapChange(
executor.get()?.updateLocation(
location.longitude,
location.latitude,
location.bearing,

View File

@@ -67,12 +67,16 @@ public class SmallMapFragment extends BaseFragment
@Override
public void showPanel() {
mSmallMapDirectionView.setVisibility(View.VISIBLE);
if (mSmallMapDirectionView != null) {
mSmallMapDirectionView.setVisibility(View.VISIBLE);
}
}
@Override
public void hidePanel() {
mSmallMapDirectionView.setVisibility(View.GONE);
if (mSmallMapDirectionView != null) {
mSmallMapDirectionView.setVisibility(View.GONE);
}
}
@Override
@@ -103,20 +107,26 @@ public class SmallMapFragment extends BaseFragment
@Override
public void onResume() {
super.onResume();
mSmallMapDirectionView.onResume();
if (mSmallMapDirectionView != null) {
mSmallMapDirectionView.onResume();
}
}
@Override
public void onPause() {
super.onPause();
mSmallMapDirectionView.onPause();
if (mSmallMapDirectionView != null) {
mSmallMapDirectionView.onPause();
}
}
@Override
public void onDestroy() {
super.onDestroy();
mSmallMapDirectionView.onDestroy();
if (mSmallMapDirectionView != null) {
mSmallMapDirectionView.onDestroy();
}
CallerAutopilotPlanningListenerManager.INSTANCE.removeListener(TAG);
}

View File

@@ -32,15 +32,17 @@ public class SpeedLimitDataManager implements IMogoCarLocationChangedListener2 {
@Override
public void run() {
if (mLocation != null){
int speedLimmit = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController().getSpeedLimmit(mLocation.getLongitude(),mLocation.getLatitude(),mLocation.getBearing());
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if (speedLimmit > 0){
CallerHmiManager.INSTANCE.showLimitingVelocity(speedLimmit);
if (MogoApisHandler.getInstance().getApis().getMapServiceApi() != null && MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController() != null) {
int speedLimmit = MogoApisHandler.getInstance().getApis().getMapServiceApi().getMapUIController().getSpeedLimmit(mLocation.getLongitude(), mLocation.getLatitude(), mLocation.getBearing());
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
if (speedLimmit > 0) {
CallerHmiManager.INSTANCE.showLimitingVelocity(speedLimmit);
}
}
}
});
});
}
}
}
};

View File

@@ -19,6 +19,11 @@ interface IMoGoMapDataCollectProvider: IMoGoFunctionServerProvider {
*/
fun unRegisterOnMapCollectTaskListener(listener: OnMapCollectCmdListener?)
/**
* 此接口用于定位准确的时候回调
*/
fun setIsInit()
/**
* 此接口是自动驾驶模块使用,用于把自动驾驶模块收集的数据给地图组
*/

View File

@@ -26,4 +26,8 @@ object CallerMapDataCollectorManager {
fun finish(id: Int, state: Int, gpsPath: String, videoPath: String, reason: String) {
provider?.finish(id, state, gpsPath, videoPath, reason)
}
fun setIsInit() {
provider?.setIsInit()
}
}

View File

@@ -83,7 +83,7 @@ MOGO_TELEMATIC_VERSION=1.3.19
######## MogoAiCloudSDK Version ########
# 自研地图
MAP_SDK_VERSION=2.0.5.1
MAP_SDK_OPERATION_VERSION=1.0.11
MAP_SDK_OPERATION_VERSION=1.0.12
# websocket
WEBSOCKET_VERSION=1.1.7
## 产品库必备配置产品库自动对versionCode和versionName版本进行升级

View File

@@ -24,6 +24,7 @@ import com.mogo.eagle.core.data.config.HdMapBuildConfig;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.call.map.CallerLocationUpdaterManager;
import com.mogo.eagle.core.function.call.map.CallerMapDataCollectorManager;
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager;
import com.mogo.eagle.core.function.call.map.CallerMapStyleListenerManager;
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
@@ -929,6 +930,7 @@ public class AMapViewWrapper implements IMogoMapView,
// 使用外部定位数据修改自车位置
mMapView.getLocationClient().updateRTKAutoPilotLocation(bean);
CallerLocationUpdaterManager.INSTANCE.updateLocation(bean);
CallerMapDataCollectorManager.INSTANCE.setIsInit();
}
}

View File

@@ -355,12 +355,18 @@ public class MogoMapUIController implements IMogoMapUIController {
@Override
public long getTileId(double lon, double lat) {
return mDelegate.getTileId(lon, lat);
if (mDelegate != null) {
return mDelegate.getTileId(lon, lat);
}
return 0;
}
@Override
public int getSpeedLimmit(double lon, double lat, float angle) {
return mDelegate.getSpeedLimmit(lon,lat,angle);
if (mDelegate != null) {
return mDelegate.getSpeedLimmit(lon,lat,angle);
}
return 0;
}
@Override

View File

@@ -422,18 +422,20 @@ public class TopViewAnimHelper {
public void removeAllViewExceptVrNav() {
Logger.d(TAG, "remove all view except vr nav");
isTopViewOut = true;
int lastCount = topContainer.getChildCount();
for (int i = 0; i < lastCount; i++) {
View child = topContainer.getChildAt(i);
viewCaches.remove(child);
IMogoTopViewStatusListener listener = statusListenerMap.remove(child);
if (listener != null) {
listener.beforeViewRemoveAnim(child);
listener.onViewRemoved(child);
if(topContainer != null) {
int lastCount = topContainer.getChildCount();
for (int i = 0; i < lastCount; i++) {
View child = topContainer.getChildAt(i);
viewCaches.remove(child);
IMogoTopViewStatusListener listener = statusListenerMap.remove(child);
if (listener != null) {
listener.beforeViewRemoveAnim(child);
listener.onViewRemoved(child);
}
}
topContainer.setTranslationY(0);
topContainer.removeAllViews();
}
topContainer.setTranslationY(0);
topContainer.removeAllViews();
hideNaviView();
}

View File

@@ -74,6 +74,7 @@ public class PadTTS implements IMogoTTS, VoiceClient.VoiceCmdCallBack, OnTtsList
mVoiceClient.release();
if (mEngine != null) {
mEngine.destroy();
mEngine = null;
}
mHasAuth = false;
mSpeakVoiceMap.clear();
@@ -95,11 +96,11 @@ public class PadTTS implements IMogoTTS, VoiceClient.VoiceCmdCallBack, OnTtsList
private static final String TTS_BACK_RES_ZHILING = "zhilingf_common_back_ce_local.v2.1.0.bin";
private int audioRecorderType = DUILiteConfig.TYPE_COMMON_MIC;
//echo module res
private static final String ECHO_RES = "echo/sspe_aec_ch2_mic1_ref1_asr_v2.0.0.95.bin";
private static final String ECHO_RES = "echo/AEC_ch4-2-ch2_2ref_chezai_v2_outgain1_20200407_dw_gain_0.1.bin";
//local tts module res
private static final String TTS_DICT_RES = "aitts_sent_dict_local.db";
private static final String TTS_FRONT_RES = "local_front.bin";
public static final String TTS_BACK_RES_GUODGM = "tts/guodgm_common_back_ce_local.v2.1.0.bin";
public static final String TTS_BACK_RES_GUODGM = "guodgm_common_back_ce_local.v2.1.0.bin";
private AILocalTTSEngine mEngine;
private AILocalTTSIntent mAILocalTTSIntent;
private String[] mBackResBinArray = new String[]{TTS_BACK_RES_ZHILING, TTS_BACK_RES_GUODGM};
@@ -123,9 +124,9 @@ public class PadTTS implements IMogoTTS, VoiceClient.VoiceCmdCallBack, OnTtsList
//echo 配置
EchoConfig echoConfig = new EchoConfig.Builder()
.setAecResource(ECHO_RES)// 2mic AEC资源
.setChannels(2)//设置音频通道数
.setMicNumber(1)//设置mic数
.setSavedDirPath("/sdcard/aispeech/aecPcmFile/")//设置echo前后音频保存路径
.setChannels(4)//设置音频通道数
.setMicNumber(2)//设置mic数
.setSavedDirPath("/sdcard/aispeech/echo")//设置echo前后音频保存路径
.create();
if (BuildConfig.DEBUG) {