[3.3.0] Text/bus司机端到站逻辑修改为:过站且在15m内上报到站,不再是单纯围栏15m到站

This commit is contained in:
wangmingjun
2023-06-20 20:04:58 +08:00
parent 3d86edb98f
commit 6f63de0b70
3 changed files with 49 additions and 10 deletions

View File

@@ -34,6 +34,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02Lis
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.CoordinateUtils;
import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils;
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
import com.mogo.eagle.core.utilcode.util.ToastUtils;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
@@ -406,10 +407,26 @@ public class OrderModel {
startLon, startLat,
location.getLongitude(), location.getLatitude());
if (distance <= BusConst.ARRIVE_AT_END_STATION_DISTANCE) {
if (distance <= BusConst.ARRIVE_AT_END_STATION_DISTANCE) {//1、当前位置和站点围栏15m内
CallerLogger.INSTANCE.d(M_BUS + TAG, "行程日志-judgeArrivedStation() distance = " + distance
+ " to " + upcomingStation.getName());
onArriveAt(null); //无自动驾驶到站信息传null
//2、开始计算当前位置和站点的向量角度 < 90度 未经过 >90度 经过
double stationAngle = DrivingDirectionUtils.getDegreeOfCar2Poi(
location.getLongitude(),
location.getLatitude(),
startLon,
startLat,
(int) location.getHeading());
CallerLogger.INSTANCE.d(M_BUS + TAG, "judgeEndStation() stationAngle = " + stationAngle);
//3、刚过站且过站距离在15m内 提交到站
if (stationAngle > 90 && distance <= BusConst.ARRIVE_AT_END_STATION_DISTANCE){
CallerLogger.INSTANCE.d(M_BUS + TAG, "judgeEndStation() = 刚过站且在15m内");
onArriveAt(null); //无自动驾驶到站信息传null
}
return;
}
}

View File

@@ -64,7 +64,7 @@ class BusConst {
const val TIMER_START_AUTOPILOT_INTERVAL = 20 * 1000L
//围栏到站 暂定10米
const val ARRIVE_AT_END_STATION_DISTANCE = 10
const val ARRIVE_AT_END_STATION_DISTANCE = 15
// 轮询
const val LOOP_PASSENGER_5S = 5 * 1000L

View File

@@ -37,6 +37,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListener
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
import com.mogo.eagle.core.utilcode.util.CoordinateUtils;
import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils;
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
import com.mogo.eagle.core.utilcode.util.ToastUtils;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
@@ -1082,26 +1083,47 @@ public class TaxiModel {
}
};
private void judgeEndStation(MogoLocation location) {
private void judgeEndStation(MogoLocation currentLocation) {
if (mCurrentOCHOrder == null || mCurrentOCHOrder.endSiteGcjPoint == null
|| mCurrentOCHOrder.endSiteGcjPoint.size() < 2) {
return;
}
double startLon = mCurrentOCHOrder.endSiteGcjPoint.get(0);
double startLat = mCurrentOCHOrder.endSiteGcjPoint.get(1);
double endLon = mCurrentOCHOrder.endSiteGcjPoint.get(0);
double endLat = mCurrentOCHOrder.endSiteGcjPoint.get(1);
double distance = CoordinateUtils.calculateLineDistance(
startLon, startLat,
location.getLongitude(), location.getLatitude());
endLon, endLat,
currentLocation.getLongitude(), currentLocation.getLatitude());
CallerLogger.INSTANCE.i(M_TAXI + TAG, "judgeEndStation() distance = " + distance);
if (distance <= TaxiConst.ARRIVE_AT_START_STATION_DISTANCE) {
if (distance <= TaxiConst.ARRIVE_AT_START_STATION_DISTANCE) { //1、当前位置和站点围栏15m内
if (!checkCurrentOCHOrder()
|| (getCurOrderStatus() == TaxiOrderStatusEnum.ArriveAtEnd)) {
CallerLogger.INSTANCE.i(M_TAXI + TAG, "order exception or order ArriveAtEnd");
return;
}
arriveTerminal();
//2、开始计算当前位置和站点的向量角度 < 90度 未经过 >90度 经过
double stationAngle = DrivingDirectionUtils.getDegreeOfCar2Poi(
currentLocation.getLongitude(),
currentLocation.getLatitude(),
endLon,
endLat,
(int) currentLocation.getHeading());
CallerLogger.INSTANCE.i(M_TAXI + TAG, "judgeEndStation() stationAngle = " + stationAngle);
//3、刚过站且过站距离在15m内 提交到站
if (stationAngle > 90 && distance <= TaxiConst.ARRIVE_AT_START_STATION_DISTANCE){
if (!checkCurrentOCHOrder()
|| (getCurOrderStatus() == TaxiOrderStatusEnum.ArriveAtEnd)) {
CallerLogger.INSTANCE.i(M_TAXI + TAG, "order exception or order ArriveAtEnd");
return;
}
CallerLogger.INSTANCE.i(M_TAXI + TAG, "judgeEndStation() = 刚过站且在15m内");
arriveTerminal();
}
}
}