Exemplo n.º 1
0
        public RangerSensorSonar(string name, SensorPose pose, IAbstractRobotHardware brick, GpioPinId triggerPin, GpioPinId outputPin, int frequency, double threshold)
        {
            this.Name = name;
            this.Pose = pose;

            // reliably measured range:
            this.MinDistanceMeters = 0.04d; // shows 3cm all right
            this.MaxDistanceMeters = 2.5d;  // shows 2.55m at infinity

            this.srf04 = brick.produceSonarSRF04(triggerPin, outputPin, frequency, threshold);

            srf04.DistanceChanged += new HardwareComponentEventHandler(ir_DistanceChanged);        
        }
Exemplo n.º 2
0
        public RangerSensorSonar(string name, SensorPose pose, IAbstractRobotHardware brick, GpioPinId triggerPin, GpioPinId outputPin, int frequency, double threshold)
        {
            this.Name = name;
            this.Pose = pose;

            // reliably measured range:
            this.MinDistanceMeters = 0.04d; // shows 3cm all right
            this.MaxDistanceMeters = 2.5d;  // shows 2.55m at infinity

            this.srf04 = brick.produceSonarSRF04(triggerPin, outputPin, frequency, threshold);

            srf04.DistanceChanged += new HardwareComponentEventHandler(ir_DistanceChanged);
        }