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

Update TeleopCommand to work on our two motor robot. #47

Open
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

a2aaron
Copy link
Contributor

@a2aaron a2aaron commented Jan 27, 2017

Blocked by PR #42 and PR #45 and PR #46

a2aaron and others added 24 commits January 15, 2017 19:26
Note that wpilib's build files ONLY look in the wpilib folder, this means that
any jars not located in this folder will not be compiled. Thus, we must
include json.jar, strongback.jar, and any talon libraries in this folder
(these are not visible in the commit). Additionally, json.jar was removed from
this project as it is not longer needed in this repo.
These build targets did nothing but call another target, so they were removed.
…y URL.

Why? Well, wpilib requires ALL user library jars to be placed in wpilib/user/java/lib,
which is a folder that this repo does not "own". Additionally, there is no easy
or elegant way to move jars into this directory. The simplest solution I can
think of is copying jars into the file from this repo, but I really don't want
to include too many jar files in this repo. Addionally, the site that was
previously downloading WPILib did not include the cpp or tools folders (which
might be nessecarry in order to deploy, I'm not sure).

Instead, I decided to download the wpilib folder directly from a repo that we
"own" (currently it's set to a repo I just made, but we can switch it over to
the FRC1076 organization). As a bonus, this means that updating WPILib is easy,
you update WPILib on a machine through eclipse, and then you push these changes
to GitHub. Then, anyone can pull these updates without having to go through the
same troubles. It also means that dependencies are easier to share between
projects (and only one person needs to ever download these dependencies).
Override Strongback's incorrect buildpath for test compilation. Why?
Strongback assumes that the correct class path is ${classpath}, which
does have WPILib.jar and NetworkTables.jar. However, this doesn't include
any user libraries (like Strongback itself!). Instead we add the path "classpath.path",
which is the correct path that wpilib uses for compilation and includes user libraries.
(the ${classpath} property is defined in ${wpilib.dir}/java/current/ant/build.properties.)

TestRobot.java has been updated to test these changes.
This commit fixes possible conflicts due to files being imported more than once, as that
could cause some overriding properties to not override properly.
This commit also replaces the TeleopCommand with a temporary arcade drive. This drive should be later placed into the current TeleopCommand (or possibly moved into a subsystem instead).
Since the new robot only has two motors (left and right), there is no need to keep FrontBackMotors.

All instances of FrontBackMotors have been removed from the codebase.

Additionally, DriveLeftRight was removed as that used only FrontBackMotors
Note that, since we no longer have a front or back motor, the radius scaling was removed. Additionally, the left and right speeds are no longer negative, as it is assumed that positive is forward and that all inverting is done prior to this command.
MockGamepad is useful in testing and implements IGamepad. IGamepad should be used instead of Gamepad because it allows for unit tests to pass in a MockGamepad
This was done all at once as converting piecewise tends to cause type errors everywhere. 

The main differences between WPILib and Strongback commands are not much.

Instead of directly starting commands, you instead submit them to Strongback's internal schedular via `Strongback.submit(command)`.
`execute()`, `initialize()` and other similar functions are public instead of protected. Additionally, only `execute()` is required, all of the others are optional by default. Finally, requirements are passed by calling the superconstructor with `super()`. A subsystem instead implements Requireable instead of extending Subsystem.
Strongback should be started in robotInit, not autonoumous init.
All SmartDashboard values should be read in disabledInit as this ensures that the value is always updated before teleop or auton
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants