Merge branch 'dev_robotaxi-d_230912_6.1.0' of gitlab.zhidaoauto.com:SCA/L4HA/AndroidApp/MoGoEagleEye into dev_robotaxi-d_230912_6.1.0

This commit is contained in:
aibingbing
2023-09-20 12:49:35 +08:00
8 changed files with 85 additions and 4 deletions

View File

@@ -87,7 +87,17 @@ object CharterTrajectoryManager {
// 5. 轨迹管理_轨迹下载超时
d(SceneConstant.M_CHARTER_D + TAG, "onAutopilotGuardian() 轨迹下载超时")
// ToastUtils.showShort("轨迹下载超时");
} else if ("ISSM_FUNC_AUTO_PILOT_READY" == guardianInfo.getCode()) {
} else if ("EMAP_ATTITUDE_INIT_FAILED" == guardianInfo.getCode()) {
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.OPERATION,
OperationMsg(
System.currentTimeMillis(), "请尽快操作车辆至适当位置掉头!", -1
)
)
)
SoundPoolHelper.getSoundPoolHelper().playSoundWithRedId(ActivityUtils.getTopActivity(), R.raw.startautopilot)
} else if ("EMAP_ATTITUDE_INIT_FAILED" == guardianInfo.getCode()) {
// 收到ssm的自动驾驶变为ready再次下发轨迹下载.解决域控重启或者102域控启动太早107节点初始化未完成导致的轨迹未进行下载。
d(SceneConstant.M_CHARTER_D + TAG, "onAutopilotGuardian() ssm ready再次发起下载")
syncTrajectoryInfo(get().getBusOrderResult()?.lineId!!,

View File

@@ -53,6 +53,7 @@ import io.reactivex.Observable
import io.reactivex.disposables.Disposable
import io.reactivex.schedulers.Schedulers
import mogo.telematics.pad.MessagePad
import mogo_msg.MogoReportMsg
import java.util.*
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.TimeUnit
@@ -197,6 +198,14 @@ object CharterPassengerModel {
d(M_BUS_P + TAG, "底盘给到站信息")
arriveDest()
}
override fun onAutopilotGuardian(guardianInfo: MogoReportMsg.MogoReportMessage?) {
super.onAutopilotGuardian(guardianInfo)
guardianInfo?.let {
if (it.code=="IMAP_TRA_LOADED") {
ToastCharterUtils.showToastShort("请等待车辆完成掉头后再出发吧~")
}
}
}
}
/**

View File

@@ -13,6 +13,9 @@ import kotlinx.android.synthetic.main.m1_itinerary_info.view.tv_distance_surplus
import kotlinx.android.synthetic.main.m1_itinerary_info.view.tv_distance_unit
import kotlinx.android.synthetic.main.m1_itinerary_info.view.tv_speed
/**
* 速度、剩余时间、剩余距离和到达时间
*/
class ItineraryView : ConstraintLayout, ItineraryViewModel.ItineraryViewCallback {
private val TAG = "ItineraryView"

View File

@@ -19,6 +19,9 @@ import kotlinx.android.synthetic.main.m1_devices_fragment.view.actv_order_times
import kotlinx.android.synthetic.main.m1_devices_fragment.view.cl_order_info
import kotlinx.android.synthetic.main.m1_devices_fragment.view.cl_order_info_endorder_comfit
/**
* 剩余时间和结束订单入口
*/
class OrderInfoView : ConstraintLayout, OrderInfoViewModel.ItineraryViewCallback {
private val TAG = "OrderInfoView"

View File

@@ -41,6 +41,9 @@ import kotlinx.android.synthetic.main.m1_order_loading.view.iv_loading_wait_ent
import me.jessyan.autosize.utils.AutoSizeUtils
import org.greenrobot.eventbus.EventBus
/**
* 选择线路
*/
class SelectLineView : ConstraintLayout, SelectLineViewModel.SelectLineViewCallback {
private val TAG = "OrderInfoView"

View File

@@ -72,6 +72,9 @@ import kotlinx.android.synthetic.main.m1_soft_fragment.view.tv_temperature_title
import me.jessyan.autosize.utils.AutoSizeUtils
import java.util.concurrent.TimeUnit
/**
* 空调、暖风机、声音控制
*/
class SoftControlView : ConstraintLayout, SoftControlViewModel.SoftControlCallback {
private val TAG = "OrderInfoView"

View File

@@ -90,12 +90,14 @@
app:layout_constraintEnd_toEndOf="@+id/viewBusPM1MsgBoxButton"
app:layout_constraintTop_toBottomOf="@+id/viewBusPM1MsgBoxButton" />
<!--速度、剩余时间、剩余距离和到达时间-->
<com.mogo.och.charter.passenger.ui.itinerary.ItineraryView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!--剩余时间和结束订单入口-->
<com.mogo.och.charter.passenger.ui.orderinfo.OrderInfoView
android:id="@+id/biz_orderinfo"
android:layout_width="match_parent"
@@ -105,12 +107,14 @@
app:layout_constraintBottom_toTopOf="@+id/bb_boorombar"
app:layout_constraintTop_toTopOf="parent" />
<!--空调、暖风机、声音控制-->
<com.mogo.och.charter.passenger.ui.softcontrol.SoftControlView
android:id="@+id/biz_softcontrol"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone" />
<!--选择线路-->
<com.mogo.och.charter.passenger.ui.selectline.SelectLineView
android:id="@+id/biz_selectline"
android:layout_width="0dp"
@@ -122,13 +126,14 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!--视频播放-->
<com.mogo.och.charter.passenger.ui.video.VideoView
android:id="@+id/biz_video"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone" />
<!--底部导航栏-->
<com.mogo.och.charter.passenger.ui.bottom.BottomBar
android:id="@+id/bb_boorombar"
android:layout_width="match_parent"
@@ -137,6 +142,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<!--调试面板-->
<com.mogo.och.charter.passenger.ui.debugview.DebugView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -145,6 +151,7 @@
app:layout_constraintEnd_toEndOf="@+id/mapBizView"
app:layout_constraintTop_toTopOf="parent" />
<!--锁定状态和解锁入口-->
<com.mogo.och.charter.passenger.ui.lockview.UnlockView
android:id="@+id/uv_only_unlock"
android:visibility="gone"
@@ -156,6 +163,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<!--锁定和解锁入口-->
<com.mogo.och.charter.passenger.ui.lockview.LockAndUnlockView
android:layout_width="@dimen/dp_138"
android:layout_height="@dimen/dp_138"

View File

@@ -1,16 +1,18 @@
package com.mogo.eagle.core.function.hmi.ui.widget
import android.animation.ObjectAnimator
import android.animation.ValueAnimator
import android.annotation.SuppressLint
import android.content.Context
import android.graphics.Color
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.animation.LinearInterpolator
import android.widget.ImageView
import android.widget.TextView
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.commons.voice.AIAssist
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotActionsListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoParallelDrivingActionsListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoParallelDrivingStatusListener
@@ -22,7 +24,6 @@ import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason.SourceType
import mogo.yycp.paralleldriving.protocol.ParallelDrivingRequest.ParallelRequest
import mogo.yycp.paralleldriving.protocol.ParallelTaskProcessNoticeOuterClass
@@ -50,6 +51,7 @@ class ParallelDriveView @JvmOverloads constructor(
//1:ready, 2:自动驾驶中, 7:平行驾驶中
@Volatile
private var autopilotState: Int = 1
@Volatile
private var isAutoDriving: Boolean = false
@@ -60,6 +62,7 @@ class ParallelDriveView @JvmOverloads constructor(
private lateinit var statusIcon: ImageView
private lateinit var statusTitle: TextView
private var listener: ClickEventListener? = null
private var animator: ObjectAnimator? = null
init {
LayoutInflater.from(context).inflate(R.layout.view_parallel_drive, this, true)
@@ -115,11 +118,13 @@ class ParallelDriveView @JvmOverloads constructor(
}, ThreadUtils.MODE.QUEUE)
}
}
2 -> {
if (this.autopilotState != state) {
isAutoDriving = true
}
}
else -> {
if (this.autopilotState != state) {
isAutoDriving = false
@@ -161,30 +166,37 @@ class ParallelDriveView @JvmOverloads constructor(
state = SYNCHRONIZING
updateUI(SYNCHRONIZING)
}
"EXCEPTION_EXIT_SYNC" -> {// 同步异常结束
state = ONE_EXCEPTION
updateUI(ONE_EXCEPTION)
}
"TASK_REJECTED" -> {// 任务已被拒绝
state = FAILURE
updateUI(FAILURE)
AIAssist.getInstance(context).speakTTSVoice("请求已被拒绝")
}
"PARALLEL_EXCEPTION_MANUAL_DRIVING" -> {// 异常请人工驾驶
state = TWO_EXCEPTION
updateUI(TWO_EXCEPTION)
}
"EXCEPTION_EXIT_PARALLEL_DRIVING" -> {// 平行驾驶异常结束
state = ONE_EXCEPTION
updateUI(ONE_EXCEPTION)
}
"EXIT_SYNC" -> {// 同步结束
checkAvailableAndUpdateUI()
}
"UNABLE_TAKEOVER" -> {// 无法接管
state = ONE_EXCEPTION
updateUI(ONE_EXCEPTION)
}
"VEHICLE_IN_TROUBLE_PARALLEL_REQUESTED" -> {// 车辆遇困请求平行驾驶
state = AD_REQUESTING
updateUI(AD_REQUESTING)
@@ -198,6 +210,7 @@ class ParallelDriveView @JvmOverloads constructor(
private fun updateUI(state: Int) {
when (state) {
0 -> {
stopRotateAnimation()
rootLayout.isEnabled = true
rootLayout.alpha = 1f
statusIcon.background =
@@ -215,6 +228,7 @@ class ParallelDriveView @JvmOverloads constructor(
resources.getDrawable(R.drawable.icon_para_requesting, null)
statusTitle.setTextColor(Color.parseColor("#FFFFFF"))
statusIcon.alpha = 1f
startRotateAnimation()
statusTitle.text = context.getString(R.string.parallel_drive_requesting)
rootLayout.background = resources.getDrawable(R.drawable.bg_auto_pilot, null)
}
@@ -226,11 +240,13 @@ class ParallelDriveView @JvmOverloads constructor(
resources.getDrawable(R.drawable.icon_para_requesting, null)
statusTitle.setTextColor(Color.parseColor("#FFFFFF"))
statusIcon.alpha = 1f
startRotateAnimation()
statusTitle.text = context.getString(R.string.parallel_drive_requesting)
rootLayout.background = resources.getDrawable(R.drawable.bg_auto_pilot, null)
}
SYNCHRONIZING -> {
stopRotateAnimation()
rootLayout.isEnabled = false
rootLayout.alpha = 1f
statusIcon.background =
@@ -242,6 +258,7 @@ class ParallelDriveView @JvmOverloads constructor(
}
PARALLEL_DRIVING -> {
stopRotateAnimation()
rootLayout.isEnabled = false
rootLayout.alpha = 1f
statusIcon.background =
@@ -254,6 +271,7 @@ class ParallelDriveView @JvmOverloads constructor(
}
FAILURE -> {
stopRotateAnimation()
rootLayout.isEnabled = false
rootLayout.alpha = 1f
rootLayout.postDelayed({
@@ -268,6 +286,7 @@ class ParallelDriveView @JvmOverloads constructor(
}
ONE_EXCEPTION -> {
stopRotateAnimation()
rootLayout.isEnabled = false
rootLayout.alpha = 1f
rootLayout.postDelayed({
@@ -282,6 +301,7 @@ class ParallelDriveView @JvmOverloads constructor(
}
TWO_EXCEPTION -> {
stopRotateAnimation()
rootLayout.isEnabled = false
rootLayout.alpha = 1f
rootLayout.postDelayed({
@@ -296,6 +316,7 @@ class ParallelDriveView @JvmOverloads constructor(
}
UNAVAILABLE -> {
stopRotateAnimation()
rootLayout.isEnabled = false
rootLayout.alpha = 0.4f
statusIcon.background =
@@ -351,6 +372,27 @@ class ParallelDriveView @JvmOverloads constructor(
}
}
@SuppressLint("Recycle")
private fun startRotateAnimation() {
if (animator == null) {
animator = ObjectAnimator.ofFloat(statusIcon, "rotation", 0f, 360f).apply {
duration = 1500
repeatMode = ValueAnimator.RESTART
repeatCount = ValueAnimator.INFINITE
interpolator = LinearInterpolator()
}
}
animator?.start()
}
private fun stopRotateAnimation() {
animator?.let {
if (it.isRunning) {
it.cancel()
}
}
}
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
CallerAutoPilotStatusListenerManager.removeListener(TAG)