Skip to content

Commit

Permalink
use corrected driver
Browse files Browse the repository at this point in the history
  • Loading branch information
j5155 committed Sep 8, 2024
1 parent 76027d0 commit abef3bb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ This will be fixed in the future, but for now make sure your hub orientation is

Also, make sure to configure the OTOS in your hardware config.
By default, SparkFunOTOSDrive will look for a sensor named sensor_otos,
but you can change this in SparkFunOTOSDrive line 70.
but you can change this in SparkFunOTOSDrive line 70.

Note that, to mitigate an issue with the OTOS driver in SDK version 9.2,
you must currently configure the OTOS as "SparkFunOTOS Corrected" in your hardware config.
### Tune Scalars and Offsets
First, tune the Angular Scalar by running the OTOSAngularScalar OpMode and following the instructions.
This will allow you to get the maximum accuracy from the OTOS IMU.
Expand Down
2 changes: 1 addition & 1 deletion TeamCode/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ dependencies {
implementation "com.acmerobotics.roadrunner:core:1.0.0"
implementation "com.acmerobotics.roadrunner:actions:1.0.0"
implementation "com.acmerobotics.dashboard:dashboard:0.4.15"
implementation "com.github.jdhs-ftc:road-runner-ftc-otos:4b219ff0c0"
implementation "com.github.jdhs-ftc:road-runner-ftc-otos:a0a02d3173"
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.acmerobotics.roadrunner.PoseVelocity2d;
import com.acmerobotics.roadrunner.Vector2d;
import com.acmerobotics.roadrunner.ftc.FlightRecorder;
import com.acmerobotics.roadrunner.ftc.SparkFunOTOSCorrected;
import com.qualcomm.hardware.sparkfun.SparkFunOTOS;
import com.qualcomm.robotcore.hardware.HardwareMap;
import org.firstinspires.ftc.robotcore.external.navigation.AngleUnit;
Expand Down Expand Up @@ -60,12 +61,12 @@ public static class Params {
}

public static SparkFunOTOSDrive.Params PARAMS = new SparkFunOTOSDrive.Params();
public SparkFunOTOS otos;
public SparkFunOTOSCorrected otos;
private Pose2d lastOtosPose = pose;

public SparkFunOTOSDrive(HardwareMap hardwareMap, Pose2d pose) {
super(hardwareMap, pose);
otos = hardwareMap.get(SparkFunOTOS.class,"sensor_otos");
otos = hardwareMap.get(SparkFunOTOSCorrected.class,"sensor_otos");

otos.setLinearUnit(DistanceUnit.INCH);
otos.setAngularUnit(AngleUnit.RADIANS);
Expand Down

0 comments on commit abef3bb

Please sign in to comment.