Merge branch 'dev_robotaxi-d-app-module_2100_220816_2.10.0' of gitlab.zhidaoauto.com:zhjt/AndroidApp/MoGoEagleEye into dev_robotaxi-d-app-module_2100_220816_2.10.0
This commit is contained in:
@@ -32,7 +32,7 @@ buildscript {
|
||||
classpath "com.bytedance.android.byteX:base-plugin:0.3.0"
|
||||
classpath "com.mogo.cloud:hook:${HOOK_LOG_VERSION}"
|
||||
classpath 'com.volcengine:apm_insight_plugin:1.4.1'
|
||||
classpath 'com.mogo.cloud:thread_opt:5.0.5'
|
||||
classpath 'com.mogo.thread.opt:plg:1.0.1'
|
||||
classpath 'com.mogo.cloud:systrace:1.0.1'
|
||||
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.18'
|
||||
|
||||
|
||||
@@ -3,13 +3,16 @@ package com.mogo.eagle.core.function.hmi.ui.pnc
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import androidx.appcompat.content.res.AppCompatResources
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.data.autopilot.pnc.PncActionsHelper
|
||||
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
|
||||
import com.mogo.eagle.core.data.trafficlight.currentRoadTrafficLight
|
||||
import com.mogo.eagle.core.data.trafficlight.isRed
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningActionsListener
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener.Companion.STATUS_AUTOPILOT_RUNNING
|
||||
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningActionsListenerManager
|
||||
import com.mogo.eagle.core.function.call.trafficlight.CallerTrafficLightListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
@@ -52,7 +55,8 @@ class PncActionsView @JvmOverloads constructor(
|
||||
var actions: String? = null
|
||||
planningActionMsg.actionMsg?.let {
|
||||
|
||||
actions = PncActionsHelper.getAction(it.drivingState.number, it.drivingAction.number)
|
||||
actions =
|
||||
PncActionsHelper.getAction(it.drivingState.number, it.drivingAction.number)
|
||||
|
||||
//如果是存在云端红绿灯数据条件下,设置云端数据
|
||||
if (PncActionsHelper.isWaitingTrafficlight(
|
||||
@@ -68,7 +72,11 @@ class PncActionsView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
// update view
|
||||
actions?.let {
|
||||
if (actions.isNullOrEmpty() || getAutoPilotStatusInfo().state != STATUS_AUTOPILOT_RUNNING) {
|
||||
this.background = null
|
||||
tvHmiPncActions.text = ""
|
||||
} else {
|
||||
this.background = AppCompatResources.getDrawable(context, R.drawable.pnc_actions_bg)
|
||||
tvHmiPncActions.text = actions
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.widget;
|
||||
|
||||
import static com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
@@ -15,7 +17,7 @@ import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotVehicleStateListener;
|
||||
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.CallerAutopilotPlanningActionsListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotVehicleStateListenerManager;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
@@ -24,6 +26,7 @@ import com.mogo.eagle.core.utilcode.util.ThreadUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import chassis.Chassis;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
/**
|
||||
* @author Jing
|
||||
@@ -60,7 +63,7 @@ public class TrafficDataView extends ConstraintLayout {
|
||||
accTextView.setText("- " + accStr);
|
||||
}
|
||||
int state = CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo().getState();
|
||||
if (state < 2) {
|
||||
if (state < STATUS_AUTOPILOT_RUNNING) {
|
||||
if (mBrake > 0) {
|
||||
brakeStatus.setImageResource(R.drawable.traffic_data_brake);
|
||||
} else if (mThrottle >= 0 && mBrake == 0) {
|
||||
@@ -99,11 +102,7 @@ public class TrafficDataView extends ConstraintLayout {
|
||||
super.onAttachedToWindow();
|
||||
handler.sendEmptyMessageDelayed(MSG_SEND_UPDATE, 1000L);
|
||||
CallerAutopilotVehicleStateListenerManager.INSTANCE.addListener(TAG, mIMoGoAutopilotVehicleStateListener);
|
||||
CallerAutopilotCarStatusListenerManager.INSTANCE.addListener(TAG, gnssInfo -> {
|
||||
if (gnssInfo != null) {
|
||||
acceleration = gnssInfo.getAcceleration();
|
||||
}
|
||||
});
|
||||
CallerAutopilotPlanningActionsListenerManager.INSTANCE.addListener(TAG, planningActionMsg -> acceleration = planningActionMsg.getDestinationAcc());
|
||||
}
|
||||
|
||||
private void initView(@NonNull Context context) {
|
||||
@@ -119,7 +118,7 @@ public class TrafficDataView extends ConstraintLayout {
|
||||
protected void onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow();
|
||||
CallerAutopilotVehicleStateListenerManager.INSTANCE.removeListener(TAG);
|
||||
CallerAutopilotCarStatusListenerManager.INSTANCE.removeListener(TAG);
|
||||
CallerAutopilotPlanningActionsListenerManager.INSTANCE.removeListener(TAG);
|
||||
}
|
||||
|
||||
private final IMoGoAutopilotVehicleStateListener mIMoGoAutopilotVehicleStateListener = new IMoGoAutopilotVehicleStateListener() {
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
@@ -184,7 +184,7 @@
|
||||
<com.mogo.eagle.core.function.hmi.ui.pnc.PncActionsView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_200"
|
||||
android:layout_marginBottom="@dimen/dp_110"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"/>
|
||||
|
||||
@@ -2,14 +2,17 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="@dimen/dp_100">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvHmiPncActions"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/sp_38"
|
||||
android:gravity="center"
|
||||
android:paddingStart="@dimen/dp_68"
|
||||
android:paddingEnd="@dimen/dp_68"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="@dimen/dp_34"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
||||
@@ -15,19 +15,25 @@
|
||||
<dimen name="dp_18">18px</dimen>
|
||||
<dimen name="dp_30">30px</dimen>
|
||||
<dimen name="dp_36">36px</dimen>
|
||||
<dimen name="dp_34">34px</dimen>
|
||||
<dimen name="dp_38">38px</dimen>
|
||||
<dimen name="dp_42">42px</dimen>
|
||||
<dimen name="dp_45">45px</dimen>
|
||||
<dimen name="dp_46">46px</dimen>
|
||||
<dimen name="dp_48">48px</dimen>
|
||||
<dimen name="dp_50">50px</dimen>
|
||||
<dimen name="dp_52">52px</dimen>
|
||||
<dimen name="dp_54">54px</dimen>
|
||||
<dimen name="dp_56">56px</dimen>
|
||||
<dimen name="dp_62">62px</dimen>
|
||||
<dimen name="dp_68">68px</dimen>
|
||||
<dimen name="dp_70">70px</dimen>
|
||||
<dimen name="dp_75">80px</dimen>
|
||||
<dimen name="dp_72">72px</dimen>
|
||||
<dimen name="dp_75">75px</dimen>
|
||||
<dimen name="dp_80">80px</dimen>
|
||||
<dimen name="dp_96">96px</dimen>
|
||||
<dimen name="dp_100">100px</dimen>
|
||||
<dimen name="dp_110">110px</dimen>
|
||||
<dimen name="dp_140">140px</dimen>
|
||||
<dimen name="dp_150">150px</dimen>
|
||||
<dimen name="dp_180">180px</dimen>
|
||||
|
||||
@@ -2,9 +2,7 @@ package com.mogo.eagle.core.function.map.identify
|
||||
|
||||
import android.os.Handler
|
||||
import android.os.Message
|
||||
import android.util.Log
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.thread.WorkThreadHandler
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import mogo.telematics.pad.MessagePad.TrackedObject
|
||||
@@ -37,29 +35,31 @@ object IdentifyFactory : Identify {
|
||||
object : Handler(WorkThreadHandler.newInstance("IdentifyFactoryDrawer").looper) {
|
||||
override fun handleMessage(msg: Message) {
|
||||
super.handleMessage(msg)
|
||||
if(!FunctionBuildConfig.isBeautyMode){
|
||||
if(identify is IdentifyBeautifyDataDrawer){
|
||||
if (!FunctionBuildConfig.isBeautyMode) {
|
||||
// 非感知美化优化模式,清除旧数据,使用 DriverIdentify originDataDrawer 原始数据绘制
|
||||
if (identify is IdentifyBeautifyDataDrawer) {
|
||||
identify!!.clearOldMarker()
|
||||
identify = DriverIdentify.originDataDrawer
|
||||
}
|
||||
}else{
|
||||
if(identify is IdentifyOriginDataDrawer){
|
||||
} else {
|
||||
// 感知优化模式,清除旧数据,使用 UserIdentify beautifyDataDrawer 优化数据
|
||||
if (identify is IdentifyOriginDataDrawer) {
|
||||
identify!!.clearOldMarker()
|
||||
identify = UserIdentify.beautifyDataDrawer
|
||||
identify = UserIdentify.beautifyDataDrawer
|
||||
}
|
||||
}
|
||||
when(msg.what){
|
||||
when (msg.what) {
|
||||
MSG_DATA_TRACK -> {
|
||||
if(msg.obj is List<*>){
|
||||
if (msg.obj is List<*>) {
|
||||
identify!!.renderAdasRecognizedResult(msg.obj as List<TrackedObject>?)
|
||||
}
|
||||
}
|
||||
MSG_DATA_WARNING -> {
|
||||
if(msg.obj is List<*>){
|
||||
if (msg.obj is List<*>) {
|
||||
identify!!.renderPlanningWarningObj(msg.obj as List<MessagePad.PlanningObject>?)
|
||||
}
|
||||
}
|
||||
MSG_DATA_CLEAR ->{
|
||||
MSG_DATA_CLEAR -> {
|
||||
identify!!.clearOldMarker()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.graphics.Point;
|
||||
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.map.marker.AMapInfoWindowAdapter;
|
||||
import com.mogo.map.marker.AMapMarkerWrapper;
|
||||
@@ -114,13 +115,13 @@ public class AMapWrapper implements IMogoMap {
|
||||
markerOptionsArrayList.add(markerOptions);
|
||||
}
|
||||
});
|
||||
MarkerHelper.INSTANCE.updateBatchMarkerPositon(markerOptionsArrayList, false, 8.0f, 1, 100, 1);
|
||||
MarkerHelper.INSTANCE.updateBatchMarkerPositon(markerOptionsArrayList, false, FunctionBuildConfig.isBeautyMode ? 8.0f : 0f, 1, 100, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String addPreVehicleModel(int type, int modelRes) {
|
||||
try {
|
||||
return MarkerHelper.INSTANCE.addPreVehicleModel(type, modelRes);
|
||||
return MarkerHelper.INSTANCE.addPreVehicleModel(type, modelRes);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -99,7 +99,6 @@ public class RouteOverlayDrawer {
|
||||
int total;
|
||||
try {
|
||||
pps.clear();
|
||||
long drawStart = SystemClock.elapsedRealtime();
|
||||
List<MessagePad.TrajectoryPoint> routes = this.routeList;
|
||||
if (routes == null || (total = routes.size()) < 2) {
|
||||
isExcept = true;
|
||||
@@ -136,7 +135,6 @@ public class RouteOverlayDrawer {
|
||||
}
|
||||
double lon = CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lon();
|
||||
double lat = CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lat();
|
||||
int removeCount = 0;
|
||||
if (points.size() > 0) {
|
||||
MogoLatLng top = null;
|
||||
while (points.size() != 0) {
|
||||
@@ -151,7 +149,6 @@ public class RouteOverlayDrawer {
|
||||
lat = CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lat();
|
||||
long angle = isPointOnCarFront(lon, lat, bearing, first.lon, first.lat);
|
||||
if (angle >= 90) {
|
||||
removeCount++;
|
||||
RouteStrategy.INSTANCE.remove(first.acc);
|
||||
pools.release(first);
|
||||
points.poll();
|
||||
@@ -203,10 +200,8 @@ public class RouteOverlayDrawer {
|
||||
} else {
|
||||
isExcept = true;
|
||||
}
|
||||
long drawEnd = SystemClock.elapsedRealtime();
|
||||
Logger.d(M_OLD_ROUTE + TAG, "drawTrajectoryList cost : " + (drawEnd - drawStart) + "ms and isExcept:" + isExcept + "::removeCount:" + removeCount + "::total:" + total);
|
||||
} catch (Throwable t) {
|
||||
Logger.d(M_OLD_ROUTE + TAG, "drawTrajectoryList error (isExcept: "+isExcept+") : " + t);
|
||||
t.printStackTrace();
|
||||
} finally {
|
||||
if (isExcept) {
|
||||
setVisible(false);
|
||||
@@ -224,16 +219,7 @@ public class RouteOverlayDrawer {
|
||||
}
|
||||
|
||||
private long isPointOnCarFront(double car_lon, double car_lat, double car_head, double lon, double lat) {
|
||||
long start = SystemClock.elapsedRealtime();
|
||||
try {
|
||||
// 计算车辆与点之间的夹角
|
||||
long diffAngle = DrivingDirectionUtils.getDegreeOfCar2Poi2(
|
||||
car_lon, car_lat, lon, lat, car_head);
|
||||
CallerLogger.INSTANCE.d(M_OLD_ROUTE + TAG, "isPointOnCarFront: angle->" + diffAngle);
|
||||
return diffAngle;
|
||||
} finally {
|
||||
CallerLogger.INSTANCE.d(M_OLD_ROUTE + TAG, "isPointOnCarFront cost:" + (SystemClock.elapsedRealtime() - start) + "ms");
|
||||
}
|
||||
return DrivingDirectionUtils.getDegreeOfCar2Poi2(car_lon, car_lat, lon, lat, car_head);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user