public PIDSteeringWheelAngleRegulator(ICar car) { Car = car; regulator = new PIDRegulator(new Settings(), "steering wheel angle regulator"); car.evTargetSteeringWheelAngleChanged += new TargetSteeringWheelAngleChangedEventHandler(car_evTargetSteeringWheelAngleChanged); car.CarComunicator.evSteeringWheelAngleInfoReceived += new SteeringWheelAngleInfoReceivedEventHandler(CarComunicator_evSteeringWheelAngleInfoReceived); }
public PIDBrakeRegulator(ICar car) { ICar = car; regulator = new PIDRegulator(new Settings(), "brake PID regulator"); ICar.evTargetSpeedChanged += ICar_evTargetSpeedChanged; ICar.SpeedRegulator.evNewSpeedSettingCalculated += SpeedRegulator_evNewSpeedSettingCalculated; ICar.CarComunicator.evBrakePositionReceived += CarComunicator_evBrakePositionReceived; evNewBrakeSettingCalculated += PIDBrakeRegulator_evNewBrakeSettingCalculated; ICar.evAlertBrake += ICar_evAlertBrake; }
public PIDSpeedRegulator(ICar parent) { Car = parent; CarComunicator = parent.CarComunicator; regulator = new PIDRegulator(new Settings(), "speed PID regulator"); Car.evAlertBrake += new EventHandler(Car_evAlertBrake); Car.evTargetSpeedChanged += new TargetSpeedChangedEventHandler(Car_evTargetSpeedChanged); evNewSpeedSettingCalculated += new NewSpeedSettingCalculatedEventHandler(PIDSpeedRegulator_evNewSpeedSettingCalculated); CarComunicator.evSpeedInfoReceived += new SpeedInfoReceivedEventHander(CarComunicator_evSpeedInfoReceived); }
public CarDriver(Map _baseMap, List<PositionAndOrientation> _track) { if (_track.Count < 2) throw new ArgumentException(); if (_baseMap.car == null) throw new ArgumentException(); baseMap = _baseMap; track = new LinkedList<PositionAndOrientation>(_track); distanceRegulator = new PIDRegulator(distanceRegulatorSettings, "Car Driver distance regulator"); distanceRegulator.targetValue = 0.0d; angleRegulator = new PIDRegulator(angleRegulatorSettings, "Car Driver ANGLE regulator"); angleRegulator.targetValue = 0.0d; currentPosition = track.First; }