如何校准bno055陀螺仪传感器?

问题描述 投票:0回答:1

对于我们的FTC机器人,我们正在尝试校准BNO055陀螺仪传感器,并且在外部/示例下已经存在TeleOp

我想知道我们是否需要在每个领域进行校准或只校准一次?

java robotics
1个回答
0
投票

您只需要校准一次陀螺仪。然后按a按钮保存该配置。通过添加以下代码,确保在您的代码中链接到该校准的陀螺文件:

// Set the parameters for the gyro
params = new BNO055IMU.Parameters();
params.angleUnit           = BNO055IMU.AngleUnit.DEGREES;
params.accelUnit           = BNO055IMU.AccelUnit.METERS_PERSEC_PERSEC;
params.calibrationDataFile = "BNO055IMUCalibration.json"; // Make sure that you have run the calibrate teleop first!!
params.loggingEnabled      = true;
params.loggingTag          = "IMU";
params.accelerationIntegrationAlgorithm = new JustLoggingAccelerationIntegrator();

// Init the IMU make sure it is in the configuration on the phone as I2C BUS 0 named as imu
BNO055IMU imu = hardwareMap.get(BNO055IMU.class, "imu");
imu.initialize(params);

// Let the gyro initialize 
while(!isStopRequested() && imu.isGyroCalibrated()) {
    sleep(50);
    idle();
}

© www.soinside.com 2019 - 2024. All rights reserved.