修改机器人驾驶识别信号机bug
This commit is contained in:
parent
690acdba5f
commit
b8687f8d40
@ -6,6 +6,7 @@ import club.joylink.rtss.simulation.cbtc.ATS.operation.handler.DriverOperateHand
|
|||||||
import club.joylink.rtss.simulation.cbtc.ATS.service.AtsStationService;
|
import club.joylink.rtss.simulation.cbtc.ATS.service.AtsStationService;
|
||||||
import club.joylink.rtss.simulation.cbtc.Simulation;
|
import club.joylink.rtss.simulation.cbtc.Simulation;
|
||||||
import club.joylink.rtss.simulation.cbtc.command.CommandBO;
|
import club.joylink.rtss.simulation.cbtc.command.CommandBO;
|
||||||
|
import club.joylink.rtss.simulation.cbtc.constant.SignalAspect;
|
||||||
import club.joylink.rtss.simulation.cbtc.constant.SimulationConstants;
|
import club.joylink.rtss.simulation.cbtc.constant.SimulationConstants;
|
||||||
import club.joylink.rtss.simulation.cbtc.constant.SimulationModule;
|
import club.joylink.rtss.simulation.cbtc.constant.SimulationModule;
|
||||||
import club.joylink.rtss.simulation.cbtc.data.CalculateService;
|
import club.joylink.rtss.simulation.cbtc.data.CalculateService;
|
||||||
@ -182,10 +183,14 @@ public class RobotLogicLoop {
|
|||||||
Signal signal = nextSection.getSignalOf(right);
|
Signal signal = nextSection.getSignalOf(right);
|
||||||
if (signal != null && !Signal.SignalType.SHUNTING.equals(signal.getType())) {
|
if (signal != null && !Signal.SignalType.SHUNTING.equals(signal.getType())) {
|
||||||
VirtualRealitySignal vrSignal = signal.getVirtualSignal();
|
VirtualRealitySignal vrSignal = signal.getVirtualSignal();
|
||||||
if (vrSignal != null && (signal.isGuideAspect() || signal.isDefaultAspect())) { //真实信号机不为null且信号机显示是引导或默认
|
if (vrSignal != null &&
|
||||||
|
(Objects.equals(signal.getGuideAspect(), vrSignal.getAspect())
|
||||||
|
|| Objects.equals(signal.getDefaultAspect(), vrSignal.getAspect())
|
||||||
|
|| SignalAspect.No.equals(vrSignal.getAspect()))) { //真实信号机不为null且信号机显示是引导/默认/灭灯
|
||||||
//目标位置修改为信号机前5米
|
//目标位置修改为信号机前5米
|
||||||
SectionPosition signalPosition = signal.getPosition();
|
SectionPosition signalPosition = signal.getPosition();
|
||||||
targetPosition = CalculateService.calculateNextPositionByStartAndLen(signalPosition, !right, 5, true);
|
targetPosition = CalculateService.calculateNextPositionByStartAndLen(signalPosition, !right, 5, true);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nextSection = nextSection.getNextRunningSectionBaseRealSwitch(right);
|
nextSection = nextSection.getNextRunningSectionBaseRealSwitch(right);
|
||||||
@ -199,6 +204,7 @@ public class RobotLogicLoop {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 机器人驾驶
|
* 机器人驾驶
|
||||||
|
*
|
||||||
* @param simulation
|
* @param simulation
|
||||||
* @param train
|
* @param train
|
||||||
* @param targetPosition
|
* @param targetPosition
|
||||||
|
Loading…
Reference in New Issue
Block a user