Skip to content

Commit

Permalink
Sync with GRRBase
Browse files Browse the repository at this point in the history
  • Loading branch information
bryceroethel committed Jan 31, 2024
1 parent 3d018d1 commit e7a5724
Show file tree
Hide file tree
Showing 52 changed files with 2,032 additions and 1,175 deletions.
1 change: 0 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"streetsidesoftware.code-spell-checker",
"vscjava.vscode-java-debug",
"vscjava.vscode-java-pack",
"github.vscode-github-actions",
"visualstudioexptteam.vscodeintellicode",
"visualstudioexptteam.intellicode-api-usage-examples",
"visualstudioexptteam.vscodeintellicode-completions",
Expand Down
11 changes: 2 additions & 9 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Main",
"request": "launch",
"mainClass": "org.team340.robot.Main",
"projectName": "Crescendo2024-340"
},
{
"type": "wpilib",
"name": "WPILib Desktop Debug",
"request": "launch",
"desktop": true
"desktop": true,
},
{
"type": "wpilib",
"name": "WPILib roboRIO Debug",
"request": "launch",
"desktop": false
"desktop": false,
}
]
}
13 changes: 10 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"java.configuration.updateBuildConfiguration": "automatic",
"java.debug.settings.onBuildFailureProceed": true,
"java.server.launchMode": "Standard",
"files.exclude": {
"**/.git": true,
Expand Down Expand Up @@ -48,8 +49,8 @@
"Desaturated",
"Desaturation",
"Devs",
"Discretize",
"Discretization",
"Discretize",
"DTheta",
"Falsi",
"Feedforward",
Expand All @@ -61,15 +62,18 @@
"Interpolatable",
"JoystickProfiles",
"Keepalive",
"Lerp",
"Motorcontrol",
"Msgpack",
"NetworkTables",
"NTURI",
"Odometry",
"Overcurrent",
"PIDF",
"Powerup",
"Pubuid",
"Protobuf",
"Pubuid",
"Quasistatic",
"Ratelimiter",
"Ratelimits",
"Regula",
Expand All @@ -82,14 +86,17 @@
"TalonSRX",
"Tauri",
"Teleop",
"Topicsonly",
"Traj",
"Unannounce",
"Unsub",
"Unsubscriber",
"Unsubscribers",
"Vbat",
"WPIBlue",
"WPILib",
"WPILibJ",
"WPIRed"
"WPIRed",
"Writables"
]
}
30 changes: 2 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,2 @@
# GRRBase
A template repository for Java-based robots in the FIRST Robotics Competition. It contains boilerplate for programming with WPILib's command framework, as well as utilities outlined in the packages section below. Additionally, this repository contains GRRDashboard, a Svelte-based dashboard for interacting with and analyzing functions of the robot via Network Tables.

## Code Styling
All Java code follows the styling guide of [Prettier](https://prettier.io/). You can apply these rules via [Spotless](https://github.com/diffplug/spotless/tree/main) using the command `./gradlew spotlessApply`

## Packages

### `org.team340.lib`
Contains an extended subsystem that automatically logs hardware information, as well as bindings to our custom dashboard.

### `org.team340.lib.commands`
Contains a builder class for creating inline commands with a similar API to subclassed commands.

### `org.team340.lib.controller`
Contains a joystick profiler for controllers, as well as a wrapper class for WPILib's `XboxController` class.

### `org.team340.lib.swerve`
Contains a hardware agnostic swerve library with extra features such as a rate limiter that respects the kinematic constraints of the robot.

### `org.team340.lib.utils`
Contains various utility classes.

### `org.team340.lib.utils.config`
Contains various wrapper classes for saving constants.

### `org.team340.lib.utils.config.rev`
Contains configuration builders that safely apply settings to REV hardware.
# Crescendo2024-340
FRC 340's code for the 2024 season, Crescendo.
13 changes: 0 additions & 13 deletions Swerve.md

This file was deleted.

2 changes: 1 addition & 1 deletion WPILib-License.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2009-2023 FIRST and other WPILib contributors
Copyright (c) 2009-2024 FIRST and other WPILib contributors
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id "java"
id "edu.wpi.first.GradleRIO" version "2024.1.1"
id "edu.wpi.first.GradleRIO" version "2024.2.1"
id "com.diffplug.spotless" version "6.23.3"
}

Expand Down Expand Up @@ -70,6 +70,8 @@ dependencies {

testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'

implementation 'com.google.code.gson:gson:2.10.1'
}

// Code formatting via spotless
Expand Down
6 changes: 3 additions & 3 deletions dashboard/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
--good: #28cd41;
--bad: #ff453a;

--auto-spline: #ffffffc9;
--auto-cp-red: #a20010;
--auto-cp-blue: #0048a7;
--auto-line: #ffffffc9;
--auto-waypoint-red: #a20010;
--auto-waypoint-blue: #0048a7;

--graph-grid: #ffffff5b;
--graph-red: #ff453a;
Expand Down
24 changes: 12 additions & 12 deletions dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@
"check": "svelte-check --tsconfig ./tsconfig.json",
"dev": "vite",
"dev:tauri": "tauri dev",
"format": "prettier --write --plugin prettier-plugin-svelte .",
"format:check": "prettier --check --plugin prettier-plugin-svelte .",
"format": "prettier --write --plugin prettier-plugin-svelte ./src/",
"format:check": "prettier --check --plugin prettier-plugin-svelte ./src/",
"preview": "vite preview",
"tauri": "tauri"
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^2.4.6",
"@tauri-apps/cli": "^1.5.6",
"@sveltejs/vite-plugin-svelte": "^3.0.1",
"@tauri-apps/cli": "^1.5.9",
"@tsconfig/svelte": "^5.0.2",
"chart.js": "^4.4.0",
"chart.js": "^4.4.1",
"chartjs-plugin-zoom": "^2.0.1",
"prettier": "^3.0.3",
"prettier-plugin-svelte": "^3.0.3",
"svelte": "^4.2.2",
"svelte-check": "^3.5.2",
"tslib": "^2.6.1",
"typescript": "^5.2.2",
"vite": "^4.5.0"
"prettier": "^3.2.4",
"prettier-plugin-svelte": "^3.1.2",
"svelte": "^4.2.9",
"svelte-check": "^3.6.3",
"tslib": "^2.6.2",
"typescript": "^5.3.3",
"vite": "^5.0.12"
},
"private": true
}
11 changes: 4 additions & 7 deletions dashboard/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
import ConnectingDialog from "./components/ConnectingDialog.svelte";
import NavBar from "./components/NavBar.svelte";
import Analysis from "./tabs/Analysis.svelte";
import AutoSelection from "./tabs/AutoSelection.svelte";
import DriverView from "./tabs/DriverView.svelte";
import { NTConnected, RobotEnabled } from "./ntStores";
import { NTConnected } from "./ntStores";
import { NTSvelteClientState } from "./lib/NTSvelte";
// Define your tabs here.
// The navbar will be automatically populated using this object, and tabs will be dynamically displayed when selected.
Expand All @@ -17,7 +17,6 @@
const tabs = {
"Driver View": DriverView,
"Auto Selection": AutoSelection,
Analysis: Analysis,
};
// Helpers for tab selection.
Expand All @@ -28,10 +27,8 @@
</script>

<main>
{#if $NTConnected || IGNORE_CONNECTION}
<!-- If connected, show the current tab and the navbar. -->
<p>{$RobotEnabled}</p>

<!-- If connected, show the current tab and the navbar. -->
{#if $NTConnected === NTSvelteClientState.CONNECTED || IGNORE_CONNECTION}
<!-- The selected tab. -->
<div class="tab">
<svelte:component this="{tabs[currentTab]}" />
Expand Down
Binary file modified dashboard/src/assets/field22.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 dashboard/src/assets/field23.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 dashboard/src/assets/field24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion dashboard/src/components/NavBar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
<code class="nav-bar-connection-address" contenteditable on:blur="{onURIBlur}">{$NTURI}</code>

<!-- NT Connection Stats. -->
<code>{$NTBitrate}kb/s | {$NTLatency}ms</code>
<code>{($NTBitrate / 1000).toFixed(2)}kb/s | {$NTLatency.toFixed(2)}ms</code>
</div>
</div>
</div>
Expand Down
65 changes: 0 additions & 65 deletions dashboard/src/components/analysis/Field.svelte

This file was deleted.

Loading

0 comments on commit e7a5724

Please sign in to comment.