Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/main' into rcahoon/…
Browse files Browse the repository at this point in the history
…yield-with-value
  • Loading branch information
rcahoon committed Apr 13, 2024
2 parents 3572167 + 5aaaabc commit 8a08dd2
Show file tree
Hide file tree
Showing 92 changed files with 3,672 additions and 1,438 deletions.
8 changes: 3 additions & 5 deletions .pathplanner/settings.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
{
"robotWidth": 0.9,
"robotLength": 0.9,
"robotWidth": 0.97,
"robotLength": 0.97,
"holonomicMode": true,
"pathFolders": [
"gatorade"
],
"pathFolders": [],
"autoFolders": [],
"defaultMaxVel": 3.0,
"defaultMaxAccel": 3.0,
Expand Down
7 changes: 6 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [

{
"type": "java",
"name": "LocalLogReader",
"request": "launch",
"mainClass": "com.team766.web.LocalLogReader"
},
{
"type": "wpilib",
"name": "WPILib Desktop Debug",
Expand Down
53 changes: 28 additions & 25 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id "java"
id 'java-library'
id 'maven-publish'
id "edu.wpi.first.GradleRIO" version "2024.3.1"
id "edu.wpi.first.GradleRIO" version "2024.3.2"
id 'com.diffplug.spotless' version '6.22.0'
id 'com.google.protobuf' version '0.8.19'
}
Expand Down Expand Up @@ -120,6 +120,9 @@ dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.8.2'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

def akitJson = new groovy.json.JsonSlurper().parseText(new File(projectDir.getAbsolutePath() + "/vendordeps/AdvantageKit.json").text)
annotationProcessor "org.littletonrobotics.akit.junction:junction-autolog:$akitJson.version"

// our files
implementation "com.google.protobuf:protobuf-javalite:${protobufVersion}"

Expand Down Expand Up @@ -166,40 +169,40 @@ wpi.java.configureTestTasks(test)
tasks.withType(JavaCompile) {
options.compilerArgs.add '-XDstringConcat=inline'
}
allprojects {
group 'com.team766'
version '2.1.1'

repositories {
mavenCentral()
repositories {
mavenCentral()

gradlePluginPortal() // for protobuf
gradlePluginPortal() // for protobuf

maven { url = uri('https://frcmaven.wpi.edu/artifactory/release/') }
maven { url = uri('https://frcmaven.wpi.edu/artifactory/release/') }

// CTRE
maven { url = uri('https://devsite.ctr-electronics.com/maven/release/') }
// CTRE
maven { url = uri('https://devsite.ctr-electronics.com/maven/release/') }

// REV
maven { url = uri('https://maven.revrobotics.com/') }
// REV
maven { url = uri('https://maven.revrobotics.com/') }

// AdvantageKit
// we're using the credentials documented at
// https://github.com/Mechanical-Advantage/AdvantageKit/blob/main/docs/INSTALLATION.md
maven {
url = uri("https://maven.pkg.github.com/Mechanical-Advantage/AdvantageKit")
credentials {
username = "Mechanical-Advantage-Bot"
password = "\u0067\u0068\u0070\u005f\u006e\u0056\u0051\u006a\u0055\u004f\u004c\u0061\u0079\u0066\u006e\u0078\u006e\u0037\u0051\u0049\u0054\u0042\u0032\u004c\u004a\u006d\u0055\u0070\u0073\u0031\u006d\u0037\u004c\u005a\u0030\u0076\u0062\u0070\u0063\u0051"
}
maven {
url = uri("https://maven.pkg.github.com/Mechanical-Advantage/AdvantageKit")
credentials {
username = "Mechanical-Advantage-Bot"
password = "\u0067\u0068\u0070\u005f\u006e\u0056\u0051\u006a\u0055\u004f\u004c\u0061\u0079\u0066\u006e\u0078\u006e\u0037\u0051\u0049\u0054\u0042\u0032\u004c\u004a\u006d\u0055\u0070\u0073\u0031\u006d\u0037\u004c\u005a\u0030\u0076\u0062\u0070\u0063\u0051"
}
}

//AdvantageKit code
configurations.all {
exclude group: "edu.wpi.first.wpilibj"
}
mavenLocal()
}

configurations.all {
exclude group: "edu.wpi.first.wpilibj"
}

task(checkAkitInstall, dependsOn: "classes", type: JavaExec) {
mainClass = "org.littletonrobotics.junction.CheckInstall"
classpath = sourceSets.main.runtimeClasspath
}
compileJava.finalizedBy checkAkitInstall

spotless {
ratchetFrom 'origin/main' // only check files that have changed relative to main
Expand Down
173 changes: 173 additions & 0 deletions docs/OperatorInterface.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
# Operator Interface

For our [2024 robot](../src/main/java/com/team766/robot/reva/Robot.java), we have controls set up for the [Driver](#driver-controls), [Box Op](#boxop-controls), and for [Debugging](#debug-controls) (eg, in the pit). This document provides an overview for each of our controls.

The top-level code is in [`src/main/java/com/team766/robot/reva/OI.java`](../src/main/java/com/team766/robot/reva/OI.java) and is organized into separate classes for each of the separate sets of controls.

## Driver Controls
Code: [`src/main/java/com/team766/robot/common/DriverOI.java`](../src/main/java/com/team766/robot/common/DriverOI.java).

The driver controls the movement of the robot on the field. They also include game piece manipulation that is best done by the driver, such as shooting a gamepiece towards the target. We use the [Thrustmaster T.16000M](https://www.amazon.com/Guillemot-Thrustmaster-T-16000M-Fcs-Joystick/dp/B01H6KXGEI) joysticks for these controls.

We use the same basic driver controls that we use on any of our swerve-drive based robots. In fact, the code for these controls is in a common directory alongside the [swerve](SwerveDrive.md) [code](../src/main/java/com/team766/robot/common/mechanisms/Drive.java) itself, and may be subclasses to allow for binding game-specific controls (eg binding the left trigger to fire the shooter), though we have not made any such customizations yet.

TODO: consider this customization.

<table style="table-layout: fixed">
<tr>
<td style="width: 50%">
<img src="images/thrustmaster.jpeg" alt="left"/>
</td>
<td style="width: 50%">
<img src="images/thrustmaster.jpeg" alt="right"/>
</td>
</tr>
<tr>
<td><strong>Drive</strong></td>
<td><strong>Steer</strong></td>
</tr>
<tr>
<td><strong>X-axis:</strong> Move forward/backward</td>
<td></td>
</tr>
<tr>
<td><strong>Y-axis:</strong> Move left/right</td>
<td><strong>Y-axis:</strong>Rotate counterclockwise/clockwise</td>
</tr>
<tr>
<td><strong>Button 9</strong>: Reset gyro</td>
<td><strong>Button 1 (Trigger)</strong>: Fine driving<br>(slow down to 25%)</td>
</tr>
<tr>
<td><strong>Button 15</strong>: Reset position (odometry)</td>
<td><strong>Button 3</strong>: Cross wheels</td>
</tr>
<tr>
<td colspan="2"><strong>NOTE: X-axis is up/down, Y-axis is sideways</strong></td>
</tr>
</table>
<div style="page-break-after: always;"></div>

## BoxOp Controls
Code: [`src/main/java/com/team766/robot/reva/BoxOpOI.java`](../src/main/java/com/team766/robot/reva/BoxOpOI.java).

The box operator (box op) controls the manipulation of the non-drive mechanisms on the robot, such the the shoulder, intake, and shooter.

We use a wired Xbox Controller (the Logitech gamepad in Xbox mode also works for testing) for these controls.

<table>
<tr>
<td colspan="2">
<img src="images/xbox.svg" alt="gamepad"/>
</td>
</tr>
<tr>
</tr>
<tr>
<td>A</td>
<td>Move shoulder to floor</td>
</tr>
<tr>
<td>B</td>
<td>Move shoulder to secondary amp shooting position</td>
</tr>
<tr>
<td>X</td>
<td>Move shoulder to medium shooting position</td>
</tr>
<tr>
<td>Y</td>
<td>Move shoulder to amp shooting position.</td>
</tr>
<tr>
<td>DPAD UP</td>
<td>Nudge shoulder up.</td>
</tr>
<tr>
<td>DPAD DOWN</td>
<td>Nudge shoulder down.</td>
</tr>

<tr>
<td>RT</td>
<td>Hold to spin shooter</td>
</tr>

<tr>
<td>LB</td>
<td>Hold to run intake (in)</td>
</tr>
<tr>
<td>RB</td>
<td>Hold to run intake (out)</td>
</tr>
<tr>
<td>A+B+LEFT STICK</td>
<td>Hold buttons + move stick to control left climber</td>
</tr>
<tr>
<td>A+B+RIGHT STICK</td>
<td>Hold buttons + move stick to control right climber</td>
</tr>
<tr>
<td>A+B+C+D*</td>
<td>Hold to override climber soft limits</td>
</tr>
</table>

The face buttons are also mapped to the buttons on the back of the Xbox Elite Controller

<div style="page-break-after: always;"></div>

## Debug Controls
Code: [`src/main/java/com/team766/robot/reva/DebugOI.java`](../src/main/java/com/team766/robot/reva/DebugOI.java).

The debug controls allow us to test each of the individual mechanisms on the robot, for bringup and for pit testing (eg in between matches).

We use a [Megalodon Macro Pad](https://www.amazon.com/KEEBMONKEY-Megalodon-Programmable-Designer-Keyboard/dp/B0C1SV9G9L) with [custom firmware](https://github.com/Team766/qmk_firmware) (providing joystick inputs) for our debug controls.

TODO: put together page with instructions on how to flash the firmware.

<table>
<tr>
<td colspan="2">
<img src="images/kb16.png" alt="macropad"/>
</td>
</tr>
<tr>
<td>1</td>
<td>Hold to control shoulder (with up/down or dials)</td>
</tr>
<tr>
<td>2</td>
<td>Hold to control climber (with up/down or dials)<br>Work in progress.</td>
</tr>
<tr>
<td>3</td>
<td>Hold to run intake (in)</td>
</tr>
<tr>
<td>4</td>
<td>Hold to run shooter. Can speed up and slow down (with up/down or dials).</td>
</tr>
<tr>
<td>7</td>
<td>Hold to run intake (out).</td>
</tr>

<tr>
<td>8</td>
<td>Moves mechanism being controlled (via another button) up.</td>
</tr>

<tr>
<td>12</td>
<td>Moves mechanism being controlled (via another button) down.</td>
</tr>

<tr>
<td>9</td>
<td>Reset relative encoders on shoulder.</td>
</tr>

</table>
Binary file added docs/images/kb16.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 docs/images/thrustmaster.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 8a08dd2

Please sign in to comment.