Class navXPerformanceMonitor

  • All Implemented Interfaces:
    IDataArrivalSubscriber

    public class navXPerformanceMonitor
    extends java.lang.Object
    implements IDataArrivalSubscriber
    The navXPerformanceMonitor class is designed to provide performance data to help tune the navx_ftc library's AHRS_OLD class to retrieve navX-Model device data using tuning parameters appropriate for a particular FTC robotic controller configuration. For an example of using the navXPerformanceMonitor class, see the navX Performance Tuning Opmode
    • Constructor Summary

      Constructors 
      Constructor Description
      navXPerformanceMonitor​(AHRS navx_device)
      Constructor for the navXPerformanceMonitor class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getDeliveredRateHz()
      The delivered rate is the rate at which samples are delivered to the Android-based FTC robotics control application.
      int getDimTransferRateHz()
      The rate at which the Core Device Interface Module (DIM) is currently delivering data samples to the navx_ftc library IO thread.
      long getLastSensorTimestampDeltaMS()
      The last sensor timestamp delta indicates the period of time between reception of the last two samples from the navX-Model device, for those data samples which are timestamped with a sensor timestamp.
      long getLastSystemTimestampDeltaMS()
      The last system timestamp delta indicates the period of time between reception of the last two samples from the navX-Model device, for those data samples which do not provide a corresponding sensor timestamp and are instead timestamped using the Android OS system timestamp.
      int getNumEstimatedMissedUntimestampedSamples()
      The number of samples which were expected to be received from the navX-Model device which are believed to have not arrived based upon the Android OS system timestamp.
      int getNumMissedSensorTimestampedSamples()
      The number of samples which were expected to be received from the navX-Model device which never arrived, since the last time the navXPerformanceMonitor's statistics were reset.
      int getSensorRateHz()
      The sensor tate is the rate at which the navX-Model device sensor is currently configured to deliver sample.
      void reset()
      Resets the peformance monitoring statistics.
      void timestampedDataReceived​(long curr_system_timestamp, long curr_sensor_timestamp, java.lang.Object kind)  
      void untimestampedDataReceived​(long curr_system_timestamp, java.lang.Object kind)  
      void yawReset()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • navXPerformanceMonitor

        public navXPerformanceMonitor​(AHRS navx_device)
        Constructor for the navXPerformanceMonitor class.
        Parameters:
        navx_device - The instance of the navX-Model device to monitor.
    • Method Detail

      • reset

        public void reset()
        Resets the peformance monitoring statistics.
      • getDeliveredRateHz

        public int getDeliveredRateHz()
        The delivered rate is the rate at which samples are delivered to the Android-based FTC robotics control application.
        Returns:
        The rate of navX-Model device sample delivery in Hz.
      • getSensorRateHz

        public int getSensorRateHz()
        The sensor tate is the rate at which the navX-Model device sensor is currently configured to deliver sample. This rate may be greater than the delivered rate.
        Returns:
        The rate at which the navX-Model device is currently configured to generate samples, in Hz.
      • getDimTransferRateHz

        public int getDimTransferRateHz()
        The rate at which the Core Device Interface Module (DIM) is currently delivering data samples to the navx_ftc library IO thread.
        Returns:
        The current DIM transfer rate in Hz.
      • getNumMissedSensorTimestampedSamples

        public int getNumMissedSensorTimestampedSamples()
        The number of samples which were expected to be received from the navX-Model device which never arrived, since the last time the navXPerformanceMonitor's statistics were reset.
        Returns:
        The number of navX-Model device samples not received.
      • getNumEstimatedMissedUntimestampedSamples

        public int getNumEstimatedMissedUntimestampedSamples()
        The number of samples which were expected to be received from the navX-Model device which are believed to have not arrived based upon the Android OS system timestamp. Note that this timestamp is not as accurate as the navX-Model device sensor timestamp, and thus the number of missed unstimestamped samples is an estimate, and is not deterministic.
        Returns:
        The estimated number of navX-Model device untimestamped samples not received, since the last time the navXPerformanceMonitor's statistics were reset.
      • getLastSensorTimestampDeltaMS

        public long getLastSensorTimestampDeltaMS()
        The last sensor timestamp delta indicates the period of time between reception of the last two samples from the navX-Model device, for those data samples which are timestamped with a sensor timestamp.
        Returns:
        The last sensor timestamp delta, in milliseconds.
      • getLastSystemTimestampDeltaMS

        public long getLastSystemTimestampDeltaMS()
        The last system timestamp delta indicates the period of time between reception of the last two samples from the navX-Model device, for those data samples which do not provide a corresponding sensor timestamp and are instead timestamped using the Android OS system timestamp.
        Returns:
        The last system timestamp delta, in milliseconds.