diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs index 98e299d09daa65a41203c3c756b31ee5017dc6d9..2d70b003450cc5d60cfee6cf0a2ef790e27ae6fd 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Impl/Driver.cs @@ -1459,6 +1459,6 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl public PCCStates PCCState => DriverStrategy.PCCState; - public MeterPerSecond NextBrakeTriggerSpeed => DriverStrategy.BrakeTrigger.NextTargetSpeed; + public MeterPerSecond NextBrakeTriggerSpeed => DriverStrategy.BrakeTrigger?.NextTargetSpeed; } } \ No newline at end of file diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Strategies/HybridStrategy.cs b/VectoCore/VectoCore/Models/SimulationComponent/Strategies/HybridStrategy.cs index 94b61f878285b6c6c0ecf8162348d64c5fb67b30..44d00dcfe86ad01bea8313769f63d9452fc85c03 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Strategies/HybridStrategy.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Strategies/HybridStrategy.cs @@ -1053,7 +1053,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies // hint: only check for halting speed if vehicle is actually braking to halt. var vehiclespeedBelowThreshold = DataBus.VehicleInfo.VehicleSpeed.IsSmaller(disengageSpeedThreshold) - && DataBus.DriverInfo.NextBrakeTriggerSpeed.IsEqual(0); + && (DataBus.DriverInfo.NextBrakeTriggerSpeed?.IsEqual(0) ?? false); if (ElectricMotorCanPropellDuringTractionInterruption || DataBus.GearboxInfo.GearEngaged(absTime)) { @@ -1378,7 +1378,7 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Strategies // only disengage if we are actually braking for halting (meaning: next brake trigger speed is 0). if (DataBus.GearboxInfo.GearboxType.ManualTransmission() - && DataBus.DriverInfo.NextBrakeTriggerSpeed.IsEqual(0) + && (DataBus.DriverInfo.NextBrakeTriggerSpeed?.IsEqual(0) ?? false) && endSpeed.IsSmallerOrEqual(ModelData.GearboxData.DisengageWhenHaltingSpeed, 0.1.KMPHtoMeterPerSecond())) { return new GearshiftPosition(0); }