Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'
classpath 'com.android.tools.build:gradle:7.2.0'


// NOTE: Do not place your application dependencies here; they belong
Expand Down
96 changes: 96 additions & 0 deletions doc/HubTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
package org.firstinspires.ftc.teamcode;

import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
import com.qualcomm.robotcore.util.RobotLog;

import org.openftc.i2cdrivers.SRSHub;

@TeleOp(name = "HubTest")
public class HubTest extends LinearOpMode {
public void runOpMode() throws InterruptedException {
// All ports default to NONE, buses default to empty
SRSHub.Config config = new SRSHub.Config();

config.setEncoder(
1,
SRSHub.Encoder.PWM
);

config.setEncoder(
2,
SRSHub.Encoder.QUADRATURE
);

config.addI2CDevice(
1,
new SRSHub.GoBildaPinpoint(
-50,
-75,
19.89f,
SRSHub.GoBildaPinpoint.EncoderDirection.FORWARD,
SRSHub.GoBildaPinpoint.EncoderDirection.FORWARD
)
);

RobotLog.clearGlobalWarningMsg();

SRSHub hub = hardwareMap.get(
SRSHub.class,
"srshub"
);

hub.init(config);

while (!hub.ready());

waitForStart();

while (opModeIsActive() && !isStopRequested()) {
hub.update();

if (hub.disconnected()) {
telemetry.addLine("srshub disconnected");
} else {
telemetry.addData(
"encoder 1 position",
hub.readEncoder(1).position
);

telemetry.addData(
"encoder 2 position",
hub.readEncoder(2).position
);

telemetry.addData(
"encoder 2 velocity",
hub.readEncoder(2).velocity
);

SRSHub.GoBildaPinpoint pinpoint = hub.getI2CDevice(
1,
SRSHub.GoBildaPinpoint.class
);

if (!pinpoint.disconnected) {
telemetry.addData(
"pose x (mm)",
pinpoint.xPosition
);

telemetry.addData(
"pose y (mm)",
pinpoint.yPosition
);

telemetry.addData(
"pose heading (rad)",
pinpoint.hOrientation
);
}
}

telemetry.update();
}
}
}
Binary file added doc/images/build-output.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/onbot-external.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/onbot-upload.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Sep 18 10:38:36 EDT 2020
#Sun Sep 14 17:54:27 EDT 2025
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
Loading