-
Notifications
You must be signed in to change notification settings - Fork 0
Add basic TeleopDrive functionalities #5
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
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
8f0be8b
Change example items to drivetrain skeleton
dfang314 4baaaf2
Format using the formatting tool in VScode
dfang314 5bc2db7
Update WPILIB extension, add motorcontrollers, and resolve merge conf…
dfang314 f876c65
Resolve merge conflict
dfang314 9070c57
Fix TeleopDrive
74a8174
Resolve merge conflicts, move teleopDrive logic to DT.java
ebb203b
Fix TeleopDrive for arcade and tank
ab61f8a
Fix Arcade Drive
c622288
Split TeleopDrive.java into Arcade and Tank Drive
1671a31
Add SmartDashboard ports and Encoders
d669b29
Add motor configuration methods for talons and victors
df53e13
Add gyros (note: there are some errors - that's because AHRS has not …
694cafb
Fix ArcadeDrive logic
7c312b7
initial changes
kevinzwang fd5c7bc
Merge branch 'dt-changes-kevin' into drivetrain
kevinzwang 0bfa709
Merge branch 'drivetrain' of https://github.com/DeepBlueRobotics/Robo…
kevinzwang 94b9f4e
Add squared joystick functionality
29ad26d
clean up code and add comments
kevinzwang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| /*----------------------------------------------------------------------------*/ | ||
| /* Copyright (c) 2018 FIRST. All Rights Reserved. */ | ||
| /* Open Source Software - may be modified and shared by FRC teams. The code */ | ||
| /* must be accompanied by the FIRST BSD license file in the root directory of */ | ||
| /* the project. */ | ||
| /*----------------------------------------------------------------------------*/ | ||
|
|
||
| package frc.robot.commands; | ||
|
|
||
| import edu.wpi.first.wpilibj.command.Command; | ||
| import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; | ||
|
|
||
| public class SlowDrive extends Command { | ||
| public enum Side { | ||
| LEFT, RIGHT | ||
| } | ||
|
|
||
| String sdValue; | ||
|
|
||
| /** | ||
| * Reduces the joystick input values while this command is running | ||
| * | ||
| * @param side the joystick to reduce | ||
| */ | ||
| public SlowDrive(Side side) { | ||
| sdValue = (side == Side.LEFT ? "Slow Left" : "Slow Right"); | ||
| } | ||
|
|
||
| @Override | ||
| protected void initialize() { | ||
| SmartDashboard.putBoolean(sdValue, true); | ||
| } | ||
|
|
||
| @Override | ||
| protected boolean isFinished() { | ||
| return false; | ||
| } | ||
|
|
||
| @Override | ||
| protected void end() { | ||
| SmartDashboard.putBoolean(sdValue, false); | ||
| } | ||
|
|
||
| @Override | ||
| protected void interrupted() { | ||
| end(); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this function is in both this file and RobotMap, then it would be better organized if this function was only present once (maybe as a static) in Main or Robot.