Merge branch 'dev_robosweeper-d_app-module_221230_1.1.0' into dev_arch_opt_3.0

# Conflicts:
#	OCH/mogo-och-common-module/src/main/java/com/mogo/och/common/module/utils/CallerLoggerUtils.kt
#	OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/ui/SweeperOperatePanelView.java
#	app/src/main/java/com/mogo/launcher/stageone/ConfigStartUp.kt
#	core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasListenerImpl.kt
#	core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoHandAdasMsgManager.java
#	core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/AIDataCollectWindow.kt
#	core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/badcase/biz/InitiativeBadCaseWindow.kt
#	core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/SteeringWheelView.java
#	core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/widget/TrafficDataView.java
#	core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/smp/SmallMapFragment.java
#	core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotVehicleStateListener.kt
#	core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutopilotVehicleStateListenerManager.kt
#	gradle.properties
#	libraries/mogo-map/src/main/java/com/mogo/map/CustomMapApiBuilder.java
This commit is contained in:
donghongyu
2023-01-09 18:42:03 +08:00
40 changed files with 854 additions and 128 deletions

View File

@@ -1,5 +1,6 @@
package com.mogo.eagle.core.function.datacenter.autopilot.adapter
import chassis.ChassisStatesOuterClass
import chassis.VehicleStateOuterClass
import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.data.config.FunctionBuildConfig
@@ -58,6 +59,7 @@ import com.zhidao.support.adas.high.bean.AutopilotStatistics
import com.zhidao.support.adas.high.common.ProtocolStatus
import com.zhjt.service.chain.ChainLog
import com.zhjt.service.chain.TracingConstants.Endpoint.Companion.PAD
import function_state_management.FunctionStates
import mogo.telematics.pad.MessagePad
import mogo.telematics.pad.MessagePad.TrackedObject
import mogo_msg.MogoReportMsg
@@ -139,38 +141,66 @@ class MoGoAdasListenerImpl : OnAdasListener {
}
}
//自车状态(底盘),车灯等。
@ChainLog(
linkChainLog = CHAIN_LINK_LOG_WEB_SOCKET_VEHICLE,
linkCode = CHAIN_LINK_ADAS,
endpoint = PAD,
nodeAliasCode = CHAIN_ALIAS_CODE_ADAS_MESSAGE_AUTOPILOT_VEHICLE,
paramIndexes = [0, 1],
clientPkFileName = "sn"
)
/**
* 老底盘
* TODO 老地盘数据会转发到新地盘
* TODO 鹰眼不要用此接口展示页面相关可以用来记录链路日志
*
* @param header 头
* @param vehicleState 数据
*/
override fun onVehicleState(
header: MessagePad.Header,
vehicleState: VehicleStateOuterClass.VehicleState?
) {
if (vehicleState != null) {
//转向灯数据
CallerChassisLamplightListenerManager.invokeAutopilotLightSwitchData(vehicleState.light)
//刹车灯数据
CallerChassisLamplightListenerManager.invokeAutopilotBrakeLightData(vehicleState.brakeLightStatus)
//方向盘转向角数据
CallerChassisSteeringStateListenerManager.invokeAutopilotSteeringData(vehicleState.steering)
//挂挡档位数据
CallerChassisGearStateListenerManager.invokeAutopilotGearData(vehicleState.gear)
//加速度
CallerChassisAccStateListenerManager.invokeAutopilotAcc(vehicleState.accel)
//油门
CallerChassisThrottleStateListenerManager.invokeAutopilotThrottle(vehicleState.throttle)
//刹车
CallerChassisBrakeStateListenerManager.invokeAutopilotBrake(vehicleState.brake)
//清扫车(福田)清扫控制系统状态
vehicleState.sweeperFutianCleanSystemState?.also {
CallerSweeperFutianCleanSystemListenerManager.invokeSweeperFutianCleanSystemState(it)
}
@ChainLog(
linkChainLog = CHAIN_LINK_LOG_WEB_SOCKET_VEHICLE,
linkCode = CHAIN_LINK_ADAS,
endpoint = PAD,
nodeAliasCode = CHAIN_ALIAS_CODE_ADAS_MESSAGE_AUTOPILOT_VEHICLE,
paramIndexes = [0, 1],
clientPkFileName = "sn"
)
override fun onChassisStates(header: MessagePad.Header, chassisStates: ChassisStatesOuterClass.ChassisStates?) {
if (chassisStates != null) {
chassisStates.bcmSystemStates?.let { bcmSystemStates ->
bcmSystemStates.turnLightState?.let {
//转向灯数据
CallerChassisLamplightListenerManager.invokeAutopilotLightSwitchData(it)
}
//刹车灯数据
CallerChassisLamplightListenerManager.invokeAutopilotBrakeLightData(bcmSystemStates.brakeLightState != 0)
}
chassisStates.steerSystemStates?.let {
//方向盘转向角数据
CallerChassisSteeringStateListenerManager.invokeAutopilotSteeringData(it.steeringWheelAngle)
}
chassisStates.gearSystemStates?.let { gearSystemStates ->
gearSystemStates.gearPosition?.let {
//挂挡档位数据
CallerChassisGearStateListenerManager.invokeAutopilotGearData(it)
}
}
chassisStates.vehicleMotionStates?.let {
//加速度
CallerChassisAccStateListenerManager.invokeAutopilotAcc(it.acceleration)
}
chassisStates.drivingSystemStates?.let {
//油门
CallerChassisThrottleStateListenerManager.invokeAutopilotThrottle(it.throttleResponsePosition)
}
chassisStates.brakeSystemStates?.let {
//刹车
CallerChassisBrakeStateListenerManager.invokeAutopilotBrake(it.brakePedalResponsePosition)
}
chassisStates.taskSystemStates?.let { taskSystemStates ->
taskSystemStates.sweeperFutianTaskSystemStates?.let {
//清扫车(福田)清扫控制系统状态
CallerSweeperFutianCleanSystemListenerManager.invokeSweeperFutianCleanSystemState(it)
}
}
} else {
CallerAutopilotVehicleStateListenerManager.invokeAutopilotDataException(header.timestamp.toLong())
@@ -434,7 +464,15 @@ class MoGoAdasListenerImpl : OnAdasListener {
invokePNCActions(it)
}
}
/**
* 重构后的功能状态
*
* @param header 头
* @param functionStates 头
*/
override fun onFunctionStates(header: MessagePad.Header?, functionStates: FunctionStates.FSMFunctionStates?) {
}
/**
* 是否可以启动自动驾驶

View File

@@ -332,7 +332,7 @@ class AIDataCollectWindow constructor(activity: Activity) : View.OnTouchListener
// 默认固定位置,靠屏幕右边缘的中间
mWindowManager!!.defaultDisplay.getMetrics(metrics)
mWindowParams!!.x = metrics.widthPixels
mWindowParams!!.y = metrics.heightPixels / 2 - BarUtils.getStatusBarHeight() - 350
mWindowParams!!.y = metrics.heightPixels - BarUtils.getStatusBarHeight()-950
mWindowManager!!.addView(mFloatLayout, mWindowParams)
}
}

View File

@@ -343,7 +343,7 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
// 默认固定位置,靠屏幕右边缘的中间
mWindowManager!!.defaultDisplay.getMetrics(metrics)
mWindowParams!!.x = metrics.widthPixels
mWindowParams!!.y = metrics.heightPixels / 2 - BarUtils.getStatusBarHeight() - 950
mWindowParams!!.y = metrics.heightPixels - BarUtils.getStatusBarHeight()-950
mWindowManager!!.addView(mFloatLayout, mWindowParams)
//开启录包
if (recordCaseEntity != null) {

View File

@@ -16,6 +16,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OBU
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OLD_ROUTE
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_OTHER
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_SWEEPER
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_TAXI
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_TAXI_P
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_V2X
@@ -38,6 +39,7 @@ class SceneManager {
private const val NET = "NET"
private const val BUS = "BUS"
private const val TAXI = "TAXI"
private const val SWEEPER = "SWEEPER"
private const val TAXI_P = "TAXI_P"
private const val OTHER = "OTHER"
@@ -63,6 +65,7 @@ class SceneManager {
sceneModuleTAG.map[BUS] = SceneModule(true, M_BUS)
sceneModuleTAG.map[TAXI] = SceneModule(true, M_TAXI)
sceneModuleTAG.map[TAXI_P] = SceneModule(true, M_TAXI_P)
sceneModuleTAG.map[SWEEPER] = SceneModule(true, M_SWEEPER)
sceneModuleTAG.map[OTHER] = SceneModule(false, M_OTHER)
sceneLogTAG.map[TAXI] = SceneTAG(false)
@@ -160,6 +163,15 @@ class SceneManager {
sceneCache[M_OLD_ROUTE]?.logger = logger
scene.updateSceneCache(sceneCache)
}
SWEEPER -> {
sceneCache[M_SWEEPER]?.logger = logger
sceneCache[M_NETWORK]?.logger = logger
sceneCache[M_ADAS_IMPL]?.logger = logger
sceneCache[M_HMI]?.logger = logger
sceneCache[M_DEVA]?.logger = logger
sceneCache[M_OLD_ROUTE]?.logger = logger
scene.updateSceneCache(sceneCache)
}
}
}
}

View File

@@ -4,7 +4,7 @@ import android.content.Context
import android.util.Log
import chassis.Chassis.GearPosition
import chassis.Chassis.LightSwitch
import chassis.VehicleStateOuterClass
import chassis.ChassisStatesOuterClass
import com.mogo.eagle.core.function.api.autopilot.*
import com.mogo.eagle.core.function.call.autopilot.*
import com.mogo.eagle.core.utilcode.kotlin.safeCancel
@@ -105,7 +105,7 @@ internal class CanImpl(ctx: Context) :
timeOutCheck()
}
override fun onSweeperFutianCleanSystemState(cleanSystemState: VehicleStateOuterClass.SweeperFuTianCleanSystemState) {
override fun onSweeperFutianCleanSystemState(cleanSystemState: ChassisStatesOuterClass.SweeperFuTianTaskSystemStates) {
send(CanStatus(isCanEnabled()))
timeOutCheck()
}

View File

@@ -18,7 +18,7 @@ import androidx.core.content.ContextCompat
import androidx.core.view.*
import androidx.recyclerview.widget.LinearLayoutManager
import chassis.Chassis
import chassis.VehicleStateOuterClass
import chassis.ChassisStatesOuterClass
import com.mogo.cloud.passport.MoGoAiCloudClient
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.commons.debug.DebugConfig
@@ -1251,6 +1251,8 @@ class DebugSettingView @JvmOverloads constructor(
SceneConstant.M_TAXI -> cbTaxiLog.isChecked = log
//TAXI_P日志标签
SceneConstant.M_TAXI_P -> cbTaxiPLog.isChecked = log
//清扫车日志
SceneConstant.M_SWEEPER -> cbSweeperPLog.isChecked = log
//其他模块日志(暂未区分具体模块)
SceneConstant.M_OTHER -> cbOtherLog.isChecked = log
}
@@ -1381,6 +1383,12 @@ class DebugSettingView @JvmOverloads constructor(
sceneMap[SceneConstant.M_TAXI_P] = taxiPModule
CallerDevaToolsManager.updateModuleTAG(sceneMap)
}
//清扫车日志标签
cbTaxiPLog.setOnCheckedChangeListener { _, isChecked ->
val sweeperModule = SceneModule(isChecked, SceneConstant.M_SWEEPER)
sceneMap[SceneConstant.M_SWEEPER] = sweeperModule
CallerDevaToolsManager.updateModuleTAG(sceneMap)
}
//其他未分类模块日志
cbOtherLog.setOnCheckedChangeListener { _, isChecked ->
val otherModule = SceneModule(isChecked, SceneConstant.M_OTHER)
@@ -2145,7 +2153,7 @@ class DebugSettingView @JvmOverloads constructor(
/**
* 清扫车(福田)清扫控制系统状态
*/
override fun onSweeperFutianCleanSystemState(cleanSystemState: VehicleStateOuterClass.SweeperFuTianCleanSystemState) {
override fun onSweeperFutianCleanSystemState(cleanSystemState: ChassisStatesOuterClass.SweeperFuTianTaskSystemStates) {
}

View File

@@ -2146,6 +2146,13 @@
android:layout_height="wrap_content"
android:checked="false"
android:text="乘客屏日志" />
<CheckBox
android:id="@+id/cbSweeperPLog"
style="@style/DebugSettingText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"
android:text="清扫车日志" />
<CheckBox
android:id="@+id/cbOtherLog"

View File

@@ -1,5 +1,7 @@
package com.mogo.eagle.core.function.smp;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_MAP;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
@@ -16,8 +18,10 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener;
import com.mogo.eagle.core.function.api.map.smp.IMogoSmallMapProvider;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager;
import com.mogo.eagle.core.function.map.R;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import org.jetbrains.annotations.NotNull;
@@ -67,6 +71,7 @@ public class SmallMapFragment extends BaseFragment
mSmallMapDirectionView = mRootView.findViewById(R.id.smallMapDirectionView);
mSmallMapDirectionView.onCreateView(savedInstanceState);
CallerPlanningRottingListenerManager.INSTANCE.addListener(TAG, this);
CallerAutoPilotStatusListenerManager.INSTANCE.addListener(TAG,this);
}
@Override
@@ -86,8 +91,13 @@ public class SmallMapFragment extends BaseFragment
@Override
public void drawablePolyline(List<MogoLatLng> coordinates) {
if (mSmallMapDirectionView != null) {
mSmallMapDirectionView.convert(coordinates);
UiThreadHandler.post(() -> mSmallMapDirectionView.drawablePolyline());
UiThreadHandler.post(new Runnable() {
@Override
public void run() {
mSmallMapDirectionView.convert(coordinates);
mSmallMapDirectionView.drawablePolyline();
}
});
}
}
@@ -127,9 +137,12 @@ public class SmallMapFragment extends BaseFragment
@Override
public void onAutopilotStatusResponse(@NotNull AutopilotStatusInfo autoPilotStatusInfo) {
int tempStatus = autoPilotStatusInfo.getPilotmode();
CallerLogger.INSTANCE.i(M_MAP + TAG, "onAutopilotStatusResponse:"+tempStatus+" autoPilotStatus:"+autoPilotStatus);
if (tempStatus != 1) {
CallerLogger.INSTANCE.i(M_MAP + TAG, "onAutopilotStatusResponse:"+tempStatus+" clearPolyline");
clearPolyline();
}else if (tempStatus == 1 && autoPilotStatus == 0){
CallerLogger.INSTANCE.i(M_MAP + TAG, "onAutopilotStatusResponse:getGlobalPath");
CallerAutoPilotManager.INSTANCE.getGlobalPath();
}
autoPilotStatus = tempStatus;
@@ -156,16 +169,21 @@ public class SmallMapFragment extends BaseFragment
@Override
public void onAutopilotRotting(MessagePad.GlobalPathResp globalPathResp) {
CallerLogger.INSTANCE.i(M_MAP + TAG, "onAutopilotRotting");
if (globalPathResp == null || globalPathResp.getWayPointsList().size() == 0) {
return;
}
CallerLogger.INSTANCE.i(M_MAP + TAG, "onAutopilotRotting:"+globalPathResp.getWayPointsList().size());
List<MogoLatLng> latLngList = new ArrayList<>();
for (MessagePad.Location routeModel : globalPathResp.getWayPointsList()) {
latLngList.add(new MogoLatLng(routeModel.getLatitude(), routeModel.getLongitude()));
}
if (latLngList.size() > 0) {
CallerLogger.INSTANCE.i(M_MAP + TAG, "onAutopilotRotting:"+"drawablePolyline");
drawablePolyline(latLngList);
} else {
CallerLogger.INSTANCE.i(M_MAP + TAG, "onAutopilotRotting:"+"clearPolyline");
clearPolyline();
}
}