Class MindsensorsAbsoluteIMU.ShortSensorMode

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected int baseReg  
      protected byte[] buffer  
      protected float[] convert  
      protected java.lang.String name  
      protected int sampleSize  
      protected float[] scale  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected ShortSensorMode​(java.lang.String name, int reg, int sampleSize, float[] convert, float scale)
      Internal class to provide the sensor data.
      protected ShortSensorMode​(java.lang.String name, int reg, int sampleSize, float convert, float scale)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void fetchSample​(float[] sample, int offset)
      Fetches a sample from a sensor or filter.
      java.lang.String getName()
      return a string description of this sensor mode
      int sampleSize()
      Returns the number of elements in a sample.
      The number of elements does not change during runtime.
      protected void setScale​(float scale)
      Set the scale factor used when converting data to returned units.
      • Methods inherited from class java.lang.Object

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

      • name

        protected final java.lang.String name
      • sampleSize

        protected final int sampleSize
      • convert

        protected final float[] convert
      • baseReg

        protected final int baseReg
      • scale

        protected float[] scale
      • buffer

        protected byte[] buffer
    • Constructor Detail

      • ShortSensorMode

        protected ShortSensorMode​(java.lang.String name,
                                  int reg,
                                  int sampleSize,
                                  float[] convert,
                                  float scale)
        Internal class to provide the sensor data. Handles obtaining the base data and converting it to suitable SI units.
        Parameters:
        name - mode name
        reg - base register for the available samples
        sampleSize - number of samples
        convert - conversion factor to SI units
        scale - scale factor needed for range adjustment
      • ShortSensorMode

        protected ShortSensorMode​(java.lang.String name,
                                  int reg,
                                  int sampleSize,
                                  float convert,
                                  float scale)
    • Method Detail

      • setScale

        protected void setScale​(float scale)
        Set the scale factor used when converting data to returned units.
        Parameters:
        scale - new scale factor
      • sampleSize

        public int sampleSize()
        Description copied from interface: SampleProvider
        Returns the number of elements in a sample.
        The number of elements does not change during runtime.
        Specified by:
        sampleSize in interface SampleProvider
        Returns:
        the number of elements in a sample
      • fetchSample

        public void fetchSample​(float[] sample,
                                int offset)
        Description copied from interface: SampleProvider
        Fetches a sample from a sensor or filter.
        Specified by:
        fetchSample in interface SampleProvider
        Parameters:
        sample - The array to store the sample in.
        offset - The elements of the sample are stored in the array starting at the offset position.
      • getName

        public java.lang.String getName()
        Description copied from interface: SensorMode
        return a string description of this sensor mode
        Specified by:
        getName in interface SensorMode
        Returns:
        The description/name of this mode