[6.5.0][道路事件][绿波通行] 变更实现方式;调整路口视角参数
This commit is contained in:
@@ -158,7 +158,6 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
|
||||
)
|
||||
)
|
||||
if (polygon.isNotEmpty()) {
|
||||
|
||||
val decision = V2NUtils.computeOccupyLanesInfo(Triple(car.longitude, car.latitude, car.heading.toFloat()), Triple(itx.longitude, itx.latitude, itx.heading.toFloat()), polygon.map { kotlin.Pair(it.first, it.second) })
|
||||
if (decision != null) {
|
||||
val isDriver = AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)
|
||||
|
||||
@@ -188,16 +188,16 @@ class AiRoadMarker {
|
||||
})
|
||||
}
|
||||
|
||||
if (marker.poiType == EventTypeEnumNew.TYPE_SOCKET_ROAD_GREE_WAVE.poiType) {
|
||||
val builder = Polyline.Options.Builder(V2XConst.V2X_MARKER_OWNER, ROAD_CENTER_LINE)
|
||||
builder.colors(listOf(Color.parseColor("#996DFED0"), Color.parseColor("#CC6DFED0"), Color.parseColor("#C76DFED0"), Color.parseColor("#006DFED0")))
|
||||
.setWidth(50f)
|
||||
.setUseGps(true)
|
||||
.points(listOf(MogoLatLng(location.latitude, location.longitude), MogoLatLng(marker.poi_lat, marker.poi_lon)))
|
||||
.setIsGradient(true)
|
||||
.isShowArrow(true)
|
||||
CallerMapUIServiceManager.getOverlayManager()?.showOrUpdateLine(builder.build())?.also { wrapper.addLine(it) }
|
||||
}
|
||||
// if (marker.poiType == EventTypeEnumNew.TYPE_SOCKET_ROAD_GREE_WAVE.poiType) {
|
||||
// val builder = Polyline.Options.Builder(V2XConst.V2X_MARKER_OWNER, ROAD_CENTER_LINE)
|
||||
// builder.colors(listOf(Color.parseColor("#996DFED0"), Color.parseColor("#CC6DFED0"), Color.parseColor("#C76DFED0"), Color.parseColor("#006DFED0")))
|
||||
// .setWidth(50f)
|
||||
// .setUseGps(true)
|
||||
// .points(listOf(MogoLatLng(location.latitude, location.longitude), MogoLatLng(marker.poi_lat, marker.poi_lon)))
|
||||
// .setIsGradient(true)
|
||||
// .isShowArrow(true)
|
||||
// CallerMapUIServiceManager.getOverlayManager()?.showOrUpdateLine(builder.build())?.also { wrapper.addLine(it) }
|
||||
// }
|
||||
wrapper.onRemoved = { id ->
|
||||
aiMakers.remove(id)
|
||||
}
|
||||
|
||||
@@ -1,32 +1,26 @@
|
||||
package com.mogo.eagle.core.function.business.routeoverlay;
|
||||
|
||||
import android.util.Log;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.config.HdMapBuildConfig;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
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.IMoGoPlanningTrajectoryListener;
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener;
|
||||
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.CallerPlanningTrajectoryListenerManager;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import mogo_msg.MogoReportMsg;
|
||||
import system_master.SsmInfo;
|
||||
import system_master.SystemStatusInfo;
|
||||
|
||||
public class MogoRouteOverlayManager implements
|
||||
IMoGoPlanningTrajectoryListener,
|
||||
@@ -36,6 +30,52 @@ public class MogoRouteOverlayManager implements
|
||||
|
||||
private final LinkedList<List<MessagePad.TrajectoryPoint>> queue = new LinkedList<>();
|
||||
|
||||
private AtomicBoolean hasGreenWave = new AtomicBoolean(false);
|
||||
|
||||
private final IViewControlListener listener = new IViewControlListener() {
|
||||
|
||||
@Override
|
||||
public void updateFuncMode(@NonNull String tag, boolean b) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateStatusBarDownloadView(boolean insert, @NonNull String tag, int progress) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateConnectionProgressView(boolean visible) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateStatusBarLeftView(boolean insert, @NonNull String tag, @NonNull ViewGroup viewGroup) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateStatusBarRightView(boolean insert, @NonNull String tag, @NonNull ViewGroup viewGroup) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStatusBarDarkOrLight(boolean light) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mainPageViewVisible(int v) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visible(int v) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGreenWaveViewVisible(int min, int max, int cross) {
|
||||
hasGreenWave.set(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGreenWaveViewDismiss() {
|
||||
hasGreenWave.set(false);
|
||||
}
|
||||
};
|
||||
private MogoRouteOverlayManager() {
|
||||
}
|
||||
|
||||
@@ -43,6 +83,7 @@ public class MogoRouteOverlayManager implements
|
||||
public void init() {
|
||||
CallerPlanningTrajectoryListenerManager.INSTANCE.addListener(TAG, this);
|
||||
CallerChassisLocationGCJ02ListenerManager.INSTANCE.addListener(TAG, 20,this);
|
||||
CallerHmiViewControlListenerManager.INSTANCE.addListener(TAG, listener);
|
||||
}
|
||||
|
||||
public static MogoRouteOverlayManager getInstance() {
|
||||
@@ -78,7 +119,7 @@ public class MogoRouteOverlayManager implements
|
||||
return;
|
||||
}
|
||||
// Log.d(TAG, "-- onChassisLocationGCJ02 -- 2 ---" + "auto-mode:" + autoPilotState + ", isDemoMode:" + FunctionBuildConfig.isDemoMode + ", force:" + FunctionBuildConfig.isForceDrawAutopilotTrajectoryByDebugSettingView);
|
||||
boolean force = FunctionBuildConfig.isForceDrawAutopilotTrajectoryByDebugSettingView || FunctionBuildConfig.isDemoMode && FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData;
|
||||
boolean force = hasGreenWave.get() || FunctionBuildConfig.isForceDrawAutopilotTrajectoryByDebugSettingView || FunctionBuildConfig.isDemoMode && FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData;
|
||||
if (!force && autoPilotState != 2) {
|
||||
RouteOverlayDrawer.getInstance().clearMogoRouteOverlay();
|
||||
return;
|
||||
@@ -88,7 +129,7 @@ public class MogoRouteOverlayManager implements
|
||||
if (!queue.isEmpty()) {
|
||||
List<MessagePad.TrajectoryPoint> items = queue.pollLast();
|
||||
if (items != null && !items.isEmpty()) {
|
||||
RouteOverlayDrawer.getInstance().drawTrajectoryList(items, gnssInfo.getHeading());
|
||||
RouteOverlayDrawer.getInstance().drawTrajectoryList(items, gnssInfo.getHeading(), hasGreenWave.get());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import com.zhidaoauto.map.sdk.open.common.tools.MapTools;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import kotlin.Pair;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
@@ -41,8 +42,9 @@ public class RouteOverlayDrawer {
|
||||
|
||||
|
||||
//用于taxi乘客屏渐变颜色集合
|
||||
private static List<Integer> colors = null;
|
||||
private List<Integer> colors = null;
|
||||
|
||||
private final List<Integer> greenWaveColors = new ArrayList<>();
|
||||
private RouteOverlayDrawer() {
|
||||
// 渐变色
|
||||
mogoOverlayManager = CallerMapUIServiceManager.INSTANCE.getOverlayManager();
|
||||
@@ -62,6 +64,11 @@ public class RouteOverlayDrawer {
|
||||
}
|
||||
};
|
||||
renderTask.start();
|
||||
//Color.parseColor("#996DFED0"), Color.parseColor("#CC6DFED0"), Color.parseColor("#C76DFED0"), Color.parseColor("#006DFED0")
|
||||
greenWaveColors.add(Color.parseColor("#996DFED0"));
|
||||
greenWaveColors.add(Color.parseColor("#CC6DFED0"));
|
||||
greenWaveColors.add(Color.parseColor("#C76DFED0"));
|
||||
greenWaveColors.add(Color.parseColor("#006DFED0"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,15 +99,17 @@ public class RouteOverlayDrawer {
|
||||
private final LinkedList<MogoLatLng> points;
|
||||
|
||||
private double bearing;
|
||||
private boolean hasGreenWave;
|
||||
|
||||
public RenderTask() {
|
||||
this.pools = new Pools.SimplePool<>(500);
|
||||
this.points = new LinkedList<>();
|
||||
}
|
||||
|
||||
public void setData(List<MessagePad.TrajectoryPoint> routeList, double bearing) {
|
||||
public void setData(List<MessagePad.TrajectoryPoint> routeList, double bearing, boolean hasGreenWave) {
|
||||
this.routeList = routeList;
|
||||
this.bearing = bearing;
|
||||
this.hasGreenWave = hasGreenWave;
|
||||
}
|
||||
|
||||
@SuppressLint("LongLogTag")
|
||||
@@ -121,11 +130,11 @@ public class RouteOverlayDrawer {
|
||||
isExcept = true;
|
||||
return;
|
||||
}
|
||||
boolean isColorfulStrategy = !AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode) || !AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode);
|
||||
boolean isColorfulStrategy = !hasGreenWave && !AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode) || !AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode);
|
||||
if (isColorfulStrategy) {
|
||||
RouteStrategy.INSTANCE.start();
|
||||
} else {
|
||||
if (colors == null) {
|
||||
if (colors == null || colors.isEmpty()) {
|
||||
ArrayList<Pair<Integer, Integer>> temps = new ArrayList<>();
|
||||
temps.add(new Pair<>(0, 51));
|
||||
temps.add(new Pair<>(10, 102));
|
||||
@@ -133,7 +142,7 @@ public class RouteOverlayDrawer {
|
||||
temps.add(new Pair<>(100, 0));
|
||||
List<Integer> alphas = MapTools.INSTANCE.getColorAlpha(temps);
|
||||
if (alphas != null && !alphas.isEmpty()) {
|
||||
colors = new ArrayList<>();
|
||||
colors = new CopyOnWriteArrayList<>();
|
||||
for (int i : alphas) {
|
||||
colors.add(Color.argb(i, 48,203,251));
|
||||
}
|
||||
@@ -227,12 +236,20 @@ public class RouteOverlayDrawer {
|
||||
builder.setLightColor(COLOR_LIGHT);
|
||||
builder.setLightSpeed(0.3f);
|
||||
} else {
|
||||
if (colors != null && !colors.isEmpty()) {
|
||||
builder.colors(colors);
|
||||
builder.setIsGradient(true);
|
||||
builder.setLightOn(true);
|
||||
builder.setLightColor(COLOR_LIGHT);
|
||||
builder.setLightSpeed(0.3f);
|
||||
if (!hasGreenWave) {
|
||||
if (colors != null && !colors.isEmpty()) {
|
||||
builder.colors(colors);
|
||||
builder.setIsGradient(true);
|
||||
builder.setLightOn(true);
|
||||
builder.isShowArrow(false);
|
||||
builder.setLightColor(COLOR_LIGHT);
|
||||
builder.setLightSpeed(0.3f);
|
||||
}
|
||||
} else {
|
||||
builder.colors(greenWaveColors)
|
||||
.setIsGradient(true)
|
||||
.setLightOn(false)
|
||||
.isShowArrow(true);
|
||||
}
|
||||
}
|
||||
builder.points(points);
|
||||
@@ -270,12 +287,12 @@ public class RouteOverlayDrawer {
|
||||
|
||||
private volatile RenderTask mRenderTask;
|
||||
|
||||
public void drawTrajectoryList(List<MessagePad.TrajectoryPoint> routeList, double bearing) {
|
||||
public void drawTrajectoryList(List<MessagePad.TrajectoryPoint> routeList, double bearing, boolean hasGreenWave) {
|
||||
if (mogoOverlayManager != null) {
|
||||
if (mRenderTask == null) {
|
||||
mRenderTask = new RenderTask();
|
||||
}
|
||||
mRenderTask.setData(routeList, bearing);
|
||||
mRenderTask.setData(routeList, bearing, hasGreenWave);
|
||||
if (mRenderHandler != null) {
|
||||
mRenderHandler.removeCallbacks(mRenderTask);
|
||||
mRenderHandler.post(mRenderTask);
|
||||
|
||||
@@ -48,13 +48,13 @@ object ConstantExt {
|
||||
const val MAP_STYLE_VR_ANGLE_ROAD_CROSS_NEW = 12
|
||||
|
||||
//新路口视角-摄像机高度
|
||||
const val MAP_STYLE_VR_EYE_HEIGHT_ROAD_CROSS_NEW = 59.3f
|
||||
const val MAP_STYLE_VR_EYE_HEIGHT_ROAD_CROSS_NEW = 52.9f
|
||||
|
||||
//新路口视角-摄像机角度
|
||||
const val MAP_STYLE_VR_OVER_LOOK_ROAD_CROSS_NEW = 36.3f
|
||||
const val MAP_STYLE_VR_OVER_LOOK_ROAD_CROSS_NEW = 31.0f
|
||||
|
||||
//新路口视角-缩放值
|
||||
const val MAP_STYLE_VR_ZOOM_VAL_ROAD_CROSS_NEW = 2.9f
|
||||
const val MAP_STYLE_VR_ZOOM_VAL_ROAD_CROSS_NEW = 0.9f
|
||||
|
||||
|
||||
//漫游距离1公里
|
||||
|
||||
Reference in New Issue
Block a user