[Add] 增加了自车定位日志输出

Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
donghongyu
2021-11-28 19:26:45 +08:00
parent 0b66920dd9
commit 683aae2444
5 changed files with 19 additions and 11 deletions

View File

@@ -1,5 +1,6 @@
package com.mogo.eagle.core.function.call.autopilot
import android.util.Log
import androidx.annotation.Nullable
import com.mogo.eagle.core.data.autopilot.AutopilotCarStateInfo
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarStateListener
@@ -17,7 +18,7 @@ object CallerAutopilotCarStatusListenerManager : CallerBase() {
// 存储所有注册了监听的对象invokeXXXX进行遍历回调将信息同步
private val M_AUTOPILOT_STATUS_LISTENERS: ConcurrentHashMap<String, IMoGoAutopilotCarStateListener> =
ConcurrentHashMap()
ConcurrentHashMap()
/**
@@ -26,8 +27,8 @@ object CallerAutopilotCarStatusListenerManager : CallerBase() {
* @param listener 监听回调
*/
fun addListener(
@Nullable tag: String,
@Nullable listener: IMoGoAutopilotCarStateListener
@Nullable tag: String,
@Nullable listener: IMoGoAutopilotCarStateListener
) {
if (M_AUTOPILOT_STATUS_LISTENERS.containsKey(tag)) {
LogUtils.eTag(TAG, "Tag:$tag already exists,please use other tag")
@@ -67,6 +68,7 @@ object CallerAutopilotCarStatusListenerManager : CallerBase() {
@Synchronized
fun invokeAutopilotCarStateData(autoPilotCarStateInfo: AutopilotCarStateInfo?) {
//LogUtils.dTag(TAG, "$autoPilotCarStateInfo")
//Log.w("DHY-location", "${autoPilotCarStateInfo?.values?.lon},${autoPilotCarStateInfo?.values?.lat} CallerAutopilotCarStatusListenerManager-invokeAutopilotCarStateData")
M_AUTOPILOT_STATUS_LISTENERS.forEach {
val tag = it.key
val listener = it.value

View File

@@ -1,5 +1,6 @@
package com.mogo.eagle.core.function.call.map
import android.util.Log
import androidx.annotation.Nullable
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener
@@ -87,6 +88,7 @@ object CallerMapLocationListenerManager : CallerBase() {
*/
fun invokeMapLocationChangeListener(location: MogoLocation?) {
//LogUtils.dTag(TAG, "mapStyleMode:$location")
Log.w("DHY-location", "${location?.longitude},${location?.latitude} CallerMapLocationListenerManager-invokeMapLocationChangeListener")
mLocation = location
mMapStyleChangeListeners.forEach {
val tag = it.key

View File

@@ -29,6 +29,7 @@ import com.mogo.eagle.core.function.call.map.CallerLocationUpdaterManager;
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.toast.TipToast;
import com.mogo.eagle.core.utilcode.util.GsonUtils;
import com.mogo.map.IMogoMap;
import com.mogo.map.IMogoMapView;
import com.mogo.map.impl.custom.navi.NaviClient;
@@ -750,6 +751,7 @@ public class AMapViewWrapper implements IMogoMapView,
@Override
public void onLocationChanged(@NotNull com.zhidaoauto.map.sdk.open.location.MogoLocation location) {
Log.w("DHY-location", location.getLon() + "," + location.getLat() + " AMapViewWrapper-onLocationChanged");
MogoLocation mLastLocation = ObjectUtils.fromLocation(location);
UiThreadHandler.post(() -> CallerMapLocationListenerManager.INSTANCE.invokeMapLocationChangeListener(mLastLocation));
@@ -788,7 +790,7 @@ public class AMapViewWrapper implements IMogoMapView,
} else {
mIsFirstLocated = true;
mIsDelayed = false;
Logger.d(TAG, "同步定位");
Logger.d(TAG, "同步定位" + GsonUtils.toJson(location));
MapStyleController.getInstance().onLocationChanged(location, this);
}
}
@@ -797,8 +799,8 @@ public class AMapViewWrapper implements IMogoMapView,
try {
mSelfMarker = mMapView.getMapAutoViewHelper().getMyLocationStyle().getSelfMarker();
mSelfMarker.setInfoWindowEnable(true);
} catch (Exception e) {
e.printStackTrace();
}
} else {
// 通过不同的方向类型来改变车模目前暂定三种模型drawlevel 1 绿,2 黄,3 红,绿色的时候需要把相应的切换为默认模型

View File

@@ -2,6 +2,7 @@ package com.mogo.map.impl.custom.location;
import android.content.Context;
import android.os.Trace;
import android.util.Log;
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager;
import com.mogo.map.impl.custom.utils.ObjectUtils;
@@ -113,6 +114,7 @@ public class ALocationClient implements IMogoLocationClient {
@Override
public void onLocationChanged( @NotNull com.zhidaoauto.map.sdk.open.location.MogoLocation location ) {
Log.w("DHY-location", location.getLon() + "," + location.getLat() + " ALocationClient-onLocationChanged");
if ( mIsDestroyed ) {
destroyWarming();
return;

View File

@@ -2,7 +2,6 @@ package com.mogo.module.adas;
import android.util.Log;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.eagle.core.data.autopilot.ADASTrajectoryInfo;
import com.mogo.eagle.core.data.autopilot.AutopilotCarStateInfo;
import com.mogo.eagle.core.data.autopilot.AutopilotGuardianStatusInfo;
@@ -10,14 +9,12 @@ import com.mogo.eagle.core.data.autopilot.AutopilotRouteInfo;
import com.mogo.eagle.core.data.autopilot.AutopilotStationInfo;
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
import com.mogo.eagle.core.data.autopilot.AutopilotWarnMessage;
import com.mogo.eagle.core.data.constants.MoGoConfig;
import com.mogo.eagle.core.data.traffic.TrafficData;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarStatusListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager;
import com.mogo.utils.logger.Logger;
import com.mogo.utils.storage.SharedPrefsMgr;
import com.zhidao.support.adas.high.AdasManager;
import com.zhidao.support.adas.high.OnAdasListener;
import com.zhidao.support.adas.high.bean.AutopilotRoute;
@@ -45,7 +42,7 @@ import java.util.List;
public class OnAdasListenerAdapter implements OnAdasListener {
private final String TAG = "OnAdasListenerAdapter";
@Override
public void onRectData(RectInfo rectInfo) {
ArrayList<TrafficData> recognizedListResults = AdasObjectUtils.INSTANCE.regroupTrafficDataData(rectInfo.getModels());
@@ -56,10 +53,10 @@ public class OnAdasListenerAdapter implements OnAdasListener {
@Override
public void onCarStateData(CarStateInfo carStateInfo) {
Logger.d(TAG, "--------carStateInfo.toString() = " + carStateInfo.toString());
AutopilotCarStateInfo autopilotCarStateInfo = AdasObjectUtils.INSTANCE.fromAdasCarStateInfoObject(carStateInfo);
CallerAutopilotCarStatusListenerManager.INSTANCE.invokeAutopilotCarStateData(autopilotCarStateInfo);
//can数据转发
CarStateInfo.ValuesBean bean = carStateInfo.getValues();
Log.w("DHY-location", bean.getLon() + "," + bean.getLat() + " OnAdasListenerAdapter-onCarStateData");
if (bean != null) {
int turn_light = bean.getTurn_light(); //转向灯状态 0是正常 1是左转 2是右转
Logger.d(TAG, "onCarStateData ---- turn_light = " + turn_light);
@@ -67,6 +64,9 @@ public class OnAdasListenerAdapter implements OnAdasListener {
} else {
Logger.e(TAG, "bean == null ");
}
AutopilotCarStateInfo autopilotCarStateInfo = AdasObjectUtils.INSTANCE.fromAdasCarStateInfoObject(carStateInfo);
CallerAutopilotCarStatusListenerManager.INSTANCE.invokeAutopilotCarStateData(autopilotCarStateInfo);
}
@Override