close route overlay log and fix draw data of route to pb style

This commit is contained in:
zhongchao
2022-04-06 18:56:03 +08:00
parent 4f7cf8608e
commit e1508a3f0f
14 changed files with 49 additions and 187 deletions

View File

@@ -5,12 +5,12 @@ import android.content.Intent;
import android.location.Location;
import android.net.ConnectivityManager;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.mogo.aicloud.services.socket.IMogoLifecycleListener;
import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.eagle.core.data.autopilot.ADASTrajectoryInfo;
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningListener;
@@ -32,6 +32,7 @@ import com.mogo.service.statusmanager.StatusDescriptor;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@@ -243,6 +244,11 @@ public class BusPassengerModel {
private final IMoGoAutopilotPlanningListener moGoAutopilotPlanningListener = new IMoGoAutopilotPlanningListener(){
@Override
public void onAutopilotTrajectory(@NonNull List<MessagePad.TrajectoryPoint> trajectoryInfos) {
}
@Override
public void onAutopilotRotting(@Nullable MessagePad.GlobalPathResp routeList) {
if (null != routeList && routeList.getWayPointsList().size() > 0){
@@ -251,10 +257,6 @@ public class BusPassengerModel {
}
}
@Override
public void onAutopilotTrajectory(ArrayList<ADASTrajectoryInfo> trajectoryInfos) {
}
};
}

View File

@@ -6,6 +6,7 @@ import android.location.Location;
import android.net.ConnectivityManager;
import android.os.Looper;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.amap.api.maps.model.LatLng;
@@ -14,7 +15,6 @@ import com.elegant.network.utils.GsonUtil;
import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager;
import com.mogo.cloud.commons.utils.CoordinateUtils;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.eagle.core.data.autopilot.ADASTrajectoryInfo;
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningListener;
@@ -556,6 +556,11 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
private final IMoGoAutopilotPlanningListener moGoAutopilotPlanningListener = new IMoGoAutopilotPlanningListener(){
@Override
public void onAutopilotTrajectory(@NonNull List<MessagePad.TrajectoryPoint> trajectoryInfos) {
}
@Override
public void onAutopilotRotting(@Nullable MessagePad.GlobalPathResp routeList) {
if (null != routeList && routeList.getWayPointsList().size() > 0){
@@ -564,11 +569,6 @@ public class TaxiPassengerModel implements IOCHTaxiPassengerNaviChangedCallback
}
}
@Override
public void onAutopilotTrajectory(ArrayList<ADASTrajectoryInfo> trajectoryInfos) {
}
};
/**

View File

@@ -7,6 +7,7 @@ import android.content.Intent;
import android.location.Location;
import android.net.ConnectivityManager;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.amap.api.maps.model.LatLng;
@@ -15,7 +16,6 @@ import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager;
import com.mogo.cloud.commons.utils.CoordinateUtils;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.eagle.core.data.BaseData;
import com.mogo.eagle.core.data.autopilot.ADASTrajectoryInfo;
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
@@ -1046,6 +1046,11 @@ public class TaxiModel {
};
private final IMoGoAutopilotPlanningListener moGoAutopilotPlanningListener = new IMoGoAutopilotPlanningListener() {
@Override
public void onAutopilotTrajectory(@NonNull List<MessagePad.TrajectoryPoint> trajectoryInfos) {
}
@Override
public void onAutopilotRotting(MessagePad.GlobalPathResp routeList) {
if (null != routeList && routeList.getWayPointsList().size() > 0){
@@ -1054,11 +1059,6 @@ public class TaxiModel {
}
}
@Override
public void onAutopilotTrajectory(ArrayList<ADASTrajectoryInfo> trajectoryInfos) {
}
};
/**

View File

@@ -1,7 +1,6 @@
package com.mogo.eagle.core.function.autopilot.adapter
import chassis.VehicleStateOuterClass
import com.mogo.eagle.core.data.autopilot.ADASTrajectoryInfo
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.config.HdMapBuildConfig
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_ADAS_MESSAGE_AUTOPILOT_ARRIVE
@@ -19,7 +18,6 @@ import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LO
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_WEB_SOCKET_TRAJECTORY
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_WEB_SOCKET_VEHICLE
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_ADAS_IMPL
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.invokeArriveAtStation
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.invokeAutoPilotStatus
@@ -37,6 +35,7 @@ import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showAdUpgradeStatu
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager.showDockerRebootResult
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_ADAS_IMPL
import com.zhidao.support.adas.high.AdasManager
import com.zhidao.support.adas.high.OnAdasListener
import com.zhidao.support.adas.high.bean.IPCUpgradeStateInfo
@@ -49,7 +48,6 @@ import mogo.telematics.pad.MessagePad.TrackedObject
import mogo_msg.MogoReportMsg
import perception.TrafficLightOuterClass
import record_cache.RecordPanelOuterClass
import java.util.*
/**
* @author emArrow
@@ -75,23 +73,9 @@ class MoGoAdasListenerImpl : OnAdasListener {
)
override fun onTrajectory(header: MessagePad.Header, trajectory: MessagePad.Trajectory?) {
if (HdMapBuildConfig.isMapLoaded) {
val trajectoryInfoArrayList = ArrayList<ADASTrajectoryInfo>()
if (trajectory != null && trajectory.pointsList.size > 0) {
for (trajectory in trajectory.pointsList) {
val adasTrajectoryInfo = ADASTrajectoryInfo()
adasTrajectoryInfo.lat = trajectory.latitude
adasTrajectoryInfo.lon = trajectory.longitude
adasTrajectoryInfo.acceleration = trajectory.acceleration
adasTrajectoryInfo.accumulatedDis = trajectory.accumulatedDis
adasTrajectoryInfo.time = trajectory.time
adasTrajectoryInfo.velocity = trajectory.velocity
adasTrajectoryInfo.alt = trajectory.altitude
adasTrajectoryInfo.kappa = trajectory.kappa
adasTrajectoryInfo.theta = trajectory.theta
trajectoryInfoArrayList.add(adasTrajectoryInfo)
}
invokeAutopilotTrajectory(trajectory.pointsList)
}
invokeAutopilotTrajectory(trajectoryInfoArrayList)
}
}
@@ -129,7 +113,11 @@ class MoGoAdasListenerImpl : OnAdasListener {
// 同步给MAP地图
CallerMapUIServiceManager.getMapUIController()?.syncLocation2Map(gnssInfo)
// 同步更新经纬度和系统时间至 AutoPilotStatusListener
CallerAutoPilotStatusListenerManager.updateAutoPilotLatLon(gnssInfo.satelliteTime.toLong(),gnssInfo.longitude, gnssInfo.latitude)
CallerAutoPilotStatusListenerManager.updateAutoPilotLatLon(
gnssInfo.satelliteTime.toLong(),
gnssInfo.longitude,
gnssInfo.latitude
)
}
}
}
@@ -217,6 +205,7 @@ class MoGoAdasListenerImpl : OnAdasListener {
invokeAutopilotGuardian(mogoReportMessage)
}
}
//感知红绿灯
override fun onPerceptionTrafficLight(
header: MessagePad.Header?,

View File

@@ -156,7 +156,7 @@ object MogoLogCatchManager : IMogoOnMessageListener<RemoteLogPushContent>, Handl
MoGoAiCloudClientConfig.getInstance().sn,
AppConfigInfo.toString(),
logPrefixName?.replace("_", "-"),
null,
mutableListOf(),
content,
this
)

View File

@@ -7,7 +7,6 @@ import android.os.Message;
import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager;
import com.mogo.cloud.commons.utils.CoordinateUtils;
import com.mogo.eagle.core.data.autopilot.ADASTrajectoryInfo;
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
import com.mogo.eagle.core.data.autopilot.AutopilotRouteInfo;
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
@@ -275,7 +274,7 @@ public class DispatchAutoPilotManager implements IMogoOnMessageListener<Dispatch
}
@Override
public void onAutopilotTrajectory(ArrayList<ADASTrajectoryInfo> trajectoryInfos) {
public void onAutopilotTrajectory(List<MessagePad.TrajectoryPoint> trajectoryInfos) {
}

View File

@@ -839,7 +839,9 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
*/
override fun showTurnLight(light: Int) {
if (HmiBuildConfig.isShowTurnLightView) {
turnLightView.setTurnLight(light)
ThreadUtils.runOnUiThread {
turnLightView.setTurnLight(light)
}
}
}
@@ -848,7 +850,9 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
*/
override fun showBrakeLight(light: Int) {
if (HmiBuildConfig.isShowBrakeLightView) {
brakeView.setBrakeLight(light)
ThreadUtils.runOnUiThread {
brakeView.setBrakeLight(light)
}
}
}

View File

@@ -1565,7 +1565,7 @@ class DebugSettingView @JvmOverloads constructor(
}
}
override fun onAutopilotTrajectory(trajectoryInfos: ArrayList<ADASTrajectoryInfo>) {
override fun onAutopilotTrajectory(trajectoryInfos: MutableList<MessagePad.TrajectoryPoint>) {
mTrajectoryInfoSize = trajectoryInfos.size
}

View File

@@ -6,7 +6,6 @@ import android.view.View;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.commons.mvp.BaseFragment;
import com.mogo.eagle.core.data.autopilot.ADASTrajectoryInfo;
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
import com.mogo.eagle.core.data.constants.MoGoFragmentPaths;
import com.mogo.eagle.core.data.map.MogoLatLng;
@@ -130,7 +129,7 @@ public class SmallMapFragment extends BaseFragment
}
@Override
public void onAutopilotTrajectory(ArrayList<ADASTrajectoryInfo> trajectoryInfos) {
public void onAutopilotTrajectory(List<MessagePad.TrajectoryPoint> trajectoryInfos) {
}

View File

@@ -1,115 +0,0 @@
package com.mogo.eagle.core.data.autopilot;
/**
* @author song kenan
* @des
* @date 2021/10/21
*/
public class ADASTrajectoryInfo {
//经度
private Double lon;
//纬度
private Double lat;
//高度
private Double alt;
//时间 秒s
private Double time;
//速度 m/s
private Double velocity;
//加速度
private Double acceleration;
//速度方向
private Double theta;
//曲率
private Double kappa;
//从起点到目前的总距离
private Double accumulatedDis;
public void setLon(Double lon) {
this.lon = lon;
}
public void setLat(Double lat) {
this.lat = lat;
}
public void setAlt(Double alt) {
this.alt = alt;
}
public void setTime(Double time) {
this.time = time;
}
public void setVelocity(Double velocity) {
this.velocity = velocity;
}
public void setAcceleration(Double acceleration) {
this.acceleration = acceleration;
}
public void setTheta(Double theta) {
this.theta = theta;
}
public void setKappa(Double kappa) {
this.kappa = kappa;
}
public void setAccumulatedDis(Double accumulatedDis) {
this.accumulatedDis = accumulatedDis;
}
public Double getLon() {
return lon;
}
public Double getLat() {
return lat;
}
public Double getAlt() {
return alt;
}
public Double getTime() {
return time;
}
public Double getVelocity() {
return velocity;
}
public Double getAcceleration() {
return acceleration;
}
public Double getTheta() {
return theta;
}
public Double getKappa() {
return kappa;
}
public Double getAccumulatedDis() {
return accumulatedDis;
}
@Override
public String toString() {
return "TrajectoryModels{" +
"lon=" + lon +
", lat=" + lat +
", alt=" + alt +
", time='" + time + '\'' +
", velocity=" + velocity +
", acceleration=" + acceleration +
", theta=" + theta +
", kappa=" + kappa +
", accumulatedDis=" + accumulatedDis +
'}';
}
}

View File

@@ -1,8 +1,6 @@
package com.mogo.eagle.core.function.api.autopilot
import com.mogo.eagle.core.data.autopilot.ADASTrajectoryInfo
import mogo.telematics.pad.MessagePad
import java.util.ArrayList
/**
* 自动驾驶规划路线相关的监听
@@ -13,7 +11,7 @@ interface IMoGoAutopilotPlanningListener {
*
* @param trajectoryInfos 引导线数据经纬度
*/
fun onAutopilotTrajectory(trajectoryInfos: ArrayList<ADASTrajectoryInfo>)
fun onAutopilotTrajectory(trajectoryInfos: MutableList<MessagePad.TrajectoryPoint>)
/**
* 2021/6/23 工控机经纬度 绘制时转成高德经纬度

View File

@@ -1,7 +1,6 @@
package com.mogo.eagle.core.function.call.autopilot
import androidx.annotation.Nullable
import com.mogo.eagle.core.data.autopilot.ADASTrajectoryInfo
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningListener
import com.mogo.eagle.core.function.call.base.CallerBase
import mogo.telematics.pad.MessagePad
@@ -18,7 +17,6 @@ object CallerAutopilotPlanningListenerManager : CallerBase() {
private val M_AUTOPILOT_PLANNING_LISTENER: ConcurrentHashMap<String, IMoGoAutopilotPlanningListener> =
ConcurrentHashMap()
/**
* 添加监听
* @param tag 标记,用来注销监听使用
@@ -62,7 +60,7 @@ object CallerAutopilotPlanningListenerManager : CallerBase() {
* @param trajectoryInfo 自动驾驶状态信息
*/
@Synchronized
fun invokeAutopilotTrajectory(trajectoryInfo: ArrayList<ADASTrajectoryInfo>) {
fun invokeAutopilotTrajectory(trajectoryInfo: MutableList<MessagePad.TrajectoryPoint>) {
M_AUTOPILOT_PLANNING_LISTENER.forEach {
val tag = it.key
val listener = it.value

View File

@@ -4,7 +4,8 @@ import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_OLD
import android.content.Context;
import com.mogo.eagle.core.data.autopilot.ADASTrajectoryInfo;
import androidx.annotation.NonNull;
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.eagle.core.data.map.MogoLatLng;
@@ -66,12 +67,10 @@ public class MogoRouteOverlayManager implements
}
@Override
public void onAutopilotTrajectory(ArrayList<ADASTrajectoryInfo> trajectoryInfos) {
public void onAutopilotTrajectory(List<MessagePad.TrajectoryPoint> trajectoryInfos) {
if (trajectoryInfos == null || trajectoryInfos.size() == 0) {
return;
}
// 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(";");
@@ -80,25 +79,20 @@ public class MogoRouteOverlayManager implements
builder.append(mLocation.getAltitude()).append(";");
builder.append(mLocation.getBearing()).append(";");
builder.append(mLocation.getSpeed()).append(";");
// ADASTrajectoryInfo adasTrajectoryInfo = trajectoryInfos.get(0);
// long temp = SystemClock.currentThreadTimeMillis();
// CallerLogger.INSTANCE.d(M_OLD_ROUTE + TAG, "temp:"+temp+" size:" + trajectoryInfos.size());
// CallerLogger.INSTANCE.d(M_OLD_ROUTE + TAG, "trajectoryInfos:" + adasTrajectoryInfo.getLat()+":"+adasTrajectoryInfo.getLon());
// CallerLogger.INSTANCE.d(M_OLD_ROUTE + TAG, "temp:"+temp+" location:" + lat+":"+lon);
List<MogoLatLng> mogoLatLngs = new ArrayList<>();
for (int i = 0; i < trajectoryInfos.size(); i++) {
// 临时解决车尾拖线问题,丢弃距离车最近的几个经纬度,原因是惯性导航的中心靠近车尾,会导致经纬度靠近尾部,且两个数据不同频
if (i > 5) {
ADASTrajectoryInfo a = trajectoryInfos.get(i);
builder.append(a.getLon()).append(",");
builder.append(a.getLat()).append(",");
mogoLatLngs.add(new MogoLatLng(a.getLat(), a.getLon()));
MessagePad.TrajectoryPoint a = trajectoryInfos.get(i);
builder.append(a.getLongitude()).append(",");
builder.append(a.getLatitude()).append(",");
mogoLatLngs.add(new MogoLatLng(a.getLatitude(), a.getLongitude()));
}
}
mTrajectoryList = mogoLatLngs;
builder.append("}");
CallerLogger.INSTANCE.d(M_OLD_ROUTE + TAG, builder.toString());
}
@Override
@@ -115,6 +109,7 @@ public class MogoRouteOverlayManager implements
// RouteOverlayDrawer.getInstance(mContext).addEndingMarker(latLngList.get(listSize - 1).lat,latLngList.get(listSize - 1).lon);
}
@Override
public void onAutopilotStatusResponse(@NotNull AutopilotStatusInfo autoPilotStatusInfo) {
if (FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData) {
@@ -190,7 +185,7 @@ public class MogoRouteOverlayManager implements
list.add(latLng);
// }
}
CallerLogger.INSTANCE.d(M_OLD_ROUTE + TAG, "TrajectoryData = " + FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData + "---status = " + STATUS_AUTOPILOT + "----size = " + list.size());
// CallerLogger.INSTANCE.d(M_OLD_ROUTE + TAG, "TrajectoryData = " + FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData + "---status = " + STATUS_AUTOPILOT + "----size = " + list.size());
if (FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData || STATUS_AUTOPILOT == 1) {
RouteOverlayDrawer.getInstance(mContext).drawTrajectoryList(list);
}

View File

@@ -117,8 +117,6 @@ public class RouteOverlayDrawer {
public void drawTrajectoryList(List<MogoLatLng> routeList) {
// clearMogoRouteOverlay();
long drawstart = System.currentTimeMillis();
mPolylinePointList.clear();
if (routeList != null && routeList.size() > 0) {
for (MogoLatLng latLng : routeList) {
@@ -126,15 +124,12 @@ public class RouteOverlayDrawer {
}
mPolylineColors.clear();
// mPolylineColors.addAll(ColorUtils.gradientAlpha_("#FF2AAFFD", "#7b2965ED", "#002965ED", mPolylinePointList.size()));
long start = System.currentTimeMillis();
List<Integer> list = new ArrayList<>();
// list = ColorUtils.gradientAlpha("#FF2AAFFD", "#002965ED", mPolylinePointList.size());
int[] startColor = ColorUtils.hexToArgb("#CC64C3EA");
int[] endColor = ColorUtils.hexToArgb("#0064C3EA");
list.add(Color.argb(startColor[0], startColor[1], startColor[2], startColor[3]));
list.add(Color.argb(endColor[0], endColor[1], endColor[2], endColor[3]));
long end = System.currentTimeMillis();
CallerLogger.INSTANCE.d(M_OLD_ROUTE + TAG, "get color cost : " + (end - start));
mPolylineColors.addAll(list);
// 线条粗细,渐变,渐变色值
@@ -147,8 +142,6 @@ public class RouteOverlayDrawer {
mMoGoPolyline.setOption(mPolylineOptions);
}
}
long drawend = System.currentTimeMillis();
CallerLogger.INSTANCE.d(M_OLD_ROUTE + TAG, "drawTrajectoryList cost : " + (drawend - drawstart));
}
public void initDraw() {