Skip to content

Commit 8bc3039

Browse files
committed
Add README files for some subprojects and update various other docs
1 parent 44441da commit 8bc3039

20 files changed

Lines changed: 159 additions & 283 deletions

File tree

CONTRIBUTING.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ So you want to contribute your changes back to WPILib. Great! We have a few cont
1818
- Tool suite changes must be generally useful to a broad range of teams
1919
- Excluding bug fixes, changes in one language generally need to have corresponding changes in other languages.
2020
- Some features, such the addition of C++23 for WPILibC or Functional Interfaces for WPILibJ, are specific to that version of WPILib only. New language features added to C++ must be wrappable in Python for [RobotPy](https://github.com/robotpy).
21-
- Substantial changes often need to have corresponding LabVIEW changes. To do this, we will work with NI on these large changes.
2221
- Changes should have tests.
2322
- Code should be well documented.
2423
- This involves writing tutorials and/or usage guides for your submitted feature. These articles are then hosted on the [WPILib](https://docs.wpilib.org/) documentation website. See the [frc-docs repository](https://github.com/wpilibsuite/frc-docs) for more information.
@@ -30,12 +29,21 @@ So you want to contribute your changes back to WPILib. Great! We have a few cont
3029
- While we do welcome improvements to the API, there are a few important rules to consider:
3130
- Features must be added to Java (WPILibJ), C++ (WPILibC), with rare exceptions.
3231
- Most of Python (RobotPy) is created by wrapping WPILibC with pybind11 via robotpy-build. However, new features to the command framework should also be submitted to [robotpy-commands-v2](https://github.com/robotpy/robotpy-commands-v2) as the command framework is reimplemented in Python.
33-
- During competition season, we will not merge any new feature additions. We want to ensure that the API is stable during the season to help minimize issues for teams.
32+
- During competition season, we will not merge any new feature additions or removals. We want to ensure that the API is stable during the season to help minimize issues for teams.
3433
- Ask about large changes before spending a bunch of time on them! See [Contribution Process](#contribution-process) for where to ask.
3534
- Features that make it easier for teams with less experience to be more successful are more likely to be accepted.
3635
- Features in WPILib should be broadly applicable to all teams. Anything that is team specific should not be submitted.
3736
- As a rule, we are happy with the general structure of WPILib. We are not interested in major rewrites of all of WPILib. We are open to talking about ideas, but backwards compatibility is very important for WPILib, so be sure to keep this in mind when proposing major changes.
38-
- Generally speaking, we do not accept code for specific sensors. We have to be able to test the sensor in hardware on the WPILib test bed. Additionally, hardware availability for teams is important. Therefore, as a general rule, the library only directly supports hardware that is in the Kit of Parts. If you are a company interested in getting a sensor into the Kit of Parts, please contact FIRST directly at frcparts@firstinspires.org.
37+
- Generally speaking, we do not accept code for specific sensors. As a general rule, the library only directly supports hardware that is in the Kit of Parts. If you are a company interested in getting a sensor into the Kit of Parts, please contact FIRST directly at frcparts@firstinspires.org.
38+
39+
### Design Philosophy
40+
41+
WPILib's general design philosophy strays far away from the traditional Object-Oriented Programming architectures dominant in enterprise codebases. The general points to follow for WPILib are as follows:
42+
43+
- Prefer functions and composition over inheritance. Inheritance is rigid and often prevents evolution, as adding or removing methods from an inherited class risks breakage. For similar reasons, functional interfaces (`std::function` in C++) are preferred over actual interfaces.
44+
- Avoid opaque black-boxes of functionality. Classes like RamseteCommand (removed in 2027) are good examples of this. While they look like a good abstraction that helps beginners, the black-box nature means they are [difficult to debug](https://github.com/wpilibsuite/allwpilib/issues/3350) and it's impossible to instrument the internals to figure out what's going on. Composition is strongly preferred, with documentation and examples describing how to do that composition.
45+
- Error at compile time, not runtime. Despite our best efforts, there will always be people who don't read stack traces (understandable for beginner programmers). Compile time errors show up in builds and in an IDE, which is much easier and faster for people to pinpoint and debug. Use language features to make invalid code impossible to build. The Matrix class in Java is an example of this. While clunky due to Java's weak generics system, it enforces correct Matrix dimensions at compile time, with the MatBuilder factory method throwing if the array passed in is the wrong size, which leads to the next point:
46+
- Try to only throw exceptions at code startup. Robots shouldn't quit, and it's a real "feels bad" moment when yours does, especially in a match. It's oftentimes better to have a robot continue running when it sees nonsensical state as opposed to outright crashing, since other components are often still functional. If you can't make invalid code a compile time error, throwing at the start of the robot program is the next best solution. This is typically done by throwing in constructors, or other functions likely to be called on code startup. But avoid throwing in functions likely to be called throughout a robot's runtime, e.g., in an `update` or `calculate` method, as again, crashing in the middle match is a terrible experience. Sometimes the behavior of functions are just incorrect if invalid data is passed in, and throwing is one of the only options. This is a judgement call, but if there are no options, throwing can be okay.
3947

4048
## Contribution Process
4149

MAINTAINERS.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
## Publishing Third Party Dependencies
2-
Currently the 3rd party deps are imgui, opencv, google test, libssh, and apriltaglib
2+
Currently the 3rd party deps are imgui, opencv, google test, libssh, ceres, and gtsam.
33

44
For publishing these dependencies, the version needs to be manually updated in the publish.gradle file of their respective repository.
55
Then, in the azure build for the dependency you want to build for, manually start a pipeline build (As of current, this is the `Run Pipeline` button).
@@ -13,11 +13,8 @@ Note, changing artifact locations (This includes changing the artifact year curr
1313
## Publishing allwpilib
1414
allwpilib publishes to the development repo on every push to main. To publish a release build, upload a new tag, and a release will automatically be built and published.
1515

16-
## Publishing desktop tools
17-
Desktop tools publish to the development repo on every push to main. To publish a release build, upload a new tag, and a release will automatically be built and published.
18-
1916
## Publishing VS Code
20-
Before publishing, make sure to update the gradlerio version in `vscode-wpilib/resources/gradle/version.txt` Also make sure the gradle wrapper version matches the wrapper required by gradlerio.
17+
Before publishing, make sure to update the GradleRIO version in `vscode-wpilib/resources/gradle/version.txt` Also make sure the gradle wrapper version matches the wrapper required by GradleRIO.
2118
Upon pushing a tag, a release will be built, and the files will be uploaded to the releases on GitHub.
2219

2320
## Publishing GradleRIO

MavenArtifacts.md

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,27 @@ The first types are Java artifacts. These are usually published as `jar` files.
1818

1919
Example:
2020
```
21-
edu.wpi.first.wpilibj:wpilibj-java:version
21+
org.wpilib.wpilibj:wpilibj-java:version
2222
```
2323

24-
The second types are native artifacts. These are usually published as `zip` files. The `-sources` and `-headers` classifiers contain the sources and headers respectively for the library. Each artifact also contains a classifier for each platform we publish. This platform is in the format `{os}{arch}`. The full list of supported platforms can be found in [native-utils](https://github.com/wpilibsuite/native-utils/blob/main/src/main/java/edu/wpi/first/nativeutils/WPINativeUtilsExtension.java#L94). If the library is built statically, it will have `static` appended to the classifier. Additionally, if the library was built in debug mode, `debug` will be appended to the classifier. The platform artifact only contains the binaries for a specific platform. Note that the binary artifacts never contain the headers, you always need the `-headers` classifier to get those.
24+
The second types are native artifacts. These are usually published as `zip` files. The `-sources` and `-headers` classifiers contain the sources and headers respectively for the library. Each artifact also contains a classifier for each platform we publish. This platform is in the format `{os}{arch}`. The full list of supported platforms can be found in [native-utils in the Platforms nested class](https://github.com/wpilibsuite/native-utils/blob/main/src/main/java/org/wpilib/nativeutils/WPINativeUtilsExtension.java). If the library is built statically, it will have `static` appended to the classifier. Additionally, if the library was built in debug mode, `debug` will be appended to the classifier. The platform artifact only contains the binaries for a specific platform. Note that the binary artifacts never contain the headers, you always need the `-headers` classifier to get those.
2525

2626
If the library is Java and C++ and has a JNI component, the native artifact will have a shared library containing JNI entrypoints alongside the C++ shared library. This JNI shared library will have a `jni` suffix in the file name.
2727

2828
Native artifacts are published with the base artifact name as their artifact ID, with a `-cpp` extension.
2929

3030
Example:
3131
```
32-
edu.wpi.first.wpimath:wpimath-cpp:version:classifier@zip
33-
edu.wpi.first.wpimath:wpimath-cpp:version:windowsx86-64staticdebug@zip
32+
org.wpilib.wpimath:wpimath-cpp:version:classifier@zip
33+
org.wpilib.wpimath:wpimath-cpp:version:windowsx86-64staticdebug@zip
3434
```
3535

3636
## Provided Artifacts
3737
This repository provides the following artifacts. Below each artifact is its dependencies.
3838

3939
For C++, if building with static dependencies, the listed order should be the link order in your linker.
4040

41-
All artifacts are based at `edu.wpi.first.artifactname` in the repository.
41+
All artifacts are based at `org.wpilib.artifactname` in the repository.
4242

4343
* wpiutil
4444

@@ -52,32 +52,33 @@ All artifacts are based at `edu.wpi.first.artifactname` in the repository.
5252
* wpiutil
5353

5454
* ntcore
55-
* wpiutil
5655
* wpinet
56+
* wpiutil
5757

5858
* glass/libglass
59-
* wpiutil
60-
* wpimath
6159
* wpigui
60+
* wpimath
61+
* wpiutil
6262

6363
* glass/libglassnt
64-
* wpiutil
65-
* wpinet
64+
* wpigui
6665
* ntcore
66+
* wpinet
6767
* wpimath
68-
* wpigui
68+
* wpiutil
6969

7070
* hal
71+
* ntcore
7172
* wpiutil
7273

7374
* halsim
74-
* wpiutil
75-
* wpinet
75+
* libglassnt
76+
* libglass
7677
* ntcore
7778
* wpimath
7879
* wpigui
79-
* libglass
80-
* libglassnt
80+
* wpinet
81+
* wpiutil
8182

8283
* cscore
8384
* opencv
@@ -126,12 +127,16 @@ All artifacts are based at `edu.wpi.first.artifactname` in the repository.
126127

127128
### Third Party Artifacts
128129

129-
This repository provides the builds of the following third party software.
130-
131-
All artifacts are based at `edu.wpi.first.thirdparty.frcYEAR` in the repository.
130+
This repository provides the builds of the following third party software:
132131

133-
* apriltaglib
134132
* googletest
135133
* imgui
136-
* opencv
137-
* libssh
134+
135+
Other software can be found in their corresponding GitHub repositories:
136+
137+
* ceres: https://github.com/wpilibsuite/thirdparty-ceres
138+
* gtsam: https://github.com/wpilibsuite/thirdparty-gtsam
139+
* opencv: https://github.com/wpilibsuite/thirdparty-opencv
140+
* libssh: https://github.com/wpilibsuite/thirdparty-libssh
141+
142+
All artifacts are based at `org.wpilib.thirdparty.frcYEAR` in the repository.

README-Bazel.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# WPILib Bazel Support
22

3-
WPILib is normally built with Gradle, but [Bazel](https://www.bazel.build/) can also be used to increase development speed due to the superior caching ability and the ability to use remote caching and remote execution (on select platforms)
3+
WPILib is normally built with Gradle, but [Bazel](https://www.bazel.build/) can also be used to increase development speed due to the superior caching ability and the ability to use remote caching and remote execution (on select platforms).
44

55

66
## Prerequisites
7-
- Install [Bazelisk](https://github.com/bazelbuild/bazelisk/releases) and add it to your path. Bazelisk is a wrapper that will download the correct version of bazel specified in the repository. Note: You can alias/rename the binary to `bazel` if you want to keep the familiar `bazel build` vs `bazelisk build` syntax.
7+
- Install [Bazelisk](https://github.com/bazelbuild/bazelisk/releases) and add it to your path. Bazelisk is a wrapper that will download the correct version of Bazel specified in the repository. Note: You can alias/rename the binary to `bazel` if you want to keep the familiar `bazel build` vs `bazelisk build` syntax.
88

99
## Building
1010
To build the entire repository, simply run `bazel build //...`. To run all of the unit tests, run `bazel test //...`
@@ -14,7 +14,7 @@ Other examples:
1414
- `bazel coverage //wpiutil/...` - (*Nix only) - Runs a code coverage report for both C++ and Java on all the targets under wpiutil
1515

1616
## User settings
17-
When invoking bazel, it will check if `user.bazelrc` exists for additional, user specified flags. You can use these settings to do things like always ignore buildin a specific folder, or limiting the CPU/RAM usage during a build.
17+
When invoking Bazel, it will check if `user.bazelrc` exists for additional, user specified flags. You can use these settings to do things like always ignore builds in a specific folder, or limiting the CPU/RAM usage during a build.
1818
Examples:
1919
- `build --build_tag_filters=-wpi-example` - Do not build any targets tagged with `wpi-example` (Currently all of the targets in wpilibcExamples and wpilibjExamples contain this tag)
2020
- `build -c opt` - Always build optimized targets. The default compiler flags were chosen to build as fast as possible, and thus don't contain many optimizations
@@ -36,12 +36,12 @@ Modify this to your likings if you want to build less.
3636

3737
## Pregenerating Files
3838
allwpilib uses extensive use of pre-generating files that are later used to build C++ / Java libraries that are tracked by version control. Quite often,
39-
these pre-generation scripts use some configuration file to create multipile files inside of an output directory. While this process could be accomplished
39+
these pre-generation scripts use some configuration file to create multiple files inside of an output directory. While this process could be accomplished
4040
with a `genrule` that would require an explicit listing of every output file, which would be tedious to maintain as well as potentially confusing to people
41-
adding new features those libraries. Therefor, we use `@aspect_bazel_lib` and their `write_source_files` feature to generate these directories. In the event that the generation process creates more than a small handful of predictable files, a custom rule is written to generate the directory.
41+
adding new features those libraries. Therefore, we use `@aspect_bazel_lib` and their `write_source_files` feature to generate these directories. In the event that the generation process creates more than a small handful of predictable files, a custom rule is written to generate the directory.
4242

4343
## Remote Caching
44-
One of the huge benefits of bazel is its remote caching ability. However, due to bazels strict build definitions it is hard to share remote cache artifacts between different computers unless our toolchains are fully hermetic, which means you are unlikely to be able to reuse the cache artifacts published from the `main` branch on your local machine like you might be able to with the `gradle` or `cmake` caches. Luckily the github actions CI machines are generally stable between runs and can reuse cache artifacts, and your local machine should remain stable, so if you set up a free buildbuddy account you can have your forks CI actions be able to use a personalized cache, as well as your local machine.
44+
One of the huge benefits of Bazel is its remote caching ability. However, due to Bazel's strict build definitions, it is hard to share remote cache artifacts between different computers unless our toolchains are fully hermetic, which means you are unlikely to be able to reuse the cache artifacts published from the `main` branch on your local machine like you might be able to with the `gradle` or `cmake` caches. Luckily, the GitHub Actions CI machines are generally stable between runs and can reuse cache artifacts, and your local machine should remain stable, so if you set up a free buildbuddy account you can have your forks CI actions be able to use a personalized cache, as well as your local machine.
4545

4646
For the main `allwpilib` upstream, the cache is only updated on the main branch; pull requests from forks will not be able to modify the cache. However, you can set up your fork to enable its own cache by following the steps below.
4747

README-CMake.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,17 @@ WPILib is normally built with Gradle, however for some systems, such as Linux ba
55
## Libraries that get built
66
* apriltag
77
* cameraserver
8+
* commandsv2
89
* commandsv3
910
* cscore
11+
* datalog
1012
* fields
1113
* hal (simulation HAL only)
1214
* ntcore
1315
* romiVendordep
1416
* simulation extensions
1517
* wpigui
16-
* wpilib (wpilibc, wpilibj, and myRobot)
17-
* commandsv2
18+
* wpilib (wpilibc, wpilibj, and developerRobot)
1819
* wpimath
1920
* wpinet
2021
* wpiunits
@@ -26,6 +27,7 @@ WPILib is normally built with Gradle, however for some systems, such as Linux ba
2627
* glass
2728
* outlineviewer
2829
* sysid
30+
* wpical
2931
* halsim_gui (if simulation extensions are enabled)
3032

3133
By default, all libraries get built with a default CMake setup. The libraries are built as shared libraries, and include the JNI libraries as well as building the Java JARs. Data Log Tool and the roboRIO Team Number Setter are only built if libssh is available.
@@ -89,7 +91,7 @@ If you want, you can also use `ccmake` in order to visually set these properties
8991

9092
## Presets
9193

92-
The WPILib CMake setup has a variety of presets for common configurations and options used. The default sets the generator to Ninja and build directory to `build-cmake`. The other presets are `with-java` (sets `WITH_JAVA=ON`), `sccache` (sets the C/C++ compiler launcher to sccache), and `with-java-sccache` (a comibination of `with-java` and `sccache`.
94+
The WPILib CMake setup has a variety of presets for common configurations and options used. The default sets the generator to Ninja and build directory to `build-cmake`. The other presets are `with-java` (sets `WITH_JAVA=ON`), `sccache` (sets the C/C++ compiler launcher to sccache), and `with-java-sccache` (a combination of `with-java` and `sccache`).
9395

9496
## Building
9597

0 commit comments

Comments
 (0)