修改大铁列车提速后停不准的问题
This commit is contained in:
parent
b13b2e6cbb
commit
a33c94a477
@ -292,8 +292,8 @@ public class SpeedCurve {
|
|||||||
if (needLimitSpeed != null && needLimitSpeed * 0.9f < limitSpeed) { //新的限速更小
|
if (needLimitSpeed != null && needLimitSpeed * 0.9f < limitSpeed) { //新的限速更小
|
||||||
endPosition = new SectionPosition(base, logic.getEndOffsetByDirection(!right)); //限速起始点
|
endPosition = new SectionPosition(base, logic.getEndOffsetByDirection(!right)); //限速起始点
|
||||||
distance = CalculateService.calculateDistance(headPosition, endPosition, right, false);
|
distance = CalculateService.calculateDistance(headPosition, endPosition, right, false);
|
||||||
if (distance != null && (distance > 500 || distance > totalLen)) //限速点在车头前方;限速点距车头不超过500m(过早考虑限速没有意义)
|
// if (distance != null && (distance > 500 || distance > totalLen)) //限速点在车头前方;限速点距车头不超过500m(过早考虑限速没有意义)
|
||||||
break;
|
// break; 由于大铁列车车速快很多,接近到500m才考虑限速就来不及了,故删除此逻辑
|
||||||
if (distance != null && distance > 0) {
|
if (distance != null && distance > 0) {
|
||||||
//取最靠下的速度曲线
|
//取最靠下的速度曲线
|
||||||
SpeedCurve limitSpeedCurve = buildTargetSpeedCurve(distance, v0, needLimitSpeed * 0.9f, limitSpeed); //到达新限速点的速度曲线
|
SpeedCurve limitSpeedCurve = buildTargetSpeedCurve(distance, v0, needLimitSpeed * 0.9f, limitSpeed); //到达新限速点的速度曲线
|
||||||
|
@ -177,13 +177,6 @@ public class SimulationRobotService {
|
|||||||
} else if (train.isRobotNeedRun() && (train.isRMMode() || train.isNRMMode())) { //CM应当根据推荐速度驾驶,待实现
|
} else if (train.isRobotNeedRun() && (train.isRMMode() || train.isNRMMode())) { //CM应当根据推荐速度驾驶,待实现
|
||||||
newRobotDrive(simulation, driver, train);
|
newRobotDrive(simulation, driver, train);
|
||||||
}
|
}
|
||||||
// //机器人驾驶
|
|
||||||
// if (driver.getCommand() != null || train.getRobotTargetPosition() != null) { //如果有和驾驶行为不冲突的指令,这里需要做修改
|
|
||||||
// robotDriveByCommand(simulation, driver, train);
|
|
||||||
// } else if (train.isRobotDriveForward()) {
|
|
||||||
// //地铁的自动驾驶暂时也用大铁的逻辑。因为地铁线路没有行车日志,所以效果等同于只看信号
|
|
||||||
// railRobotDrive(simulation, train);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user