Merge branch 'dev_robotaxi-d_230612_3.3.0' of gitlab.zhidaoauto.com:SCA/L4HA/AndroidApp/MoGoEagleEye into dev_robotaxi-d_230612_3.3.0
This commit is contained in:
@@ -229,11 +229,11 @@ object BusPassengerModel{
|
||||
mRouteLineInfoCallback!!.updateStationsInfo(stations, i + 1, false)
|
||||
if (mNextStationIndex != i + 1) {
|
||||
mTwoStationsRouts.clear()
|
||||
val startStation = mStations[i]
|
||||
val endStation = mStations[i + 1]
|
||||
setTrajectoryStation(startStation, endStation, result.lineId)
|
||||
}
|
||||
mNextStationIndex = i + 1
|
||||
val startStation = mStations[i]
|
||||
val endStation = mStations[i + 1]
|
||||
setTrajectoryStation(startStation, endStation, result.lineId)
|
||||
updateAutopilotControlParameters(result, i)
|
||||
return
|
||||
} else if (station.drivingStatus == BusPassengerConst.STATION_STATUS_STOPPED && !station.isLeaving) { //到站
|
||||
|
||||
@@ -56,6 +56,8 @@ object TrajectoryAndDistanceManager: IMoGoPlanningRottingListener{
|
||||
|
||||
@Volatile
|
||||
private var mRoutePoints: MutableList<MogoLocation>? = ArrayList()
|
||||
private var mRoutePointsDistance: MutableList<Float>? = ArrayList()
|
||||
private var maxDistanceAllPoint:Double = 0.0
|
||||
|
||||
@Volatile
|
||||
private var lineId:Long? = null
|
||||
@@ -99,9 +101,26 @@ object TrajectoryAndDistanceManager: IMoGoPlanningRottingListener{
|
||||
|
||||
private fun updateRoutePoints(routePoints: List<MessagePad.Location>?) {
|
||||
mRoutePoints = null
|
||||
mRoutePointsDistance = null
|
||||
val latLngModels = CoordinateCalculateRouteUtil
|
||||
.coordinateConverterWgsToGcjLocations(AbsMogoApplication.getApp(), routePoints!!)
|
||||
mRoutePoints = latLngModels
|
||||
|
||||
mRoutePointsDistance = ArrayList()
|
||||
maxDistanceAllPoint = 0.0
|
||||
mRoutePoints?.forEachIndexed { index, current ->
|
||||
if (mRoutePoints!!.last()!=current) {
|
||||
val next = mRoutePoints!![index + 1]
|
||||
val distanceItem = CoordinateUtils.calculateLineDistance(
|
||||
current.longitude,
|
||||
current.latitude,
|
||||
next.longitude,
|
||||
next.latitude
|
||||
)
|
||||
mRoutePointsDistance?.add(distanceItem)
|
||||
maxDistanceAllPoint += distanceItem
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun removeTempData() {
|
||||
@@ -262,12 +281,27 @@ object TrajectoryAndDistanceManager: IMoGoPlanningRottingListener{
|
||||
preCarLocationIndexInTrajectory = 0
|
||||
return
|
||||
}
|
||||
|
||||
var maxDisatance = 0.0f
|
||||
if(carLocationInfo.second==true){
|
||||
if(carLocationInfo.first>0) {
|
||||
maxDisatance = mRoutePointsDistance?.get(carLocationInfo.first - 1)?:0f
|
||||
}
|
||||
}else{
|
||||
maxDisatance = mRoutePointsDistance?.get(carLocationInfo.first)?:0f
|
||||
}
|
||||
if(carLocationInfo.third>maxDisatance){
|
||||
preCarLocationIndexInTrajectory = 0
|
||||
writeLog("到点的距离${carLocationInfo.third},最大距离${maxDisatance}",locationInfo)
|
||||
return
|
||||
}
|
||||
|
||||
preCarLocationIndexInTrajectory = carLocationInfo.first
|
||||
|
||||
// 距离回调
|
||||
try {
|
||||
if(distanceListeners.size>0) {
|
||||
invokeDistance(carLocationInfo, location)
|
||||
invokeDistance(carLocationInfo, location,locationInfo)
|
||||
}
|
||||
}catch (e:Exception){
|
||||
e(M_OCHCOMMON+ TAG,"距离计算错误")
|
||||
@@ -293,7 +327,11 @@ object TrajectoryAndDistanceManager: IMoGoPlanningRottingListener{
|
||||
}
|
||||
|
||||
|
||||
private fun invokeDistance(carLocationInfo:Triple<Int,Boolean?,Float>,location: MogoLocation){
|
||||
private fun invokeDistance(
|
||||
carLocationInfo: Triple<Int, Boolean?, Float>,
|
||||
location: MogoLocation,
|
||||
locationInfo: String
|
||||
){
|
||||
var lastSumLength = 0f
|
||||
|
||||
val stationIndex = endStationInfo.index?:0
|
||||
@@ -321,6 +359,11 @@ object TrajectoryAndDistanceManager: IMoGoPlanningRottingListener{
|
||||
)
|
||||
}
|
||||
d(M_OCHCOMMON+ TAG,"距离终点:$lastSumLength")
|
||||
if(lastSumLength>maxDistanceAllPoint){
|
||||
// 大于最大值需要需要删除此次计算
|
||||
writeLog("距离终点:$lastSumLength",locationInfo)
|
||||
return
|
||||
}
|
||||
if(distanceListeners.size>0) {
|
||||
distanceListeners.forEach {
|
||||
//val tag = it.key
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.mogo.eagle.core.function.view.OverMapView
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.taxi.passenger.R
|
||||
import com.mogo.och.taxi.passenger.constant.TaxiPassengerOrderStatusEnum
|
||||
import com.mogo.och.taxi.passenger.model.TaxiPassengerModel
|
||||
import io.reactivex.Observable
|
||||
@@ -26,23 +27,6 @@ class OverviewFragment : BaseFragment() {
|
||||
|
||||
private var subscribe: Disposable?=null
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View {
|
||||
if (overmapview == null) {
|
||||
overmapview = OverMapView(requireContext())
|
||||
} else {
|
||||
val viewGroup = overmapview?.parent as ViewGroup
|
||||
viewGroup.removeView(overmapview)
|
||||
}
|
||||
overmapview?.onCreateView(savedInstanceState)
|
||||
CallerLogger.d(SceneConstant.M_TAXI_P + TAG,"onCreateView")
|
||||
statusChange(TaxiPassengerModel.getInstance().curOrderStatus)
|
||||
return overmapview!!
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
overmapview?.onResume()
|
||||
@@ -80,7 +64,6 @@ class OverviewFragment : BaseFragment() {
|
||||
if(finalVisable2User){
|
||||
CallerLogger.d(SceneConstant.M_TAXI_P + TAG,"已经隐藏")
|
||||
finalVisable2User = false
|
||||
stopAndClear()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -117,7 +100,7 @@ class OverviewFragment : BaseFragment() {
|
||||
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return 0
|
||||
return R.layout.taxi_p_overmap_fragment
|
||||
}
|
||||
|
||||
override fun getTagName(): String {
|
||||
@@ -128,6 +111,15 @@ class OverviewFragment : BaseFragment() {
|
||||
|
||||
}
|
||||
|
||||
override fun initViews(savedInstanceState: Bundle?) {
|
||||
super.initViews(savedInstanceState)
|
||||
overmapview = findViewById(R.id.overMapView)
|
||||
overmapview?.onCreateView(savedInstanceState)
|
||||
|
||||
CallerLogger.d(SceneConstant.M_TAXI_P + TAG,"onCreateView")
|
||||
statusChange(TaxiPassengerModel.getInstance().curOrderStatus)
|
||||
}
|
||||
|
||||
companion object{
|
||||
private const val TAG = "OverviewFragment"
|
||||
@JvmStatic
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.mogo.eagle.core.function.view.OverMapView
|
||||
android:id="@+id/overMapView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:mapStyleExtraPath="map_style_extra.data"
|
||||
app:mapStylePath="map_style.data" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Reference in New Issue
Block a user