No announcement yet.

Occassional can't talk to IMU init error

  • Filter
  • Time
  • Show
Clear All
new posts

  • Occassional can't talk to IMU init error

    Our team occasionally gets an error during init that we can not talk to the IMU. We use the REV hub with the internal IMU. Usually when we get the error once, the robot stays in this non-cooperative state by merely doing a robot restart. To resolve it we usually power off the robot switch, exit the phone app, and unplug the phone. We had a tournament this weekend, and unfortunately it happened for one of our matches, which meant we had a dead robot for a match. Has anyone else seen this error? We use the IMU a lot, for both auto and teleop. Our IMU init code is the following:

    BNO055IMU imu = null;
    String IMU = "imu";

    BNO055IMU.Parameters parameters = new BNO055IMU.Parameters();
    parameters.angleUnit = BNO055IMU.AngleUnit.DEGREES;
    parameters.accelUnit = BNO055IMU.AccelUnit.METERS_PERSEC_PERSEC;
    parameters.calibrationDataFile = "BNO055IMUCalibration.json";
    parameters.loggingEnabled = true;
    parameters.loggingTag = "IMU";
    parameters.accelerationIntegrationAlgorithm = new JustLoggingAccelerationIntegrator();

    imu = hwMap.get(BNO055IMU.class, IMU);

    When we read the IMU we use the following:

    Orientation angles = imu.getAngularOrientation(AxesReference.INTRINSIC, AxesOrder.ZYX, AngleUnit.DEGREES);
    double heading = (double)angles.firstAngle;