增加了对识别数据的绘制动态控制

增加动态控制自车定位数据源

Signed-off-by: 董宏宇 <martindhy@gmail.com>
This commit is contained in:
董宏宇
2021-10-20 12:46:43 +08:00
parent 351b879fcb
commit c0f02ce58d
10 changed files with 176 additions and 37 deletions

2
.idea/misc.xml generated
View File

@@ -17,7 +17,7 @@
<entry key="core/function-impl/mogo-core-function-hmi/src/main/res/layout/fragment_hmi.xml" value="0.33" />
<entry key="core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_autopilot_status.xml" value="0.25833333333333336" />
<entry key="core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_check_status.xml" value="1.0" />
<entry key="core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml" value="0.26614583333333336" />
<entry key="core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_debug_setting.xml" value="0.5" />
<entry key="core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_perspective_switch.xml" value="0.24947916666666667" />
<entry key="core/function-impl/mogo-core-function-hmi/src/main/res/layout/view_traffic_light_vr.xml" value="1.0" />
<entry key="modules/mogo-module-adas/src/main/res/drawable/module_adas_left_corner_bg.xml" value="0.22125" />

View File

@@ -14,7 +14,7 @@ import com.mogo.cloud.passport.IMoGoTokenCallback;
import com.mogo.cloud.passport.MoGoAiCloudClient;
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.FunctionBuildConfig;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.commons.constants.SharedPrefsConstants;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.commons.network.Utils;

View File

@@ -8,6 +8,7 @@ import com.mogo.cloud.passport.MoGoAiCloudClient
import com.mogo.commons.AbsMogoApplication
import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.data.autopilot.*
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.constants.MoGoConfig
import com.mogo.eagle.core.data.obu.ObuStatusInfo
import com.mogo.eagle.core.data.traffic.TrafficData
@@ -98,6 +99,59 @@ class DebugSettingView @JvmOverloads constructor(
btnRecordPackage.setOnClickListener {
CallerAutoPilotManager.recordPackage()
}
// 初始化 GSP数据源 数据
rgGpsProvider.check(
when (FunctionBuildConfig.gpsProvider) {
0 -> {
R.id.rbGpsProviderAndroid
}
1 -> {
R.id.rbGpsProviderRTK
}
2 -> {
R.id.rbGpsProviderOBU
}
else -> R.id.rbGpsProviderAndroid
}
)
rgGpsProvider.setOnCheckedChangeListener { group, checkedId ->
when (checkedId) {
R.id.rbGpsProviderAndroid -> {
FunctionBuildConfig.gpsProvider = 0
}
R.id.rbGpsProviderRTK -> {
FunctionBuildConfig.gpsProvider = 1
}
R.id.rbGpsProviderOBU -> {
FunctionBuildConfig.gpsProvider = 2
}
}
}
// 初始化 感知数据是否绘制 选择情况
rgIsDrawIdentifyData.check(
when (FunctionBuildConfig.isDrawIdentifyData) {
true -> {
R.id.rbDraw
}
false -> {
R.id.rbDoNotDraw
}
}
)
rgIsDrawIdentifyData.setOnCheckedChangeListener { group, checkedId ->
when (checkedId) {
R.id.rbDraw -> {
FunctionBuildConfig.isDrawIdentifyData = true
}
R.id.rbDoNotDraw -> {
FunctionBuildConfig.isDrawIdentifyData = false
}
}
}
}
/**

View File

@@ -12,6 +12,86 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<!--地图呈现数据源控制-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#B200BCD4"
android:padding="@dimen/dp_10"
android:text="地图呈现数据源控制"
android:textColor="#000"
android:textSize="@dimen/dp_34"
android:textStyle="bold" />
<RadioGroup
android:id="@+id/rgGpsProvider"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<RadioButton
android:id="@+id/rbGpsProviderAndroid"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/dp_10"
android:text="使用Android定位数据"
android:textColor="#000"
android:textSize="@dimen/dp_34" />
<RadioButton
android:id="@+id/rbGpsProviderRTK"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/dp_10"
android:text="使用RTK定位数据"
android:textColor="#000"
android:textSize="@dimen/dp_34" />
<RadioButton
android:id="@+id/rbGpsProviderOBU"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/dp_10"
android:text="使用OBU定位数据"
android:textColor="#000"
android:textSize="@dimen/dp_34" />
</RadioGroup>
<RadioGroup
android:id="@+id/rgIsDrawIdentifyData"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<RadioButton
android:id="@+id/rbDraw"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/dp_10"
android:text="绘制感知数据"
android:textColor="#000"
android:textSize="@dimen/dp_34" />
<RadioButton
android:id="@+id/rbDoNotDraw"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/dp_10"
android:text="不绘制感知数据"
android:textColor="#000"
android:textSize="@dimen/dp_34" />
</RadioGroup>
</LinearLayout>
<!--鹰眼应用配置信息-->
<LinearLayout
android:layout_width="match_parent"

View File

@@ -0,0 +1,20 @@
package com.mogo.eagle.core.data.config
/**
* @author xiaoyuzhou
* @date 2021/8/24 8:59 下午
* 功能构建配置文件,根据 APP 中build.gradle productFlavors 配置的不同将直接影响加载的功能的不同
*/
object FunctionBuildConfig {
/**
* 自车位置使用哪种外部数据源,0-Android系统1-工控机2-OBU
*/
@JvmField
var gpsProvider = 0
/**
* 地图是否绘制Adas识别回调的Marker
*/
@JvmField
var isDrawIdentifyData = true
}

View File

@@ -1,16 +0,0 @@
package com.mogo.commons;
/**
* @author xiaoyuzhou
* @date 2021/8/24 8:59 下午
* 功能构建配置文件,根据 APP 中build.gradle productFlavors 配置的不同将直接影响加载的功能的不同
*/
public class FunctionBuildConfig {
// 地图是否绘制Adas识别回调的Marker
public static boolean isShowAdasMarker = true;
// 自车位置使用哪种外部数据源,0-Android系统1-工控机2-OBU
public static int gpsProvider = 0;
}

View File

@@ -19,7 +19,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.mogo.commons.FunctionBuildConfig;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.commons.constants.SharedPrefsConstants;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.eagle.core.data.map.MogoLatLng;

View File

@@ -6,19 +6,18 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.google.gson.Gson;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.eagle.core.data.autopilot.AutopilotCarStateInfo;
import com.mogo.eagle.core.data.autopilot.AutopilotGuardianStatusInfo;
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.config.FunctionBuildConfig;
import com.mogo.eagle.core.data.traffic.TrafficData;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.module.adas.model.AdasServiceModel;
import com.mogo.module.common.drawer.IdentifyDataDrawer;
import com.mogo.service.statusmanager.IMogoStatusManager;
import com.mogo.utils.logger.Logger;
import com.mogo.utils.network.utils.GsonUtil;
import com.zhidao.autopilotservice.model.AdasAIDLAutopilotStateModel;
@@ -239,8 +238,10 @@ public class AdasEventManager implements OnAdasMsgConnectStatusListener, IMoGoAu
} else {
final long start = System.nanoTime();
try {
IdentifyDataDrawer.getInstance().renderAdasRecognizedResult(trafficData);
Log.i(TAG, "接收数据 -> 发出 cost :" + TimeUnit.NANOSECONDS.toMillis((System.nanoTime() - start)) + "ms");
if (FunctionBuildConfig.isDrawIdentifyData) {
IdentifyDataDrawer.getInstance().renderAdasRecognizedResult(trafficData);
Log.i(TAG, "接收数据 -> 发出 cost :" + TimeUnit.NANOSECONDS.toMillis((System.nanoTime() - start)) + "ms");
}
} catch (Exception e) {
e.printStackTrace();
}

View File

@@ -1,6 +1,6 @@
package com.mogo.module.common.datacenter;
import com.mogo.commons.FunctionBuildConfig;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
@@ -91,17 +91,19 @@ public class SnapshotLocationDataCenter {
long systemTime = data.optLong("systemTime");
int gpsProvider = data.optInt("gpsProvider", 1);
//测试面板状态同步
AutopilotStatusInfo autopilotStatusInfo = CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo();
autopilotStatusInfo.setLocationLat(lat);
autopilotStatusInfo.setLocationLon(lon);
autopilotStatusInfo.setLocationStatus(true);
CallerAutoPilotStatusListenerManager.INSTANCE.invokeAutoPilotStatus();
DebugConfig.setStatusData(DebugConfig.sLon, lon);
DebugConfig.setStatusData(DebugConfig.sLat, lat);
// 使用与渠道配置一样的gps提供者提供的数据
if (gpsProvider == FunctionBuildConfig.gpsProvider) {
//测试面板状态同步
AutopilotStatusInfo autopilotStatusInfo = CallerAutoPilotStatusListenerManager.INSTANCE.getAutoPilotStatusInfo();
autopilotStatusInfo.setLocationLat(lat);
autopilotStatusInfo.setLocationLon(lon);
CallerAutoPilotStatusListenerManager.INSTANCE.invokeAutoPilotStatus();
DebugConfig.setStatusData(DebugConfig.sLon, lon);
DebugConfig.setStatusData(DebugConfig.sLat, lat);
CloudLocationInfo cloudLocationInfo = new CloudLocationInfo();
cloudLocationInfo.setAlt(alt);
cloudLocationInfo.setHeading(heading);

View File

@@ -6,7 +6,7 @@ import android.text.TextUtils;
import com.mogo.cloud.socket.entity.SocketDownData;
import com.mogo.commons.AbsMogoApplication;
import com.mogo.commons.FunctionBuildConfig;
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.eagle.core.data.map.MogoLatLng;
import com.mogo.map.marker.IMogoMarker;
@@ -16,12 +16,10 @@ import com.mogo.map.uicontroller.EnumMapUI;
import com.mogo.module.common.ModuleNames;
import com.mogo.module.common.MogoApisHandler;
import com.mogo.module.common.api.CallChatApi;
import com.mogo.module.common.drawer.AdasRecognizedResultDrawer;
import com.mogo.module.common.drawer.IdentifyDataDrawer;
import com.mogo.module.common.drawer.MarkerDrawer;
import com.mogo.module.common.drawer.OnlineCarDrawer;
import com.mogo.module.common.drawer.RoadConditionDrawer;
import com.mogo.module.common.drawer.SnapshotSetDataDrawer;
import com.mogo.module.common.drawer.marker.IMarkerView;
import com.mogo.module.common.drawer.marker.MapMarkerAdapter;
import com.mogo.module.common.drawer.marker.OnlineCarMarkerView;
@@ -184,7 +182,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
// msg.sendToTarget();
// 使用与渠道配置一样的gps提供者提供的数据 修改fPadLenovo.gradle文件中的GPS_PROVIDER字段控制渲染来源
Logger.d(TAG, "result.addAdasRecognizedDataCallback == 3 ------> ");
if (FunctionBuildConfig.gpsProvider != 2) {
if (FunctionBuildConfig.isDrawIdentifyData) {
IdentifyDataDrawer.getInstance().renderAdasRecognizedResult(resultList);
}