commit | 397f6fec54ba4e89b85ae4472263b25d43c212e7 | [log] [tgz] |
---|---|---|
author | James Kuszmaul <jabukuszmaul+collab@gmail.com> | Sat Jan 04 16:21:52 2020 -0800 |
committer | James Kuszmaul <jabukuszmaul+collab@gmail.com> | Sat Jan 04 16:21:52 2020 -0800 |
tree | afe73f83859b1d1ab61e94427e458ffebc002276 | |
parent | 4b81d3014e62032c63ff45fefc190fe002faa2bb [diff] |
Squashed 'third_party/allwpilib_2019/' changes from e20d96ea4e..b0167e6337 32c62449be Add ArrayRef overloads to new command classes (#2216) 6190fcb237 Run wpiformat (#2218) 012d93b2bd Use an explicit stack instead of recursion when parameterizing splines (#2197) 222669dc2c Fix trapezoidal profile PID controller setpoint bug (#2210) abe25b795b TrajectoryUtil.toPathweaverJson: Create parent directories (#2214) 354185189c Update ProjectYear to 2020 (#2212) f14fe434a1 Add (Old) qualifier to old subsystem (#2211) e874ba9313 Add Color classes for use with AddressableLED (#2127) 96348e835a Fix C++ SendableRegistry::AddChild() (#2207) d91796f8d2 fix clang-format version number (#2206) 9abce8eb06 Fix subsystem LiveWindow usage (#2202) 8b4508ad53 Use default path for networktables.ini in simulation (#2205) 5b7dd186d2 Add templates for new commands for vscode plugin (#2016) 6ea13ea8f3 ntcore: Add support for local-only operation (#2204) 44bcf7fb4d Java examples: use non-static imports for constants (#2191) c7a1dfc0bc Add SlewRateLimiter class (#2192) a12bb447e4 Fail cmake build if python3 generate_numbers.py fails (#2203) c4bd54ef44 Add JNI binding to suppress driver station error/warning messages (#2200) f9a11cce5e Remove -no-module-directories flag from javadoc build (#2201) 6008671c30 Report WPILib version as part of usage reporting (#2199) 7b952d599d Add usage reporting for many new things (#2184) 93cdf68694 Add Constants.cpp for MecanumControllerCommand example (#2196) 0c6f24562f Fix bug in ULEB128 decoding (#2195) bdc1cab013 Add support for configuring SPI Auto Stall Config (#2193) 3259cffc63 Add transform methods to Trajectory (#2187) 67b59f2b31 Minor improvements/fixes to new command framework (#2186) 1ce24a7a2f Add 2020 speed controllers (#2188) 635882a9f7 Add getter for initial pose in Trajectory (#2180) 71a22861eb Use ManagedStatic for CameraServer (#2174) 9cb69c5b46 Add a way to pass in a preconstructed value to ManagedStatic (#2175) 5e08bb28f8 Add docs and lifecycle tasks for faster dev builds (#2182) ea4d1a39e1 Update characterization values to match real robot (#2183) 31b588d961 Fix ArmFeedforward Javadocs (#2176) 0b80d566ad Use ChipObject HMB function for LED (#2173) f8294e689b Sim GUI: Add a bit of spacing to the analog inputs (#2170) b78f115fcf Work around VS2019 16.4.0 bugs (#2171) b468c51251 Change AddressableLED example to use consistent PWM port (#2168) 023c088290 Add toString() to relevant kinematics classes (#2160) 8a11d13a39 Fix C++ DutyCycleEncoder int constructor (#2166) daa81c64a7 Minor javadoc fix in SwerveDriveKinematicsConstraint (#2167) Change-Id: Ied6a4d039f2b95381e1d2124fcc70d52580cc165 git-subtree-dir: third_party/allwpilib_2019 git-subtree-split: b0167e6337135545e7053acb89dd5726accc7dec
Welcome to the WPILib project. This repository contains the HAL, WPILibJ, and WPILibC projects. These are the core libraries for creating robot programs for the roboRIO.
The WPILib Mission is to enable FIRST Robotics teams to focus on writing game-specific software rather than focusing on hardware details - "raise the floor, don't lower the ceiling". We work to enable teams with limited programming knowledge and/or mentor experience to be as successful as possible, while not hampering the abilities of teams with more advanced programming capabilities. We support Kit of Parts control system components directly in the library. We also strive to keep parity between major features of each language (Java, C++, and NI's LabVIEW), so that teams aren't at a disadvantage for choosing a specific programming language. WPILib is an open source project, licensed under the BSD 3-clause license. You can find a copy of the license here.
Using Gradle makes building WPILib very straightforward. It only has a few dependencies on outside tools, such as the ARM cross compiler for creating roboRIO binaries.
Clone the WPILib repository. If the toolchains are not installed, install them, and make sure they are available on the system PATH.
See the styleguide README for wpiformat setup instructions.
All build steps are executed using the Gradle wrapper, gradlew
. Each target that Gradle can build is referred to as a task. The most common Gradle task to use is build
. This will build all the outputs created by WPILib. To run, open a console and cd into the cloned WPILib directory. Then:
./gradlew build
To build a specific subproject, such as WPILibC, you must access the subproject and run the build task only on that project. Accessing a subproject in Gradle is quite easy. Simply use :subproject_name:task_name
with the Gradle wrapper. For example, building just WPILibC:
./gradlew :wpilibc:build
If you have installed the FRC Toolchain to a directory other than the default, or if the Toolchain location is not on your System PATH, you can pass the toolChainPath
property to specify where it is located. Example:
./gradlew build -PtoolChainPath=some/path/to/frc/toolchain/bin
If you also want simulation to be built, add -PmakeSim. This requires gazebo_transport. We have tested on 14.04 and 15.05, but any correct install of Gazebo should work, even on Windows if you build Gazebo from source. Correct means CMake needs to be able to find gazebo-config.cmake. See The Gazebo website for installation instructions.
./gradlew build -PmakeSim
If you prefer to use CMake directly, the you can still do so. The common CMake tasks are wpilibcSim, frc_gazebo_plugins, and gz_msgs
mkdir build #run this in the root of allwpilib cd build cmake .. make
The gradlew wrapper only exists in the root of the main project, so be sure to run all commands from there. All of the subprojects have build tasks that can be run. Gradle automatically determines and rebuilds dependencies, so if you make a change in the HAL and then run ./gradlew :wpilibc:build
, the HAL will be rebuilt, then WPILibC.
There are a few tasks other than build
available. To see them, run the meta-task tasks
. This will print a list of all available tasks, with a description of each task.
wpiformat can be executed anywhere in the repository via py -3 -m wpiformat
on Windows or python3 -m wpiformat
on other platforms.
CMake is also supported for building. See README-CMAKE.md.
If you are building to test with other dependencies or just want to export the build as a Maven-style dependency, simply run the publish
task. This task will publish all available packages to ~/releases/maven/development. If you need to publish the project to a different repo, you can specify it with -Prepo=repo_name
. Valid options are:
The maven artifacts are described in MavenArtifacts.md
The main WPILib code you're probably looking for is in WPILibJ and WPILibC. Those directories are split into shared, sim, and athena. Athena contains the WPILib code meant to run on your roboRIO. Sim is WPILib code meant to run on your computer with Gazebo, and shared is code shared between the two. Shared code must be platform-independent, since it will be compiled with both the ARM cross-compiler and whatever desktop compiler you are using (g++, msvc, etc...).
The Simulation directory contains extra simulation tools and libraries, such as gz_msgs and JavaGazebo. See sub-directories for more information.
The integration test directories for C++ and Java contain test code that runs on our test-system. When you submit code for review, it is tested by those programs. If you add new functionality you should make sure to write tests for it so we don't break it in the future.
The hal directory contains more C++ code meant to run on the roboRIO. HAL is an acronym for "Hardware Abstraction Layer", and it interfaces with the NI Libraries. The NI Libraries contain the low-level code for controlling devices on your robot. The NI Libraries are found in the ni-libraries folder.
The styleguide repository contains our style guides for C++ and Java code. Anything submitted to the WPILib project needs to follow the code style guides outlined in there. For details about the style, please see the contributors document here.
See CONTRIBUTING.md.