Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test/swerve 2023 #35

Draft
wants to merge 84 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
e2e4ac8
add swerve drive motors to actuator interface
danielbrownmsm Dec 24, 2022
4d65374
add swerve drive absolute steering encoders to sensor interface
danielbrownmsm Dec 24, 2022
e8767c6
create swerve drive hardware interface per #11
danielbrownmsm Dec 24, 2022
b5f4cb8
created swerve drive IO per #11
danielbrownmsm Dec 24, 2022
8cc8137
fixes bug with drive config from last commit
danielbrownmsm Dec 24, 2022
3244231
adds swerve drive parameters to the parameters.toml file per #11
danielbrownmsm Dec 27, 2022
60a2d43
add swerve drive to RobotContainer per #11
danielbrownmsm Dec 27, 2022
3b0fe4f
add swerve drive to RobotContainer header per #11
danielbrownmsm Dec 27, 2022
e8fe72e
created SwerveModule classes, need to be fleshed out
danielbrownmsm Dec 31, 2022
696c850
finised adding WPILib swerve support to SwerveDrive subsystem
danielbrownmsm Dec 31, 2022
a5846dd
fixes swerve drive initialization in RobotContainer
danielbrownmsm Dec 31, 2022
b1e56d1
fixes swerve drive subsystem constructor
danielbrownmsm Dec 31, 2022
688361a
instantiates swerve drive kinematics and swerve drive odometry
danielbrownmsm Dec 31, 2022
24e7e39
Merge branch 'master' into feat/swerve-drive-support
danielbrownmsm Dec 31, 2022
32f9628
remove ServeModule class as it was never written and it turns out we …
danielbrownmsm Dec 31, 2022
9cc17d2
Merge branch 'feat/swerve-drive-support' of https://github.com/Team-O…
danielbrownmsm Dec 31, 2022
f43a456
added swerve drive PID constants
danielbrownmsm Jan 2, 2023
ded7317
fixed SwerveDrive.h default constructors, added PID controllers
danielbrownmsm Jan 2, 2023
076b762
created actual swerve I/O motor outputs
danielbrownmsm Jan 2, 2023
a0aad18
added drive and steer PID controllers, fleshed out TeleOpDrive method
danielbrownmsm Jan 2, 2023
9db4fa1
created swerve module class
danielbrownmsm Jan 3, 2023
06b330d
fix swerve module not actually having a way to set its physical location
danielbrownmsm Jan 3, 2023
5b66c7b
added velocity readings to swerve software interface
danielbrownmsm Jan 3, 2023
20f607e
fix destructor
danielbrownmsm Jan 3, 2023
219fa28
set outputs in sw_interface
danielbrownmsm Jan 3, 2023
1ee7e1e
added absolute encoders to hardware interface
danielbrownmsm Jan 4, 2023
a120dd9
created teleop and auto commands for the swerve drive
danielbrownmsm Jan 4, 2023
2a95107
add steering absolute encoders to swerve drive i/o. ticket: #11
danielbrownmsm Jan 4, 2023
b6f1e0b
fix swerve module constructor
danielbrownmsm Jan 4, 2023
2088ee6
added swerve drive shuffleboard values to the UI class
danielbrownmsm Jan 4, 2023
f98b32b
make AutoSwerveCommand use Pose2d instead of a Translation2d and a Ro…
danielbrownmsm Jan 6, 2023
5982eec
add SetPID methods to SwerveModule
danielbrownmsm Jan 6, 2023
7e782da
add a bunch of auto methods and variables and an enum to SwerveDrive …
danielbrownmsm Jan 6, 2023
71159af
remove tele-op input cubing, add strafe_power and fix it
danielbrownmsm Jan 6, 2023
e2b7042
add shuffleboard, SwerveModule class usage, and a bunch of auton suff…
danielbrownmsm Jan 6, 2023
8b61304
made code build
danielbrownmsm Jan 6, 2023
02cab8d
imported into beta-7
danielbrownmsm Jan 6, 2023
5675e2d
Merge remote-tracking branch 'FRC-2022-CPP/master' into feat/swerve-d…
danielbrownmsm Jan 6, 2023
0f84f34
fix shuffleboard changing to pointers because WPILib
danielbrownmsm Jan 6, 2023
0ac7893
update to 2023
danielbrownmsm Jan 6, 2023
39e5911
add OKC_CHECKs to swerve drive hardware when we set up the swerve dri…
danielbrownmsm Jan 6, 2023
206c3b5
disable desktop support for faster builds
danielbrownmsm Jan 6, 2023
99be727
added OKC_CHECK to hw_interface_ motors in UpdateDriveConfig
danielbrownmsm Jan 6, 2023
2dd5527
OKC_CHECK upgrades (#34)
jkleiber Jan 6, 2023
16bb338
add steering sensor ports to SensorInterface
danielbrownmsm Jan 7, 2023
cdfa57c
add swerve drive motor definitions
danielbrownmsm Jan 7, 2023
8df362c
add swerve drive tele-op command
danielbrownmsm Jan 7, 2023
f87efb9
comment out everything not related to the swerve drive, actually crea…
danielbrownmsm Jan 7, 2023
e58d6f9
random update to settings.json
danielbrownmsm Jan 7, 2023
6d17546
make all of swerve drive's stuff use shared pointers
danielbrownmsm Jan 7, 2023
777d3cd
add missing return statement to SetupSwerveDriveInterface
danielbrownmsm Jan 7, 2023
f7c4fc9
initialize swerve drive, fix swerve drive drive and steer vel encoders
danielbrownmsm Jan 11, 2023
dd567df
add drive encoders to hardware interface
danielbrownmsm Jan 11, 2023
3fd4427
fix encoder readings in swerve IO and add a lot more OKC_CHECKs
danielbrownmsm Jan 11, 2023
9821f11
add more OKC_CHECK stuff
danielbrownmsm Jan 11, 2023
3b917c6
remove feedforward
danielbrownmsm Jan 11, 2023
8ea2bfd
change swerve encoders to SparkMaxRelativeEncoder instead of just Rel…
danielbrownmsm Jan 11, 2023
73e573d
kill everything that isn't swerve drive (and drivetrain) with fire
danielbrownmsm Jan 12, 2023
f99b5e5
kill the drivetrain with fire too
danielbrownmsm Jan 12, 2023
def02ee
missed an ember
danielbrownmsm Jan 12, 2023
68cfde3
delete drivetrain test
danielbrownmsm Jan 12, 2023
6dd95e4
remove everything but swerve from parameters.toml
danielbrownmsm Jan 12, 2023
2540464
more OKC_CHECKs
danielbrownmsm Jan 12, 2023
f822f75
fix nullptr and OKC_CHECK fails and segfaulting etc etc
danielbrownmsm Jan 12, 2023
0dc0b81
saved/created shuffleboard layout
danielbrownmsm Jan 13, 2023
66e3cc0
remove button bindings not related to swerve, change absolute encoder…
danielbrownmsm Jan 13, 2023
f864c3f
remove all non-swerve shuffleboard
danielbrownmsm Jan 13, 2023
ac20ccb
make swerve modules PID controllers pointers
danielbrownmsm Jan 13, 2023
854ae99
more OKC_CHECK stuff in SwerveDrive
danielbrownmsm Jan 13, 2023
5bf530e
remove non swerve buttons
danielbrownmsm Jan 13, 2023
142ee7b
attempt to tune PIDs
danielbrownmsm Jan 13, 2023
31cc711
fix absolute encoder readings in swerve IO
danielbrownmsm Jan 13, 2023
afc8463
swap to dump tele op drive for now
danielbrownmsm Jan 13, 2023
47be45e
add a method to SwerveModule to bypass WPILib's crap and do manual an…
danielbrownmsm Jan 15, 2023
29cc14e
fix gamepad axes for TeleOp
danielbrownmsm Jan 15, 2023
f87efb5
manually implement turning in teleop for SwerveDrive subsystem
danielbrownmsm Jan 15, 2023
fdb33f9
reset relative encoders in RestSteerEncoders() (for velocity)
danielbrownmsm Jan 15, 2023
8e7fada
tune swerve PIDs, add absolute encoder offsets
danielbrownmsm Jan 15, 2023
35ba055
continuous input for steer PID, added absolute encoder offsets, a man…
danielbrownmsm Jan 15, 2023
2219822
fixed steer pid
danielbrownmsm Jan 17, 2023
b69605b
tried to implement strafing and better turning, added more VOKC_CALLs…
danielbrownmsm Jan 17, 2023
eca2f81
revert back to working code
danielbrownmsm Jan 17, 2023
29d0f2c
documentation!
danielbrownmsm Jan 17, 2023
b860d7e
add random chief delphi math controls to the swerve drive
danielbrownmsm Jan 18, 2023
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 .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: [ master ]
pull_request:
branches: [ '*' ]
branches: [ '**' ]
jobs:
# This workflow contains a single job called "build"
build:
Expand Down
16 changes: 15 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,20 @@
"hash_set": "cpp",
"filesystem": "cpp",
"*.inc": "cpp",
"charconv": "cpp"
"charconv": "cpp",
"ios": "cpp",
"xfacet": "cpp",
"xiosbase": "cpp",
"xlocale": "cpp",
"xlocinfo": "cpp",
"xlocmon": "cpp",
"xlocnum": "cpp",
"xloctime": "cpp",
"xmemory": "cpp",
"xstddef": "cpp",
"xstring": "cpp",
"xtr1common": "cpp",
"xtree": "cpp",
"xutility": "cpp"
}
}
2 changes: 1 addition & 1 deletion .wpilib/wpilib_preferences.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"enableCppIntellisense": true,
"currentLanguage": "cpp",
"projectYear": "2023Beta",
"projectYear": "2023",
"teamNumber": 2718
}
83 changes: 2 additions & 81 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import org.gradle.internal.os.OperatingSystem

plugins {
id "cpp"
id "google-test-test-suite"
id "edu.wpi.first.GradleRIO" version "2023.1.1-beta-7"
id "edu.wpi.first.GradleRIO" version "2023.1.1"
}

// Define my targets (RoboRIO) and artifacts (deployable files)
Expand Down Expand Up @@ -38,7 +36,7 @@ deploy {
def deployArtifact = deploy.targets.roborio.artifacts.frcCpp

// Set this to true to enable desktop support.
def includeDesktopSupport = true
def includeDesktopSupport = false

// Set to true to run simulation in debug mode
wpi.cpp.debugSimulation = false
Expand Down Expand Up @@ -99,80 +97,3 @@ model {
}
}
}

task copyDeployDir {
String prefix = 'test-results/frcUserProgramTest/'
String suffix = 'src/main/deploy'

// println prefix + "platform/version/" + suffix
// println OperatingSystem.current()

if(OperatingSystem.current().isWindows()){
// println "COPYING DEPLOY FOR WINDOWS"
// println "SRC: " + project.fileTree('src/main/deploy')
// println "TO"
// Copy debug
copy {
from project.fileTree('src/main/deploy')
into layout.buildDirectory.dir(prefix + "windowsx86-64/debug/" + suffix)
}
// Copy release
copy {
from project.fileTree('src/main/deploy')
into layout.buildDirectory.dir(prefix + "windowsx86-64/release/" + suffix)
}
// println layout.buildDirectory.dir("")
// println prefix + "windowsx86-64/debug/" + suffix
// println prefix + "windowsx86-64/release/" + suffix
// println 'Copied Windows configuration'

} else {
// println "COPYING DEPLOY FOR LINUX"
// println "SRC: " + project.fileTree('src/main/deploy')
// println "TO"
// Linux Athena
// Copy debug
copy {
from project.fileTree('src/main/deploy')
into layout.buildDirectory.dir(prefix + "linuxathena/debug/" + suffix)
}
// Copy release
copy {
from project.fileTree('src/main/deploy')
into layout.buildDirectory.dir(prefix + "linuxathena/release/" + suffix)
}
// println layout.buildDirectory.dir("")
// println prefix + "linuxathena/debug/" + suffix
// println prefix + "linuxathena/release/" + suffix

// Linux x86-64
// Copy debug
copy {
from project.fileTree('src/main/deploy')
into layout.buildDirectory.dir(prefix + "linuxx86-64/debug/" + suffix)
}
// Copy release
copy {
from project.fileTree('src/main/deploy')
into layout.buildDirectory.dir(prefix + "linuxx86-64/release/" + suffix)
}

// println prefix + "linuxx86-64/release/" + suffix
// println prefix + "linuxx86-64/debug/" + suffix
// println 'Copied Linux configuration'
}

}

// Copy the deploy/ folder when doing unit tests (check) in order to load things like parameters.
check.dependsOn {
tasks.findAll {
task -> task.name.startsWith('copyDeployDir')
}
}

build.dependsOn {
tasks.findAll {
task -> task.name.startsWith('copyDeployDir')
}
}
245 changes: 245 additions & 0 deletions shuffleboard.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,245 @@
{
"tabPane": [
{
"title": "swerve",
"autoPopulate": false,
"autoPopulatePrefix": "",
"widgetPane": {
"gridSize": 128.0,
"showGrid": true,
"hgap": 16.0,
"vgap": 16.0,
"titleType": 0,
"tiles": {
"6,1": {
"size": [
1,
1
],
"content": {
"_type": "Text View",
"_source0": "network_table:///Shuffleboard/SwerveDrive/Distance kD",
"_title": "Shuffleboard/SwerveDrive/Distance kD",
"_glyph": 148,
"_showGlyph": false
}
},
"5,1": {
"size": [
1,
1
],
"content": {
"_type": "Text View",
"_source0": "network_table:///Shuffleboard/SwerveDrive/Distance kI",
"_title": "Shuffleboard/SwerveDrive/Distance kI",
"_glyph": 148,
"_showGlyph": false
}
},
"4,1": {
"size": [
1,
1
],
"content": {
"_type": "Text View",
"_source0": "network_table:///Shuffleboard/SwerveDrive/Distance kP",
"_title": "Shuffleboard/SwerveDrive/Distance kP",
"_glyph": 148,
"_showGlyph": false
}
},
"10,1": {
"size": [
1,
1
],
"content": {
"_type": "Text View",
"_source0": "network_table:///Shuffleboard/SwerveDrive/Heading",
"_title": "Shuffleboard/SwerveDrive/Heading",
"_glyph": 148,
"_showGlyph": false
}
},
"11,1": {
"size": [
1,
1
],
"content": {
"_type": "Toggle Button",
"_source0": "network_table:///Shuffleboard/SwerveDrive/Reset Gyro",
"_title": "Shuffleboard/SwerveDrive/Reset Gyro",
"_glyph": 148,
"_showGlyph": false
}
},
"7,1": {
"size": [
1,
1
],
"content": {
"_type": "Toggle Button",
"_source0": "network_table:///Shuffleboard/SwerveDrive/Save",
"_title": "Shuffleboard/SwerveDrive/Save",
"_glyph": 148,
"_showGlyph": false
}
},
"6,2": {
"size": [
1,
1
],
"content": {
"_type": "Text View",
"_source0": "network_table:///Shuffleboard/SwerveDrive/Steer kD",
"_title": "Shuffleboard/SwerveDrive/Steer kD",
"_glyph": 148,
"_showGlyph": false
}
},
"5,2": {
"size": [
1,
1
],
"content": {
"_type": "Text View",
"_source0": "network_table:///Shuffleboard/SwerveDrive/Steer kI",
"_title": "Shuffleboard/SwerveDrive/Steer kI",
"_glyph": 148,
"_showGlyph": false
}
},
"4,2": {
"size": [
1,
1
],
"content": {
"_type": "Text View",
"_source0": "network_table:///Shuffleboard/SwerveDrive/Steer kP",
"_title": "Shuffleboard/SwerveDrive/Steer kP",
"_glyph": 148,
"_showGlyph": false
}
},
"7,2": {
"size": [
1,
1
],
"content": {
"_type": "Toggle Button",
"_source0": "network_table:///Shuffleboard/SwerveDrive/Write Mode",
"_title": "Shuffleboard/SwerveDrive/Write Mode",
"_glyph": 148,
"_showGlyph": false
}
},
"4,4": {
"size": [
1,
1
],
"content": {
"_type": "Text View",
"_source0": "network_table:///Shuffleboard/SwerveDrive/avg dist",
"_title": "Shuffleboard/SwerveDrive/avg dist",
"_glyph": 148,
"_showGlyph": false
}
},
"5,4": {
"size": [
1,
1
],
"content": {
"_type": "Text View",
"_source0": "network_table:///Shuffleboard/SwerveDrive/left avg dist",
"_title": "Shuffleboard/SwerveDrive/left avg dist",
"_glyph": 148,
"_showGlyph": false
}
},
"9,4": {
"size": [
1,
1
],
"content": {
"_type": "Text View",
"_source0": "network_table:///Shuffleboard/SwerveDrive/left back steer",
"_title": "Shuffleboard/SwerveDrive/left back steer",
"_glyph": 148,
"_showGlyph": false
}
},
"9,3": {
"size": [
1,
1
],
"content": {
"_type": "Text View",
"_source0": "network_table:///Shuffleboard/SwerveDrive/left front steer",
"_title": "Shuffleboard/SwerveDrive/left front steer",
"_glyph": 148,
"_showGlyph": false
}
},
"6,4": {
"size": [
1,
1
],
"content": {
"_type": "Text View",
"_source0": "network_table:///Shuffleboard/SwerveDrive/right avg dist",
"_title": "Shuffleboard/SwerveDrive/right avg dist",
"_glyph": 148,
"_showGlyph": false
}
},
"10,3": {
"size": [
1,
1
],
"content": {
"_type": "Text View",
"_source0": "network_table:///Shuffleboard/SwerveDrive/right front steer",
"_title": "Shuffleboard/SwerveDrive/right front steer",
"_glyph": 148,
"_showGlyph": false
}
},
"10,4": {
"size": [
1,
1
],
"content": {
"_type": "Text View",
"_source0": "network_table:///Shuffleboard/SwerveDrive/right back steer",
"_title": "Shuffleboard/SwerveDrive/right back steer",
"_glyph": 148,
"_showGlyph": false
}
}
}
}
}
],
"windowGeometry": {
"x": -8.0,
"y": -8.0,
"width": 1936.0,
"height": 1048.0
}
}
Loading