diff --git a/OCH/sweeper/sweeper-cloud/src/main/java/com/mogo/och/sweepercloud/fragment/SweeperFragment.kt b/OCH/sweeper/sweeper-cloud/src/main/java/com/mogo/och/sweepercloud/fragment/SweeperFragment.kt index 1dc67cae43..0714e5ddc3 100644 --- a/OCH/sweeper/sweeper-cloud/src/main/java/com/mogo/och/sweepercloud/fragment/SweeperFragment.kt +++ b/OCH/sweeper/sweeper-cloud/src/main/java/com/mogo/och/sweepercloud/fragment/SweeperFragment.kt @@ -122,6 +122,11 @@ class SweeperFragment : BaseSweeperTabFragment { + tvStartAuto.setTextColor(Color.parseColor("#66FFFFFF")) + tvStartAuto.isSelected = false + } + //人工驾驶 + IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_ENABLE -> { + tvStartAuto.setTextColor(Color.parseColor("#FFFFFFFF")) + tvStartAuto.isSelected = true + } + //自动驾驶中 + IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING -> { + tvStartAuto.setTextColor(Color.parseColor("#66FFFFFF")) + tvStartAuto.isSelected = false + } + //平行驾驶 + IMoGoAutopilotStatusListener.STATUS_PARALLEL_DRIVING -> { + tvStartAuto.setTextColor(Color.parseColor("#66FFFFFF")) + tvStartAuto.isSelected = false + } + } + } + /** * 设置当前任务数据 */ @@ -51,12 +93,13 @@ class SweeperCurrentTaskInfoView : ConstraintLayout { tvTaskName.text = taskName val calendarStart = DateTimeUtil.formatLongToCalendar(taskStartTime) val calendarEnd = DateTimeUtil.formatLongToCalendar(taskEndTime) - tvTaskTime.text = "${DateTimeUtil.formatCalendarToString(calendarStart, DateTimeUtil.HH_mm)}-${ - DateTimeUtil.formatCalendarToString( - calendarEnd, - DateTimeUtil.HH_mm - ) - }" + tvTaskTime.text = + "${DateTimeUtil.formatCalendarToString(calendarStart, DateTimeUtil.HH_mm)}-${ + DateTimeUtil.formatCalendarToString( + calendarEnd, + DateTimeUtil.HH_mm + ) + }" } listTask?.let { //特殊处理当前暂无执行中任务的情况 @@ -75,10 +118,10 @@ class SweeperCurrentTaskInfoView : ConstraintLayout { */ private fun setSubTaskState(isWorking: Boolean) { if (isWorking) { - tvTaskState.text = "正在作业" + tvTaskState.text = "任务执行中" tvTaskState.setBackgroundResource(R.drawable.bg_shape_task_state_working) } else { - tvTaskState.text = "暂未准备" + tvTaskState.text = "任务待开始" tvTaskState.setBackgroundResource(R.drawable.bg_shape_task_state_not_ready) } } diff --git a/OCH/sweeper/sweeper-cloud/src/main/res/drawable/sweeper_upload_autopoiltstate.xml b/OCH/sweeper/sweeper-cloud/src/main/res/drawable/sweeper_upload_autopoiltstate.xml index 6d189929bc..ea710c45e4 100644 --- a/OCH/sweeper/sweeper-cloud/src/main/res/drawable/sweeper_upload_autopoiltstate.xml +++ b/OCH/sweeper/sweeper-cloud/src/main/res/drawable/sweeper_upload_autopoiltstate.xml @@ -1,10 +1,15 @@ - + - - + + + + + + + \ No newline at end of file diff --git a/OCH/sweeper/sweeper-cloud/src/main/res/layout/sweeper_work_mode.xml b/OCH/sweeper/sweeper-cloud/src/main/res/layout/sweeper_work_mode.xml index f2e743be58..34be95b606 100644 --- a/OCH/sweeper/sweeper-cloud/src/main/res/layout/sweeper_work_mode.xml +++ b/OCH/sweeper/sweeper-cloud/src/main/res/layout/sweeper_work_mode.xml @@ -26,7 +26,7 @@ android:layout_height="wrap_content" android:layout_marginStart="@dimen/dp_36" android:layout_marginTop="@dimen/dp_20" - android:text="当前作业模式:" + android:text="当前上装模式:" android:textColor="@color/white" android:textSize="@dimen/dp_32" app:layout_constraintStart_toStartOf="parent" diff --git a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/MoGoAutopilotControlProvider.kt b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/MoGoAutopilotControlProvider.kt index 3eda2762f8..f538aa58b0 100644 --- a/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/MoGoAutopilotControlProvider.kt +++ b/core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/MoGoAutopilotControlProvider.kt @@ -10,30 +10,29 @@ import com.mogo.cloud.passport.MoGoAiCloudClientConfig import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters import com.mogo.eagle.core.data.autopilot.toAutoPilotLine import com.mogo.eagle.core.data.autopilot.toRouteInfo -import com.mogo.eagle.core.data.deva.badcase.BagManagerEntity +import com.mogo.eagle.core.data.biz.trafficlight.TrafficLightResult +import com.mogo.eagle.core.data.biz.trafficlight.toTrafficLightDetail import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.constants.MoGoConfig import com.mogo.eagle.core.data.constants.MogoServicePaths +import com.mogo.eagle.core.data.deva.badcase.BagManagerEntity import com.mogo.eagle.core.data.deva.chain.ChainConstant import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_ALIAS_CODE_MULTI_CONNECT import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_ADAS import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_CONNECT_STATUS import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT -import com.mogo.eagle.core.data.biz.trafficlight.TrafficLightResult -import com.mogo.eagle.core.data.biz.trafficlight.toTrafficLightDetail import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarConfigListener import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotControlProvider import com.mogo.eagle.core.function.api.map.collect.IMoGoMapDataCollectProvider -import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager +import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarConfigListenerManager +import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager +import com.mogo.eagle.core.function.call.map.CallerMapDataCollectorManager import com.mogo.eagle.core.function.datacenter.autopilot.adapter.MoGoAdasListenerImpl import com.mogo.eagle.core.function.datacenter.autopilot.adapter.MoGoAdasMsgConnectStatusListenerImpl import com.mogo.eagle.core.function.datacenter.autopilot.server.AsyncDataToAutopilotServer import com.mogo.eagle.core.function.datacenter.autopilot.telematic.EventListener import com.mogo.eagle.core.function.datacenter.autopilot.telematic.IMsgHandler import com.mogo.eagle.core.function.datacenter.autopilot.telematic.TeleMsgHandler -import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarConfigListenerManager -import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager -import com.mogo.eagle.core.function.call.map.CallerMapDataCollectorManager import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_ADAS_IMPL @@ -320,14 +319,41 @@ class MoGoAutopilotControlProvider : } override fun startAutoPilot(controlParameters: AutopilotControlParameters) { + startAutoPilot(controlParameters, Constants.AUTOPILOT_SOURCE.PAD) + } + + override fun startAutoPilotByMoFang(controlParameters: AutopilotControlParameters?) { + if (controlParameters==null){ + startAutoPilotWithNoParameter(Constants.AUTOPILOT_SOURCE.MO_FANG) + }else{ + startAutoPilot(controlParameters, Constants.AUTOPILOT_SOURCE.MO_FANG) + } + } + private fun startAutoPilotWithNoParameter(source: Int) { if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) { val invokeResult = AdasManager.getInstance() - .sendAutoPilotModeReq(1, 1, controlParameters.toRouteInfo()) + .sendAutoPilotModeReq(1, source, null) + invokeAutoPilotResult(if (invokeResult) "无参自动驾驶调用成功" else "自动驾驶调用失败, socket 或者 rawPack 可能为空") + } else { + if (AdasManager.getInstance().ipcConnectionStatus == IPC_CONNECTION_STATUS.CONNECTED) { + val invokeResult = AdasManager.getInstance() + .sendAutoPilotModeReq(1, source, null) + invokeAutoPilotResult(if (invokeResult) "无参自动驾驶调用成功" else "自动驾驶调用失败, socket 或者 rawPack 可能为空") + } else { + invokeAutoPilotResult("车机与工控机链接失败,无法开启自动驾驶 无参") + CallerLogger.e("$M_ADAS_IMPL$TAG", "车机与工控机链接失败,无法开启自动驾驶") + } + } + } + private fun startAutoPilot(controlParameters: AutopilotControlParameters, source: Int) { + if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) { + val invokeResult = AdasManager.getInstance() + .sendAutoPilotModeReq(1, source, controlParameters.toRouteInfo()) invokeAutoPilotResult(if (invokeResult) "自动驾驶调用成功" else "自动驾驶调用失败, socket 或者 rawPack 可能为空") } else { if (AdasManager.getInstance().ipcConnectionStatus == IPC_CONNECTION_STATUS.CONNECTED) { val invokeResult = AdasManager.getInstance() - .sendAutoPilotModeReq(1, 1, controlParameters.toRouteInfo()) + .sendAutoPilotModeReq(1, source, controlParameters.toRouteInfo()) invokeAutoPilotResult(if (invokeResult) "自动驾驶调用成功" else "自动驾驶调用失败, socket 或者 rawPack 可能为空") } else { invokeAutoPilotResult("车机与工控机链接失败,无法开启自动驾驶") diff --git a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/mofang/MoFangManager.kt b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/mofang/MoFangManager.kt index cf28e98458..1923955f1c 100644 --- a/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/mofang/MoFangManager.kt +++ b/core/function-impl/mogo-core-function-devatools/src/main/java/com/zhjt/mogo_core_function_devatools/mofang/MoFangManager.kt @@ -9,6 +9,7 @@ import android.content.Intent import android.content.IntentFilter import android.view.KeyEvent import com.mogo.commons.context.ContextHolderUtil +import com.mogo.eagle.core.data.config.FunctionBuildConfig import com.mogo.eagle.core.data.config.HmiBuildConfig import com.mogo.eagle.core.data.deva.mofang.MfConstants import com.mogo.eagle.core.function.api.devatools.mofang.IMoGoMoFangListener @@ -17,9 +18,11 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.sendOperatorSetAcceleratedSpeed import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.sendOperatorSetHorn import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.startAutoPilot +import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager.startAutoPilotByMoFang import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager.invokeMoFangStatus import com.mogo.eagle.core.function.call.mofang.CallerMofangListenerManager +import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.e import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_F @@ -319,7 +322,12 @@ class MoFangManager private constructor() : IMoGoMoFangListener { if (HmiBuildConfig.isShowMfToastView) { ToastUtils.showShort("方块 单击E 开启自动驾驶 timeInterval: ${pressEUpTime - startPressTime}ms") } - startAutoPilot(getAutoPilotStatusInfo().autopilotControlParameters) + //清扫车有FSM模块,魔方启动自驾时需要将Source修改为魔方,以便telamatics做区分并在转发时增加flag标记 + if (AppIdentityModeUtils.isSweeper(FunctionBuildConfig.appIdentityMode)) { + startAutoPilotByMoFang(getAutoPilotStatusInfo().autopilotControlParameters) + } else{ + startAutoPilot(getAutoPilotStatusInfo().autopilotControlParameters) + } } } } diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotControlProvider.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotControlProvider.kt index 28df0f814d..d4f979dc59 100644 --- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotControlProvider.kt +++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/autopilot/IMoGoAutopilotControlProvider.kt @@ -37,6 +37,13 @@ interface IMoGoAutopilotControlProvider : IMoGoFunctionServerProvider { */ fun startAutoPilot(controlParameters: AutopilotControlParameters) + /** + * 开启自动驾驶(魔方) + * + * @param controlParameters 开启自动驾驶的控制参数 + */ + fun startAutoPilotByMoFang(controlParameters: AutopilotControlParameters?) + /** * 给工控机透出路口红绿灯信息 */ diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotControlManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotControlManager.kt index c5eb0d1821..5bbca5918b 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotControlManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerAutoPilotControlManager.kt @@ -79,6 +79,25 @@ object CallerAutoPilotControlManager { CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(controlParameters) } + /** + * 开启自动驾驶 + * + * @param controlParameters 开启自动驾驶的控制参数 + */ + @ChainLog( + linkChainLog = CHAIN_LINK_LOG_WEB_SOCKET_AUTOPILOT, + linkCode = CHAIN_LINK_ADAS, + endpoint = TracingConstants.Endpoint.PAD, + nodeAliasCode = CHAIN_ALIAS_CODE_EAGLE_START_AUTOPILOT, + paramIndexes = [0], + clientPkFileName = "sn" + ) + fun startAutoPilotByMoFang(controlParameters: AutopilotControlParameters?) { + providerApi?.startAutoPilotByMoFang(controlParameters) + // 更新记录在全局的控制参数 + CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters(controlParameters) + } + /** * 发送红绿灯数据至工控机 */ diff --git a/gradle.properties b/gradle.properties index 419c2c2f3d..f56a887c77 100644 --- a/gradle.properties +++ b/gradle.properties @@ -171,6 +171,6 @@ CHARTER_DRIVER_VERSION=3.1.0 # 包车模式乘客端端版本号 CHARTER_PASSENGER_VERSION=2.2.0 # 支持云控清扫车模式司机端版本号 -SWEEPERCLOUD_DRIVER_VERSION=3.1.2 +SWEEPERCLOUD_DRIVER_VERSION=3.1.4 # 清扫车模式司机端版本号 SWEEPEROPERATE_DRIVER_VERSION=3.1.0 diff --git a/libraries/mogo-adas-data/src/main/proto/message_pad.proto b/libraries/mogo-adas-data/src/main/proto/message_pad.proto index 4868e38df6..7d5882a353 100644 --- a/libraries/mogo-adas-data/src/main/proto/message_pad.proto +++ b/libraries/mogo-adas-data/src/main/proto/message_pad.proto @@ -296,7 +296,7 @@ message RouteInfo message SetAutopilotModeReq { uint32 mode = 1; //1: enter autopilot mode, 0: quit autopilot mode - uint32 source = 2; //命令来源: 0: pad模拟, 1: pad业务, 2:aicloud + uint32 source = 2; //命令来源: 0: pad模拟, 1: pad业务, 2:aicloud, 3:魔方(清扫车MAP Version==332以及MAP Version>=350,其他车型目前未上线) RouteInfo routeInfo = 3; //自动驾驶路径信息 } @@ -597,13 +597,13 @@ message PlanningActionMsg //message definition for MsgTypeSetParamReq message SetOneParam { - uint32 type = 1; // 0:default 1:绕障类功能开关(bool) 2:变道绕障的目标障碍物速度阈值(double, m/s) + uint32 type = 1; // 0:default 1:绕障类功能开关(bool) 2:变道绕障的目标障碍物速度阈值(double, m/s) // 3:AEB开关(bool) 0:关闭自动紧急制动功能 1:启用自动紧急制动功能 // 4:限制绕障开关(bool) 0:正常绕障 1:限制绕障 默认0 // 5:停车让行线前避让等待开关(bool) 0:停车让行线前无需等待 1:停车让行线前需要等待 默认0 // 6:地图限速功能开关(bool) 0:不使用地图限速功能 1:使用地图限速功能 默认0 // 7:环岛模式开关(bool) 0:普通模式 1:环岛模式 默认0 - // 8:弱网减速停车策略开关(bool) 0:关闭弱网减速停车策略 1:使用弱网减速停车策略 + // 8:弱网减速停车策略开关(bool) 0:关闭弱网减速停车策略 1:使用弱网减速停车策略 // 9:m1拼接视频自车位置参数(string), 格式:x,y,width,height string value = 2; // 转成字符串的值 } @@ -700,6 +700,3 @@ message SessionInfo uint64 connectedTimeStamp = 4; string version = 5; } - - - diff --git a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasChannel.java b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasChannel.java index d665729ac1..62be98f40b 100644 --- a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasChannel.java +++ b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasChannel.java @@ -836,7 +836,7 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec * 设置自动驾驶模式 启动自动驾驶 * * @param mode 1: enter autopilot mode, 0: quit autopilot mode - * @param source 命令来源: 0: pad模拟(模拟时routeInfo传null), 1: AICloud业务 + * @param source 命令来源: 0: pad模拟, 1: pad业务, 2:aicloud, 3:魔方(清扫车MAP Version==332以及MAP Version>=350,其他车型目前未上线) * @param routeInfo 自动驾驶路径信息 * @return boolean */ diff --git a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasManager.java b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasManager.java index cd5094aebc..7390609693 100644 --- a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasManager.java +++ b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/AdasManager.java @@ -297,7 +297,7 @@ public class AdasManager implements IAdasNetCommApi { * 设置自动驾驶模式 启动自动驾驶 * * @param mode 1: enter autopilot mode, 0: quit autopilot mode - * @param source 命令来源: 0: pad模拟(模拟时routeInfo传null), 1: AICloud业务 + * @param source 命令来源: 0: pad模拟, 1: pad业务, 2:aicloud, 3:魔方(清扫车MAP Version==332以及MAP Version>=350,其他车型目前未上线) * @param routeInfo 自动驾驶路径信息 * @return */ diff --git a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/IAdasNetCommApi.java b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/IAdasNetCommApi.java index 08e5cb088d..8362541ce7 100644 --- a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/IAdasNetCommApi.java +++ b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/IAdasNetCommApi.java @@ -86,7 +86,7 @@ public interface IAdasNetCommApi { * 设置自动驾驶模式 启动自动驾驶 * * @param mode 1: enter autopilot mode, 0: quit autopilot mode - * @param source 命令来源: 0: pad模拟(模拟时routeInfo传null), 1: AICloud业务 + * @param source 命令来源: 0: pad模拟, 1: pad业务, 2:aicloud, 3:魔方(清扫车MAP Version==332以及MAP Version>=350,其他车型目前未上线) * @param routeInfo 自动驾驶路径信息 * @return 加入WS发送消息队列是否成功 */ diff --git a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/Constants.java b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/Constants.java index 08670c2d31..0d914fa7f0 100644 --- a/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/Constants.java +++ b/libraries/mogo-adas/src/main/java/com/zhidao/support/adas/high/common/Constants.java @@ -134,4 +134,26 @@ public class Constants { int RAMP_THETA_VALID = 7;//环岛模式开关 int WEAK_NET_SLOW_DOWN = 8;//弱网减速停车策略开关 } + + /** + * 启动自动驾驶-Source类型 + */ + public interface AUTOPILOT_SOURCE { + /** + * pad模拟 + */ + int PAD_SIMULATE = 0; + /** + * pad业务 + */ + int PAD = 1; + /** + * AICloud + */ + int AI_CLOUD = 2; + /** + * 魔方 + */ + int MO_FANG = 3; + } }