8.0.15 输出车前引导线log

This commit is contained in:
lianglihui
2021-12-30 16:49:47 +08:00
parent 49e0ce026c
commit 542391e225

View File

@@ -1,6 +1,8 @@
package com.mogo.module.service.routeoverlay;
import android.content.Context;
import android.location.Location;
import android.os.SystemClock;
import android.util.Log;
import com.mogo.eagle.core.data.autopilot.ADASTrajectoryInfo;
@@ -9,10 +11,14 @@ 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.map.MogoLatLng;
import com.mogo.eagle.core.data.map.MogoLocation;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager;
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager;
import com.mogo.map.navi.IMogoCarLocationChangedListener2;
import com.mogo.module.common.MogoApisHandler;
import org.jetbrains.annotations.NotNull;
@@ -21,13 +27,14 @@ import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.List;
public class MogoRouteOverlayManager implements IMoGoAutopilotPlanningListener, IMoGoAutopilotStatusListener{
public class MogoRouteOverlayManager implements IMoGoAutopilotPlanningListener, IMoGoAutopilotStatusListener, IMoGoMapLocationListener {
private static volatile MogoRouteOverlayManager sInstance;
private Context mContext;
private String TAG = "MogoRouteOverlayManager";
private String TAG2 = "MogoRouteOverlayManager routes";
private int STATUS_AUTOPILOT = 0;//0 非自动驾驶 ; 1 自动驾驶
private MogoLatLng mEnding;
private MogoLocation mLocation;
private MogoRouteOverlayManager(Context context) {
mContext = context;
}
@@ -35,6 +42,7 @@ public class MogoRouteOverlayManager implements IMoGoAutopilotPlanningListener,
public void init() {
CallerAutopilotPlanningListenerManager.INSTANCE.addListener(TAG, this);
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG, this);
CallerMapLocationListenerManager.INSTANCE.addListener(TAG,this);
}
public static MogoRouteOverlayManager getInstance(Context context) {
@@ -53,19 +61,33 @@ public class MogoRouteOverlayManager implements IMoGoAutopilotPlanningListener,
if (trajectoryInfos == null || trajectoryInfos.size() == 0) {
return;
}
ADASTrajectoryInfo adasTrajectoryInfo = trajectoryInfos.get(0);
double lat = MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLat();
double lon = MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLon();
Log.d(TAG, "size:" + trajectoryInfos.size());
Log.d(TAG, "trajectoryInfos:" + adasTrajectoryInfo.getLat()+":"+adasTrajectoryInfo.getLon());
Log.d(TAG, "location:" + lat+":"+lon);
// double lat = MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLat();
// double lon = MogoApisHandler.getInstance().getApis().getAdasControllerApi().getLastLon();
StringBuilder builder = new StringBuilder();
builder.append("{");
builder.append(System.currentTimeMillis()).append(";");
builder.append(mLocation.getLongitude()).append(";");
builder.append(mLocation.getLatitude()).append(";");
builder.append(mLocation.getAltitude()).append(";");
builder.append(mLocation.getBearing()).append(";");
builder.append(mLocation.getSpeed()).append(";");
// ADASTrajectoryInfo adasTrajectoryInfo = trajectoryInfos.get(0);
// long temp = SystemClock.currentThreadTimeMillis();
// Log.d(TAG, "temp:"+temp+" size:" + trajectoryInfos.size());
// Log.d(TAG, "trajectoryInfos:" + adasTrajectoryInfo.getLat()+":"+adasTrajectoryInfo.getLon());
// Log.d(TAG, "temp:"+temp+" location:" + lat+":"+lon);
List<MogoLatLng> mogoLatLngs = new ArrayList<>();
for (ADASTrajectoryInfo a : trajectoryInfos) {
// Log.d(TAG, "temp:"+temp+" trajectoryInfos:" + a.getLat()+":"+a.getLon());
builder.append(a.getLon()).append(",");
builder.append(a.getLat()).append(",");
mogoLatLngs.add(new MogoLatLng(a.getLat(), a.getLon()));
}
if (STATUS_AUTOPILOT == 1) {
RouteOverlayDrawer.getInstance(mContext).drawTrajectoryList(mogoLatLngs);
}
builder.append("}");
Log.d(TAG,builder.toString());
}
@Override
@@ -108,4 +130,9 @@ public class MogoRouteOverlayManager implements IMoGoAutopilotPlanningListener,
public void onAutopilotSNRequest() {
}
@Override
public void onLocationChanged(@Nullable MogoLocation location) {
mLocation = location;
}
}