Merge branch 'dev_robotaxi-d_250417_8.0.0' into dev_robotaxi-d_250417_8.0.0_routing
This commit is contained in:
@@ -26,8 +26,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_350"
|
||||
android:layout_marginRight="@dimen/dp_50"
|
||||
android:layout_marginTop="@dimen/dp_115"
|
||||
android:layout_marginEnd="@dimen/dp_23"
|
||||
app:explorationUser="driver"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningActionsListenerManager
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.unmanned.passenger.model.TaxiPassengerModel
|
||||
import com.mogo.och.unmanned.passenger.ui.aiview.bean.AIMessage
|
||||
import mogo.telematics.pad.MessagePad
|
||||
|
||||
@@ -47,8 +48,12 @@ class PNCActionsViewModel: ViewModel(), IMoGoAutopilotPlanningActionsListener {
|
||||
actions?.let {
|
||||
if(it.isNotEmpty() && it != currentAction){
|
||||
currentAction = it
|
||||
val action = AIMessage.PNCAction(it+System.currentTimeMillis(),it)
|
||||
AIMessageManager.post(action)
|
||||
val title = getActionTitle(it)
|
||||
if(title.isNotEmpty()){
|
||||
val desc = getActionDesc(title)
|
||||
val action = AIMessage.PNCAction(it+System.currentTimeMillis(),title,desc,System.currentTimeMillis())
|
||||
AIMessageManager.post(action)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,4 +64,163 @@ class PNCActionsViewModel: ViewModel(), IMoGoAutopilotPlanningActionsListener {
|
||||
}
|
||||
}
|
||||
|
||||
private fun getActionTitle(pncAction: String): String{
|
||||
return when(pncAction){
|
||||
"正在进站"->{
|
||||
"车辆进站"
|
||||
}
|
||||
"等待进站"->{
|
||||
"车辆等待进站"
|
||||
}
|
||||
"正在出站"->{
|
||||
"车辆出站"
|
||||
}
|
||||
"等待出站"->{
|
||||
"车辆等待出站"
|
||||
}
|
||||
"正在向左变道"->{
|
||||
"车辆向左变道"
|
||||
}
|
||||
"正在向右变道"->{
|
||||
"车辆向右变道"
|
||||
}
|
||||
"正在完成变道"->{
|
||||
"车辆完成变道"
|
||||
}
|
||||
"正在绕过障碍物"->{
|
||||
"车辆正在绕过前方障碍物"
|
||||
}
|
||||
"正在向左绕行避让前方静止障碍物"->{
|
||||
"车辆正在绕过前方障碍物"
|
||||
}
|
||||
"正在向右绕行避让前方静止障碍物"->{
|
||||
"车辆正在绕过前方障碍物"
|
||||
}
|
||||
"正在避让障碍物"->{
|
||||
"车辆正在避让前方障碍物"
|
||||
}
|
||||
"正在向左变道避让前方静止障碍物"->{
|
||||
"车辆正在避让前方障碍物"
|
||||
}
|
||||
"正在向右变道避让前方静止障碍物"->{
|
||||
"车辆正在避让前方障碍物"
|
||||
}
|
||||
"正在等红灯"->{
|
||||
"路口等红灯"
|
||||
}
|
||||
"正在向左变道避让前方道路施工"->{
|
||||
"车辆正在变道避让前方道路施工"
|
||||
}
|
||||
"正在向右变道避让前方道路施工"->{
|
||||
"车辆正在变道避让前方道路施工"
|
||||
}
|
||||
"正在向左绕行避让前方道路施工"->{
|
||||
"车辆正在绕行避让前方道路施工"
|
||||
}
|
||||
"正在向右绕行避让前方道路施工"->{
|
||||
"车辆正在绕行避让前方道路施工"
|
||||
}
|
||||
|
||||
"正在向左变道避让前方道路事故"->{
|
||||
"车辆正在变道避让前方道路事故"
|
||||
}
|
||||
"正在向右变道避让前方道路事故"->{
|
||||
"车辆正在变道避让前方道路事故"
|
||||
}
|
||||
"正在向左绕行避让前方道路事故"->{
|
||||
"车辆正在绕行避让前方道路事故"
|
||||
}
|
||||
"正在向右绕行避让前方道路事故"->{
|
||||
"车辆正在绕行避让前方道路事故"
|
||||
}
|
||||
"正在跟随车辆行驶"->{
|
||||
"车辆正在跟车通行"
|
||||
}
|
||||
"正在跟车行驶"->{
|
||||
"车辆正在跟车通行"
|
||||
}
|
||||
"正在向左变道避让前方车龙"->{
|
||||
"车辆正在绕行前方车龙"
|
||||
}
|
||||
"正在向右变道避让前方车龙"->{
|
||||
"车辆正在绕行前方车龙"
|
||||
}
|
||||
"正在使用云端规划通过路口"->{
|
||||
"车辆正在使用云端轨迹通行"
|
||||
}
|
||||
"正在避让后方来车"->{
|
||||
"车辆正在避让后方来车"
|
||||
}
|
||||
else->{
|
||||
""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun getActionDesc(action: String): String{
|
||||
return when(action){
|
||||
"车辆进站"->{
|
||||
"前方即将到达${TaxiPassengerModel.currentOCHOrder!!.orderEndSite.siteName}," +
|
||||
"车辆正在规划减速并进站停靠,请安心等待车辆停稳再下车哦~"
|
||||
}
|
||||
"车辆等待进站"->{
|
||||
"车辆待环境安全后进站,耐心等几秒,安全比赶路更重要~"
|
||||
}
|
||||
"车辆出站"->{
|
||||
"欢迎乘坐MOGO RoboTaxi~车辆正在规划出站,坐稳扶好哦,我们出发啦!小智持续守护您的行程。"
|
||||
}
|
||||
"车辆等待出站"->{
|
||||
"车辆待环境安全后出站,耐心等几秒,安全比赶路更重要~"
|
||||
}
|
||||
"车辆向左变道"->{
|
||||
"确认环境安全,车辆正在规划平稳向左/向右变道,同时持续监测周边交通参与者动向,放心交给我们吧!"
|
||||
}
|
||||
"车辆向右变道"->{
|
||||
"确认环境安全,车辆正在规划平稳向左/向右变道,同时持续监测周边交通参与者动向,放心交给我们吧!"
|
||||
}
|
||||
"车辆完成变道"->{
|
||||
"变道完成啦,继续前进!小智持续守护您的行程。"
|
||||
}
|
||||
"车辆正在绕过前方障碍物"->{
|
||||
"发现前方障碍物,车辆正在规划平稳变道,即将画出一条完美弧线~"
|
||||
}
|
||||
"车辆正在避让前方障碍物"->{
|
||||
"发现前方障碍物,车辆正在规划平稳避让,诠释优雅与丝滑~"
|
||||
}
|
||||
"车辆完成绕障"->{
|
||||
"绕障完成啦,继续前进!小智持续守护您的行程。"
|
||||
}
|
||||
"路口等红灯"->{
|
||||
"车辆正在路口等红灯,可以安心放空望望窗外~小智一直在您身边哦!"
|
||||
}
|
||||
"车辆正在变道避让前方道路施工"->{
|
||||
"车辆正在提前规划向左/右变道避让前方道路施工,稳稳的很安心~您已体验到车路云一体化协同应用场景,是当之无愧的先锋体验官!"
|
||||
}
|
||||
"车辆正在绕行避让前方道路施工"->{
|
||||
"车辆正在提前规划向左/右绕行避让前方道路施工,稳稳的很安心~您已体验到车路云一体化协同应用场景,是当之无愧的先锋体验官!"
|
||||
}
|
||||
"车辆正在变道避让前方道路事故"->{
|
||||
"车辆正在提前规划向左/右变道避让前方道路事故,放心看我表现吧!您已体验到车路云一体化协同应用场景,小智为您欢呼!"
|
||||
}
|
||||
"车辆正在绕行避让前方道路事故"->{
|
||||
"车辆正在提前规划向左/右绕行避让前方道路事故,放心看我表现吧!您已体验到车路云一体化协同应用场景,小智为您欢呼!"
|
||||
}
|
||||
"车辆正在跟车通行"->{
|
||||
"车辆正在跟随前车通行,舒适度MAX~您已体验到车路云一体化协同应用场景,超越全国99%的乘客!"
|
||||
}
|
||||
"车辆正在绕行前方车龙"->{
|
||||
"车辆正在提前规划向左/右变道避让路口车龙,舒适度MAX~。您已体验到车路云一体化协同应用场景,超越全国99%的乘客!"
|
||||
}
|
||||
"车辆正在使用云端轨迹通行"->{
|
||||
"前方智慧路口内有障碍物,车辆正在使用云端规划轨迹通行。您已体验到车路云一体化协同应用场景,超越全国99%的乘客!"
|
||||
}
|
||||
"车辆正在避让后方来车"->{
|
||||
"车辆正在避让后方来车,耐心等几秒,安全比赶路更重要~"
|
||||
}
|
||||
else->{
|
||||
""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -186,9 +186,15 @@ class QAViewHolder(val binding: View) : MessageViewHolder(binding) {
|
||||
class PNCActionViewHolder(binding: View) : MessageViewHolder(binding){
|
||||
|
||||
private var tvPncAction: TextView = binding.findViewById(R.id.tvPncAction)
|
||||
private var tvPncActionDesc: TextView = binding.findViewById(R.id.tvPncActionDesc)
|
||||
private var tvPncActionTime: TextView = binding.findViewById(R.id.tvPncActionTime)
|
||||
|
||||
override fun bind(item: AIMessage, onItemClickListener: OnItemClickListener?) {
|
||||
tvPncAction.text = item.title
|
||||
if(item is AIMessage.PNCAction){
|
||||
tvPncAction.text = item.title
|
||||
tvPncActionDesc.text = item.actionDesc
|
||||
tvPncActionTime.text = DateTimeUtils.getTimeText(item.timeStamp, DateTimeUtils.HH_mm_ss)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -135,7 +135,9 @@ sealed class AIMessage(
|
||||
|
||||
data class PNCAction(
|
||||
override val id: String,
|
||||
override val title: String
|
||||
override val title: String,
|
||||
var actionDesc: String,
|
||||
var timeStamp: Long = 0, //事件发生事件戳
|
||||
): AIMessage(id,title)
|
||||
|
||||
data class RoadV2NEvent(
|
||||
|
||||
@@ -19,9 +19,7 @@ import com.mogo.och.unmanned.passenger.ui.bar.LeftBarView
|
||||
import com.mogo.och.unmanned.taxi.passenger.R
|
||||
import kotlinx.android.synthetic.main.taxi_p_home.view.acbtn_show_all
|
||||
import kotlinx.android.synthetic.main.taxi_p_home.view.acbtn_show_hdmap
|
||||
import kotlinx.android.synthetic.main.taxi_p_home.view.decContainer
|
||||
import kotlinx.android.synthetic.main.taxi_p_home.view.hdMapView
|
||||
import kotlinx.android.synthetic.main.taxi_p_home.view.preContainer
|
||||
import kotlinx.android.synthetic.main.taxi_p_home.view.lbv_go2_center
|
||||
import kotlinx.android.synthetic.main.taxi_p_home.view.leftEndGuideline
|
||||
import kotlinx.android.synthetic.main.taxi_p_home.view.midContainer
|
||||
@@ -54,12 +52,12 @@ class HomeView @JvmOverloads constructor(
|
||||
private fun initlistener() {
|
||||
lbv_go2_center.setOrderIdCallback(object : LeftBarView.LeftBarCallback{
|
||||
override fun setGo2CenterClick() {
|
||||
//切换到地图中间
|
||||
//切换到地图中间
|
||||
hdMapView.getUI()?.let {
|
||||
val wgs02Location = OchLocationManager.getWgs02Location()
|
||||
it.moveToCenter(MogoLatLng(wgs02Location.latitude, wgs02Location.longitude))
|
||||
}
|
||||
//overMapView.displayCustomOverView()
|
||||
//overMapView.displayCustomOverView()
|
||||
}
|
||||
|
||||
})
|
||||
@@ -89,38 +87,38 @@ class HomeView @JvmOverloads constructor(
|
||||
|
||||
fun onCreate(savedInstanceState: Bundle?) {
|
||||
hdMapView.onCreate(savedInstanceState)
|
||||
preContainer.onCreate(savedInstanceState)
|
||||
decContainer.onCreate(savedInstanceState)
|
||||
// preContainer.onCreate(savedInstanceState)
|
||||
// decContainer.onCreate(savedInstanceState)
|
||||
}
|
||||
|
||||
fun onSaveInstanceState(outState: Bundle) {
|
||||
hdMapView.onSaveInstanceState(outState)
|
||||
preContainer.onSaveInstanceState(outState)
|
||||
decContainer.onSaveInstanceState(outState)
|
||||
// preContainer.onSaveInstanceState(outState)
|
||||
// decContainer.onSaveInstanceState(outState)
|
||||
}
|
||||
|
||||
fun onResume() {
|
||||
hdMapView.onResume()
|
||||
preContainer.onResume()
|
||||
decContainer.onResume()
|
||||
// preContainer.onResume()
|
||||
// decContainer.onResume()
|
||||
}
|
||||
|
||||
fun onLowMemory() {
|
||||
hdMapView.onLowMemory()
|
||||
preContainer.onLowMemory()
|
||||
decContainer.onLowMemory()
|
||||
// preContainer.onLowMemory()
|
||||
// decContainer.onLowMemory()
|
||||
}
|
||||
|
||||
fun onPause() {
|
||||
hdMapView.onPause()
|
||||
preContainer.onPause()
|
||||
decContainer.onPause()
|
||||
// preContainer.onPause()
|
||||
// decContainer.onPause()
|
||||
}
|
||||
|
||||
fun onDestroy() {
|
||||
hdMapView.onDestroy()
|
||||
preContainer.onDestroy()
|
||||
decContainer.onDestroy()
|
||||
// preContainer.onDestroy()
|
||||
// decContainer.onDestroy()
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
|
||||
@@ -41,35 +41,35 @@ class HomeViewModel : ViewModel(), BridgeListener, OrderListener {
|
||||
|
||||
override fun onTrajectoryHaveData(haveTrajectoryInfos: Boolean) {
|
||||
this.haveTrajectoryInfos = haveTrajectoryInfos
|
||||
checkScreenChange()
|
||||
// checkScreenChange()
|
||||
}
|
||||
|
||||
override fun onPredictionHavaData(havePredictionInfos: Boolean) {
|
||||
this.havePredictionInfos = havePredictionInfos
|
||||
checkScreenChange()
|
||||
// checkScreenChange()
|
||||
}
|
||||
|
||||
override fun onCurrentOrderStatusChanged(order: BaseOrderBean?) {
|
||||
this.order = order
|
||||
checkScreenChange()
|
||||
// checkScreenChange()
|
||||
}
|
||||
|
||||
fun checkScreenChange(){
|
||||
CallerLogger.d(TAG,"havePredictionInfos:${havePredictionInfos}--haveTrajectoryInfos:${haveTrajectoryInfos}--order:${order}")
|
||||
if(order!=null&&havePredictionInfos&&havePredictionInfos){
|
||||
FunctionBuildConfig.isDrawDecIdentifyData = true
|
||||
FunctionBuildConfig.isDrawPreIdentifyData = true
|
||||
// 展示三联屏
|
||||
BizLoopManager.runInMainThread{
|
||||
this.viewCallback?.showThreeScreen()
|
||||
}
|
||||
}else{
|
||||
FunctionBuildConfig.isDrawDecIdentifyData = false
|
||||
FunctionBuildConfig.isDrawPreIdentifyData = false
|
||||
// 展示二联屏幕
|
||||
BizLoopManager.runInMainThread{
|
||||
this.viewCallback?.showTwoScreen()
|
||||
}
|
||||
}
|
||||
// CallerLogger.d(TAG,"havePredictionInfos:${havePredictionInfos}--haveTrajectoryInfos:${haveTrajectoryInfos}--order:${order}")
|
||||
// if(order!=null&&havePredictionInfos&&havePredictionInfos){
|
||||
// FunctionBuildConfig.isDrawDecIdentifyData = true
|
||||
// FunctionBuildConfig.isDrawPreIdentifyData = true
|
||||
// // 展示三联屏
|
||||
// BizLoopManager.runInMainThread{
|
||||
// this.viewCallback?.showThreeScreen()
|
||||
// }
|
||||
// }else{
|
||||
// FunctionBuildConfig.isDrawDecIdentifyData = false
|
||||
// FunctionBuildConfig.isDrawPreIdentifyData = false
|
||||
// // 展示二联屏幕
|
||||
// BizLoopManager.runInMainThread{
|
||||
// this.viewCallback?.showTwoScreen()
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
@@ -9,18 +9,53 @@
|
||||
app:yOffset="0dp"
|
||||
app:blurRadius="@dimen/dp_26">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvPncAction"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="@dimen/dp_747"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#394047"
|
||||
android:textSize="@dimen/sp_32"
|
||||
android:paddingStart="@dimen/dp_16"
|
||||
android:paddingEnd="@dimen/dp_30"
|
||||
android:paddingTop="@dimen/dp_28"
|
||||
android:paddingBottom="@dimen/dp_28"
|
||||
android:drawablePadding="@dimen/dp_7"
|
||||
android:drawableStart="@drawable/icon_pnc_action"
|
||||
/>
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvPncAction"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#394047"
|
||||
android:textSize="@dimen/sp_32"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_28"
|
||||
android:drawablePadding="@dimen/dp_7"
|
||||
android:drawableStart="@drawable/icon_pnc_action"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvPncActionTime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@id/tvPncAction"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvPncAction"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:layout_marginEnd="@dimen/dp_30"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvPncActionDesc"
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvPncAction"
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvPncAction"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="@id/tvPncActionTime"
|
||||
android:textSize="@dimen/sp_32"
|
||||
android:textColor="#394047"
|
||||
android:layout_marginStart="@dimen/dp_45"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_marginBottom="@dimen/dp_26"
|
||||
|
||||
android:text="古城村滇池卫城我吃完传达传达出我擦撒擦擦车是擦擦"
|
||||
/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</com.mogo.och.common.module.wigets.OCHBorderShadowLayout>
|
||||
@@ -34,24 +34,24 @@
|
||||
app:layout_constraintStart_toEndOf="@+id/midStartGuideline"
|
||||
app:layout_constraintEnd_toStartOf="@id/rightStartGuideline">
|
||||
|
||||
<com.mogo.eagle.core.function.view.PredictionLayout
|
||||
android:id="@+id/preContainer"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:background="@drawable/taxi_p_home_middle_top_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_676" />
|
||||
<!-- <com.mogo.eagle.core.function.view.PredictionLayout-->
|
||||
<!-- android:id="@+id/preContainer"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- android:background="@drawable/taxi_p_home_middle_top_bg"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="@dimen/dp_676" />-->
|
||||
|
||||
<com.mogo.eagle.core.function.view.DecisionLayout
|
||||
android:id="@+id/decContainer"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:background="@drawable/taxi_p_home_middle_bottom_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_676"
|
||||
/>
|
||||
<!-- <com.mogo.eagle.core.function.view.DecisionLayout-->
|
||||
<!-- android:id="@+id/decContainer"-->
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- android:background="@drawable/taxi_p_home_middle_bottom_bg"-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:layout_height="@dimen/dp_676"-->
|
||||
<!-- />-->
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -162,5 +162,5 @@
|
||||
android:visibility="gone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
|
||||
</merge>
|
||||
5
OCH/taxi/unmanned-passenger/src/main/res/values/ids.xml
Normal file
5
OCH/taxi/unmanned-passenger/src/main/res/values/ids.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<item name="prediction_layout_id" type="id" />
|
||||
<item name="decision_layout_id" type="id" />
|
||||
</resources>
|
||||
@@ -11,7 +11,7 @@
|
||||
"eagle_dns_url": "",
|
||||
"bind_driver_qr_url": "",
|
||||
"chart_socket_url":"",
|
||||
"nde_url":"",
|
||||
"nde_url":"https://nde-qa-city.zhidaozhixing.com",
|
||||
"secure_active_url":"http://gateway.ee-private-dev1.myghost.zhidaoauto.com/openapi/security/deviceCert/active",
|
||||
"secure_refresh_url":"http://gateway.ee-private-dev1.myghost.zhidaoauto.com/openapi/security/deviceCert/refresh",
|
||||
"secure_auth_url":"http://gateway.ee-private-dev1.myghost.zhidaoauto.com/openapi/security/deviceCert/auth",
|
||||
@@ -29,7 +29,7 @@
|
||||
"eagle_dns_url": "",
|
||||
"bind_driver_qr_url": "",
|
||||
"chart_socket_url":"",
|
||||
"nde_url":"",
|
||||
"nde_url":"https://nde-qa-city.zhidaozhixing.com",
|
||||
"secure_active_url":"https://mygateway.zhidaozhixing.com/openapi/security/deviceCert/active",
|
||||
"secure_refresh_url":"https://mygateway.zhidaozhixing.com/openapi/security/deviceCert/refresh",
|
||||
"secure_auth_url":"https://mygateway.zhidaozhixing.com/openapi/security/deviceCert/auth",
|
||||
@@ -49,7 +49,7 @@
|
||||
"eagle_dns_url": "http://eagle-dns-a.zhidaozhixing.com/",
|
||||
"bind_driver_qr_url": "https://och-mini-eh.zhidaozhixing.com?pipe=ehsafety&sn=%1$s",
|
||||
"chart_socket_url":"wss://acp-eh.zhidaozhixing.com/ws",
|
||||
"nde_url":"",
|
||||
"nde_url":"https://nde-qa-city.zhidaozhixing.com",
|
||||
"secure_active_url":"http://gateway.ee-private-dev1.myghost.zhidaoauto.com/openapi/security/deviceCert/active",
|
||||
"secure_refresh_url":"http://gateway.ee-private-dev1.myghost.zhidaoauto.com/openapi/security/deviceCert/refresh",
|
||||
"secure_auth_url":"http://gateway.ee-private-dev1.myghost.zhidaoauto.com/openapi/security/deviceCert/auth",
|
||||
@@ -67,7 +67,7 @@
|
||||
"eagle_dns_url": "https://och-hailing-eh.zhidaozhixing.com/",
|
||||
"bind_driver_qr_url": "https://och-mini-eh.zhidaozhixing.com?pipe=ehsafety&sn=%1$s",
|
||||
"chart_socket_url":"wss://acp-eh.zhidaozhixing.com/ws",
|
||||
"nde_url":"",
|
||||
"nde_url":"https://nde-qa-city.zhidaozhixing.com",
|
||||
"secure_active_url":"https://mygateway.zhidaozhixing.com/openapi/security/deviceCert/active",
|
||||
"secure_refresh_url":"https://mygateway.zhidaozhixing.com/openapi/security/deviceCert/refresh",
|
||||
"secure_auth_url":"https://mygateway.zhidaozhixing.com/openapi/security/deviceCert/auth",
|
||||
@@ -87,7 +87,7 @@
|
||||
"eagle_dns_url": "http://eagle-dns-a.zhidaozhixing.com/",
|
||||
"bind_driver_qr_url": "https://och-mini-yt.zhidaozhixing.com?pipe=ytsafety&sn=%1$s",
|
||||
"chart_socket_url":"",
|
||||
"nde_url":"",
|
||||
"nde_url":"https://nde-qa-city.zhidaozhixing.com",
|
||||
"secure_active_url":"http://gateway.ee-private-dev1.myghost.zhidaoauto.com/openapi/security/deviceCert/active",
|
||||
"secure_refresh_url":"http://gateway.ee-private-dev1.myghost.zhidaoauto.com/openapi/security/deviceCert/refresh",
|
||||
"secure_auth_url":"http://gateway.ee-private-dev1.myghost.zhidaoauto.com/openapi/security/deviceCert/auth",
|
||||
@@ -105,7 +105,7 @@
|
||||
"eagle_dns_url": "https://och-hailing-yt.zhidaozhixing.com/",
|
||||
"bind_driver_qr_url": "https://och-mini-yt.zhidaozhixing.com?pipe=ytsafety&sn=%1$s",
|
||||
"chart_socket_url":"",
|
||||
"nde_url":"",
|
||||
"nde_url":"https://nde-qa-city.zhidaozhixing.com",
|
||||
"secure_active_url":"https://mygateway.zhidaozhixing.com/openapi/security/deviceCert/active",
|
||||
"secure_refresh_url":"https://mygateway.zhidaozhixing.com/openapi/security/deviceCert/refresh",
|
||||
"secure_auth_url":"https://mygateway.zhidaozhixing.com/openapi/security/deviceCert/auth",
|
||||
|
||||
@@ -230,6 +230,13 @@ object OTAUpgradeManager: IMoGoAutopilotStatusListener, IDataCenterBizListener,
|
||||
if(OTAUpgradeConfig.isQuery){
|
||||
ToastUtils.showLong("暂无待升级任务!")
|
||||
OTAUpgradeConfig.isQuery = false
|
||||
}else{
|
||||
//没有升级任务,取消查询,关掉弹窗
|
||||
responseTimeoutNum = 0
|
||||
handler.removeMessages(1)
|
||||
CallerHmiManager.showOTAUpgradeDialog(false)
|
||||
CallerHmiManager.showOTADownloadStatusDialog(false, emptyList())
|
||||
CallerOTAManager.invokeOtaDownloadStatus(false)
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -303,6 +310,7 @@ object OTAUpgradeManager: IMoGoAutopilotStatusListener, IDataCenterBizListener,
|
||||
}
|
||||
if(productStatus == 4){
|
||||
upgradeResult = false
|
||||
upgradeComplete = true
|
||||
}
|
||||
if(productName.contains(":")){
|
||||
productName = productName.trim().substringAfterLast(":")
|
||||
|
||||
@@ -15,6 +15,7 @@ import com.mogo.eagle.core.function.api.datacenter.IDataCenterBizListener
|
||||
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsListener
|
||||
import com.mogo.eagle.core.function.api.devatools.IOTAListener
|
||||
import com.mogo.eagle.core.function.api.hmi.autopilot.IMoGoCheckAutoPilotBtnListener
|
||||
import com.mogo.eagle.core.function.api.setting.IMapShowNameListener
|
||||
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.CallerChassisLocationWGS84ListenerManager
|
||||
@@ -25,6 +26,7 @@ import com.mogo.eagle.core.function.call.hmi.CallerHmiListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.och.CallerOchCustomViewManager
|
||||
import com.mogo.eagle.core.function.call.setting.CallerMapShowNameManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.ui.tools.OfflineMapDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.utils.HmiActionLog
|
||||
@@ -68,7 +70,8 @@ class CarInfoTabView @JvmOverloads constructor(
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoCheckAutoPilotBtnListener,
|
||||
IMoGoAutopilotStatusListener, IMoGoDevaToolsListener, IDataCenterBizListener, IOTAListener {
|
||||
IMoGoAutopilotStatusListener, IMoGoDevaToolsListener, IDataCenterBizListener, IOTAListener,
|
||||
IMapShowNameListener {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "CarInfoTabView"
|
||||
@@ -91,6 +94,7 @@ class CarInfoTabView @JvmOverloads constructor(
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
CallerDevaToolsListenerManager.addListener(TAG, this)
|
||||
CallerDataCenterBizListener.addListener(TAG, this)
|
||||
CallerMapShowNameManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
@@ -99,6 +103,7 @@ class CarInfoTabView @JvmOverloads constructor(
|
||||
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
CallerDevaToolsListenerManager.removeListener(TAG)
|
||||
CallerDataCenterBizListener.removeListener(TAG)
|
||||
CallerMapShowNameManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
@@ -248,8 +253,12 @@ class CarInfoTabView @JvmOverloads constructor(
|
||||
|
||||
private fun showCurrentAdVersion() {
|
||||
UiThreadHandler.post {
|
||||
CallerAutoPilotStatusListenerManager.getDockerVersion()?.let {
|
||||
tvADVersionName.text = it
|
||||
if(AppConfigInfo.mapShowName.isNotEmpty()){
|
||||
tvADVersionName.text = AppConfigInfo.mapShowName
|
||||
}else{
|
||||
CallerAutoPilotStatusListenerManager.getDockerVersion()?.let {
|
||||
tvADVersionName.text = it
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -356,4 +365,9 @@ class CarInfoTabView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
override fun changeMapShowName(showName: String) {
|
||||
super.changeMapShowName(showName)
|
||||
showCurrentAdVersion()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -96,6 +96,7 @@ import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager
|
||||
import com.mogo.eagle.core.function.call.obu.CallerObuApiManager
|
||||
import com.mogo.eagle.core.function.call.obu.CallerObuConnectListenerManager
|
||||
import com.mogo.eagle.core.function.call.obu.CallerObuInfoListenerManager
|
||||
import com.mogo.eagle.core.function.call.setting.CallerMapShowNameManager
|
||||
import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager
|
||||
import com.mogo.eagle.core.function.call.setting.CallerSopSettingManager
|
||||
import com.mogo.eagle.core.function.call.telematic.CallerTelematicListenerManager
|
||||
@@ -337,6 +338,8 @@ import kotlin.collections.set
|
||||
import kotlin.math.abs
|
||||
import kotlin.system.exitProcess
|
||||
import com.mogo.eagle.core.function.hmi.ui.tools.ShowDevicesManagerStateDialog
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.btnEnsureMap
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.etMapShowName
|
||||
import kotlinx.android.synthetic.main.view_debug_setting.view.tbTileFileLog
|
||||
|
||||
|
||||
@@ -597,6 +600,18 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
appVersionInfoLayout.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
//动态配置鹰眼显示MAP版本
|
||||
if(AppConfigInfo.mapShowName.isEmpty()){
|
||||
AppConfigInfo.mapShowName = CallerAutoPilotStatusListenerManager.getDockerVersion()+""
|
||||
}
|
||||
etMapShowName.setText(AppConfigInfo.mapShowName)
|
||||
etMapShowName.text?.let { etMapShowName.setSelection(it.length) }
|
||||
btnEnsureMap.setOnClickListener {
|
||||
AppConfigInfo.mapShowName = etMapShowName.text.toString()
|
||||
tvIpcVersionInfo.text = "MAP:${AppConfigInfo.mapShowName}"
|
||||
tvIpcVersionInfoKey.text = "MAP:${AppConfigInfo.mapShowName}"
|
||||
CallerMapShowNameManager.invokeMapShowName(AppConfigInfo.mapShowName)
|
||||
}
|
||||
|
||||
/**
|
||||
* 状态中心
|
||||
@@ -2108,7 +2123,11 @@ internal class DebugSettingView @JvmOverloads constructor(
|
||||
} else {
|
||||
tvIpcProtocolVersionInfo.text = "工控机协议版本:${AppConfigInfo.protocolVersionNumber}"
|
||||
}
|
||||
val dockerVersion = CallerAutoPilotStatusListenerManager.getDockerVersion()
|
||||
val dockerVersion = if(AppConfigInfo.mapShowName.isNotEmpty() && AppConfigInfo.mapShowName!=CallerAutoPilotStatusListenerManager.getDockerVersion()){
|
||||
AppConfigInfo.mapShowName
|
||||
}else{
|
||||
CallerAutoPilotStatusListenerManager.getDockerVersion()
|
||||
}
|
||||
tvIpcVersionInfo.text = "MAP:$dockerVersion"
|
||||
tvIpcVersionInfoKey.text = "MAP:$dockerVersion"
|
||||
tvMoGoMapVersion.text = "HD-Map版本:${DebugConfig.getMapVersion()}"
|
||||
|
||||
@@ -3,11 +3,15 @@ package com.mogo.eagle.core.function.hmi.ui.widget
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.widget.LinearLayout
|
||||
import com.mogo.eagle.core.data.app.AppConfigInfo
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.setting.IMapShowNameListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.call.setting.CallerMapShowNameManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.kotlin.*
|
||||
import com.mogo.eagle.core.utilcode.util.AppUtils
|
||||
@@ -23,7 +27,7 @@ class VersionNameView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : LinearLayout(context, attrs, defStyleAttr),IMoGoAutopilotStatusListener {
|
||||
) : LinearLayout(context, attrs, defStyleAttr),IMoGoAutopilotStatusListener, IMapShowNameListener {
|
||||
|
||||
companion object {
|
||||
const val TAG = "VersionNameView"
|
||||
@@ -64,7 +68,9 @@ class VersionNameView @JvmOverloads constructor(
|
||||
@SuppressLint("SetTextI18n")
|
||||
private fun showCurrentMapVersion() {
|
||||
val old = tvMapVersionName?.text
|
||||
val version = dockerVersion
|
||||
val version = AppConfigInfo.mapShowName.ifEmpty {
|
||||
dockerVersion
|
||||
}
|
||||
if (!version.isNullOrEmpty() && old != version) {
|
||||
scope.launch {
|
||||
tvMapVersionName?.also {
|
||||
@@ -78,11 +84,13 @@ class VersionNameView @JvmOverloads constructor(
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
CallerMapShowNameManager.addListener(TAG,this)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
CallerMapShowNameManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
override fun onAutopilotDockerInfo(dockerVersion: String) {
|
||||
@@ -93,4 +101,9 @@ class VersionNameView @JvmOverloads constructor(
|
||||
CallerDevaToolsManager.dockerVersion(dockerVersion)
|
||||
}
|
||||
|
||||
override fun changeMapShowName(showName: String) {
|
||||
super.changeMapShowName(showName)
|
||||
showCurrentMapVersion()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
<gradient
|
||||
android:startColor="#4D1466FB"
|
||||
android:startColor="#BBDAFF"
|
||||
android:endColor="#001466FB"
|
||||
android:angle="270"
|
||||
/>
|
||||
|
||||
@@ -543,6 +543,45 @@
|
||||
android:layout_height="1dp"
|
||||
android:background="#F0F0F0" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="动态配置鹰眼显示MAP版本:"
|
||||
style="@style/DebugSettingText"
|
||||
/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatEditText
|
||||
android:id="@+id/etMapShowName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="start"
|
||||
tools:ignore="SpeakableTextPresentCheck"
|
||||
android:background="@drawable/debug_setting_edit_bg"
|
||||
android:textColor="#1A1A1A"
|
||||
android:textSize="@dimen/dp_24"
|
||||
android:paddingTop="@dimen/dp_10"
|
||||
android:paddingBottom="@dimen/dp_10"
|
||||
android:paddingStart="@dimen/dp_20"
|
||||
android:paddingEnd="@dimen/dp_20"
|
||||
/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnEnsureMap"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="确定"
|
||||
style="@style/DebugSettingText"
|
||||
android:paddingStart="@dimen/dp_30"
|
||||
android:paddingEnd="@dimen/dp_30"
|
||||
android:paddingTop="@dimen/dp_10"
|
||||
android:paddingBottom="@dimen/dp_10"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#F0F0F0" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ToggleButton
|
||||
|
||||
@@ -16,6 +16,10 @@ interface Identify {
|
||||
|
||||
}
|
||||
|
||||
fun renderAdasRegResults(resultList: List<TrackedObject>?, mapObjList: List<String>) {
|
||||
|
||||
}
|
||||
|
||||
fun renderAiCloudResult(resultList: List<SocketDownData.CloudRoadDataProto>, mapInstance:String) {
|
||||
|
||||
}
|
||||
@@ -40,6 +44,10 @@ interface Identify {
|
||||
|
||||
}
|
||||
|
||||
fun clearOldMarkers(mapObjList:List<String>) {
|
||||
|
||||
}
|
||||
|
||||
fun clearAiMarker(mapInstance:String) {
|
||||
|
||||
}
|
||||
|
||||
@@ -33,8 +33,9 @@ object IdentifyFactory : Identify, IMoGoObuStatusListener, IMoGoAutopilotCarConf
|
||||
|
||||
// 预测
|
||||
object PreDriverIdentify {
|
||||
internal val preDataDrawer = IdentifyPredictionDataDrawer()
|
||||
// internal val preDataDrawer2 = IdentifyPredictionDataDrawer()
|
||||
internal val preDataDrawer = IdentifyOriginDataDrawer()
|
||||
|
||||
// internal val preDataDrawer2 = IdentifyPredictionDataDrawer()
|
||||
// internal val preDataDrawer3 = IdentifyPredictionDataDrawer()
|
||||
internal val preDataDrawer2 = IdentifyOriginDataDrawer()
|
||||
internal val preDataDrawer3 = IdentifyOriginDataDrawer()
|
||||
@@ -47,16 +48,19 @@ object IdentifyFactory : Identify, IMoGoObuStatusListener, IMoGoAutopilotCarConf
|
||||
|
||||
private var identify: Identify = DriverIdentify.originDataDrawer
|
||||
private var aiCloudIdentify: Identify? = null
|
||||
|
||||
// 预测
|
||||
private var preIdentify: Identify = PreDriverIdentify.preDataDrawer
|
||||
private var preIdentify2: Identify = PreDriverIdentify.preDataDrawer2
|
||||
private var preIdentify3: Identify = PreDriverIdentify.preDataDrawer3
|
||||
|
||||
// private var preIdentify2: Identify = PreDriverIdentify.preDataDrawer2
|
||||
// private var preIdentify3: Identify = PreDriverIdentify.preDataDrawer3
|
||||
// 决策
|
||||
private var desIdentify: Identify = DesDriverIdentify.desDataDrawer
|
||||
|
||||
private var startTime: Long = 0L
|
||||
private var preStartTime: Long = 0L
|
||||
private var desStartTime: Long = 0L
|
||||
|
||||
// private var preStartTime: Long = 0L
|
||||
// private var desStartTime: Long = 0L
|
||||
private var dockerVersion: String? = null
|
||||
|
||||
fun initType() {
|
||||
@@ -96,33 +100,24 @@ object IdentifyFactory : Identify, IMoGoObuStatusListener, IMoGoAutopilotCarConf
|
||||
if (internal >= 1000) {
|
||||
lostFrame(internal.toString())
|
||||
identify.clearOldMarker()
|
||||
}
|
||||
if (FunctionBuildConfig.isDrawPreIdentifyData && TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - preStartTime) >= 1000) {
|
||||
preIdentify.clearOldMarker()
|
||||
}
|
||||
if (FunctionBuildConfig.isDrawDecIdentifyData && TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - desStartTime) >= 1000) {
|
||||
desIdentify.clearOldMarker()
|
||||
preIdentify2.clearOldMarker()
|
||||
preIdentify3.clearOldMarker()
|
||||
}
|
||||
sendEmptyMessageDelayed(MSG_CHECK, 1000L)
|
||||
}
|
||||
|
||||
MSG_DATA_TRACK -> {
|
||||
if (msg.obj is List<*>) {
|
||||
val objectList = msg.obj as List<TrackedObject>?
|
||||
identify.renderAdasRecognizedResult(objectList)
|
||||
val mapInstanceList = ArrayList<String>()
|
||||
mapInstanceList.add(MogoMap.DEFAULT)
|
||||
// if (FunctionBuildConfig.isDrawDecIdentifyData) {
|
||||
// mapInstanceList.add(MogoMap.SMALL_DES_MAP)
|
||||
// }
|
||||
if (FunctionBuildConfig.isDrawPreIdentifyData) {
|
||||
mapInstanceList.add(MogoMap.SMALL_PRED_MAP)
|
||||
}
|
||||
identify.renderAdasRegResults(objectList, mapInstanceList)
|
||||
startTime = System.nanoTime()
|
||||
|
||||
if (FunctionBuildConfig.isDrawDecIdentifyData) {
|
||||
desIdentify.renderAdasRegResult(objectList, MogoMap.SMALL_DES_MAP)
|
||||
desStartTime = System.nanoTime()
|
||||
}
|
||||
if (FunctionBuildConfig.isDrawPreIdentifyData) {
|
||||
preIdentify2.renderAdasRegResult(objectList, MogoMap.SMALL_PRED_MAP2)
|
||||
preIdentify3.renderAdasRegResult(objectList, MogoMap.SMALL_PRED_MAP3)
|
||||
preStartTime = System.nanoTime()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,7 +133,7 @@ object IdentifyFactory : Identify, IMoGoObuStatusListener, IMoGoAutopilotCarConf
|
||||
MSG_DATA_PRE_TRACK -> {
|
||||
if (msg.obj is List<*>) {
|
||||
val objectList = msg.obj as List<Prediction2025.mPredictionObjectApp>
|
||||
preIdentify.renderPredictionResult(objectList, MogoMap.SMALL_PRED_MAP)
|
||||
// preIdentify.renderPredictionResult(objectList, MogoMap.SMALL_PRED_MAP)
|
||||
// preIdentify2.renderPredictionResult(objectList, MogoMap.SMALL_PRED_MAP2)
|
||||
// preIdentify3.renderPredictionResult(objectList, MogoMap.SMALL_PRED_MAP3)
|
||||
}
|
||||
@@ -163,7 +158,10 @@ object IdentifyFactory : Identify, IMoGoObuStatusListener, IMoGoAutopilotCarConf
|
||||
}
|
||||
|
||||
MSG_DATA_CLEAR -> {
|
||||
identify.clearOldMarker()
|
||||
val mapInstanceList = ArrayList<String>()
|
||||
mapInstanceList.add(MogoMap.DEFAULT)
|
||||
mapInstanceList.add(MogoMap.SMALL_PRED_MAP)
|
||||
identify.clearOldMarkers(mapInstanceList)
|
||||
}
|
||||
|
||||
MSG_DATA_AI_CLEAR -> {
|
||||
@@ -172,8 +170,8 @@ object IdentifyFactory : Identify, IMoGoObuStatusListener, IMoGoAutopilotCarConf
|
||||
|
||||
MSG_DATA_PRE_CLEAR -> {
|
||||
preIdentify.clearPredictionMarker(MogoMap.SMALL_PRED_MAP)
|
||||
preIdentify2.clearPredictionMarker(MogoMap.SMALL_PRED_MAP2)
|
||||
preIdentify3.clearPredictionMarker(MogoMap.SMALL_PRED_MAP3)
|
||||
// preIdentify2.clearPredictionMarker(MogoMap.SMALL_PRED_MAP2)
|
||||
// preIdentify3.clearPredictionMarker(MogoMap.SMALL_PRED_MAP3)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,6 +126,49 @@ class IdentifyOriginDataDrawer : Identify {
|
||||
}
|
||||
}
|
||||
|
||||
override fun renderAdasRegResults(resultList: List<TrackedObject>?, mapObjList: List<String>) {
|
||||
if (resultList.isNullOrEmpty()) {
|
||||
clearOldMarker()
|
||||
return
|
||||
}
|
||||
if (!MogoStatusManager.getInstance().isVrMode) {
|
||||
clearOldMarker()
|
||||
return
|
||||
}
|
||||
|
||||
//清除缓存
|
||||
for (data in resultList) {
|
||||
if (trafficDataUuidList.size > 0 && trafficDataUuidList.contains(data.uuid.toString())) {
|
||||
if (TrackerSourceFilterHelper.filterData(data)) {
|
||||
continue
|
||||
}
|
||||
trafficDataUuidList.remove(data.uuid.toString())
|
||||
}
|
||||
}
|
||||
|
||||
//清除缓存,删除marker
|
||||
val it: MutableIterator<*> = trafficDataUuidList.iterator()
|
||||
while (it.hasNext()) {
|
||||
val key = it.next() as String
|
||||
it.remove()
|
||||
mMarkersCaches.remove(key)
|
||||
mapObjList.forEach {
|
||||
MogoIdentifyManager.getInstance()
|
||||
.removeMarker(key, it)
|
||||
}
|
||||
TrackerSourceFilterHelper.removeBottomMarker(key)
|
||||
}
|
||||
|
||||
val filterList = filterTrafficData(resultList)
|
||||
if (filterList.size > 0) {
|
||||
// 绘制新数据
|
||||
mapObjList.forEach {
|
||||
MogoIdentifyManager.getInstance()
|
||||
.updateBatchMarkerPosition(filterList, it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据过滤器
|
||||
*
|
||||
@@ -169,4 +212,16 @@ class IdentifyOriginDataDrawer : Identify {
|
||||
WarningHelper.clear()
|
||||
}
|
||||
|
||||
override fun clearOldMarkers(mapObjList: List<String>) {
|
||||
for (uuid in trafficDataUuidList) {
|
||||
mapObjList.forEach {
|
||||
MogoIdentifyManager.getInstance()
|
||||
.removeMarker(uuid, it)
|
||||
}
|
||||
TrackerSourceFilterHelper.removeBottomMarker(uuid)
|
||||
}
|
||||
trafficDataUuidList.clear()
|
||||
mMarkersCaches.clear()
|
||||
WarningHelper.clear()
|
||||
}
|
||||
}
|
||||
@@ -48,8 +48,8 @@ class IdentifyPredictionDataDrawer : Identify {
|
||||
}
|
||||
//清除缓存
|
||||
for (data in predictionObjectList) {
|
||||
if (trafficDataUuidList.size > 0 && trafficDataUuidList.contains("" + data.mNid)) {
|
||||
trafficDataUuidList.remove("" + data.mNid)
|
||||
if (trafficDataUuidList.size > 0 && trafficDataUuidList.contains("${data.mNid-800000}")) {
|
||||
trafficDataUuidList.remove("${data.mNid-800000}")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ class IdentifyPredictionDataDrawer : Identify {
|
||||
mFilterTrafficData.clear()
|
||||
trafficDataUuidList.clear()
|
||||
for (data in trafficData) {
|
||||
val uuid = "" + data.mNid
|
||||
val uuid = "${data.mNid-800000}"
|
||||
mMarkersCaches[uuid] = data
|
||||
trafficDataUuidList.add(uuid)
|
||||
mFilterTrafficData[uuid] = data
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.mogo.eagle.core.function.business.identify
|
||||
|
||||
import android.util.Log
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
|
||||
@@ -8,12 +10,17 @@ import com.mogo.eagle.core.function.api.base.IMoGoSubscriber
|
||||
import com.mogo.eagle.core.function.api.datacenter.obu.IMoGoObuStatusListener
|
||||
import com.mogo.eagle.core.function.business.routeoverlay.PredictionOverlayDrawer
|
||||
import com.mogo.eagle.core.function.business.routeoverlay.PredictionOverlayDrawer2
|
||||
import com.mogo.eagle.core.function.business.routeoverlay.PredictionOverlayDrawer3
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager.getLocationHeading
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager.getWgs84Lat
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager.getWgs84Lon
|
||||
import com.mogo.eagle.core.function.call.obu.CallerObuWarningListenerManager
|
||||
import com.mogo.eagle.core.function.utils.LocationUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.map.MogoMap
|
||||
import com.mogo.map.MogoMap.Companion.mapInstance
|
||||
import com.mogo.map.identify.MogoIdentifyManager
|
||||
import com.mogo.map.utils.LocationUtils
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import mogo.telematics.pad.MessagePad.TrackedObject
|
||||
import mogo.yycp.api.proto.SocketDownData
|
||||
@@ -69,36 +76,63 @@ class MapIdentifySubscriber private constructor() : IMoGoSubscriber,
|
||||
private var carPoiList2: List<geometry.Geometry.Point>? = null
|
||||
private var location1: MogoLocation? = null
|
||||
private var location2: MogoLocation? = null
|
||||
private var probability1: Float = 0f
|
||||
private var probability2: Float = 0f
|
||||
|
||||
override fun onPredictionObstacleTrajectory(predictionObjects: Prediction2025.mPredictionObjects) {
|
||||
if (FunctionBuildConfig.isDrawPreIdentifyData) {
|
||||
try {
|
||||
ThreadUtils.getSinglePool().execute {
|
||||
// 渲染它车
|
||||
IdentifyFactory.renderPredictionResult(predictionObjects.objsAppList)
|
||||
val mogoMap = mapInstance.getMogoMap(MogoMap.DEFAULT)
|
||||
val pointsList: ArrayList<List<MogoLatLng>> = ArrayList()
|
||||
var arr: DoubleArray?
|
||||
var point: geometry.Geometry.Point
|
||||
// 渲染自车
|
||||
predictionObjects.objsAppList.forEach { preObj ->
|
||||
val points = ArrayList<MogoLatLng>()
|
||||
if (preObj.mNid == 800000L) {
|
||||
// 自车有2条轨迹,一条概率大、一条概率小
|
||||
if (preObj.predictionTrajectoryList == null || preObj.predictionTrajectoryList.size < 2) return@forEach
|
||||
carPoiList1 = preObj.predictionTrajectoryList[0].trajectoryPointsList
|
||||
carPoiList2 = preObj.predictionTrajectoryList[1].trajectoryPointsList
|
||||
val largeType: Int
|
||||
location1 = LocationUtils.generateLocation(carPoiList1!![0].x, carPoiList1!![0].y, carPoiList1!![1].x, carPoiList1!![1].y)
|
||||
location2 = LocationUtils.generateLocation(carPoiList2!![0].x, carPoiList2!![0].y, carPoiList2!![1].x, carPoiList2!![1].y)
|
||||
location1 = LocationUtils.generateLocation(carPoiList1!![0].x, carPoiList1!![0].y, getLocationHeading())
|
||||
location2 = LocationUtils.generateLocation(carPoiList2!![0].x, carPoiList2!![0].y, getLocationHeading())
|
||||
if (location1 == null || location2 == null) return@forEach
|
||||
if (preObj.predictionTrajectoryList[0].predictionProbability >= preObj.predictionTrajectoryList[1].predictionProbability) {
|
||||
probability1 = preObj.predictionTrajectoryList[0].predictionProbability
|
||||
probability2 = preObj.predictionTrajectoryList[1].predictionProbability
|
||||
CallerAutopilotIdentifyListenerManager.invokeProbabilityChanged(probability1, probability2)
|
||||
if (probability1 >= probability2) {
|
||||
MogoIdentifyManager.getInstance().updateGps(location1!!, MogoMap.SMALL_PRED_MAP)
|
||||
largeType = 2
|
||||
} else {
|
||||
MogoIdentifyManager.getInstance().updateGps(location2!!, MogoMap.SMALL_PRED_MAP)
|
||||
largeType = 3
|
||||
}
|
||||
PredictionOverlayDrawer.getInstance().drawPredictionList(carPoiList1, location1!!.heading, false, 2, largeType)
|
||||
PredictionOverlayDrawer2.getInstance().drawPredictionList(carPoiList2, location2!!.heading, false, 3, largeType)
|
||||
PredictionOverlayDrawer2.getInstance().drawPredictionList(carPoiList1, getLocationHeading(), false, 2, largeType)
|
||||
PredictionOverlayDrawer3.getInstance().drawPredictionList(carPoiList2, getLocationHeading(), false, 3, largeType)
|
||||
MogoIdentifyManager.getInstance().updateGps(location1!!, MogoMap.SMALL_PRED_MAP2)
|
||||
MogoIdentifyManager.getInstance().updateGps(location2!!, MogoMap.SMALL_PRED_MAP3)
|
||||
} else {
|
||||
if (preObj.predictionTrajectoryList.isNullOrEmpty() || mogoMap == null) return@forEach
|
||||
point = preObj.predictionTrajectoryList[0].trajectoryPointsList[0]
|
||||
arr = mogoMap.switchData(point.x, point.y, false)
|
||||
arr?.let { lonLatArr ->
|
||||
val distance = com.mogo.eagle.core.utilcode.util.LocationUtils.getDistance(getWgs84Lat(), getWgs84Lon(), lonLatArr[1], lonLatArr[0])
|
||||
if (distance > 25) return@forEach
|
||||
}
|
||||
preObj.predictionTrajectoryList[0].trajectoryPointsList.forEachIndexed { index, point ->
|
||||
if (index > 9 && index % 2 == 0) {// 步长为2,减少点
|
||||
arr = mogoMap.switchData(point.x, point.y, false)
|
||||
arr?.let { lonLatArr ->
|
||||
points.add(MogoLatLng(lonLatArr[1], lonLatArr[0]))
|
||||
}
|
||||
}
|
||||
}
|
||||
pointsList.add(points)
|
||||
}
|
||||
}
|
||||
PredictionOverlayDrawer.getInstance().drawPredictionList(pointsList, getLocationHeading())
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
|
||||
@@ -131,16 +131,16 @@ public class MogoRouteOverlayManager implements
|
||||
// Log.d(TAG, "-- onChassisLocationGCJ02 -- 1 ---" + ":auto-mode:" + autoPilotState + ", isArriveAtStation: " + isArriveAtStation);
|
||||
if (isArriveAtStation && autoPilotState != 2) {
|
||||
RouteOverlayDrawer.getInstance().clearMogoRouteOverlay();
|
||||
PredictionOverlayDrawer.getInstance().clearPreRouteOverlay();
|
||||
PredictionOverlayDrawer2.getInstance().clearPreRouteOverlay();
|
||||
PredictionOverlayDrawer3.getInstance().clearPreRouteOverlay();
|
||||
return;
|
||||
}
|
||||
// Log.d(TAG, "-- onChassisLocationGCJ02 -- 2 ---" + "auto-mode:" + autoPilotState + ", isDemoMode:" + FunctionBuildConfig.isDemoMode + ", force:" + FunctionBuildConfig.isForceDrawAutopilotTrajectoryByDebugSettingView);
|
||||
boolean force = hasGreenWave.get() || FunctionBuildConfig.isForceDrawAutopilotTrajectoryByDebugSettingView || FunctionBuildConfig.isDemoMode && FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData;
|
||||
if (!force && autoPilotState != 2) {
|
||||
RouteOverlayDrawer.getInstance().clearMogoRouteOverlay();
|
||||
PredictionOverlayDrawer.getInstance().clearPreRouteOverlay();
|
||||
PredictionOverlayDrawer2.getInstance().clearPreRouteOverlay();
|
||||
PredictionOverlayDrawer3.getInstance().clearPreRouteOverlay();
|
||||
return;
|
||||
}
|
||||
// Log.d(TAG, "-- onChassisLocationGCJ02 -- 3 ---");
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
package com.mogo.eagle.core.function.business.routeoverlay;
|
||||
|
||||
import static com.mogo.map.MogoMap.DEFAULT;
|
||||
import static com.mogo.map.MogoMap.SMALL_DES_MAP;
|
||||
import static com.mogo.map.MogoMap.SMALL_PRED_MAP;
|
||||
import static com.mogo.map.MogoMap.SMALL_PRED_MAP2;
|
||||
import static com.mogo.map.MogoMap.SMALL_PRED_MAP3;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.graphics.Color;
|
||||
@@ -17,23 +13,17 @@ import androidx.core.util.Pools;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapIdentifyManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils;
|
||||
import com.mogo.map.IMogoMap;
|
||||
import com.mogo.map.MogoMap;
|
||||
import com.mogo.map.overlay.IMoGoOverlayManager;
|
||||
import com.mogo.map.overlay.core.Level;
|
||||
import com.mogo.map.overlay.line.Polyline;
|
||||
import com.zhidaoauto.map.sdk.open.common.tools.MapTools;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import kotlin.Pair;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
public class PredictionOverlayDrawer {
|
||||
|
||||
@@ -46,14 +36,12 @@ public class PredictionOverlayDrawer {
|
||||
private static final byte[] obj = new byte[0];
|
||||
private static final int COLOR_LIGHT = Color.parseColor("#BAEBF5");
|
||||
|
||||
private final List<Integer> greenWaveColors = new ArrayList<>();
|
||||
|
||||
private PredictionOverlayDrawer() {
|
||||
// 渐变色
|
||||
mogoOverlayManager = CallerMapUIServiceManager.INSTANCE.getOverlayManager();
|
||||
if (mogoOverlayManager != null) {
|
||||
// 线条粗细,渐变,渐变色值
|
||||
HandlerThread renderTask = new HandlerThread("prediction_render") {
|
||||
HandlerThread renderTask = new HandlerThread("pred_render") {
|
||||
@Override
|
||||
protected void onLooperPrepared() {
|
||||
super.onLooperPrepared();
|
||||
@@ -61,17 +49,6 @@ public class PredictionOverlayDrawer {
|
||||
}
|
||||
};
|
||||
renderTask.start();
|
||||
ArrayList<Pair<Integer, Integer>> temps = new ArrayList<>();
|
||||
temps.add(new Pair<>(0, 51));
|
||||
temps.add(new Pair<>(10, 102));
|
||||
temps.add(new Pair<>(30, 51));
|
||||
temps.add(new Pair<>(100, 0));
|
||||
List<Integer> alphas = MapTools.INSTANCE.getColorAlpha(temps);
|
||||
if (alphas != null && !alphas.isEmpty()) {
|
||||
for (int i : alphas) {
|
||||
greenWaveColors.add(Color.argb(i, 48, 163, 255));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,36 +73,25 @@ public class PredictionOverlayDrawer {
|
||||
}
|
||||
|
||||
private class RenderTask implements Runnable {
|
||||
private volatile List<MogoLatLng> predictionList;
|
||||
|
||||
private final Pools.Pool<MogoLatLng> pools;
|
||||
private final LinkedList<MogoLatLng> points;
|
||||
|
||||
private double bearing;
|
||||
private boolean hasGreenWave;
|
||||
private int preViewType;
|
||||
private int largeType;
|
||||
|
||||
// 对象池
|
||||
// private final Pools.Pool<MogoLatLng> pools;
|
||||
private Polyline.Options mPolylineOptions;
|
||||
//用于taxi乘客屏渐变颜色集合
|
||||
private List<Integer> colors = null;
|
||||
|
||||
private volatile List<List<MogoLatLng>> mPredPointsList;
|
||||
private List<Polyline.Options> mLineOptList;
|
||||
|
||||
public RenderTask() {
|
||||
this.pools = new Pools.SimplePool<>(500);
|
||||
this.points = new LinkedList<>();
|
||||
mPolylineOptions = new Polyline.Options.Builder("prediction_overlay" + preViewType, Level.GUIDE_ROUTE_LINE)
|
||||
// this.pools = new Pools.SimplePool<>(1000);
|
||||
mPolylineOptions = new Polyline.Options.Builder("pred_overlay", Level.GUIDE_ROUTE_LINE)
|
||||
.setUseGps(true)
|
||||
.setWidth(20)
|
||||
.setWidth(10)
|
||||
.setIsGradient(true)
|
||||
.build();
|
||||
}
|
||||
|
||||
public void setPreData(List<MogoLatLng> data, double bearing, boolean hasGreenWave, int preType, int largeType) {
|
||||
predictionList = data;
|
||||
this.bearing = bearing;
|
||||
this.hasGreenWave = hasGreenWave;
|
||||
preViewType = preType;
|
||||
this.largeType = largeType;
|
||||
public void setPreDataList(List<List<MogoLatLng>> data, double bearing) {
|
||||
mPredPointsList = data;
|
||||
}
|
||||
|
||||
@SuppressLint("LongLogTag")
|
||||
@@ -135,172 +101,66 @@ public class PredictionOverlayDrawer {
|
||||
if (overlayManager == null) {
|
||||
return;
|
||||
}
|
||||
LinkedList<MogoLatLng> pps = this.points;
|
||||
boolean isExcept = false;
|
||||
int total;
|
||||
|
||||
try {
|
||||
pps.clear();
|
||||
List<MogoLatLng> routes = this.predictionList;
|
||||
if (routes == null || (total = routes.size()) < 2) {
|
||||
isExcept = true;
|
||||
List<List<MogoLatLng>> routes1 = this.mPredPointsList;
|
||||
if (mLineOptList == null) {
|
||||
mLineOptList = new ArrayList<>();
|
||||
}
|
||||
for (List<MogoLatLng> latLngList : routes1) {
|
||||
if (latLngList == null || (total = latLngList.size()) < 2) {
|
||||
return;
|
||||
}
|
||||
boolean isColorfulStrategy = !hasGreenWave && !AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode) || !AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode);
|
||||
if (isColorfulStrategy) {
|
||||
RouteStrategy.INSTANCE.start();
|
||||
} else {
|
||||
if (colors == null || colors.isEmpty()) {
|
||||
ArrayList<Pair<Integer, Integer>> temps = new ArrayList<>();
|
||||
temps.add(new Pair<>(0, 51));
|
||||
temps.add(new Pair<>(10, 102));
|
||||
temps.add(new Pair<>(30, 51));
|
||||
temps.add(new Pair<>(100, 0));
|
||||
List<Integer> alphas = MapTools.INSTANCE.getColorAlpha(temps);
|
||||
if (alphas != null && !alphas.isEmpty()) {
|
||||
colors = new CopyOnWriteArrayList<>();
|
||||
for (int i : alphas) {
|
||||
colors.add(Color.argb(i, 48, 163, 255));
|
||||
ArrayList<MogoLatLng> pps = new ArrayList<>();
|
||||
try {
|
||||
for (int i = 0; i < total; i++) {
|
||||
MogoLatLng route = null;
|
||||
try {
|
||||
route = latLngList.get(i);
|
||||
if (route == null) {
|
||||
continue;
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
Log.d("Route", "render-error:" + t.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < total; i++) {
|
||||
MogoLatLng route = null;
|
||||
try {
|
||||
route = routes.get(i);
|
||||
if (route == null) {
|
||||
continue;
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
Log.d("Route", "render-error:" + t.getMessage());
|
||||
}
|
||||
if (route == null) {
|
||||
//数组越界了,结束循环
|
||||
break;
|
||||
}
|
||||
MogoLatLng acquire = pools.acquire();
|
||||
double latitude = route.getLat();
|
||||
double longitude = route.getLon();
|
||||
if (acquire == null) {
|
||||
acquire = new MogoLatLng(latitude, longitude);
|
||||
} else {
|
||||
acquire.lon = longitude;
|
||||
acquire.lat = latitude;
|
||||
}
|
||||
acquire.acc = 0.0;// 加速度
|
||||
acquire.speed = 0.0;// 速度
|
||||
pps.add(acquire);
|
||||
if (isColorfulStrategy) {
|
||||
RouteStrategy.INSTANCE.check(0.0, 0.0, predictionList.size());
|
||||
}
|
||||
}
|
||||
double lon = CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84().getLongitude();
|
||||
double lat = CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84().getLatitude();
|
||||
if (!points.isEmpty()) {
|
||||
MogoLatLng top = null;
|
||||
while (!points.isEmpty()) {
|
||||
MogoLatLng first = points.peek();
|
||||
if (first == null) {
|
||||
continue;
|
||||
}
|
||||
if (first == top) {
|
||||
//数组越界了,结束循环
|
||||
break;
|
||||
}
|
||||
lon = CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84().getLongitude();
|
||||
lat = CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84().getLatitude();
|
||||
long angle = isPointOnCarFront(lon, lat, bearing, first.lon, first.lat);
|
||||
if (angle >= 90) {
|
||||
if (isColorfulStrategy) {
|
||||
RouteStrategy.INSTANCE.remove(first.acc);
|
||||
}
|
||||
pools.release(first);
|
||||
points.poll();
|
||||
}
|
||||
top = first;
|
||||
MogoLatLng acquire;
|
||||
double latitude = route.getLat();
|
||||
double longitude = route.getLon();
|
||||
acquire = new MogoLatLng(latitude, longitude);
|
||||
acquire.acc = 0.0;// 加速度
|
||||
acquire.speed = 0.0;// 速度
|
||||
pps.add(acquire);
|
||||
}
|
||||
if (points.isEmpty()) {
|
||||
isExcept = true;
|
||||
return;
|
||||
}
|
||||
MogoLatLng self = pools.acquire();
|
||||
if (self == null) {
|
||||
self = new MogoLatLng(lat, lon);
|
||||
} else {
|
||||
self.lat = lat;
|
||||
self.lon = lon;
|
||||
}
|
||||
points.addFirst(self);
|
||||
|
||||
// 线的配置
|
||||
Polyline.Options.Builder builder;
|
||||
if (mPolylineOptions == null) {
|
||||
builder = new Polyline.Options.Builder("router_overlay", Level.GUIDE_ROUTE_LINE)
|
||||
builder = new Polyline.Options.Builder("pred_overlay", Level.GUIDE_ROUTE_LINE)
|
||||
.setUseGps(true)
|
||||
.setWidth(20)
|
||||
.setWidth(5)
|
||||
.setIsGradient(true);
|
||||
} else {
|
||||
builder = mPolylineOptions.builder();
|
||||
}
|
||||
|
||||
if (isColorfulStrategy) {
|
||||
RouteStrategy.INSTANCE.end();
|
||||
Strategy strategy = RouteStrategy.INSTANCE.getStrategy();
|
||||
List<Integer> colors = strategy.getColors();
|
||||
boolean isLightOn = strategy instanceof ColorfulStrategy && ((ColorfulStrategy) strategy).isLightOn();
|
||||
builder.colors(colors);
|
||||
builder.setLightOn(isLightOn);
|
||||
builder.setLightColor(COLOR_LIGHT);
|
||||
builder.setLightSpeed(0.3f);
|
||||
} else {
|
||||
if (!hasGreenWave) {
|
||||
if (colors != null && !colors.isEmpty()) {
|
||||
builder.colors(colors);
|
||||
builder.setIsGradient(true);
|
||||
builder.setLightOn(true);
|
||||
builder.isShowArrow(false);
|
||||
builder.setLightColor(COLOR_LIGHT);
|
||||
builder.setLightSpeed(0.3f);
|
||||
}
|
||||
} else {
|
||||
builder.colors(greenWaveColors)
|
||||
.setIsGradient(true)
|
||||
.setLightOn(false)
|
||||
.isShowArrow(true);
|
||||
}
|
||||
}
|
||||
builder.points(points);
|
||||
builder.color(Color.rgb(196, 196, 196));
|
||||
builder.setIsGradient(false);
|
||||
builder.setLightOn(false);
|
||||
builder.setIsDottedLine(false);
|
||||
builder.isShowArrow(false);
|
||||
builder.points(pps);
|
||||
builder.setVisible(true);
|
||||
Polyline.Options options = builder.build();
|
||||
if (mPolylineOptions == null) {
|
||||
mPolylineOptions = options;
|
||||
}
|
||||
if (FunctionBuildConfig.isDrawPreIdentifyData) {
|
||||
if (preViewType == 2) {
|
||||
overlayManager.showOrUpdateLine(options, SMALL_PRED_MAP2);
|
||||
} else if (preViewType == 3) {
|
||||
overlayManager.showOrUpdateLine(options, SMALL_PRED_MAP3);
|
||||
}
|
||||
if (preViewType == largeType) {
|
||||
overlayManager.showOrUpdateLine(options, SMALL_PRED_MAP);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
isExcept = true;
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
} finally {
|
||||
if (isExcept) {
|
||||
setVisible(false);
|
||||
}
|
||||
if (!points.isEmpty()) {
|
||||
for (int i = 0; i < points.size(); i++) {
|
||||
MogoLatLng latLng = points.get(i);
|
||||
if (latLng == null) {
|
||||
continue;
|
||||
}
|
||||
pools.release(latLng);
|
||||
if (FunctionBuildConfig.isDrawPreIdentifyData && CallerMapIdentifyManager.INSTANCE.isPreViewLoaded()) {
|
||||
overlayManager.showOrUpdateLine(options, SMALL_PRED_MAP);
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -311,23 +171,14 @@ public class PredictionOverlayDrawer {
|
||||
}
|
||||
|
||||
private volatile RenderTask mPreRenderTask;
|
||||
private volatile RenderTask mPreRenderTask2;
|
||||
|
||||
public void drawPredictionList(List<geometry.Geometry.Point> dataList, double bearing, boolean hasGreenWave, int preType, int largeType) {
|
||||
IMogoMap iMogoMap = MogoMap.Companion.getMapInstance().getMogoMap(DEFAULT);
|
||||
double[] arr = null;
|
||||
if (mogoOverlayManager != null && iMogoMap != null) {
|
||||
public void drawPredictionList(List<List<MogoLatLng>> dataList, double bearing) {
|
||||
if (dataList.isEmpty()) return;
|
||||
if (mogoOverlayManager != null) {
|
||||
if (mPreRenderTask == null) {
|
||||
mPreRenderTask = new RenderTask();
|
||||
}
|
||||
List<MogoLatLng> latLngList = new ArrayList<>();
|
||||
for (geometry.Geometry.Point point : dataList) {
|
||||
arr = iMogoMap.switchData(point.getX(), point.getY(), false);
|
||||
if (arr == null || arr.length < 2) continue;
|
||||
latLngList.add(new MogoLatLng(arr[1], arr[0]));
|
||||
}
|
||||
if (latLngList.isEmpty()) return;
|
||||
mPreRenderTask.setPreData(latLngList, bearing, hasGreenWave, preType, largeType);
|
||||
mPreRenderTask.setPreDataList(dataList, bearing);
|
||||
if (mRenderHandler != null) {
|
||||
mRenderHandler.removeCallbacks(mPreRenderTask);
|
||||
mRenderHandler.post(mPreRenderTask);
|
||||
@@ -335,28 +186,6 @@ public class PredictionOverlayDrawer {
|
||||
}
|
||||
}
|
||||
|
||||
public void drawPredictionList2(List<geometry.Geometry.Point> dataList, double bearing, boolean hasGreenWave, int preType, int largeType) {
|
||||
IMogoMap iMogoMap = MogoMap.Companion.getMapInstance().getMogoMap(DEFAULT);
|
||||
double[] arr = null;
|
||||
if (mogoOverlayManager != null) {
|
||||
if (mPreRenderTask2 == null) {
|
||||
mPreRenderTask2 = new RenderTask();
|
||||
}
|
||||
List<MogoLatLng> latLngList = new ArrayList<>();
|
||||
for (geometry.Geometry.Point point : dataList) {
|
||||
arr = iMogoMap.switchData(point.getX(), point.getY(), false);
|
||||
if (arr == null || arr.length < 2) continue;
|
||||
latLngList.add(new MogoLatLng(arr[0], arr[1]));
|
||||
}
|
||||
if (latLngList.isEmpty()) return;
|
||||
mPreRenderTask2.setPreData(latLngList, bearing, hasGreenWave, preType, largeType);
|
||||
if (mRenderHandler != null) {
|
||||
mRenderHandler.removeCallbacks(mPreRenderTask2);
|
||||
mRenderHandler.post(mPreRenderTask2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setVisible(boolean isVisible) {
|
||||
if (mogoOverlayManager != null) {
|
||||
if (isVisible) {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.mogo.eagle.core.function.business.routeoverlay;
|
||||
|
||||
import static com.mogo.map.MogoMap.DEFAULT;
|
||||
import static com.mogo.map.MogoMap.SMALL_PRED_MAP;
|
||||
import static com.mogo.map.MogoMap.SMALL_PRED_MAP2;
|
||||
import static com.mogo.map.MogoMap.SMALL_PRED_MAP3;
|
||||
|
||||
@@ -16,6 +15,7 @@ import androidx.core.util.Pools;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapIdentifyManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils;
|
||||
@@ -32,6 +32,7 @@ import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import kotlin.Pair;
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
|
||||
public class PredictionOverlayDrawer2 {
|
||||
|
||||
@@ -144,7 +145,7 @@ public class PredictionOverlayDrawer2 {
|
||||
isExcept = true;
|
||||
return;
|
||||
}
|
||||
boolean isColorfulStrategy = !hasGreenWave && !AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode) || !AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode);
|
||||
boolean isColorfulStrategy = false;
|
||||
if (isColorfulStrategy) {
|
||||
RouteStrategy.INSTANCE.start();
|
||||
} else {
|
||||
@@ -209,9 +210,6 @@ public class PredictionOverlayDrawer2 {
|
||||
lat = CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84().getLatitude();
|
||||
long angle = isPointOnCarFront(lon, lat, bearing, first.lon, first.lat);
|
||||
if (angle >= 90) {
|
||||
if (isColorfulStrategy) {
|
||||
RouteStrategy.INSTANCE.remove(first.acc);
|
||||
}
|
||||
pools.release(first);
|
||||
points.poll();
|
||||
}
|
||||
@@ -232,7 +230,7 @@ public class PredictionOverlayDrawer2 {
|
||||
|
||||
Polyline.Options.Builder builder;
|
||||
if (mPolylineOptions == null) {
|
||||
builder = new Polyline.Options.Builder("router_overlay", Level.GUIDE_ROUTE_LINE)
|
||||
builder = new Polyline.Options.Builder("prediction_overlay" + preViewType, Level.GUIDE_ROUTE_LINE)
|
||||
.setUseGps(true)
|
||||
.setWidth(20)
|
||||
.setIsGradient(true);
|
||||
@@ -272,15 +270,12 @@ public class PredictionOverlayDrawer2 {
|
||||
if (mPolylineOptions == null) {
|
||||
mPolylineOptions = options;
|
||||
}
|
||||
if (FunctionBuildConfig.isDrawDecIdentifyData) {
|
||||
if (preViewType == 2) {
|
||||
if (FunctionBuildConfig.isDrawPreIdentifyData) {
|
||||
if (preViewType == 2 && CallerMapIdentifyManager.INSTANCE.isPreView2Loaded()) {
|
||||
overlayManager.showOrUpdateLine(options, SMALL_PRED_MAP2);
|
||||
} else if (preViewType == 3) {
|
||||
} else if (preViewType == 3 && CallerMapIdentifyManager.INSTANCE.isPreView3Loaded()) {
|
||||
overlayManager.showOrUpdateLine(options, SMALL_PRED_MAP3);
|
||||
}
|
||||
if (preViewType == largeType) {
|
||||
overlayManager.showOrUpdateLine(options, SMALL_PRED_MAP);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
isExcept = true;
|
||||
@@ -312,7 +307,7 @@ public class PredictionOverlayDrawer2 {
|
||||
|
||||
public void drawPredictionList(List<geometry.Geometry.Point> dataList, double bearing, boolean hasGreenWave, int preType, int largeType) {
|
||||
IMogoMap iMogoMap = MogoMap.Companion.getMapInstance().getMogoMap(DEFAULT);
|
||||
double[] arr = null;
|
||||
double[] arr;
|
||||
if (mogoOverlayManager != null && iMogoMap != null) {
|
||||
if (mPreRenderTask == null) {
|
||||
mPreRenderTask = new RenderTask();
|
||||
|
||||
@@ -0,0 +1,341 @@
|
||||
package com.mogo.eagle.core.function.business.routeoverlay;
|
||||
|
||||
import static com.mogo.map.MogoMap.DEFAULT;
|
||||
import static com.mogo.map.MogoMap.SMALL_PRED_MAP2;
|
||||
import static com.mogo.map.MogoMap.SMALL_PRED_MAP3;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.graphics.Color;
|
||||
import android.os.Handler;
|
||||
import android.os.HandlerThread;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.core.util.Pools;
|
||||
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapIdentifyManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils;
|
||||
import com.mogo.map.IMogoMap;
|
||||
import com.mogo.map.MogoMap;
|
||||
import com.mogo.map.overlay.IMoGoOverlayManager;
|
||||
import com.mogo.map.overlay.core.Level;
|
||||
import com.mogo.map.overlay.line.Polyline;
|
||||
import com.zhidaoauto.map.sdk.open.common.tools.MapTools;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import kotlin.Pair;
|
||||
|
||||
public class PredictionOverlayDrawer3 {
|
||||
|
||||
private static final String TAG = "PredictionOverlayDrawer3";
|
||||
|
||||
// 连接线参数
|
||||
private Handler mRenderHandler;
|
||||
private final IMoGoOverlayManager mogoOverlayManager;
|
||||
private static volatile PredictionOverlayDrawer3 sInstance;
|
||||
private static final byte[] obj = new byte[0];
|
||||
private static final int COLOR_LIGHT = Color.parseColor("#BAEBF5");
|
||||
|
||||
private final List<Integer> greenWaveColors = new ArrayList<>();
|
||||
|
||||
private PredictionOverlayDrawer3() {
|
||||
// 渐变色
|
||||
mogoOverlayManager = CallerMapUIServiceManager.INSTANCE.getOverlayManager();
|
||||
if (mogoOverlayManager != null) {
|
||||
// 线条粗细,渐变,渐变色值
|
||||
HandlerThread renderTask = new HandlerThread("prediction_render2") {
|
||||
@Override
|
||||
protected void onLooperPrepared() {
|
||||
super.onLooperPrepared();
|
||||
mRenderHandler = new Handler(getLooper());
|
||||
}
|
||||
};
|
||||
renderTask.start();
|
||||
ArrayList<Pair<Integer, Integer>> temps = new ArrayList<>();
|
||||
temps.add(new Pair<>(0, 51));
|
||||
temps.add(new Pair<>(10, 102));
|
||||
temps.add(new Pair<>(30, 51));
|
||||
temps.add(new Pair<>(100, 0));
|
||||
List<Integer> alphas = MapTools.INSTANCE.getColorAlpha(temps);
|
||||
if (alphas != null && !alphas.isEmpty()) {
|
||||
for (int i : alphas) {
|
||||
greenWaveColors.add(Color.argb(i, 48, 163, 255));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static PredictionOverlayDrawer3 getInstance() {
|
||||
if (sInstance == null) {
|
||||
synchronized (obj) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new PredictionOverlayDrawer3();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public void clearPreRouteOverlay() {
|
||||
if (mogoOverlayManager != null) {
|
||||
if (mPreRenderTask != null) {
|
||||
mRenderHandler.removeCallbacks(mPreRenderTask);
|
||||
}
|
||||
mogoOverlayManager.hideAllLinesInLevel(Level.GUIDE_ROUTE_LINE);
|
||||
}
|
||||
}
|
||||
|
||||
private class RenderTask implements Runnable {
|
||||
private volatile List<MogoLatLng> predictionList;
|
||||
|
||||
private final Pools.Pool<MogoLatLng> pools;
|
||||
private final LinkedList<MogoLatLng> points;
|
||||
|
||||
private double bearing;
|
||||
private boolean hasGreenWave;
|
||||
private int preViewType;
|
||||
private int largeType;
|
||||
|
||||
private Polyline.Options mPolylineOptions;
|
||||
//用于taxi乘客屏渐变颜色集合
|
||||
private List<Integer> colors = null;
|
||||
|
||||
public RenderTask() {
|
||||
this.pools = new Pools.SimplePool<>(500);
|
||||
this.points = new LinkedList<>();
|
||||
mPolylineOptions = new Polyline.Options.Builder("prediction_overlay" + preViewType, Level.GUIDE_ROUTE_LINE)
|
||||
.setUseGps(true)
|
||||
.setWidth(20)
|
||||
.setIsGradient(true)
|
||||
.build();
|
||||
}
|
||||
|
||||
public void setPreData(List<MogoLatLng> data, double bearing, boolean hasGreenWave, int preType, int largeType) {
|
||||
predictionList = data;
|
||||
this.bearing = bearing;
|
||||
this.hasGreenWave = hasGreenWave;
|
||||
preViewType = preType;
|
||||
this.largeType = largeType;
|
||||
}
|
||||
|
||||
@SuppressLint("LongLogTag")
|
||||
@Override
|
||||
public void run() {
|
||||
IMoGoOverlayManager overlayManager = mogoOverlayManager;
|
||||
if (overlayManager == null) {
|
||||
return;
|
||||
}
|
||||
LinkedList<MogoLatLng> pps = this.points;
|
||||
boolean isExcept = false;
|
||||
int total;
|
||||
|
||||
try {
|
||||
pps.clear();
|
||||
List<MogoLatLng> routes = this.predictionList;
|
||||
if (routes == null || (total = routes.size()) < 2) {
|
||||
isExcept = true;
|
||||
return;
|
||||
}
|
||||
boolean isColorfulStrategy = false;
|
||||
if (isColorfulStrategy) {
|
||||
RouteStrategy.INSTANCE.start();
|
||||
} else {
|
||||
if (colors == null || colors.isEmpty()) {
|
||||
ArrayList<Pair<Integer, Integer>> temps = new ArrayList<>();
|
||||
temps.add(new Pair<>(0, 51));
|
||||
temps.add(new Pair<>(10, 102));
|
||||
temps.add(new Pair<>(30, 51));
|
||||
temps.add(new Pair<>(100, 0));
|
||||
List<Integer> alphas = MapTools.INSTANCE.getColorAlpha(temps);
|
||||
if (alphas != null && !alphas.isEmpty()) {
|
||||
colors = new CopyOnWriteArrayList<>();
|
||||
for (int i : alphas) {
|
||||
colors.add(Color.argb(i, 48, 163, 255));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < total; i++) {
|
||||
MogoLatLng route = null;
|
||||
try {
|
||||
route = routes.get(i);
|
||||
if (route == null) {
|
||||
continue;
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
Log.d("Route", "render-error:" + t.getMessage());
|
||||
}
|
||||
if (route == null) {
|
||||
//数组越界了,结束循环
|
||||
break;
|
||||
}
|
||||
MogoLatLng acquire = pools.acquire();
|
||||
double latitude = route.getLat();
|
||||
double longitude = route.getLon();
|
||||
if (acquire == null) {
|
||||
acquire = new MogoLatLng(latitude, longitude);
|
||||
} else {
|
||||
acquire.lon = longitude;
|
||||
acquire.lat = latitude;
|
||||
}
|
||||
acquire.acc = 0.0;// 加速度
|
||||
acquire.speed = 0.0;// 速度
|
||||
pps.add(acquire);
|
||||
if (isColorfulStrategy) {
|
||||
RouteStrategy.INSTANCE.check(0.0, 0.0, predictionList.size());
|
||||
}
|
||||
}
|
||||
double lon = CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84().getLongitude();
|
||||
double lat = CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84().getLatitude();
|
||||
if (!points.isEmpty()) {
|
||||
MogoLatLng top = null;
|
||||
while (!points.isEmpty()) {
|
||||
MogoLatLng first = points.peek();
|
||||
if (first == null) {
|
||||
continue;
|
||||
}
|
||||
if (first == top) {
|
||||
break;
|
||||
}
|
||||
lon = CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84().getLongitude();
|
||||
lat = CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84().getLatitude();
|
||||
long angle = isPointOnCarFront(lon, lat, bearing, first.lon, first.lat);
|
||||
if (angle >= 90) {
|
||||
if (isColorfulStrategy) {
|
||||
RouteStrategy.INSTANCE.remove(first.acc);
|
||||
}
|
||||
pools.release(first);
|
||||
points.poll();
|
||||
}
|
||||
top = first;
|
||||
}
|
||||
if (points.isEmpty()) {
|
||||
isExcept = true;
|
||||
return;
|
||||
}
|
||||
MogoLatLng self = pools.acquire();
|
||||
if (self == null) {
|
||||
self = new MogoLatLng(lat, lon);
|
||||
} else {
|
||||
self.lat = lat;
|
||||
self.lon = lon;
|
||||
}
|
||||
points.addFirst(self);
|
||||
|
||||
Polyline.Options.Builder builder;
|
||||
if (mPolylineOptions == null) {
|
||||
builder = new Polyline.Options.Builder("prediction_overlay" + preViewType, Level.GUIDE_ROUTE_LINE)
|
||||
.setUseGps(true)
|
||||
.setWidth(20)
|
||||
.setIsGradient(true);
|
||||
} else {
|
||||
builder = mPolylineOptions.builder();
|
||||
}
|
||||
|
||||
if (isColorfulStrategy) {
|
||||
RouteStrategy.INSTANCE.end();
|
||||
Strategy strategy = RouteStrategy.INSTANCE.getStrategy();
|
||||
List<Integer> colors = strategy.getColors();
|
||||
boolean isLightOn = strategy instanceof ColorfulStrategy && ((ColorfulStrategy) strategy).isLightOn();
|
||||
builder.colors(colors);
|
||||
builder.setLightOn(isLightOn);
|
||||
builder.setLightColor(COLOR_LIGHT);
|
||||
builder.setLightSpeed(0.3f);
|
||||
} else {
|
||||
if (!hasGreenWave) {
|
||||
if (colors != null && !colors.isEmpty()) {
|
||||
builder.colors(colors);
|
||||
builder.setIsGradient(true);
|
||||
builder.setLightOn(true);
|
||||
builder.isShowArrow(false);
|
||||
builder.setLightColor(COLOR_LIGHT);
|
||||
builder.setLightSpeed(0.3f);
|
||||
}
|
||||
} else {
|
||||
builder.colors(greenWaveColors)
|
||||
.setIsGradient(true)
|
||||
.setLightOn(false)
|
||||
.isShowArrow(true);
|
||||
}
|
||||
}
|
||||
builder.points(points);
|
||||
builder.setVisible(true);
|
||||
Polyline.Options options = builder.build();
|
||||
if (mPolylineOptions == null) {
|
||||
mPolylineOptions = options;
|
||||
}
|
||||
if (FunctionBuildConfig.isDrawDecIdentifyData) {
|
||||
if (preViewType == 2 && CallerMapIdentifyManager.INSTANCE.isPreView2Loaded()) {
|
||||
overlayManager.showOrUpdateLine(options, SMALL_PRED_MAP2);
|
||||
} else if (preViewType == 3 && CallerMapIdentifyManager.INSTANCE.isPreView3Loaded()) {
|
||||
overlayManager.showOrUpdateLine(options, SMALL_PRED_MAP3);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
isExcept = true;
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
} finally {
|
||||
if (isExcept) {
|
||||
setVisible(false);
|
||||
}
|
||||
if (!points.isEmpty()) {
|
||||
for (int i = 0; i < points.size(); i++) {
|
||||
MogoLatLng latLng = points.get(i);
|
||||
if (latLng == null) {
|
||||
continue;
|
||||
}
|
||||
pools.release(latLng);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private long isPointOnCarFront(double car_lon, double car_lat, double car_head, double lon, double lat) {
|
||||
return DrivingDirectionUtils.getDegreeOfCar2Poi2(car_lon, car_lat, lon, lat, car_head);
|
||||
}
|
||||
}
|
||||
|
||||
private volatile RenderTask mPreRenderTask;
|
||||
|
||||
public void drawPredictionList(List<geometry.Geometry.Point> dataList, double bearing, boolean hasGreenWave, int preType, int largeType) {
|
||||
IMogoMap iMogoMap = MogoMap.Companion.getMapInstance().getMogoMap(DEFAULT);
|
||||
double[] arr = null;
|
||||
if (mogoOverlayManager != null && iMogoMap != null) {
|
||||
if (mPreRenderTask == null) {
|
||||
mPreRenderTask = new RenderTask();
|
||||
}
|
||||
List<MogoLatLng> latLngList = new ArrayList<>();
|
||||
for (geometry.Geometry.Point point : dataList) {
|
||||
arr = iMogoMap.switchData(point.getX(), point.getY(), false);
|
||||
if (arr == null || arr.length < 2) continue;
|
||||
latLngList.add(new MogoLatLng(arr[1], arr[0]));
|
||||
}
|
||||
if (latLngList.isEmpty()) return;
|
||||
mPreRenderTask.setPreData(latLngList, bearing, hasGreenWave, preType, largeType);
|
||||
if (mRenderHandler != null) {
|
||||
mRenderHandler.removeCallbacks(mPreRenderTask);
|
||||
mRenderHandler.post(mPreRenderTask);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setVisible(boolean isVisible) {
|
||||
if (mogoOverlayManager != null) {
|
||||
if (isVisible) {
|
||||
mogoOverlayManager.showAllLinesInLevel(Level.GUIDE_ROUTE_LINE);
|
||||
} else {
|
||||
mogoOverlayManager.hideAllLinesInLevel(Level.GUIDE_ROUTE_LINE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,7 @@ import androidx.core.util.Pools;
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapIdentifyManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils;
|
||||
@@ -187,8 +188,8 @@ public class RouteOverlayDrawer {
|
||||
RouteStrategy.INSTANCE.check(route.getVelocity(), route.getAcceleration(), routeList.size());
|
||||
}
|
||||
}
|
||||
double lon = CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84().getLongitude();
|
||||
double lat = CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84().getLatitude();
|
||||
double lon = CallerChassisLocationWGS84ListenerManager.INSTANCE.getWgs84Lon();
|
||||
double lat = CallerChassisLocationWGS84ListenerManager.INSTANCE.getWgs84Lat();
|
||||
if (!points.isEmpty()) {
|
||||
MogoLatLng top = null;
|
||||
while (!points.isEmpty()) {
|
||||
@@ -199,8 +200,8 @@ public class RouteOverlayDrawer {
|
||||
if (first == top) {
|
||||
break;
|
||||
}
|
||||
lon = CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84().getLongitude();
|
||||
lat = CallerChassisLocationWGS84ListenerManager.INSTANCE.getChassisLocationWGS84().getLatitude();
|
||||
lon = CallerChassisLocationWGS84ListenerManager.INSTANCE.getWgs84Lon();
|
||||
lat = CallerChassisLocationWGS84ListenerManager.INSTANCE.getWgs84Lat();
|
||||
long angle = isPointOnCarFront(lon, lat, bearing, first.lon, first.lat);
|
||||
if (angle >= 90) {
|
||||
if (isColorfulStrategy) {
|
||||
@@ -267,7 +268,7 @@ public class RouteOverlayDrawer {
|
||||
mPolylineOptions = options;
|
||||
}
|
||||
overlayManager.showOrUpdateLine(options,DEFAULT);
|
||||
if (FunctionBuildConfig.isDrawDecIdentifyData) {
|
||||
if (FunctionBuildConfig.isDrawDecIdentifyData && CallerMapIdentifyManager.INSTANCE.isDecViewLoaded()) {
|
||||
overlayManager.showOrUpdateLine(options,SMALL_DES_MAP);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -1,26 +1,41 @@
|
||||
package com.mogo.eagle.core.function.view
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
|
||||
import com.mogo.eagle.core.function.map.R
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import kotlinx.android.synthetic.main.layout_decision_container.view.decMapView
|
||||
import kotlinx.android.synthetic.main.layout_decision_container.view.preDetailView2
|
||||
import kotlinx.android.synthetic.main.layout_decision_container.view.preDetailView3
|
||||
import kotlinx.android.synthetic.main.layout_decision_container.view.tvPre1
|
||||
import kotlinx.android.synthetic.main.layout_decision_container.view.tvPre2
|
||||
import kotlinx.android.synthetic.main.layout_decision_container.view.tvPre3
|
||||
|
||||
class DecisionLayout @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null
|
||||
) : ConstraintLayout(context, attrs) {
|
||||
) : ConstraintLayout(context, attrs), IMoGoAutopilotIdentifyListener {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "DecisionLayout"
|
||||
}
|
||||
|
||||
@Volatile
|
||||
private var lastTime = 0L
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.layout_decision_container, this, true)
|
||||
initView()
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
|
||||
CallerAutopilotIdentifyListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
fun onCreate(savedInstanceState: Bundle?) {
|
||||
@@ -41,6 +56,30 @@ class DecisionLayout @JvmOverloads constructor(
|
||||
preDetailView3.onResume()
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
override fun onPredictionProbabilityChanged(pro1: Float, pro2: Float) {
|
||||
if (System.currentTimeMillis() - lastTime >= 1000) {
|
||||
ThreadUtils.runOnUiThread {
|
||||
val prob1: Int
|
||||
val prob2: Int
|
||||
val prob3: Int
|
||||
if (pro1 + pro2 < 50) {
|
||||
prob1= (pro1*100).toInt()
|
||||
prob3= (pro2*100).toInt()
|
||||
prob2 = 100 - prob1 - prob3
|
||||
} else {
|
||||
prob1 = 15 * (pro1 / (pro1 + pro2)).toInt()
|
||||
prob3 = 15 * (pro2 / (pro1 + pro2)).toInt()
|
||||
prob2 = 100 - prob1 - prob3
|
||||
}
|
||||
tvPre1.text = "${prob1}%"
|
||||
tvPre3.text = "${prob3}%"
|
||||
tvPre2.text = "${prob2}%"
|
||||
}
|
||||
lastTime = System.currentTimeMillis()
|
||||
}
|
||||
}
|
||||
|
||||
fun onLowMemory() {
|
||||
decMapView.onLowMemory()
|
||||
preDetailView2.onLowMemory()
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
|
||||
import com.mogo.eagle.core.function.api.map.road.IMoGoMapRoadListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapIdentifyManager.isDecViewLoaded
|
||||
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_MAP
|
||||
@@ -92,6 +93,11 @@ class DecisionMapView(context: Context?, attrs: AttributeSet?) : MogoMapView(con
|
||||
|
||||
override fun onMapInit() {}
|
||||
|
||||
override fun onDestroy() {
|
||||
isDecViewLoaded = false
|
||||
super.onDestroy()
|
||||
}
|
||||
|
||||
override fun onMapLoaded() {
|
||||
(mMapView.mapView as MapAutoView).getMapView()?.getMapEngine()?.setHDTypeVisible(
|
||||
intArrayOf(
|
||||
@@ -101,6 +107,7 @@ class DecisionMapView(context: Context?, attrs: AttributeSet?) : MogoMapView(con
|
||||
HDTypes.regional.type
|
||||
)
|
||||
)
|
||||
isDecViewLoaded = true
|
||||
}
|
||||
|
||||
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
|
||||
import com.mogo.eagle.core.function.api.map.road.IMoGoMapRoadListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapIdentifyManager
|
||||
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_MAP
|
||||
@@ -96,6 +97,11 @@ class PredictionMap2View(context: Context, attrs: AttributeSet) : MogoMapView(co
|
||||
|
||||
override fun onMapInit() {}
|
||||
|
||||
override fun onDestroy() {
|
||||
CallerMapIdentifyManager.isPreView2Loaded = false
|
||||
super.onDestroy()
|
||||
}
|
||||
|
||||
override fun onMapLoaded() {
|
||||
(mMapView.mapView as MapAutoView).getMapView()?.getMapEngine()?.setHDTypeVisible(
|
||||
intArrayOf(
|
||||
@@ -105,6 +111,7 @@ class PredictionMap2View(context: Context, attrs: AttributeSet) : MogoMapView(co
|
||||
HDTypes.regional.type
|
||||
)
|
||||
)
|
||||
CallerMapIdentifyManager.isPreView2Loaded = true
|
||||
}
|
||||
|
||||
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
|
||||
import com.mogo.eagle.core.function.api.map.road.IMoGoMapRoadListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapIdentifyManager
|
||||
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_MAP
|
||||
@@ -96,6 +97,11 @@ class PredictionMap3View(context: Context, attrs: AttributeSet) : MogoMapView(co
|
||||
|
||||
override fun onMapInit() {}
|
||||
|
||||
override fun onDestroy() {
|
||||
CallerMapIdentifyManager.isPreView3Loaded = false
|
||||
super.onDestroy()
|
||||
}
|
||||
|
||||
override fun onMapLoaded() {
|
||||
(mMapView.mapView as MapAutoView).getMapView()?.getMapEngine()?.setHDTypeVisible(
|
||||
intArrayOf(
|
||||
@@ -105,6 +111,7 @@ class PredictionMap3View(context: Context, attrs: AttributeSet) : MogoMapView(co
|
||||
HDTypes.regional.type
|
||||
)
|
||||
)
|
||||
CallerMapIdentifyManager.isPreView3Loaded = true
|
||||
}
|
||||
|
||||
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Listener
|
||||
import com.mogo.eagle.core.function.api.map.road.IMoGoMapRoadListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapIdentifyManager
|
||||
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_MAP
|
||||
@@ -118,6 +119,12 @@ class PredictionMapView(context: Context, attrs: AttributeSet) : MogoMapView(con
|
||||
HDTypes.regional.type
|
||||
)
|
||||
)
|
||||
CallerMapIdentifyManager.isPreViewLoaded = true
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
CallerMapIdentifyManager.isPreViewLoaded = false
|
||||
super.onDestroy()
|
||||
}
|
||||
|
||||
override fun onChassisLocationWGS84(gnssInfo: MogoLocation) {
|
||||
|
||||
@@ -62,6 +62,9 @@ object AppConfigInfo {
|
||||
//工控机激光Slam地图版本
|
||||
@Volatile
|
||||
var slamMapVersion: String =""
|
||||
//鹰眼可动态展示的MAP版本
|
||||
@Volatile
|
||||
var mapShowName: String = ""
|
||||
|
||||
//业务状态信息
|
||||
/**
|
||||
|
||||
@@ -60,4 +60,5 @@ interface IMoGoAutopilotIdentifyListener {
|
||||
*/
|
||||
fun onAutopilotV2nCongestionEvent(header: MessagePad.Header, rsi: MogoV2X.RSI_PB) {}
|
||||
|
||||
fun onPredictionProbabilityChanged(pro1: Float, pro2: Float) {}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.mogo.eagle.core.function.api.setting
|
||||
|
||||
/**
|
||||
* 工控机显示版本监听接口
|
||||
*/
|
||||
interface IMapShowNameListener {
|
||||
|
||||
/**
|
||||
* 工控机显示版本
|
||||
* @param showName 展示版本
|
||||
*/
|
||||
fun changeMapShowName(showName: String){}
|
||||
|
||||
}
|
||||
@@ -66,4 +66,11 @@ object CallerAutopilotIdentifyListenerManager : CallerBase<IMoGoAutopilotIdentif
|
||||
listener.onAutopilotV2nCongestionEvent(header, rsi)
|
||||
}
|
||||
}
|
||||
|
||||
fun invokeProbabilityChanged(pro1: Float, pro2: Float) {
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.onPredictionProbabilityChanged(pro1, pro2)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,18 @@ object CallerChassisLocationWGS84ListenerManager : CallerBase<IMoGoChassisLocati
|
||||
return mGnssInfo.copy(mGnssInfo, mGnssInfo.longitude, mGnssInfo.latitude)
|
||||
}
|
||||
|
||||
fun getLocationHeading(): Double {
|
||||
return mGnssInfo.heading
|
||||
}
|
||||
|
||||
fun getWgs84Lon(): Double {
|
||||
return mGnssInfo.longitude
|
||||
}
|
||||
|
||||
fun getWgs84Lat(): Double {
|
||||
return mGnssInfo.latitude
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加监听并指定回掉频率
|
||||
*/
|
||||
|
||||
@@ -10,6 +10,15 @@ object CallerMapIdentifyManager {
|
||||
@Volatile
|
||||
var roam = Pair("", false)
|
||||
|
||||
@Volatile
|
||||
var isPreViewLoaded = false
|
||||
@Volatile
|
||||
var isPreView2Loaded = false
|
||||
@Volatile
|
||||
var isPreView3Loaded = false
|
||||
@Volatile
|
||||
var isDecViewLoaded = false
|
||||
|
||||
private val roamApi: IMogoRoma
|
||||
get() = ARouter.getInstance().build(MogoServicePaths.PATH_MAP_BIZ)
|
||||
.navigation() as IMogoRoma
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.mogo.eagle.core.function.call.setting
|
||||
import com.mogo.eagle.core.function.api.setting.IMapShowNameListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
|
||||
/**
|
||||
* 工控机展示版本
|
||||
*/
|
||||
object CallerMapShowNameManager: CallerBase<IMapShowNameListener>() {
|
||||
|
||||
/**
|
||||
* 工控机显示版本
|
||||
* @param showName 展示版本
|
||||
*/
|
||||
fun invokeMapShowName(showName: String){
|
||||
M_LISTENERS.forEach{
|
||||
val listener = it.value
|
||||
listener.changeMapShowName(showName)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -43,7 +43,7 @@ class MogoMap private constructor() {
|
||||
*/
|
||||
fun getMogoMap(instance: String = DEFAULT): IMogoMap? {
|
||||
return if (mapCache[instance] == null) {
|
||||
CallerLogger.e("$M_MAP$TAG", "getMogoMap func has error with no instance in mapCache")
|
||||
CallerLogger.e("$M_MAP$TAG", "getMogoMap func has error with no ${instance} in mapCache")
|
||||
mapCache[DEFAULT]
|
||||
} else {
|
||||
mapCache[instance]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.mogo.eagle.core.function.utils
|
||||
package com.mogo.map.utils
|
||||
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils
|
||||
@@ -7,8 +7,8 @@ import android.view.View;
|
||||
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.data.map.MogoLatLng;
|
||||
import com.mogo.eagle.core.data.map.MogoLocation;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils;
|
||||
import com.mogo.map.overlay.line.Polyline;
|
||||
import com.mogo.map.overlay.point.Point;
|
||||
import com.mogo.map.uicontroller.MapCameraPosition;
|
||||
@@ -38,18 +38,18 @@ import prediction2025.Prediction2025;
|
||||
*/
|
||||
public class ObjectUtils {
|
||||
|
||||
private static Map<Adas.TrackedObjectType, Adas.TrackedObjectClassID> sTypeMap = Map.of(
|
||||
Adas.TrackedObjectType.TYPE_PEDESTRIAN, Adas.TrackedObjectClassID.Person,
|
||||
Adas.TrackedObjectType.TYPE_MOTOR, Adas.TrackedObjectClassID.MotorCycle,
|
||||
Adas.TrackedObjectType.TYPE_BICYCLE, Adas.TrackedObjectClassID.Bicycle,
|
||||
Adas.TrackedObjectType.TYPE_CAR, Adas.TrackedObjectClassID.Car,
|
||||
Adas.TrackedObjectType.TYPE_TRUCK, Adas.TrackedObjectClassID.Truck,
|
||||
Adas.TrackedObjectType.TYPE_BUS, Adas.TrackedObjectClassID.Bus,
|
||||
Adas.TrackedObjectType.TYPE_WARNINGTRIANGLE, Adas.TrackedObjectClassID.WarningTriangle,
|
||||
Adas.TrackedObjectType.TYPE_ROADWORK_OCCUPY_0501, Adas.TrackedObjectClassID.RoadWork_occupy_0501,
|
||||
Adas.TrackedObjectType.TYPE_ROADWORK_BREAK_0502, Adas.TrackedObjectClassID.RoadWork_break_0502,
|
||||
Adas.TrackedObjectType.TYPE_ROAD_CONGESTION, Adas.TrackedObjectClassID.ROAD_CONGESTION
|
||||
);
|
||||
// private static Map<Adas.TrackedObjectType, Adas.TrackedObjectClassID> sTypeMap = Map.of(//最低得JDK9,注意换成new HashMap<>
|
||||
// Adas.TrackedObjectType.TYPE_PEDESTRIAN, Adas.TrackedObjectClassID.Person,
|
||||
// Adas.TrackedObjectType.TYPE_MOTOR, Adas.TrackedObjectClassID.MotorCycle,
|
||||
// Adas.TrackedObjectType.TYPE_BICYCLE, Adas.TrackedObjectClassID.Bicycle,
|
||||
// Adas.TrackedObjectType.TYPE_CAR, Adas.TrackedObjectClassID.Car,
|
||||
// Adas.TrackedObjectType.TYPE_TRUCK, Adas.TrackedObjectClassID.Truck,
|
||||
// Adas.TrackedObjectType.TYPE_BUS, Adas.TrackedObjectClassID.Bus,
|
||||
// Adas.TrackedObjectType.TYPE_WARNINGTRIANGLE, Adas.TrackedObjectClassID.WarningTriangle,
|
||||
// Adas.TrackedObjectType.TYPE_ROADWORK_OCCUPY_0501, Adas.TrackedObjectClassID.RoadWork_occupy_0501,
|
||||
// Adas.TrackedObjectType.TYPE_ROADWORK_BREAK_0502, Adas.TrackedObjectClassID.RoadWork_break_0502,
|
||||
// Adas.TrackedObjectType.TYPE_ROAD_CONGESTION, Adas.TrackedObjectClassID.ROAD_CONGESTION
|
||||
// );
|
||||
|
||||
public static MarkerOptions fromMogo(Point.Options opt, MapAutoView mapAutoView) {
|
||||
|
||||
@@ -196,14 +196,16 @@ public class ObjectUtils {
|
||||
return null;
|
||||
}
|
||||
MarkerSimpleData markerOptions = null;
|
||||
MogoLocation location = getPreLocation(preData);
|
||||
if (location == null) return null;
|
||||
try {
|
||||
markerOptions = new MarkerSimpleData();
|
||||
markerOptions.setId(preData.getMNid());
|
||||
markerOptions.setId(preData.getMNid()-800000);
|
||||
markerOptions.setMarkerType(trackedObjectTypeTransform(preData.getClasstype()));
|
||||
markerOptions.setRotateAngle(getPredictionHeading(preData));
|
||||
markerOptions.setRotateAngle((float) location.getHeading());
|
||||
// 自车2条轨迹,它车1条轨迹;每条轨迹的第一个点为位置,其它点为预测轨迹点
|
||||
markerOptions.setLat(preData.getPredictionTrajectoryList().get(0).getTrajectoryPointsList().get(0).getX());
|
||||
markerOptions.setLon(preData.getPredictionTrajectoryList().get(0).getTrajectoryPointsList().get(0).getY());
|
||||
markerOptions.setLat(location.getLatitude());
|
||||
markerOptions.setLon(location.getLongitude());
|
||||
// marker做动画时需用到(要么一直不传,要么一直都传)
|
||||
// markerOptions.setTime(Double.valueOf(preData.getSatelliteTime() * 1000).longValue());
|
||||
markerOptions.setColor("#90ABCAFF");
|
||||
@@ -224,19 +226,16 @@ public class ObjectUtils {
|
||||
if (type == null) {
|
||||
type = Adas.TrackedObjectType.TYPE_UNKNOWN;
|
||||
}
|
||||
Adas.TrackedObjectClassID classID = sTypeMap.get(type);
|
||||
if (classID == null) {
|
||||
classID = Adas.TrackedObjectClassID.Unknown;
|
||||
}
|
||||
Adas.TrackedObjectClassID classID = Adas.TrackedObjectClassID.Unknown;
|
||||
return classID.getNumber();
|
||||
}
|
||||
|
||||
private static float getPredictionHeading(Prediction2025.mPredictionObjectApp preData) {
|
||||
private static MogoLocation getPreLocation(Prediction2025.mPredictionObjectApp preData) {
|
||||
List<geometry.Geometry.Point> pointList = preData.getPredictionTrajectoryList().get(0).getTrajectoryPointsList();
|
||||
if (pointList.size() >= 2) {
|
||||
return (float) DrivingDirectionUtils.getLineAngle(pointList.get(0).getX(), pointList.get(0).getY(), pointList.get(1).getX(), pointList.get(1).getY());
|
||||
return LocationUtils.INSTANCE.generateLocation(pointList.get(0).getX(), pointList.get(0).getY(), pointList.get(1).getX(), pointList.get(1).getY());
|
||||
} else {
|
||||
return 0;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user