JHS-Viking-Robotics / FRC-2022

Code for the 2022 FRC season, now written in Java
Other
2 stars 2 forks source link

Merge Feature/teleop-basic-drive (#11) #12

Closed derickson2402 closed 3 years ago

derickson2402 commented 3 years ago

Imported the CTRE Phoenix library to the gradle project by following the official docs

Added a basic Talon drivetrain configuration in the new Drivetrain subsystem, based on the LabVIEW code from FRC-2021.

Added Talon CAN Bus ID's to Constants for easier updating of device ID's. In the future, also add inversion booleans here.

Added arcadeDrivePercentOutput method, which calls WPI lib arcade drive for driving the differential drivetrain in arcade mode with the joysticks.

Added getDifferentialDrive method which is a getter method for the raw differential drivetrain object. This might be useful in the future for path generation, although this functionality may be best handled within the class itself.

NOTE: the DriveStandard command has not yet been mapped to a joystick and is not yet called.

Add joystick port numbers to Constants, and add joysticks to RobotContainer.

Create DriveStandard command, which runs Drivetrain arcade drive method.

Xbox controllers are set up in RobotContainer as public and static, and the command DriveStandard now imports the RobotContainer class so it can access the joysticks directly. This cleans up the command calling process and the parameters that are used during calls.

Removed the getDifferentialDrive() method from Drivetrain subsystem class, as this object should inherently not be accessible directly. The goal of the subsystem class is to abstract away all hardware so that it is never directly addressed except by the class itself.

Removed ExampleSubsystem and ExampleCommand from project. Replaced default auton command with DriveStandard as a temporary placeholder.

If you need these files as reference, checkout the previous commit or check WPILib FRC docs online.

WPI Lib docs recommend passing subsystems in RobotContainer to commands as parameters, and also passing Supplier classes for necessary controller inputs. Read more here. Restructured DriveStandard to follow these practices, based on the example HatchBot code here](https://github.com/wpilibsuite/allwpilib/tree/main/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/hatchbottraditional). Drivetrain subsystem is now passed to command as a reference, and controller inputs are passed as DoubleSupplier class by using a lambda expression in RobotContainer.

Updated the member definitions in RobotContainer to follow best practices, and improved readability.

This commit addresses #1 (Talon config) and #10 (Talon inversion), and closes #2 (Talon safety config) and #5 (Xbox controller).

DriveStandard and the Drivetrain.arcadeDrivePercentOutput() method are tested and working.

geofflowes commented 3 years ago

can you send me the format for email passwords that you used yesterday to get into the account?

On Thu, Jul 8, 2021 at 4:39 PM Dan @.***> wrote:

Merged #12 https://github.com/JHS-Viking-Robotics/FRC-2022/pull/12 into main.

— You are receiving this because your review was requested. Reply to this email directly, view it on GitHub https://github.com/JHS-Viking-Robotics/FRC-2022/pull/12#event-4997099469, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATFC2IAPD233TNPAEWHDCPTTWYEIPANCNFSM5ABO3RUA .

-- Geoffrey Lowes JHS Science Department JEA President Viking Robotics Coach

"If it disagrees with experiment, it's wrong...and that simple statement is the key to science. It doesn't make any difference how beautiful your guess is, it doesn't matter how smart you are who made the guess, or what his name is… If it disagrees with experiment, it's wrong. That's all there is to it.” - Richard Feynman