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

Rewrote the Entire Control System (and command flow) 😎 ✌️ #283

Open
wants to merge 163 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
163 commits
Select commit Hold shift + click to select a range
a841423
Removed comment
zbuster05 Mar 1, 2022
5cbd08d
Merge https://github.com/RoboticsTeam4904/standard into HEAD
zbuster05 Mar 1, 2022
da70865
rewrite UDP implementation
aemino Mar 22, 2022
abe7a66
merge with main
aemino Mar 25, 2022
8a55e0e
add time conversion factor utility
aemino Mar 25, 2022
f5e51e2
improve CANTalonEncoder limit switch getter methods
aemino Mar 25, 2022
49f0a2e
Merge remote-tracking branch 'origin' into HEAD
zbuster05 Apr 3, 2022
bcf47a2
That was hard
zbuster05 Apr 3, 2022
726bb4c
init from driver station
roboticsteam4904-2 Jan 15, 2023
7885cfb
Added odometry to SimpleSplines
Jm0rr Jan 16, 2023
97365a3
Now logs yaw on b press
Jm0rr Jan 16, 2023
92a9a77
hopefully splines fixed
Jan 21, 2023
dc2b259
Merge https://github.com/RoboticsTeam4904/standard into HEAD
Jm0rr Jan 21, 2023
be25438
Merge branch 'udp-rewrite' of https://github.com/RoboticsTeam4904/sta…
Jm0rr Jan 21, 2023
39fff8f
Reverted extraneous logging
zbuster05 Jan 21, 2023
cef9918
reformat simple slines
roboticsteam4904-2 Jan 27, 2023
dbd6919
Merge branch 'splines-test-2023' of https://github.com/RoboticsTeam49…
roboticsteam4904-2 Jan 27, 2023
2b48fa9
finish reformatting simple splines
Exr0n Jan 27, 2023
972a042
log intended and actual trajectory in simpleSplines
Exr0n Jan 27, 2023
7e409f2
upgrade to 2023
Exr0n Feb 1, 2023
f21e07a
HID triggers: delete CustomXBoxController; add CustomCommandJoystick
Exr0n Feb 1, 2023
cb14ea6
TO UNDO: jankily delete broken things
Exr0n Feb 1, 2023
9d7311b
fix sensordrive
Exr0n Feb 4, 2023
124321e
remove RunAllParallel, RunAllSequential, RunFor; use wpilib
Exr0n Feb 7, 2023
cd3397a
custom MotorController interface to force better setVoltage
Exr0n Feb 7, 2023
2227980
new MotorSubsystem replaces Motor.java and commands
Exr0n Feb 7, 2023
36d0f7d
clarify MotorSubsystem docstring
Exr0n Feb 7, 2023
02f1fa0
remove Controller interface; use upcoming EZMotion
Exr0n Feb 7, 2023
ce3cbcb
BrakeableMotorSubsystem/Controller; remove MotorBrake
Exr0n Feb 7, 2023
d4bbca6
MotorSubsystem.c_setVoltageHold; docstring warnings
Exr0n Feb 7, 2023
fc4d8d8
clear warnings by removing unused imports and extends
Exr0n Feb 7, 2023
eadb0b1
replace limit switch with new Trigger; clear more warnings; deprecate…
Exr0n Feb 7, 2023
7ab3647
convert chassis code from Motor to MotorSubsystem
Exr0n Feb 8, 2023
5d4cc7a
force passing neutralMode and inverted to CANTalonFX/SRX
Exr0n Feb 12, 2023
55d0dfa
Deleted old PID workflow and added
zbuster05 Feb 15, 2023
382a5c7
delete chassis
Exr0n Feb 15, 2023
9c93b1e
solidify setBrakeOnNeutral naming; brakable motor subsys default cmd
Exr0n Feb 15, 2023
7c0e3bd
delete motorController .get; TalonMotorController
Exr0n Feb 15, 2023
d7f65dd
Merge branch '2023-vssimple-testing' of https://github.com/RoboticsTe…
Exr0n Feb 15, 2023
62b414b
cannot builder pattern on TalonMC.follow bc name collision
Exr0n Feb 15, 2023
989e228
brakeableMotorSubsys use this.runOnce to auto-require
Exr0n Feb 15, 2023
a9cb241
TalonMotorController extend IMotorControllerEnhanced; test followed b…
Exr0n Feb 15, 2023
2956414
make MotorSubsys and BrakeMotorSubsys generic
Exr0n Feb 17, 2023
bbcd23b
move neutralMode, neutralDeadband to motorsubsys; voltagecomp and lim…
Exr0n Feb 17, 2023
a5dbf5f
added custom spark max class (incomplete)
henryharms Feb 17, 2023
eaa3d48
remove old neutralMode and deadbandPercent constructor on cantalonsrx…
Exr0n Feb 17, 2023
6237b64
Merge branch '2023-vssimple-testing' of https://github.com/RoboticsTe…
Exr0n Feb 17, 2023
894b752
eeeeeeeeeeeeeeeee (that took far too long)
zbuster05 Feb 17, 2023
b4d6ace
delete motorSubsystem.get()
Exr0n Feb 17, 2023
717a76a
talonmotorsubsystem neutraldeadband by default; docs
Exr0n Feb 17, 2023
1935c07
Merge branch '2023-vssimple-testing' of https://github.com/RoboticsTe…
zbuster05 Feb 17, 2023
d2c6d27
Merge branch '2023-vssimple-testing' of https://github.com/RoboticsTe…
zbuster05 Feb 17, 2023
5f9b8f9
Forgot to change package lines
zbuster05 Feb 17, 2023
971d39a
reorganize files harder
Exr0n Feb 17, 2023
9b274ca
pid sensor setup
roboticsteam4904-2 Feb 28, 2023
1a5f5f9
snap: partial plumbing sparkmax to talon interface
Exr0n Mar 1, 2023
a66fa9e
undo sparkmax extends talons; just make SparkMaxMotorController instead
roboticsteam4904-2 Mar 1, 2023
2175773
UT: SparkMax, mv to SmartMotorController
Exr0n Mar 1, 2023
957950b
make smartMotorController extend WPILIB::MotorController
roboticsteam4904-2 Mar 1, 2023
f7519ee
UT chassis; smartmotorsubsystem interface methods
Exr0n Mar 2, 2023
40887e2
replace MotorPos/Vel; WestCoastDrive partial feature parity
Exr0n Mar 2, 2023
b7bd4f1
make constructor public
Exr0n Mar 2, 2023
f16c2c8
use MotorControllerType instead of SMC for clarity
Exr0n Mar 3, 2023
a4747d2
UT: smartmotorsubsys, sparkmax dynamic motion profiling
Exr0n Mar 3, 2023
bcd8769
config software limit
Exr0n Mar 3, 2023
d679a67
m
roboticsteam4904-2 Mar 3, 2023
ef50bdf
fill in some motionmagic methods on talonmotorsubsystem
Exr0n Mar 4, 2023
cc66a49
Filled out talon Todos
Jm0rr Mar 4, 2023
4877792
finished more todos
Jm0rr Mar 4, 2023
e168832
WestCoastDrive Chassis Minimum Distance.
syllars Mar 4, 2023
f448b4f
Merge branch 'ctrls-rewrite' of https://github.com/RoboticsTeam4904/s…
syllars Mar 4, 2023
c164a99
add new variables to configpidf
Jm0rr Mar 5, 2023
69bb332
Merge branch 'ctrls-rewrite' of https://github.com/RoboticsTeam4904/s…
Jm0rr Mar 5, 2023
970d092
Add ChassisTurn to west coast drive
Jm0rr Mar 5, 2023
881ff0a
talon softlimits
Exr0n Mar 9, 2023
f807058
UT: telescoping arm feedforward
Exr0n Mar 12, 2023
daa1510
deprecate old code; rm sensor .get()
Exr0n Mar 12, 2023
b48cf3a
pathplanner autonomous westcoastdrive
Exr0n Mar 12, 2023
96ab2c7
fix talon setVoltage w/ voltagecomp; simplify talonMC
Exr0n Mar 12, 2023
053aa18
westcoastdrive pathplannercommand use Map
Exr0n Mar 12, 2023
d78f866
CommandSendableChooser use command over commandBase
Exr0n Mar 12, 2023
3cd0500
whitespace
Exr0n Mar 12, 2023
01ece4e
ez motion
zbuster05 Mar 12, 2023
b39a520
Merge branch 'ctrls-rewrite' of https://github.com/RoboticsTeam4904/s…
zbuster05 Mar 12, 2023
28f88ad
made stuff protected and added setvoltage polymorphism
Jm0rr Mar 12, 2023
5406fd3
Merge branch 'ctrls-rewrite' of https://github.com/RoboticsTeam4904/s…
Jm0rr Mar 12, 2023
de513fe
remove brakeablemotorcontroller
roboticsteam4904-2 Mar 12, 2023
709b0fd
make thing public
roboticsteam4904-2 Mar 12, 2023
795f611
change navx to ahrs and change smartmotorsubsystem to generic
Jm0rr Mar 12, 2023
d407426
de-generic westcoastdrive
Exr0n Mar 13, 2023
4ffe59b
deprecate WCD pathplanner spline factory
Exr0n Mar 14, 2023
9ffb6a2
telescoping arm extension feedforward
Exr0n Mar 14, 2023
f640987
Fixed typo
zbuster05 Mar 14, 2023
cf4469b
Merge branch 'ctrls-rewrite' of https://github.com/RoboticsTeam4904/s…
zbuster05 Mar 14, 2023
0550b8b
important modifications
zbuster05 Mar 14, 2023
89c9973
removed some warnings
zbuster05 Mar 14, 2023
a199353
enable zeroing sensors to non-zero values
Exr0n Mar 14, 2023
b88b0b6
Merge branch 'ctrls-rewrite' of https://github.com/RoboticsTeam4904/s…
Exr0n Mar 14, 2023
fa1bc91
delete old methods from sensormotor
Exr0n Mar 14, 2023
24948f8
smartmotorsubsystem arbitraryfeedforward for c_control methods
Exr0n Mar 14, 2023
551ef8e
possible cringe limit switch accessor code
Exr0n Mar 14, 2023
c0a618c
Fixed minecraft
zbuster05 Mar 14, 2023
7b17b00
Merge branch 'ctrls-rewrite' of https://github.com/RoboticsTeam4904/s…
zbuster05 Mar 14, 2023
d873fe5
??
zbuster05 Mar 14, 2023
2a4ee8f
TEMP: Removed logkitten because of its performance impacts.
zbuster05 Mar 15, 2023
398ab9d
Staging`
zbuster05 Mar 15, 2023
2646cb6
NEEDS REVIEW: I think this works?
zbuster05 Mar 15, 2023
bb0eaf8
fix names on openloop chassis control
Exr0n Mar 15, 2023
34549eb
Sketchy driver chooser fr
zbuster05 Mar 15, 2023
841c191
Merge branch 'ctrls-rewrite' of https://github.com/RoboticsTeam4904/s…
zbuster05 Mar 15, 2023
482e915
merge with driver station
roboticsteam4904-2 Mar 16, 2023
b833d75
complete merge \/
roboticsteam4904-2 Mar 16, 2023
a8e5d59
no operator fail more gracefully; fix westcoastdrive command factorie…
roboticsteam4904-2 Mar 16, 2023
80a509b
remove smartmotorsubsystem defaultcommand
Exr0n Mar 16, 2023
c82d37c
rip out follow mode
Exr0n Mar 16, 2023
a39b007
correct docstring wording
Exr0n Mar 16, 2023
bf797fe
remove defaultCommand on SmartMotorSubsystem; westCoast integrate fee…
Exr0n Mar 16, 2023
dd158a9
\/
Exr0n Mar 16, 2023
0410b19
triage todos into TODO (comp) and TO DO (later)
Exr0n Mar 16, 2023
738e9ae
add zach's goofy driver code back
Exr0n Mar 16, 2023
7e8bb07
ezcontrol logging
roboticsteam4904-2 Mar 17, 2023
9033f37
Merge branch 'ctrls-rewrite' of https://github.com/RoboticsTeam4904/s…
roboticsteam4904-2 Mar 17, 2023
5119f82
added custom xbox
Jm0rr Mar 17, 2023
3109be5
further remove follow mode (read remote encoders)
Exr0n Mar 17, 2023
b62aa61
Merge branch 'ctrls-rewrite' of https://github.com/RoboticsTeam4904/s…
Exr0n Mar 17, 2023
2f45ba1
applied config software limits to every motor
aze12345 Mar 17, 2023
0db1774
run command scheduler in test
roboticsteam4904-2 Mar 17, 2023
f3064ca
Merge branch 'ctrls-rewrite' of https://github.com/RoboticsTeam4904/s…
roboticsteam4904-2 Mar 17, 2023
7f9cebc
joystick deadzone: linear interpolate
roboticsteam4904-2 Mar 17, 2023
3f91256
better controller deadzone implementations
Exr0n Mar 17, 2023
51b3e88
format customCommandXbox
Exr0n Mar 17, 2023
8cf0f58
clean up todos
Jm0rr Mar 17, 2023
f19dc8e
clamp the arm lerp to avoid accidentally using unreasonable values an…
roboticsteam4904-2 Mar 17, 2023
5d9ae1d
Merge branch 'ctrls-rewrite' of https://github.com/RoboticsTeam4904/s…
roboticsteam4904-2 Mar 17, 2023
49422c8
manually invert left motors in WestCoastDrive (bodge)
roboticsteam4904-2 Mar 18, 2023
81bd420
clean up todos
Exr0n Mar 18, 2023
558559f
Merge branch 'dev-scuffed-git' into ctrls-rewrite
Exr0n Mar 18, 2023
d921939
fix xboxcontroller deadzone implementation
roboticsteam4904-2 Mar 18, 2023
fcffe9d
Removed unecessary logging
roboticsteam4904-2 Mar 23, 2023
d467086
make resetpose public
Jm0rr Mar 25, 2023
a247130
Merge branch 'ctrls-rewrite' of https://github.com/RoboticsTeam4904/s…
Jm0rr Mar 25, 2023
e21cc0c
add extended kg for arm pivot
roboticsteam4904-2 Mar 27, 2023
5173578
Revert "add extended kg for arm pivot", because we don't
Exr0n Mar 29, 2023
f8afa81
Added triplet type
zbuster05 Apr 2, 2023
d7c1a03
easymotion takes setpointDealerDealer
Exr0n Apr 3, 2023
1af05e3
UT: trigger command factory wrapper
Exr0n Apr 3, 2023
3ce0092
should we add requirements to triggercommandfactory
Exr0n Apr 3, 2023
d2415f0
named triggerCommandFactory
Exr0n Apr 3, 2023
5217d90
actually fix triggercommandfactory to instantly end
roboticsteam4904-2 Apr 3, 2023
510ff09
UT: make triggerCommandFactory take varargs
Exr0n Apr 4, 2023
4646627
triggerCommandFactory non-varargs overrides
Exr0n Apr 4, 2023
5492244
merge triggerCommandFdactory
roboticsteam4904-2 Apr 5, 2023
8cf0444
Revert "triggerCommandFactory non-varargs overrides"
Exr0n Apr 6, 2023
6dc4a1c
Revert "UT: make triggerCommandFactory take varargs"
Exr0n Apr 6, 2023
49bb104
trigger command factory sets own name
Exr0n Apr 6, 2023
109068d
nice
roboticsteam4904-2 Apr 6, 2023
e0154e9
Fixed OpenCV tuple2
zbuster05 May 14, 2023
529e576
fix TriggerCommandFactory moments (construct != initialize); deprecat…
Exr0n May 14, 2023
9e5a1b8
rename triggerCommandFactory to CreateAndDisown
Exr0n May 14, 2023
d2218bf
clean up CreateAndDisown
Exr0n May 14, 2023
ef7dc7c
can end
zbuster05 May 14, 2023
2e90db8
Merge branch 'ctrls-rewrite' of https://github.com/RoboticsTeam4904/s…
zbuster05 May 14, 2023
4a57caa
Changed ezMotion formatting
zbuster05 May 14, 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
33 changes: 28 additions & 5 deletions CommandRobotBase.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package org.usfirst.frc4904.standard;

import java.io.Console;

import org.usfirst.frc4904.standard.custom.CommandSendableChooser;
import org.usfirst.frc4904.standard.custom.TypedNamedSendableChooser;
import org.usfirst.frc4904.standard.humaninput.Driver;
import org.usfirst.frc4904.standard.humaninput.Operator;
import edu.wpi.first.wpilibj.TimedRobot;
import edu.wpi.first.wpilibj2.command.CommandBase;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.CommandScheduler;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;

Expand All @@ -15,8 +17,9 @@
* CommandRobotBase class. Robot should extend this instead of iterative robot.
*/
public abstract class CommandRobotBase extends TimedRobot {
private CommandBase autonomousCommand;
protected CommandBase teleopCommand;

private Command autonomousCommand;
protected Command teleopCommand;
protected CommandSendableChooser autoChooser;
protected TypedNamedSendableChooser<Driver> driverChooser;
protected TypedNamedSendableChooser<Operator> operatorChooser;
Expand Down Expand Up @@ -45,6 +48,24 @@ private void cleanup() {
}
}

// HACK FIXME, incredibly cursed and potentially bad
public static Driver drivingConfig = new Driver("uhohhh") {
@Override
public double getX() {
for (int i=0; i<1000000; i++) System.err.println("DRIVER NOT CONFIGED");
return 0;
}

@Override
public double getY() {return 0;}

@Override
public double getTurnSpeed() {return 0;}

@Override
public void bindCommands() {}
};

/**
* This initializes the entire robot. It is called by WPILib on robot code
* launch. Year-specific code should be written in the initialize function.
Expand Down Expand Up @@ -76,11 +97,12 @@ public final void robotInit() {
public final void teleopInit() {
cleanup();
if (driverChooser.getSelected() != null) {
LogKitten.d("Loading driver " + driverChooser.getSelected().getName());
// LogKitten.d("Loading driver " + driverChooser.getSelected().getName());
CommandRobotBase.drivingConfig = driverChooser.getSelected();
driverChooser.getSelected().bindCommands();
}
if (operatorChooser.getSelected() != null) {
LogKitten.d("Loading operator " + operatorChooser.getSelected().getName());
// LogKitten.d("Loading operator " + operatorChooser.getSelected().getName());
operatorChooser.getSelected().bindCommands();
}
teleopInitialize();
Expand Down Expand Up @@ -199,6 +221,7 @@ public final void testInit() {
*/
@Override
public void testPeriodic() {
CommandScheduler.getInstance().run();
testExecute();
alwaysExecute();
}
Expand Down
Loading