commit | 60246090c818a75ac60fad4ec4d540d8ca428157 | [log] [tgz] |
---|---|---|
author | Brian Silverman <bsilver16384@gmail.com> | Sat Mar 02 13:29:58 2019 -0800 |
committer | Brian Silverman <bsilver16384@gmail.com> | Sat Mar 02 13:29:58 2019 -0800 |
tree | 1085fc31877b3297441f5534f473620fc76fd3bc | |
parent | 41cdd3e87217ce13d4167a1fda7baa9c60fefb8c [diff] |
Squashed 'third_party/allwpilib_2019/' changes from bd05dfa1c..99e4f7dd2 99e4f7dd2 Fix SPI CS1 not working correctly (#1614) 60c2f5905 C++ CameraServer: initialize default Usb camera device number (#1601) d55ca191b CameraServer: Add switched camera support (#1600) e8b24717c C++ Shuffleboard fixes (#1595) 182758c05 Fix Ultrasonic sensor runner thread (#1598) 74f7ba04b Java PIDBase: Make setPIDSourceType and getPIDSourceType public (#1599) 997d4fdf4 Update HAL GetStackTrace to properly report user errors (#1594) 76d9e2663 uv: Add reuse to pipe (#1577) a230c814c Add support for WPILib vscode extension for allwpilib C++ intellisense (#1590) 12cb77cd7 Fix DS Comm button tests (#1591) 8a9822a96 Allow multiple instances of the same PDP (#1582) a9371a758 Fix missing exposure property on windows USB cameras (#1571) 6992f5421 cscore: Avoid crash if invalid (null) source set in MjpegServer (#1585) 43696956d Fix Watchdog incorrectly resetting expiration flag upon disable (#1580) ae3fd5ada Fix docs search having unspecified module directory (#1568) 404666b29 Fix Halsim DS Button Format (#1583) 1eb4c99d1 Update README for 2019 changes (#1569) 910b9f3af Add support for camera descriptions on windows (#1572) 09d90b02f Remove prints and unecessary items from windows GetNetworkInterfaces (#1573) 0e1f9c2ed ntcore: Read ini escaped quotes correctly (#1579) f156a0011 wpiutil uv: Pass IPC value of listening pipe to accepted pipe (#1576) 4a6087ed5 Disable watchdog test on mac (#1578) 88a09dd13 cscore: Handle USB camera integer menus (#1561) 7d1959636 Changed terminology from "Overload" to "Override" (#1563) Change-Id: If58e497053b7e80f1f3d6182ad6060a186616a0f git-subtree-dir: third_party/allwpilib_2019 git-subtree-split: 99e4f7dd2c497d24016b7cb0e6fe16b04d2db1e8
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.