Class ADIS16470_IMU

    • Method Detail

      • configCalTime

        public int configCalTime​(ADIS16470_IMU.CalibrationTime new_cal_time)
        Configures calibration time
        Parameters:
        new_cal_time - New calibration time
        Returns:
        1 if the new calibration time is the same as the current one else 0
      • calibrate

        public void calibrate()
        Calibrate the gyro. It's important to make sure that the robot is not moving while the calibration is in progress, this is typically done when the robot is first turned on while it's sitting at rest before the match starts.
      • setYawAxis

        public int setYawAxis​(ADIS16470_IMU.IMUAxis yaw_axis)
        Sets the yaw axis
        Parameters:
        yaw_axis - The new yaw axis to use
        Returns:
        1 if the new yaw axis is the same as the current one, 2 if the switch to Standard SPI failed, else 0.
      • reset

        public void reset()
      • close

        public void close()
        Delete (free) the spi port used for the IMU.
        Specified by:
        close in interface AutoCloseable
      • getAngle

        public double getAngle()
        Returns:
        Yaw axis angle in degrees (CCW positive)
      • getRate

        public double getRate()
        Returns:
        Yaw axis angular rate in degrees per second (CCW positive)
      • getAccelX

        public double getAccelX()
        Returns:
        current acceleration in the X axis
      • getAccelY

        public double getAccelY()
        Returns:
        current acceleration in the Y axis
      • getAccelZ

        public double getAccelZ()
        Returns:
        current acceleration in the Z axis
      • getPort

        public int getPort()
        Get the SPI port number.
        Returns:
        The SPI port number.