[charter]
[到站逻辑修改]
This commit is contained in:
yangyakun
2023-09-27 17:24:30 +08:00
parent 6d17e8f2b8
commit e197f8f777

View File

@@ -18,6 +18,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.updateAutopilotControlParameters
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
import com.mogo.eagle.core.network.utils.GsonUtil
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.e
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
@@ -416,7 +417,7 @@ object CharterPassengerModel {
// 小于15m到站
if (calculateLineDistance < CharterPassengerConst.ARRIVE_AT_START_STATION_DISTANCE && calculateLineDistance > 0) {
d(M_BUS_P + TAG, "小于15米到站1")
arriveDest()
checkArriveDesk(currentInfo)
}
if (calculateLineDistance < CharterPassengerConst.ARRIVE_SOON_AT_START_STATION_DISTANCE && calculateLineDistance > 0) {
d(M_BUS_P + TAG, "小于100米到站")
@@ -717,7 +718,7 @@ object CharterPassengerModel {
}
if (lastSumLength < CharterPassengerConst.ARRIVE_AT_START_STATION_DISTANCE && lastSumLength > 0) {
d(M_BUS_P + TAG, "小于15米到站2")
arriveDest()
checkArriveDesk(it)
return
}
if (order.arriveStatus == OrderInfoResponse.ARRIVING) {
@@ -883,6 +884,27 @@ object CharterPassengerModel {
BusPassengerServiceManager.queryLineLocation(mContext, lineId = lineId.toString(), callback)
}
private fun checkArriveDesk(currentLocation:MogoLocation){
//2、开始计算当前位置和站点的向量角度 < 90度 未经过 >90度 经过
orderInfo?.let {
val stationAngle = DrivingDirectionUtils.getDegreeOfCar2Poi(
currentLocation.longitude,
currentLocation.latitude,
it.gcj02Lon!!,
it.gcj02Lat!!, currentLocation.heading.toInt()
).toDouble()
if(stationAngle>90){
d(M_BUS_P + TAG, "过站触发到站")
arriveDest()
}else{
if (currentLocation.gnssSpeed < 0.3) {
d(M_BUS_P + TAG, "距离站点15m 未到站速度为0触发到站")
arriveDest()
}
}
}
}
@Synchronized
fun arriveDest() {
val (order, lineId, siteId) = getOrderInfo()