[8.4.0]
[b4] [和@yuelei 联调]
This commit is contained in:
@@ -27,7 +27,6 @@ import com.mogo.och.bridge.R
|
||||
import com.mogo.och.bridge.autopilot.OCHAdasAbilityManager
|
||||
import com.mogo.och.bridge.autopilot.autopilot.OchAutoPilotManager
|
||||
import com.mogo.och.bridge.autopilot.autopilot.OchAutoPilotManager.startAutoPilot
|
||||
import com.mogo.och.bridge.autopilot.autopilot.OchAutoPilotManager.unmannedStartAutoPilot
|
||||
import com.mogo.och.bridge.autopilot.autopilot.OchAutopilotAnalytics
|
||||
import com.mogo.och.bridge.autopilot.location.OchLocationManager
|
||||
import com.mogo.och.bridge.distance.TrajectoryAndDistanceManager
|
||||
@@ -626,7 +625,7 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
}
|
||||
}
|
||||
|
||||
fun unmannedStartAutopilot(taskId: Long, isSlideAutoStart: Boolean = false) {
|
||||
fun unmannedStartAutopilot(isSlideAutoStart: Boolean = false) {
|
||||
if (startStation == null || endStation == null) {
|
||||
// ToastUtils.showShort("未设置起始或终点站点")
|
||||
ToastUtils.showShort(R.string.module_och_not_stat_and_end_point)
|
||||
@@ -731,7 +730,7 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
.wayPoints(wayPoints)
|
||||
.blackPoints(blackPoints)
|
||||
.build()
|
||||
val sessionId = OchAutoPilotManager.unmannedStartAutoPilot(taskId, traj, parameters)
|
||||
val sessionId = OchAutoPilotManager.unmannedStartAutoPilot(i.taskId, traj, parameters)
|
||||
OchAutopilotAnalytics.triggerUpdateStartAutoPilotSessionId(sessionId, true)
|
||||
d(
|
||||
TAG,
|
||||
@@ -747,7 +746,7 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
|
||||
|
||||
//TODO 任务管理继续
|
||||
fun unmanneAutopilotContinue(taskId: Long, isSlideAutoStart: Boolean = false) {
|
||||
fun unmanneAutopilotContinue(isSlideAutoStart: Boolean = false) {
|
||||
if (startStation == null || endStation == null) {
|
||||
// ToastUtils.showShort("未设置起始或终点站点")
|
||||
ToastUtils.showShort(R.string.module_och_not_stat_and_end_point)
|
||||
@@ -793,7 +792,7 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
e(TAG, "无人化 行程日志-AutopilotControlParameters is empty.")
|
||||
return
|
||||
}
|
||||
_lineInfos?.let { i ->
|
||||
_lineInfos?.let { lineInfo ->
|
||||
startStation?.let { start->
|
||||
val wayPoints = ArrayList<VehicleSite>()
|
||||
val blackPoints = ArrayList<VehicleSite>()
|
||||
@@ -808,8 +807,8 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
.build()
|
||||
wayPoints.add(vehicleSite)
|
||||
val traj = Trajectory.builder()
|
||||
.id(i.lineId)
|
||||
.name(i.lineName)
|
||||
.id(lineInfo.lineId)
|
||||
.name(lineInfo.lineName)
|
||||
.trajUrl(_contraiInfo!!.csvFileUrl)
|
||||
.trajMd5(_contraiInfo!!.csvFileMd5)
|
||||
.stopUrl(_contraiInfo!!.txtFileUrl)
|
||||
@@ -818,7 +817,7 @@ object LineManager : CallerBase<ILineCallback>() {
|
||||
.wayPoints(wayPoints)
|
||||
.blackPoints(blackPoints)
|
||||
.build()
|
||||
val sessionId = OchAutoPilotManager.unmannedAutoPilotContinue(taskId, traj,vehicleSite, parameters)
|
||||
val sessionId = OchAutoPilotManager.unmannedAutoPilotContinue(lineInfo.taskId, traj,vehicleSite, parameters)
|
||||
OchAutopilotAnalytics.triggerUpdateStartAutoPilotSessionId(sessionId, true)
|
||||
d(
|
||||
TAG,
|
||||
|
||||
@@ -119,7 +119,7 @@ class AutopilotState @JvmOverloads constructor(
|
||||
actv_autopilot_state.setTextColor(ResourcesUtils.getColor(R.color.common_B3FFFFFF))
|
||||
actv_autopilot_state.text = ResourcesUtils.getString(R.string.common_autopilot_starting)
|
||||
actv_pxjs_state.setTextColor(ResourcesUtils.getColor(R.color.common_19FFCB))
|
||||
AutopilotState@this.isEnabled = false
|
||||
//AutopilotState@this.isEnabled = false
|
||||
|
||||
autopilotLoadingAnimator.start()
|
||||
|
||||
@@ -140,7 +140,7 @@ class AutopilotState @JvmOverloads constructor(
|
||||
actv_autopilot_state.setTextColor(ResourcesUtils.getColor(R.color.common_B3FFFFFF))
|
||||
actv_autopilot_state.text = ResourcesUtils.getString(R.string.common_autopilot_starting)
|
||||
actv_pxjs_state.setTextColor(ResourcesUtils.getColor(R.color.common_19FFCB))
|
||||
AutopilotState@this.isEnabled = false
|
||||
//AutopilotState@this.isEnabled = false
|
||||
|
||||
autopilotLoadingAnimator.cancel()
|
||||
autopilotChangeStateAnimator.start()
|
||||
@@ -158,7 +158,7 @@ class AutopilotState @JvmOverloads constructor(
|
||||
actv_autopilot_state.setTextColor(ResourcesUtils.getColor(R.color.common_19FFCB))
|
||||
actv_autopilot_state.text = ResourcesUtils.getString(R.string.common_autopilot_running)
|
||||
actv_pxjs_state.setTextColor(ResourcesUtils.getColor(R.color.common_19FFCB))
|
||||
AutopilotState@this.isEnabled = false
|
||||
//AutopilotState@this.isEnabled = false
|
||||
|
||||
aciv_autopilot_running_ani.visibility = VISIBLE
|
||||
autopilotStateAnimator?.start()
|
||||
@@ -179,7 +179,7 @@ class AutopilotState @JvmOverloads constructor(
|
||||
actv_autopilot_state.text = ResourcesUtils.getString(R.string.common_autopilot_start)
|
||||
actv_pxjs_state.setTextColor(ResourcesUtils.getColor(R.color.common_19FFCB))
|
||||
|
||||
AutopilotState@this.isEnabled = false
|
||||
//AutopilotState@this.isEnabled = false
|
||||
|
||||
aciv_autopilot_running_ani.visibility = GONE
|
||||
autopilotStateAnimator?.stop()
|
||||
@@ -220,7 +220,7 @@ class AutopilotState @JvmOverloads constructor(
|
||||
actv_autopilot_state.setTextColor(ResourcesUtils.getColor(R.color.common_19FFCB))
|
||||
actv_autopilot_state.text = ResourcesUtils.getString(R.string.common_autopilot_start)
|
||||
actv_pxjs_state.setTextColor(ResourcesUtils.getColor(R.color.common_19FFCB))
|
||||
AutopilotState@this.isEnabled = false
|
||||
//AutopilotState@this.isEnabled = false
|
||||
|
||||
aciv_autopilot_running_ani.visibility = VISIBLE
|
||||
autopilotStateAnimator?.start()
|
||||
@@ -244,7 +244,7 @@ class AutopilotState @JvmOverloads constructor(
|
||||
actv_autopilot_state.setTextColor(ResourcesUtils.getColor(R.color.common_FF4E41))
|
||||
actv_autopilot_state.text = ResourcesUtils.getString(R.string.common_autopilot_fail)
|
||||
actv_pxjs_state.setTextColor(ResourcesUtils.getColor(R.color.common_19FFCB))
|
||||
AutopilotState@this.isEnabled = false
|
||||
//AutopilotState@this.isEnabled = false
|
||||
|
||||
aciv_autopilot_running_ani.visibility = GONE
|
||||
autopilotStateAnimator?.stop()
|
||||
|
||||
@@ -4,6 +4,9 @@ import androidx.lifecycle.ViewModel
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerTaskListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.mogo.CockpitType
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.common.module.debug.autopilot.AutopilotStateDebug
|
||||
import com.mogo.och.common.module.debug.autopilot.IOchDebugAutopilotStatusListener
|
||||
@@ -229,7 +232,15 @@ class AutopilotStateModel : ViewModel(), IOchAutopilotStatusListener, ILineCallb
|
||||
startAutopilotFail()
|
||||
}
|
||||
} else {
|
||||
LineManager.startAutopilot()
|
||||
if (AppIdentityModeUtils.getCockpitType() == CockpitType.UNMANNED) {
|
||||
if (CallerTaskListenerManager.isCarRunningTask()) {
|
||||
LineManager.unmanneAutopilotContinue(false)
|
||||
}else{
|
||||
LineManager.unmannedStartAutopilot(true)
|
||||
}
|
||||
}else{
|
||||
LineManager.startAutopilot()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ data class LineInfo(
|
||||
*/
|
||||
var siteInfos:MutableList<BusStationBean> = mutableListOf(),
|
||||
|
||||
var taskId:Long=-1L
|
||||
) {
|
||||
fun genAutopilotId(): String {
|
||||
val tempAutopilotId = StringBuilder()
|
||||
|
||||
@@ -111,6 +111,7 @@ class BusRoutesResponse : BaseData() {
|
||||
// 线路信息
|
||||
if (lineInfo == null && taskAndsite.lineId != null && taskAndsite.lineName != null) {
|
||||
lineInfo = LineInfo(taskAndsite.lineId!!, taskAndsite.lineName!!, orderId = taskAndsite.taskId.toString())
|
||||
lineInfo?.taskId = taskAndsite.taskId?.toLong()?:0L
|
||||
}
|
||||
}
|
||||
if (currentStationIndex == -1) {
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerTaskListenerManager
|
||||
import com.mogo.eagle.core.function.call.setting.CallerSopSettingManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.e
|
||||
@@ -16,6 +17,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_
|
||||
import com.mogo.eagle.core.utilcode.util.CoordinateUtils
|
||||
import com.mogo.eagle.core.utilcode.util.StringUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.bridge.autopilot.autopilot.IOchAutopilotStatusListener
|
||||
import com.mogo.och.bridge.autopilot.autopilot.OchAutoPilotStatusListenerManager
|
||||
@@ -244,11 +246,16 @@ object OrderModel {
|
||||
private fun onStartAutopilot(taskId: Long?) {
|
||||
//开启自动驾驶 2.10.0: 如果自动驾驶状态下开启, 非自动驾驶状态下不开启,需手动点击自动驾驶按钮开启
|
||||
isGoingToNextStation = true
|
||||
if (CallerTaskListenerManager.isCarRunningTask()) {
|
||||
LineManager.unmanneAutopilotContinue(false)
|
||||
}else{
|
||||
LineManager.unmannedStartAutopilot(true)
|
||||
}
|
||||
if (CallerAutoPilotStatusListenerManager.getState() != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING
|
||||
) {
|
||||
LineManager.unmannedStartAutopilot(taskId ?: 0L, true)
|
||||
}else{
|
||||
LineManager.unmanneAutopilotContinue(taskId ?: 0L, false)
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -111,6 +111,7 @@ class NormalRepository : ILineRepository {
|
||||
// 线路信息
|
||||
if (lineInfo == null && busRoutesResult.name != null) {
|
||||
lineInfo = LineInfo(busRoutesResult.lineId.toLong(), busRoutesResult.name, orderId = busRoutesResult.taskId.toString())
|
||||
lineInfo?.taskId = busRoutesResult.taskId.toLong()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.view.LayoutInflater
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.findViewTreeViewModelStoreOwner
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS
|
||||
@@ -82,15 +83,15 @@ class TaskRunningView : ConstraintLayout, TaskRunningModel.SwtichLineViewCallbac
|
||||
})
|
||||
unmanned_actv_arriver_station.onClick {
|
||||
unmanned_loading_arrive_station.visibility = VISIBLE
|
||||
if(LineModel.isPreLastStation()==true){
|
||||
viewModel?.arriveStation()
|
||||
}else{
|
||||
viewModel?.skipStation()
|
||||
}
|
||||
|
||||
// if(LineModel.isPreLastStation()==true){
|
||||
// viewModel?.arriveStation()
|
||||
// }else{
|
||||
// viewModel?.skipStation()
|
||||
// }
|
||||
viewModel?.arriveStation()
|
||||
}
|
||||
unmanned_actv_arriver_station_new.setOnLongClickListener {
|
||||
viewModel?.arriveStation()
|
||||
CallerAutoPilotControlManager.sendTaskManagerRunningInfo()
|
||||
true
|
||||
}
|
||||
unmanned_actv_complete_task.onClick {
|
||||
|
||||
@@ -137,7 +137,7 @@ class MoGoAutopilotControlProvider :
|
||||
// .setType(Constants.SUBSCRIBE_TYPE.UNSUBSCRIBE)
|
||||
// .setMessageTypes(messageTypes).build()
|
||||
|
||||
// "192.168.1.102"
|
||||
// "172.30.33.83"
|
||||
val options = AdasOptions.newBuilder()
|
||||
.setConnectionMode(AdasOptions.IPC_CONNECTION_MODE.PING)
|
||||
.setPingAddressList(AdasManager.getInstance().pingAddressList)
|
||||
@@ -445,6 +445,16 @@ class MoGoAutopilotControlProvider :
|
||||
}
|
||||
}
|
||||
|
||||
override fun sendTaskManagerRunningInfo(): Long {
|
||||
return if (AdasManager.getInstance().ipcConnectionStatus == AdasConstants.IpcConnectionStatus.CONNECTED) {
|
||||
val invokeResult = AdasManager.getInstance().sendTaskManagerRunningInfo()
|
||||
invokeAutoPilotResult(if (invokeResult > -1) "无人化 获取正在执行的任务信息调用成功:${invokeResult}" else "获取正在执行的任务信息调用失败, socket 或者 rawPack 可能为空")
|
||||
invokeResult
|
||||
} else {
|
||||
invokeAutoPilotResult("无人化 车机与工控机链接失败,无法开启自动驾驶")
|
||||
-1L
|
||||
}
|
||||
}
|
||||
|
||||
override fun sendTaskManagerAutopilotStart(taskId: Long, traj: Trajectory): Long {
|
||||
return if (AdasManager.getInstance().ipcConnectionStatus == AdasConstants.IpcConnectionStatus.CONNECTED) {
|
||||
|
||||
@@ -83,6 +83,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerRoboBusJinlvM1StitchedV
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerSweeperFutianCleanSystemListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerSweeperFutianCloudTaskListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerTakeoverListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerTaskListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerV2XListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerV2nNioEventListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerVlmManager
|
||||
@@ -131,6 +132,7 @@ import com.zhjt.mogo.adas.data.sweeper.task.confirm.SweeperTaskConfirm
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.s_r.SweeperTaskSuspendResume
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.status.SweeperTaskStatus
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.stop.SweeperTaskStop
|
||||
import com.zhjt.mogo.adas.unmanned.task.dto.cmd.TaskLocationQueryResponse
|
||||
import com.zhjt.mogo.adas.utils.ByteUtil
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
import fault_management.FmInfo
|
||||
@@ -1700,6 +1702,10 @@ class MoGoAdasListenerImpl : OnAdasListener {
|
||||
override fun onAdasTaskManagerComplete(taskId: Long?, userId: Long?, status: Int?, reason: String?, completedTime: Date?, mileage: BigDecimal?) {
|
||||
}
|
||||
|
||||
override fun onAdasTaskManagerRunning(taskId: Long?, lineId: Long?, taskLocationQueryResponse: TaskLocationQueryResponse?){
|
||||
CallerTaskListenerManager.invokeRunningTaskInfo(taskId,lineId,taskLocationQueryResponse)
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否可以启动自动驾驶
|
||||
* 使用方法查看:app_ipc_monitoring/uiMainActivity/onAutopilotAbility
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.io.Serializable
|
||||
*/
|
||||
open class AutopilotStatusInfo : Serializable, Cloneable {
|
||||
/**
|
||||
* 当前链接的IP地址, 默认地址 192.168.1.102
|
||||
* 当前链接的IP地址, 默认地址 172.30.33.83
|
||||
*/
|
||||
var connectIP: String? = null
|
||||
|
||||
|
||||
@@ -181,11 +181,11 @@ object FunctionBuildConfig {
|
||||
/**
|
||||
* 配置连接工控机的IP地址
|
||||
* 小巴车 192.168.8.102
|
||||
* 出租车 192.168.1.102
|
||||
* 出租车 172.30.33.83
|
||||
*/
|
||||
@Volatile
|
||||
@JvmField
|
||||
var adasConnectIP = "192.168.1.102"
|
||||
var adasConnectIP = "172.30.33.83"
|
||||
|
||||
/**
|
||||
* acc 加速度值阈值
|
||||
|
||||
@@ -45,6 +45,8 @@ interface IMoGoAutopilotControlProvider : IMoGoFunctionServerProvider {
|
||||
*/
|
||||
fun startAutoPilot(controlParameters: AutopilotControlParameters): Long
|
||||
|
||||
fun sendTaskManagerRunningInfo(): Long
|
||||
|
||||
fun sendTaskManagerAutopilotStart(taskId: Long, traj: Trajectory): Long
|
||||
|
||||
fun sendTaskManagerAutopilotContinue(trackId: Long, taskId: Long, stationId: Long, stationName: String, stationSeq: Int, lon: Double, lat: Double): Long
|
||||
|
||||
@@ -92,6 +92,17 @@ object CallerAutoPilotControlManager {
|
||||
return sessionId
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启自动驾驶
|
||||
*
|
||||
* @param controlParameters 开启自动驾驶的控制参数
|
||||
*/
|
||||
fun sendTaskManagerRunningInfo(): Long {
|
||||
val sessionId = providerApi?.sendTaskManagerRunningInfo() ?: -1L
|
||||
// 更新记录在全局的控制参数
|
||||
return sessionId
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启自动驾驶
|
||||
*
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.mogo.eagle.core.function.call.autopilot
|
||||
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotActionsListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import com.zhjt.mogo.adas.unmanned.task.dto.cmd.TaskLocationQueryResponse
|
||||
|
||||
|
||||
/**
|
||||
* 能否启动自驾管理类
|
||||
*/
|
||||
object CallerTaskListenerManager : CallerBase<IMoGoAutopilotActionsListener>() {
|
||||
@Volatile
|
||||
private var runningtaskId = 0L
|
||||
|
||||
@Volatile
|
||||
private var runningLineId = 0L
|
||||
|
||||
@Volatile
|
||||
private var runningTaskLocationInfo: TaskLocationQueryResponse? = null
|
||||
|
||||
init {
|
||||
|
||||
}
|
||||
|
||||
fun isCarRunningTask(): Boolean {
|
||||
return runningLineId != 0L && runningLineId != 0L
|
||||
}
|
||||
|
||||
fun invokeRunningTaskInfo(
|
||||
taskId: Long?,
|
||||
lineId: Long?,
|
||||
taskLocationQueryResponse: TaskLocationQueryResponse?
|
||||
) {
|
||||
this.runningtaskId = taskId ?: 0L
|
||||
this.runningLineId = lineId ?: 0L
|
||||
this.runningTaskLocationInfo = taskLocationQueryResponse
|
||||
}
|
||||
}
|
||||
@@ -366,8 +366,8 @@ object AppIdentityModeUtils {
|
||||
//获取驾舱类型
|
||||
@JvmStatic
|
||||
fun getCockpitType(): CockpitType {
|
||||
return CockpitType.getCockpitType(SPUtils.getInstance().getString(COCKPIT_TYPE, CockpitType.NONE.code))
|
||||
// return CockpitType.UNMANNED
|
||||
// return CockpitType.getCockpitType(SPUtils.getInstance().getString(COCKPIT_TYPE, CockpitType.NONE.code))
|
||||
return CockpitType.UNMANNED
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.zhjt.mogo.adas.unmanned.task.dto.cmd;
|
||||
|
||||
/**
|
||||
* app发送给车端
|
||||
* 开启任务
|
||||
*/
|
||||
public class TaskRouteSyncRequest {
|
||||
|
||||
|
||||
public TaskRouteSyncRequest() {
|
||||
}
|
||||
|
||||
public static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public static class Builder {
|
||||
|
||||
public TaskRouteSyncRequest build() {
|
||||
return new TaskRouteSyncRequest();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,8 @@ public enum MessageCmdEnum {
|
||||
TaskCancelResponse("TaskCancelResponse", "任务取消请求"),
|
||||
TaskQueryStateRequest("TaskQueryStateRequest", "任务状态查询"),
|
||||
TaskQueryStateResponse("TaskQueryStateResponse", "任务状态查询响应"),
|
||||
TaskRouteSyncRequest("TaskRouteSyncRequest", "查询正在执行的任务"),
|
||||
TaskRouteSyncResponse("TaskRouteSyncResponse", "查询执行的任务的结果"),
|
||||
;
|
||||
private final String code;
|
||||
private final String desc;
|
||||
|
||||
@@ -65,6 +65,7 @@ import com.zhjt.mogo.adas.unmanned.task.dto.cmd.AutopilotPoint;
|
||||
import com.zhjt.mogo.adas.unmanned.task.dto.cmd.AutopilotStartRequest;
|
||||
import com.zhjt.mogo.adas.unmanned.task.dto.cmd.CmdDto;
|
||||
import com.zhjt.mogo.adas.unmanned.task.dto.cmd.TaskContinueNotification;
|
||||
import com.zhjt.mogo.adas.unmanned.task.dto.cmd.TaskRouteSyncRequest;
|
||||
import com.zhjt.mogo.adas.unmanned.task.dto.cmd.Trajectory;
|
||||
import com.zhjt.mogo.adas.unmanned.task.dto.cmd.VehicleSite;
|
||||
import com.zhjt.mogo.adas.unmanned.task.enums.AutopilotCoordinateTypeEnum;
|
||||
@@ -3396,9 +3397,22 @@ public class AdasChannel implements IAdasNetCommApi, FpgaSocket.IWebSocketConnec
|
||||
// .newBuilder()
|
||||
// .setTaskData(com.google.protobuf.ByteString.copyFrom(JsonUtil.toJsonBase64(data).getBytes(StandardCharsets.UTF_8)));
|
||||
// return sendPBMessage(MessageType.TYPE_SEND_TASK_MANAGER, builder.build().toByteArray());
|
||||
Log.i(TAG, "任务管理:"+data.toString());
|
||||
return sendPBMessage(MessageType.TYPE_SEND_TASK_MANAGER, JsonUtil.toJsonBase64(data).getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
|
||||
/**
|
||||
* 向任务管理发送启动自驾命令
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public long sendTaskManagerRunningInfo() {
|
||||
CmdDto<TaskRouteSyncRequest> cmdDto = CmdDto.<TaskRouteSyncRequest>builder().cmdType(MessageCmdEnum.TaskRouteSyncRequest.getCode()).taskId(-1L)
|
||||
.lineId(-1L).timestamp(System.currentTimeMillis()).build();
|
||||
return sendTaskManager(cmdDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 向任务管理发送启动自驾命令
|
||||
*
|
||||
|
||||
@@ -2087,6 +2087,11 @@ public class AdasManager implements IAdasNetCommApi {
|
||||
return mChannel == null ? -1L : mChannel.sendImgUploadCloudStatusQuery();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long sendTaskManagerRunningInfo() {
|
||||
return mChannel == null ? -1L : mChannel.sendTaskManagerRunningInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long sendTaskManagerAutopilotStart(Long taskId, Trajectory traj) {
|
||||
return mChannel == null ? -1L : mChannel.sendTaskManagerAutopilotStart(taskId, traj);
|
||||
|
||||
@@ -1544,6 +1544,7 @@ public interface IAdasNetCommApi {
|
||||
*/
|
||||
long sendImgUploadCloudStatusQuery();
|
||||
|
||||
long sendTaskManagerRunningInfo();
|
||||
long sendTaskManagerAutopilotStart(Long taskId, Trajectory traj);
|
||||
|
||||
long sendTaskManagerAutopilotContinue(Long trackId, Long taskId, Long stationId, String stationName, Integer stationSeq, double lon, double lat);
|
||||
|
||||
@@ -33,6 +33,7 @@ import com.zhjt.mogo.adas.data.sweeper.task.confirm.SweeperTaskConfirm;
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.s_r.SweeperTaskSuspendResume;
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.status.SweeperTaskStatus;
|
||||
import com.zhjt.mogo.adas.data.sweeper.task.stop.SweeperTaskStop;
|
||||
import com.zhjt.mogo.adas.unmanned.task.dto.cmd.TaskLocationQueryResponse;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
@@ -840,6 +841,14 @@ public interface OnAdasListener {
|
||||
*/
|
||||
void onAdasTaskManagerComplete(Long taskId, Long userId, Integer status, String reason, Date completedTime, BigDecimal mileage);
|
||||
|
||||
/**
|
||||
* 地盘正在执行的任务
|
||||
* @param taskId
|
||||
* @param lineId
|
||||
* @param taskLocationQueryResponse
|
||||
*/
|
||||
void onAdasTaskManagerRunning(Long taskId, Long lineId, TaskLocationQueryResponse taskLocationQueryResponse);
|
||||
|
||||
/**
|
||||
* 是否有能力启动自动驾驶
|
||||
*
|
||||
|
||||
@@ -42,7 +42,7 @@ public class Constants {
|
||||
*/
|
||||
public static final ByteString RAW_HEARTBEAT = ByteString.of((byte) 0x6e, (byte) 0x68, (byte) 0x6f, (byte) 0x69);
|
||||
|
||||
public static final String DEFAULT_PING_ADDRESS_LIST = "[\"192.168.1.102\", \"192.168.8.102\"]";
|
||||
public static final String DEFAULT_PING_ADDRESS_LIST = "[\"172.30.33.83\", \"192.168.8.102\"]";
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -95,8 +95,10 @@ public class TaskManagerMessage extends MyAbstractMessageHandler {
|
||||
if (cmdDto != null) {
|
||||
Log.i(TAG, "onAdasTaskLocationQueryResponse=" + cmdDto);
|
||||
TaskLocationQueryResponse taskLocationQueryResponse = cmdDto.getData();
|
||||
adasListener.onAdasTaskManagerRunning(cmdDto.getTaskId(),cmdDto.getLineId(),taskLocationQueryResponse);
|
||||
}
|
||||
|
||||
} else if (messageCmdEnum == MessageCmdEnum.TaskRouteSyncResponse) {//任务查询结果
|
||||
Log.i(TAG, "TaskRouteSyncResponse=" + data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user