public LineAndWallDetectorRobot(IEnvironment env, int wallSensorMaxDistance = 100, int minMapValueForObstacle = 10) : base(env) { this.WallSensorMaxDistance = wallSensorMaxDistance; this.minMapValueForObstacle = minMapValueForObstacle; LineSensor = new LineSensor(this); LeftWallSensor = new FixedDistanceSensor(this, -90.0, this.minMapValueForObstacle, this.WallSensorMaxDistance); RightWallSensor = new FixedDistanceSensor(this, 90.0, this.minMapValueForObstacle, this.WallSensorMaxDistance); BeaconProximitySensor = new BeaconProximitySensor(this, 50.0); }
private void PollBeaconProximitySensor() { var ids = BeaconProximitySensor.GetCloseBeaconIds(); foreach (var id in ids) { if (!lastCloseBeaconIds.Contains(id)) { OnBeaconClose?.Invoke(id); } } lastCloseBeaconIds.Clear(); lastCloseBeaconIds.AddRange(ids); }