Merge branch 'release_sweeper-d_230614_3.1.4.1' into 'master'

[Publish]Sweeper driver 230614 V3.1.4

See merge request SCA/L4HA/AndroidApp/MoGoEagleEye!796
This commit is contained in:
aibingbing
2023-07-04 09:57:37 +00:00
14 changed files with 166 additions and 34 deletions

View File

@@ -122,6 +122,11 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
}
}
override fun setAutoState(state: Int) {
super.setAutoState(state)
getCurrentView().updateStartAutoPilotBtnState(state)
}
fun onSweeperFutianCleanSystemState(cleanSystemState: ChassisStatesOuterClass.SweeperFuTianTaskSystemStates) {
mCleanSystemState = cleanSystemState
sweeper_cl_work_mode.setSweeperFutianCleanSystemState(mSubTaskType, cleanSystemState)

View File

@@ -1,11 +1,13 @@
package com.mogo.och.sweepercloud.view
import android.content.Context
import android.graphics.Color
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.View
import android.widget.TextView
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.och.common.module.utils.DateTimeUtil
import com.mogo.och.sweepercloud.R
import com.zhjt.mogo.adas.data.sweeper.common.SweeperCommon.TaskStatus
@@ -27,8 +29,20 @@ class SweeperCurrentTaskInfoView : ConstraintLayout {
initView(context)
}
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {}
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes) {}
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(
context,
attrs,
defStyleAttr
) {
}
constructor(
context: Context,
attrs: AttributeSet?,
defStyleAttr: Int,
defStyleRes: Int
) : super(context, attrs, defStyleAttr, defStyleRes) {
}
private fun initView(context: Context) {
LayoutInflater.from(context).inflate(R.layout.sweeper_current_task_info, this)
@@ -39,6 +53,34 @@ class SweeperCurrentTaskInfoView : ConstraintLayout {
return tvStartAuto
}
/**
* 根据当前自动驾驶状态,更新【请求进入自动驾驶】按钮样式
*/
fun updateStartAutoPilotBtnState(autopilotState: Int) {
when (autopilotState) {
//不可自动驾驶
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE -> {
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)
}
}

View File

@@ -1,10 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<item android:state_selected="true">
<shape android:shape="rectangle">
<corners android:bottomRightRadius="30dp" android:bottomLeftRadius="@dimen/dp_30"/>
<corners android:bottomLeftRadius="@dimen/dp_30" android:bottomRightRadius="@dimen/dp_30" />
<gradient android:angle="180" android:endColor="#2F6EFF" android:startColor="#20AAFF" />
</shape>
</item>
<item android:state_selected="false">
<shape>
<solid android:color="#4D2F6EFF" />
<corners android:bottomLeftRadius="@dimen/dp_30" android:bottomRightRadius="@dimen/dp_30" />
</shape>
</item>
</selector>

View File

@@ -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"

View File

@@ -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("车机与工控机链接失败,无法开启自动驾驶")

View File

@@ -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)
}
}
}
}

View File

@@ -37,6 +37,13 @@ interface IMoGoAutopilotControlProvider : IMoGoFunctionServerProvider {
*/
fun startAutoPilot(controlParameters: AutopilotControlParameters)
/**
* 开启自动驾驶(魔方)
*
* @param controlParameters 开启自动驾驶的控制参数
*/
fun startAutoPilotByMoFang(controlParameters: AutopilotControlParameters?)
/**
* 给工控机透出路口红绿灯信息
*/

View File

@@ -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)
}
/**
* 发送红绿灯数据至工控机
*/

View File

@@ -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

View File

@@ -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;
}

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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发送消息队列是否成功
*/

View File

@@ -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;
}
}