Merge branch 'dev_sweeper-d_230717_3.2.0' into 'release_sweeper-d_230717_3.2.0.1'
Dev sweeper d 230717 3.2.0 See merge request SCA/L4HA/AndroidApp/MoGoEagleEye!816
This commit is contained in:
@@ -7,6 +7,7 @@ import chassis.ChassisStatesOuterClass
|
||||
import com.amap.api.maps.model.LatLng
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener.Companion.STATUS_AUTOPILOT_ENABLE
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener.Companion.STATUS_AUTOPILOT_RUNNING
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
@@ -36,6 +37,7 @@ import com.mogo.och.sweepercloud.view.SweeperCurrentTaskInfoView
|
||||
import com.zhjt.mogo.adas.data.sweeper.SweeperCloudTask
|
||||
import com.zhjt.mogo.adas.data.sweeper.bootable.SweeperBootable
|
||||
import com.zhjt.mogo.adas.data.sweeper.common.SweeperCommon
|
||||
import com.zhjt.mogo.adas.data.sweeper.common.SweeperCommon.TaskStatus
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.SweeperTask
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.SweeperTask.SubTaskInfo
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.SweeperTask.TaskModel
|
||||
@@ -143,7 +145,10 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
|
||||
|
||||
override fun setAutoState(state: Int) {
|
||||
super.setAutoState(state)
|
||||
getCurrentTaskView().updateStartAutoPilotBtnState(state)
|
||||
getCurrentTaskView().updateStartAutoPilotBtnByAutoPilotState(
|
||||
state == STATUS_AUTOPILOT_ENABLE,
|
||||
mCurrentRunningSubTaskInfo?.taskModel == TaskModel.AUTO,
|
||||
mCurrentRunningSubTaskInfo?.taskStatus == TaskStatus.RUNNING)
|
||||
}
|
||||
|
||||
fun onSweeperFutianCleanSystemState(cleanSystemState: ChassisStatesOuterClass.SweeperFuTianTaskSystemStates) {
|
||||
@@ -216,6 +221,9 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
|
||||
addTaskData()
|
||||
mPresenter?.isHasTaskInfo(true)
|
||||
|
||||
//更新自动驾驶按钮样式
|
||||
updateStartAutoPilotBtnByAutoPilotState()
|
||||
|
||||
//恢复高精地图上的Marker
|
||||
mCurrentRunningSubTaskInfo?.also {
|
||||
addHDMapMarkerBySubTask(it)
|
||||
@@ -227,6 +235,9 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
|
||||
addTaskData()
|
||||
mPresenter?.isHasTaskInfo(true)
|
||||
|
||||
//更新自动驾驶按钮样式
|
||||
updateStartAutoPilotBtnByAutoPilotState()
|
||||
|
||||
if (taskInfo.isPop) {
|
||||
showReceivedBigTaskDialog()
|
||||
} else {
|
||||
@@ -243,6 +254,14 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateStartAutoPilotBtnByAutoPilotState() {
|
||||
getCurrentTaskView().updateStartAutoPilotBtnByAutoPilotState(
|
||||
mPresenter?.autopilotState == STATUS_AUTOPILOT_ENABLE,
|
||||
mCurrentRunningSubTaskInfo?.taskModel == TaskModel.AUTO,
|
||||
mCurrentRunningSubTaskInfo?.taskStatus == TaskStatus.RUNNING
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据云端同步的子任务状态,更新列表中任务状态
|
||||
*/
|
||||
@@ -253,6 +272,7 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
|
||||
) {
|
||||
mLoadingDialog.hideLoading()
|
||||
updateSubTaskInfo(taskId, subTaskId, subTaskStatus)
|
||||
updateStartAutoPilotBtnByAutoPilotState()
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -534,7 +554,7 @@ class SweeperFragment : BaseSweeperTabFragment<SweeperFragment?, SweeperPresente
|
||||
var ttsString = "云端恢复任务,注意车辆即将启动!"
|
||||
mCurrentSuspendSubTaskInfo?.also { suspendSub ->
|
||||
val isAutoPoilotState =
|
||||
mPresenter?.autopilotState == STATUS_AUTOPILOT_ENABLE
|
||||
mPresenter?.autopilotState == STATUS_AUTOPILOT_RUNNING
|
||||
when {
|
||||
suspendSub.taskModel == TaskModel.MANUAL -> {
|
||||
ttsString = "云端恢复任务,请继续手动驾驶完成任务!"
|
||||
|
||||
@@ -646,6 +646,7 @@ public class SweeperTaskModel implements IMoGoSweeperFutianCloudTaskListener, IM
|
||||
@Override
|
||||
public void onAutopilotIpcConnectStatusChanged(int status, @Nullable String reason) {
|
||||
if (status == 0x00) {//判断工控机重连后,获取当前正在执行的子任务,延时10秒,防止工控机连接上时SN为空
|
||||
CallerAutoPilotControlManager.INSTANCE.setIsSubscribeBackCameraVideoVideo(0, false);//TODO 当前3.2.0版本产品未规划后摄像头展示功能
|
||||
UiThreadHandler.postDelayed(() -> {
|
||||
getCurrentTask();
|
||||
}, 10000);
|
||||
|
||||
@@ -64,7 +64,7 @@ class SweeperCurrentTaskInfoView : ConstraintLayout {
|
||||
/**
|
||||
* 根据当前自动驾驶状态,更新【请求进入自动驾驶】按钮样式
|
||||
*/
|
||||
fun updateStartAutoPilotBtnState(autopilotState: Int) {
|
||||
fun updateStartAutoPilotBtnByAutoPilotState(autopilotState: Int) {
|
||||
when (autopilotState) {
|
||||
//不可自动驾驶
|
||||
IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_DISABLE -> {
|
||||
@@ -90,102 +90,119 @@ class SweeperCurrentTaskInfoView : ConstraintLayout {
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置当前任务数据
|
||||
* 根据 当前自动驾驶状态-是否是自动驾驶子任务-子任务是否在运行,更新【请求进入自动驾驶】按钮样式
|
||||
*/
|
||||
@SuppressLint("SetTextI18n")
|
||||
fun setData(
|
||||
taskInfo: TaskInfo?,
|
||||
currentPosition: Int = -1
|
||||
fun updateStartAutoPilotBtnByAutoPilotState(
|
||||
isManualAutoPilotState: Boolean,
|
||||
isAutoSubTask: Boolean,
|
||||
isSubTaskRunning: Boolean
|
||||
) {
|
||||
// 更新 任务名称、任务时间
|
||||
taskInfo?.apply {
|
||||
this@SweeperCurrentTaskInfoView.listTask = subListList
|
||||
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
|
||||
)
|
||||
}"
|
||||
}
|
||||
// 更新大任务状态
|
||||
updateTaskStateText(taskInfo?.taskStatus ?: TaskStatus.TO_START)
|
||||
// 更新子任务列表
|
||||
listTask?.let {
|
||||
//特殊处理当前暂无执行中任务的情况
|
||||
if (currentPosition == -1) {
|
||||
setCurrentData(currentPosition + 1)
|
||||
} else {
|
||||
setCurrentData(currentPosition)
|
||||
}
|
||||
if (isManualAutoPilotState && isAutoSubTask && isSubTaskRunning) {
|
||||
tvStartAuto.setTextColor(Color.parseColor("#FFFFFFFF"))
|
||||
tvStartAuto.isSelected = true
|
||||
} else {
|
||||
tvStartAuto.setTextColor(Color.parseColor("#66FFFFFF"))
|
||||
tvStartAuto.isSelected = false
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置任务的状态
|
||||
*/
|
||||
private fun updateTaskStateText(taskStatus: SweeperCommon.TaskStatus) {
|
||||
when (taskStatus) {
|
||||
SweeperCommon.TaskStatus.RUNNING -> {
|
||||
tvTaskState.text = "任务执行中"
|
||||
tvTaskState.setBackgroundResource(R.drawable.bg_shape_task_state_working)
|
||||
/**
|
||||
* 设置当前任务数据
|
||||
*/
|
||||
@SuppressLint("SetTextI18n")
|
||||
fun setData(
|
||||
taskInfo: TaskInfo?,
|
||||
currentPosition: Int = -1
|
||||
) {
|
||||
// 更新 任务名称、任务时间
|
||||
taskInfo?.apply {
|
||||
this@SweeperCurrentTaskInfoView.listTask = subListList
|
||||
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
|
||||
)
|
||||
}"
|
||||
}
|
||||
|
||||
SweeperCommon.TaskStatus.SUSPENDED -> {
|
||||
tvTaskState.text = "任务已暂停"
|
||||
tvTaskState.setBackgroundResource(R.drawable.bg_shape_task_state_not_ready)
|
||||
}
|
||||
|
||||
else -> {
|
||||
tvTaskState.text = "任务待开始"
|
||||
tvTaskState.setBackgroundResource(R.drawable.bg_shape_task_state_not_ready)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 填充数据
|
||||
*/
|
||||
private fun setCurrentData(currentPosition: Int) {
|
||||
listTask?.let {
|
||||
if (it.size == 1) {
|
||||
preSubTask.setData(it[currentPosition], isLastTask = true)
|
||||
currentSubTask.visibility = View.INVISIBLE
|
||||
lastSubTask.visibility = View.INVISIBLE
|
||||
} else if (it.size == 2) {
|
||||
if (currentPosition == 0) {
|
||||
preSubTask.setData(it[currentPosition])
|
||||
currentSubTask.setData(it[1], isLastTask = true)
|
||||
// 更新大任务状态
|
||||
updateTaskStateText(taskInfo?.taskStatus ?: TaskStatus.TO_START)
|
||||
// 更新子任务列表
|
||||
listTask?.let {
|
||||
//特殊处理当前暂无执行中任务的情况
|
||||
if (currentPosition == -1) {
|
||||
setCurrentData(currentPosition + 1)
|
||||
} else {
|
||||
preSubTask.setData(it[currentPosition - 1])
|
||||
currentSubTask.setData(it[currentPosition], isLastTask = true)
|
||||
}
|
||||
preSubTask.visibility = View.VISIBLE
|
||||
currentSubTask.visibility = View.VISIBLE
|
||||
lastSubTask.visibility = View.GONE
|
||||
} else {
|
||||
preSubTask.visibility = View.VISIBLE
|
||||
currentSubTask.visibility = View.VISIBLE
|
||||
lastSubTask.visibility = View.VISIBLE
|
||||
//当前正在执行的任务是第一个子任务
|
||||
if (currentPosition == 0) {
|
||||
preSubTask.setData(it[currentPosition])
|
||||
currentSubTask.setData(it[1])
|
||||
lastSubTask.setData(it[2], isLastTask = true)
|
||||
//当前正在执行的任务是最后一个子任务
|
||||
} else if (currentPosition == it.size - 1) {
|
||||
preSubTask.setData(it[currentPosition - 2])
|
||||
currentSubTask.setData(it[currentPosition - 1])
|
||||
lastSubTask.setData(it[currentPosition], isLastTask = true)
|
||||
} else {
|
||||
preSubTask.setData(it[currentPosition - 1])
|
||||
currentSubTask.setData(it[currentPosition])
|
||||
lastSubTask.setData(it[currentPosition + 1], isLastTask = true)
|
||||
setCurrentData(currentPosition)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置任务的状态
|
||||
*/
|
||||
private fun updateTaskStateText(taskStatus: SweeperCommon.TaskStatus) {
|
||||
when (taskStatus) {
|
||||
SweeperCommon.TaskStatus.RUNNING -> {
|
||||
tvTaskState.text = "任务执行中"
|
||||
tvTaskState.setBackgroundResource(R.drawable.bg_shape_task_state_working)
|
||||
}
|
||||
|
||||
SweeperCommon.TaskStatus.SUSPENDED -> {
|
||||
tvTaskState.text = "任务已暂停"
|
||||
tvTaskState.setBackgroundResource(R.drawable.bg_shape_task_state_not_ready)
|
||||
}
|
||||
|
||||
else -> {
|
||||
tvTaskState.text = "任务待开始"
|
||||
tvTaskState.setBackgroundResource(R.drawable.bg_shape_task_state_not_ready)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 填充数据
|
||||
*/
|
||||
private fun setCurrentData(currentPosition: Int) {
|
||||
listTask?.let {
|
||||
if (it.size == 1) {
|
||||
preSubTask.setData(it[currentPosition], isLastTask = true)
|
||||
currentSubTask.visibility = View.INVISIBLE
|
||||
lastSubTask.visibility = View.INVISIBLE
|
||||
} else if (it.size == 2) {
|
||||
if (currentPosition == 0) {
|
||||
preSubTask.setData(it[currentPosition])
|
||||
currentSubTask.setData(it[1], isLastTask = true)
|
||||
} else {
|
||||
preSubTask.setData(it[currentPosition - 1])
|
||||
currentSubTask.setData(it[currentPosition], isLastTask = true)
|
||||
}
|
||||
preSubTask.visibility = View.VISIBLE
|
||||
currentSubTask.visibility = View.VISIBLE
|
||||
lastSubTask.visibility = View.GONE
|
||||
} else {
|
||||
preSubTask.visibility = View.VISIBLE
|
||||
currentSubTask.visibility = View.VISIBLE
|
||||
lastSubTask.visibility = View.VISIBLE
|
||||
//当前正在执行的任务是第一个子任务
|
||||
if (currentPosition == 0) {
|
||||
preSubTask.setData(it[currentPosition])
|
||||
currentSubTask.setData(it[1])
|
||||
lastSubTask.setData(it[2], isLastTask = true)
|
||||
//当前正在执行的任务是最后一个子任务
|
||||
} else if (currentPosition == it.size - 1) {
|
||||
preSubTask.setData(it[currentPosition - 2])
|
||||
currentSubTask.setData(it[currentPosition - 1])
|
||||
lastSubTask.setData(it[currentPosition], isLastTask = true)
|
||||
} else {
|
||||
preSubTask.setData(it[currentPosition - 1])
|
||||
currentSubTask.setData(it[currentPosition])
|
||||
lastSubTask.setData(it[currentPosition + 1], isLastTask = true)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1045,6 +1045,14 @@ class MoGoAutopilotControlProvider :
|
||||
}
|
||||
}
|
||||
|
||||
override fun setIsSubscribeBackCameraVideoVideo(role: Int, isSubscribe: Boolean) {
|
||||
val type =
|
||||
if (isSubscribe) Constants.SUBSCRIBE_TYPE.SUBSCRIBE else Constants.SUBSCRIBE_TYPE.UNSUBSCRIBE
|
||||
AdasManager.getInstance().subscribeInterface(
|
||||
role, type, MessageType.TYPE_RECEIVE_BACK_CAMERA_VIDEO
|
||||
)
|
||||
}
|
||||
|
||||
override fun sendRoboBusJinlvM1FrontDoorCmd(switchCmd: Int): Boolean {
|
||||
return AdasManager.getInstance().sendRoboBusJinlvM1FrontDoorCmd(switchCmd)
|
||||
}
|
||||
|
||||
@@ -535,7 +535,7 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
* @param data 数据
|
||||
*/
|
||||
override fun onBackCameraVideo(header: MessagePad.Header, data: ByteArray) {
|
||||
CallerSweeperFutianBackCameraVideoListenerManager.invokeSweeperFutianBackCameraVideo(data)
|
||||
CallerBackCameraVideoListenerManager.invokeBackCameraVideo(data)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -21,7 +21,7 @@ import mogo.telematics.pad.MessagePad.SetParamReq
|
||||
import java.util.concurrent.atomic.AtomicInteger
|
||||
import kotlin.concurrent.*
|
||||
|
||||
internal class MoGoLookAroundProviderImpl: IMoGoLookAroundProvider, IMoGoSweeperFutianBackCameraVideoListener, IMoGoRoboBusJinlvM1StitchedVideoListener, IMoGoGetParamResponseListener {
|
||||
internal class MoGoLookAroundProviderImpl: IMoGoLookAroundProvider, IMoGoBackCameraVideoListener, IMoGoRoboBusJinlvM1StitchedVideoListener, IMoGoGetParamResponseListener {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "MoGoLookAroundProvider"
|
||||
@@ -58,7 +58,7 @@ internal class MoGoLookAroundProviderImpl: IMoGoLookAroundProvider, IMoGoSweeper
|
||||
private var job: Job? = null
|
||||
|
||||
override fun init(ctx: Context) {
|
||||
CallerSweeperFutianBackCameraVideoListenerManager.addListener(TAG, this)
|
||||
CallerBackCameraVideoListenerManager.addListener(TAG, this)
|
||||
CallerRoboBusJinlvM1StitchedVideoListenerManager.addListener(TAG, this)
|
||||
CallerAutopilotGetParamResponseDispatcher.addListener(TAG, this)
|
||||
if (AppIdentityModeUtils.isM1(FunctionBuildConfig.appIdentityMode)) {
|
||||
@@ -116,7 +116,7 @@ internal class MoGoLookAroundProviderImpl: IMoGoLookAroundProvider, IMoGoSweeper
|
||||
|
||||
}
|
||||
|
||||
override fun onSweeperFutianBackCameraVideo(data: ByteArray) {
|
||||
override fun onBackCameraVideo(data: ByteArray) {
|
||||
if (bitmapWidth.get() == 0 || bitmapHeight.get() == 0) {
|
||||
val options = BitmapFactory.Options()
|
||||
options.inJustDecodeBounds = true
|
||||
|
||||
@@ -15,18 +15,17 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.bumptech.glide.request.target.CustomTarget;
|
||||
import com.bumptech.glide.request.transition.Transition;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoBackCameraVideoListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoRoboBusJinlvM1StitchedVideoListener;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoSweeperFutianBackCameraVideoListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerBackCameraVideoListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerRoboBusJinlvM1StitchedVideoListenerManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerSweeperFutianBackCameraVideoListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp;
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
|
||||
|
||||
/**
|
||||
* 清扫车摄像头展示View 10Hz
|
||||
* M1拼接视频展示View 10Hz 需要订阅(连接成功后订阅才生效):CallerAutoPilotControlManager.setIsSubscribeM1StitchedVideo(isSubscribe)
|
||||
* 图片帧展示View
|
||||
*/
|
||||
public class MogoVideoView extends AppCompatImageView implements IMoGoSweeperFutianBackCameraVideoListener, IMoGoRoboBusJinlvM1StitchedVideoListener {
|
||||
public class MogoVideoView extends AppCompatImageView implements IMoGoBackCameraVideoListener, IMoGoRoboBusJinlvM1StitchedVideoListener {
|
||||
private static final String TAG = MogoVideoView.class.getSimpleName();
|
||||
private final RequestOptions requestOptions = new RequestOptions()
|
||||
.priority(Priority.HIGH)
|
||||
@@ -49,14 +48,14 @@ public class MogoVideoView extends AppCompatImageView implements IMoGoSweeperFut
|
||||
@Override
|
||||
protected void onAttachedToWindow() {
|
||||
super.onAttachedToWindow();
|
||||
CallerSweeperFutianBackCameraVideoListenerManager.INSTANCE.addListener(TAG, this);
|
||||
CallerBackCameraVideoListenerManager.INSTANCE.addListener(TAG, this);
|
||||
CallerRoboBusJinlvM1StitchedVideoListenerManager.INSTANCE.addListener(TAG, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow();
|
||||
CallerSweeperFutianBackCameraVideoListenerManager.INSTANCE.removeListener(this);
|
||||
CallerBackCameraVideoListenerManager.INSTANCE.removeListener(this);
|
||||
CallerRoboBusJinlvM1StitchedVideoListenerManager.INSTANCE.removeListener(this);
|
||||
}
|
||||
|
||||
@@ -90,7 +89,7 @@ public class MogoVideoView extends AppCompatImageView implements IMoGoSweeperFut
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSweeperFutianBackCameraVideo(@NonNull byte[] data) {
|
||||
public void onBackCameraVideo(@NonNull byte[] data) {
|
||||
draw(data);
|
||||
}
|
||||
|
||||
|
||||
@@ -423,6 +423,13 @@ interface IMoGoAutopilotControlProvider : IMoGoFunctionServerProvider {
|
||||
*/
|
||||
fun setIsSubscribeM1StitchedVideo(isSubscribe: Boolean)
|
||||
|
||||
/**
|
||||
* 后摄像头接口订阅 目前用于清扫车后摄像头接口和Taxi右后摄像头接口
|
||||
* @param role 角色 详情参见{@link Constants.TERMINAL_ROLE}
|
||||
* @param isSubscribe 是否订阅
|
||||
*/
|
||||
fun setIsSubscribeBackCameraVideoVideo(role: Int,isSubscribe: Boolean)
|
||||
|
||||
fun sendRoboBusJinlvM1FrontDoorCmd(switchCmd: Int): Boolean
|
||||
|
||||
fun sendRoboBusJinlvM1AirConditionerCmd(
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.mogo.eagle.core.function.api.autopilot
|
||||
|
||||
/**
|
||||
* 后摄像头视频数据
|
||||
* 目前用于清扫车(福田)后摄像头和Taxi右后摄像头
|
||||
* 需要进行接口订阅才能 CallerAutoPilotControlManager.setIsSubscribeBackCameraVideoVideo(role: Int, isSubscribe: Boolean)
|
||||
*/
|
||||
interface IMoGoBackCameraVideoListener {
|
||||
/**
|
||||
* 后摄像头视频数据 10Hz 每一帧为一张图片
|
||||
*/
|
||||
fun onBackCameraVideo(data: ByteArray)
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
package com.mogo.eagle.core.function.api.autopilot
|
||||
|
||||
/**
|
||||
* 清扫车(福田)后摄像头视频数据
|
||||
*/
|
||||
interface IMoGoSweeperFutianBackCameraVideoListener {
|
||||
/**
|
||||
* 清扫车(福田)后摄像头视频数据 10Hz 每一帧为一张图片
|
||||
*/
|
||||
fun onSweeperFutianBackCameraVideo(data: ByteArray)
|
||||
}
|
||||
@@ -578,6 +578,15 @@ object CallerAutoPilotControlManager {
|
||||
providerApi?.setIsSubscribeM1StitchedVideo(isSubscribe)
|
||||
}
|
||||
|
||||
/**
|
||||
* 后摄像头接口订阅 目前用于清扫车后摄像头接口和Taxi右后摄像头接口
|
||||
* @param role 角色 详情参见{@link Constants.TERMINAL_ROLE}
|
||||
* @param isSubscribe 是否订阅
|
||||
*/
|
||||
fun setIsSubscribeBackCameraVideoVideo(role: Int, isSubscribe: Boolean) {
|
||||
providerApi?.setIsSubscribeBackCameraVideoVideo(role, isSubscribe)
|
||||
}
|
||||
|
||||
fun sendRoboBusJinlvM1FrontDoorCmd(switchCmd: Int): Boolean {
|
||||
return providerApi?.sendRoboBusJinlvM1FrontDoorCmd(switchCmd) ?: false
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.mogo.eagle.core.function.call.autopilot
|
||||
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoBackCameraVideoListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
|
||||
/**
|
||||
* 后摄像头视频数据
|
||||
*/
|
||||
object CallerBackCameraVideoListenerManager : CallerBase<IMoGoBackCameraVideoListener>() {
|
||||
|
||||
/**
|
||||
* 后摄像头视频数据
|
||||
*/
|
||||
fun invokeBackCameraVideo(data: ByteArray) {
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.onBackCameraVideo(data)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.mogo.eagle.core.function.call.autopilot
|
||||
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoSweeperFutianBackCameraVideoListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
|
||||
/**
|
||||
* 清扫车(福田)后摄像头视频数据
|
||||
*/
|
||||
object CallerSweeperFutianBackCameraVideoListenerManager : CallerBase<IMoGoSweeperFutianBackCameraVideoListener>() {
|
||||
|
||||
/**
|
||||
* 后摄像头视频数据
|
||||
*/
|
||||
fun invokeSweeperFutianBackCameraVideo(data: ByteArray) {
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.onSweeperFutianBackCameraVideo(data)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -261,7 +261,8 @@ public interface OnAdasListener {
|
||||
// void onFSMStatusReasonRespond(@NonNull MessagePad.Header header, @NonNull FSMStatusReasonQueryOuterClass.FSMStatusReasonRespond respond);
|
||||
|
||||
/**
|
||||
* 清扫车后部摄像头视频 10Hz
|
||||
* 后部摄像头视频 10Hz
|
||||
* 目前用于清扫车后摄像头和Taxi右右后摄像头
|
||||
*
|
||||
* @param header 头
|
||||
* @param data 数据
|
||||
|
||||
@@ -28,7 +28,7 @@ public enum MessageType {
|
||||
TYPE_RECEIVE_PLANNING_OBJECTS(MessagePad.MessageType.MsgTypePlanningObjects, "Planning障碍物"),
|
||||
TYPE_RECEIVE_CHASSIS_STATES(MessagePad.MessageType.MsgTypeChassisStates, "底盘状态"),
|
||||
TYPE_RECEIVE_FUNCTION_STATES(MessagePad.MessageType.MsgTypeFunctionStates, "重构后功能状态"),
|
||||
TYPE_RECEIVE_BACK_CAMERA_VIDEO(MessagePad.MessageType.MsgTypeBackCameraVideo, "清扫车后摄像头"),
|
||||
TYPE_RECEIVE_BACK_CAMERA_VIDEO(MessagePad.MessageType.MsgTypeBackCameraVideo, "后摄像头"),
|
||||
TYPE_RECEIVE_M1_STITCHED_VIDEO(MessagePad.MessageType.MsgTypeM1StitchedVideo, "M1拼接视频"),
|
||||
|
||||
TYPE_RECEIVE_BASIC_INFO_REQ(MessagePad.MessageType.MsgTypeBasicInfoReq, "自动驾驶设备基础信息请求"),
|
||||
|
||||
@@ -9,7 +9,8 @@ import com.zhidao.support.adas.high.common.CupidLogUtils;
|
||||
import com.zhidao.support.adas.high.protocol.RawData;
|
||||
|
||||
/**
|
||||
* 清扫车后摄像头 10Hz
|
||||
* 清扫车和Taxi后摄像头
|
||||
* 需要主动订阅,否则工控机不会发送此数据
|
||||
*/
|
||||
public class BackCameraVideoMessage extends MyAbstractMessageHandler {
|
||||
|
||||
@@ -21,13 +22,13 @@ public class BackCameraVideoMessage extends MyAbstractMessageHandler {
|
||||
int len = raw.getPackageLengthValue() - raw.getOffsetValue();
|
||||
byte[] data = new byte[len];
|
||||
System.arraycopy(raw.originalData.toByteArray(), raw.getOffsetValue(), data, 0, len);
|
||||
AdasChannel.calculateTimeConsumingOnDispatchRaw("清扫车后摄像头", raw.receiveTime);
|
||||
AdasChannel.calculateTimeConsumingOnDispatchRaw("后摄像头", raw.receiveTime);
|
||||
long nowTime = 0;
|
||||
if (CupidLogUtils.isEnableLog())
|
||||
nowTime = SystemClock.elapsedRealtime();
|
||||
if (adasListener != null) {
|
||||
adasListener.onBackCameraVideo(raw.getHeader(), data);
|
||||
}
|
||||
AdasChannel.calculateTimeConsumingBusiness("清扫车后摄像头", nowTime);
|
||||
AdasChannel.calculateTimeConsumingBusiness("后摄像头", nowTime);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.zhidao.support.adas.high.protocol.RawData;
|
||||
|
||||
/**
|
||||
* M1拼接视频 10Hz
|
||||
* 需要主动订阅,否则工控机不会发送此数据
|
||||
*/
|
||||
public class M1StitchedVideoMessage extends MyAbstractMessageHandler {
|
||||
|
||||
|
||||
@@ -139,8 +139,8 @@ public class SubscribeInterface {
|
||||
if (types.length > 0) {
|
||||
for (MessageType messageType : types) {
|
||||
if (messageType.name().toLowerCase().contains("type_receive")) {
|
||||
//连接成功后只有M1拼接视频接收接口默认不进行订阅,其他接收接口默认自动订阅
|
||||
if (messageType == MessageType.TYPE_RECEIVE_M1_STITCHED_VIDEO) {
|
||||
//连接成功后只有M1拼接视频接收接口和后摄像头接口默认不进行订阅,其他接收接口默认自动订阅
|
||||
if (messageType == MessageType.TYPE_RECEIVE_M1_STITCHED_VIDEO || messageType == MessageType.TYPE_RECEIVE_BACK_CAMERA_VIDEO) {
|
||||
unsubscribedInterface.put(messageType, messageType.typeCode.getNumber());
|
||||
} else {
|
||||
subscribedInterface.put(messageType, messageType.typeCode.getNumber());
|
||||
|
||||
Reference in New Issue
Block a user