def getPeriod(self) -> float: """Returns the period of the most recent pulse. Returns the period of the most recent Encoder pulse in seconds. This method compensates for the decoding type. .. deprecated:: Use :func:`getRate` in favor of this method. This returns unscaled periods and :func:`getRate` scales using value from :func:`getDistancePerPulse`. :returns: Period in seconds of the most recent pulse. """ warnings.warn("use getRate instead", DeprecationWarning) return hal.getEncoderPeriod(self.encoder)
def getPeriod(self) -> float: """Returns the period of the most recent pulse. Returns the period of the most recent Encoder pulse in seconds. This method compensates for the decoding type. .. deprecated:: Use :func:`getRate` in favor of this method. This returns unscaled periods and :func:`getRate` scales using value from :func:`getDistancePerPulse`. :returns: Period in seconds of the most recent pulse. """ warnings.warn("use getRate instead", DeprecationWarning) return hal.getEncoderPeriod(self.encoder)
def getPeriod(self): """Returns the period of the most recent pulse. Returns the period of the most recent Encoder pulse in seconds. This method compensates for the decoding type. .. deprecated:: Use :func:`getRate` in favor of this method. This returns unscaled periods and :func:`getRate` scales using value from :func:`getDistancePerPulse`. :returns: Period in seconds of the most recent pulse. """ warnings.warn("use getRate instead", DeprecationWarning) if self.counter is not None: measuredPeriod = self.counter.getPeriod() / self.decodingScaleFactor() else: measuredPeriod = hal.getEncoderPeriod(self.encoder) return measuredPeriod
def getPeriod(self): """Returns the period of the most recent pulse. Returns the period of the most recent Encoder pulse in seconds. This method compensates for the decoding type. .. deprecated:: Use :func:`getRate` in favor of this method. This returns unscaled periods and :func:`getRate` scales using value from :func:`getDistancePerPulse`. :returns: Period in seconds of the most recent pulse. """ warnings.warn("use getRate instead", DeprecationWarning) if self.counter is not None: measuredPeriod = self.counter.getPeriod( ) / self.decodingScaleFactor() else: measuredPeriod = hal.getEncoderPeriod(self.encoder) return measuredPeriod