Rename FRC to WPILib (#8637)

This commit is contained in:
Thad House
2026-03-13 23:05:55 -07:00
committed by GitHub
parent 6830c65a15
commit b2b111dc11
73 changed files with 134 additions and 141 deletions

View File

@@ -65,7 +65,7 @@ plugins {
}
wpi.maven.useLocal = false
wpi.maven.useFrcMavenLocalDevelopment = true
wpi.maven.useWpilibMavenLocalDevelopment = true
wpi.versions.wpilibVersion = 'YEAR.424242.+'
```
@@ -78,7 +78,7 @@ plugins {
}
wpi.maven.useLocal = false
wpi.maven.useFrcMavenLocalDevelopment = true
wpi.maven.useWpilibMavenLocalDevelopment = true
wpi.versions.wpilibVersion = 'YEAR.424242.+'
```

2
MODULE.bazel.lock generated
View File

@@ -263,7 +263,7 @@
"repoRuleId": "@@rules_bzlmodrio_toolchains+//toolchains:configure_cross_compiler.bzl%configure_cross_compiler",
"attributes": {
"extra_defines": [
"-D__FRC_SYSTEMCORE__=1"
"-D__FIRST_SYSTEMCORE__=1"
],
"bin_subfolder": "bookworm/bin",
"bin_prefix": "aarch64-bookworm-linux-gnu-",

View File

@@ -129,10 +129,10 @@ Please read the documentation available [here](DevelopmentBuilds.md)
### Custom toolchain location
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:
If you have installed the WPILib 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:
```bash
./gradlew build -PtoolChainPath=some/path/to/frc/toolchain/bin
./gradlew build -PtoolChainPath=some/path/to/wpilib/toolchain/bin
```
### Formatting/linting

View File

@@ -20,7 +20,7 @@
### C++ updates
1. Update `src/main/native/include/frc/apriltag/AprilTagFields.h`
1. Update `src/main/native/include/wpi/apriltag/AprilTagFields.hpp`
1. Add enum value for new field to `AprilTagFields`
2. Update `AprilTagFields::kDefaultField` if necessary
2. Update `src/main/native/cpp/AprilTagFields.cpp`

View File

@@ -93,35 +93,35 @@ deploy {
all {
postdeploy << { ctx ->
ctx.execute("sync")
ctx.execute("sudo ldconfig /home/systemcore/frc/third-party/lib")
ctx.execute("sudo ldconfig /home/systemcore/wpilib/third-party/lib")
}
}
benchmarkCpp(NativeExecutableArtifact) {
libraryDirectory = '/usr/local/frc/third-party/lib'
libraryDirectory = '/home/systemcore/wpilib/third-party/lib'
def excludes = getLibraryFilter().getExcludes()
excludes.add('**/*.so.debug')
excludes.add('**/*.so.*.debug')
postdeploy << { ctx ->
ctx.execute("echo '/home/lvuser/benchmarkCpp' > /home/lvuser/robotCommand")
ctx.execute("chmod +x /home/lvuser/robotCommand; chown lvuser /home/lvuser/robotCommand")
ctx.execute("setcap cap_sys_nice+eip \"/home/lvuser/benchmarkCpp\"")
ctx.execute("echo '/home/systemcore/benchmarkCpp' > /home/systemcore/robotCommand")
ctx.execute("chmod +x /home/systemcore/robotCommand; chown systemcore /home/systemcore/robotCommand")
ctx.execute("setcap cap_sys_nice+eip \"/home/systemcore/benchmarkCpp\"")
ctx.execute('chmod +x benchmarkCpp')
}
}
benchmarkCppStatic(NativeExecutableArtifact) {
libraryDirectory = '/usr/local/frc/third-party/lib'
libraryDirectory = '/home/systemcore/wpilib/third-party/lib'
postdeploy << { ctx ->
ctx.execute("echo '/home/lvuser/benchmarkCppStatic' > /home/lvuser/robotCommand")
ctx.execute("chmod +x /home/lvuser/robotCommand; chown lvuser /home/lvuser/robotCommand")
ctx.execute("setcap cap_sys_nice+eip \"/home/lvuser/benchmarkCppStatic\"")
ctx.execute("echo '/home/systemcore/benchmarkCppStatic' > /home/systemcore/robotCommand")
ctx.execute("chmod +x /home/systemcore/robotCommand; chown systemcore /home/systemcore/robotCommand")
ctx.execute("setcap cap_sys_nice+eip \"/home/systemcore/benchmarkCppStatic\"")
ctx.execute('chmod +x benchmarkCppStatic')
}
}
benchmarkCppJava(NativeExecutableArtifact) {
libraryDirectory = '/usr/local/frc/third-party/lib'
libraryDirectory = '/home/systemcore/wpilib/third-party/lib'
def excludes = getLibraryFilter().getExcludes()
excludes.add('**/*.so.debug')
excludes.add('**/*.so.*.debug')
@@ -130,8 +130,8 @@ deploy {
benchmarkJava(JavaArtifact) {
jarTask = shadowJar
postdeploy << { ctx ->
ctx.execute("echo '/usr/local/frc/JRE/bin/java -XX:+UseSerialGC -Djava.library.path=/usr/local/frc/third-party/lib -Djava.lang.invoke.stringConcat=BC_SB -jar /home/lvuser/benchmark-all.jar' > /home/lvuser/robotCommand")
ctx.execute("chmod +x /home/lvuser/robotCommand; chown lvuser /home/lvuser/robotCommand")
ctx.execute("echo 'java -XX:+UseSerialGC -Djava.library.path=/home/systemcore/wpilib/third-party/lib -Djava.lang.invoke.stringConcat=BC_SB -jar /home/systemcore/benchmark-all.jar' > /home/systemcore/robotCommand")
ctx.execute("chmod +x /home/systemcore/robotCommand; chown systemcore /home/systemcore/robotCommand")
}
}
}

View File

@@ -47,7 +47,7 @@ import org.wpilib.vision.stream.CameraServer;
*/
public final class Main {
private static String configFile = "/boot/frc.json";
private static String configFile = "/boot/CameraServerConfig.json";
@SuppressWarnings("MemberName")
public static class CameraConfig {

View File

@@ -46,9 +46,9 @@
*/
#ifdef __RASPBIAN__
static const char* configFile = "/boot/frc.json";
static const char* configFile = "/boot/CameraServerConfig.json";
#else
static const char* configFile = "frc.json";
static const char* configFile = "CameraServerConfig.json";
#endif
namespace {

View File

@@ -186,7 +186,7 @@ std::vector<std::string> Instance::GetSourceStreamValues(CS_Source source) {
value = "mjpg:" + value;
}
#ifdef __FRC_SYSTEMCORE__
#ifdef __FIRST_SYSTEMCORE__
// Look to see if we have a passthrough server for this source
// Only do this on the systemcore
for (const auto& i : m_sinks) {

View File

@@ -3,7 +3,7 @@
"name": "Commands V2",
"version": "1.0.0",
"uuid": "111e20f7-815e-48f8-9dd6-e675ce75b266",
"frcYear": "2027_alpha1",
"wpilibYear": "2027_alpha4",
"mavenUrls": [],
"jsonUrl": "",
"conflictsWith": [

View File

@@ -3,7 +3,7 @@
"name": "Commands v3",
"version": "1.0.0",
"uuid": "4decdc05-a056-46cf-9561-39449bbb0130",
"frcYear": "2027_alpha1",
"wpilibYear": "2027_alpha4",
"mavenUrls": [],
"jsonUrl": "",
"conflictsWith": [

View File

@@ -10,11 +10,11 @@ A simple binary logging format designed for high speed logging of timestamped da
[[motivation]]
== Motivation
FRC robots generate a lot of real-time data of various data types (most typically numeric values, but also strings and more complex data such as camera images). While there is good support in the WPILib software ecosystem for real-time display of this data on dashboards (via NetworkTables), there is no current standard for logging of timestamped data values for offline analysis. In the absence of a standard, teams have developed various ad-hoc solutions, including CSV files.
FIRST robots generate a lot of real-time data of various data types (most typically numeric values, but also strings and more complex data such as camera images). While there is good support in the WPILib software ecosystem for real-time display of this data on dashboards (via NetworkTables), there is no current standard for logging of timestamped data values for offline analysis. In the absence of a standard, teams have developed various ad-hoc solutions, including CSV files.
Similar to how the NetworkTables standard protocol enabled ecosystem development of multiple dashboards, it is expected that a standard format for data logging, in combination with built-in library support for easy on-robot logging of robot data, will facilitate ecosystem development of offline data analysis tools.
Standard logging facilities currently available (e.g. in Java) are generally designed for string messages, not for binary data. As a binary format, this will be faster with less overhead for the typical data (e.g. numbers) coming from a robot in real time (at least dozens, if not hundreds, of data points every ~20 ms). String formatting is significantly more expensive than just copying the binary number, and is more difficult to read back into analysis tools. Latency of the actual logging to the main program is also critical in the FRC application. WPILib also needs a common logging format and implementation across both C++ and Java.
Standard logging facilities currently available (e.g. in Java) are generally designed for string messages, not for binary data. As a binary format, this will be faster with less overhead for the typical data (e.g. numbers) coming from a robot in real time (at least dozens, if not hundreds, of data points every ~20 ms). String formatting is significantly more expensive than just copying the binary number, and is more difficult to read back into analysis tools. Latency of the actual logging to the main program is also critical in the FIRST application. WPILib also needs a common logging format and implementation across both C++ and Java.
[[references]]
== References
@@ -35,7 +35,7 @@ Entry ID:: An unsigned 4-byte ID by which records in the log refer to an Entry,
Record:: Storage of a single timestamped data item in the log. A record consists of the entry ID, the data length, a 64-bit integer timestamp, and the data contents.
[[def-timestamp]]
Timestamp:: 64-bit integer microseconds. The zero time is not specified by the data format, but on an FRC robot is typically the time the robot program started.
Timestamp:: 64-bit integer microseconds. The zero time is not specified by the data format, but on an FIRST robot is typically the time the robot program started.
[[design]]
== Design

View File

@@ -209,7 +209,7 @@ def define_pybind_library(name, pkgcfgs = []):
"//wpiutil:robotpy-wpiutil",
],
strip_path_prefixes = ["datalog/src/main/python", "datalog"],
summary = "Binary wrapper for FRC wpilog library",
summary = "Binary wrapper for WPILib logging library",
project_urls = {"Source code": "https://github.com/robotpy/mostrobotpy"},
author_email = "RobotPy Development Team <robotpy@googlegroups.com>",
requires = ["robotpy-native-datalog==0.0.0", "robotpy-wpiutil==0.0.0"],

View File

@@ -11,7 +11,7 @@ requires = [
[project]
name = "robotpy-wpilog"
version = "0.0.0"
description = "Binary wrapper for FRC wpilog library"
description = "Binary wrapper for WPILib logging library"
authors = [
{name = "RobotPy Development Team", email = "robotpy@googlegroups.com"},
]

View File

@@ -93,17 +93,17 @@ deploy {
all {
postdeploy << { ctx ->
ctx.execute("sync")
ctx.execute("sudo ldconfig /home/systemcore/frc/third-party/lib")
ctx.execute("sudo ldconfig /home/systemcore/wpilib/third-party/lib")
}
}
developerRobotCpp(NativeExecutableArtifact) {
libraryDirectory = '/home/systemcore/frc/third-party/lib'
libraryDirectory = '/home/systemcore/wpilib/third-party/lib'
def excludes = getLibraryFilter().getExcludes()
excludes.add('**/*.so.debug')
excludes.add('**/*.so.*.debug')
postdeploy << { ctx ->
ctx.execute("echo 'LD_LIBRARY_PATH=/home/systemcore/frc/third-party/lib /home/systemcore/developerRobotCpp' > /home/systemcore/robotCommand")
ctx.execute("echo 'LD_LIBRARY_PATH=/home/systemcore/wpilib/third-party/lib /home/systemcore/developerRobotCpp' > /home/systemcore/robotCommand")
ctx.execute("chmod +x /home/systemcore/robotCommand; chown systemcore /home/systemcore/robotCommand")
ctx.execute("setcap cap_sys_nice+eip \"/home/systemcore/developerRobotCpp\"")
ctx.execute('chmod +x developerRobotCpp')
@@ -111,9 +111,9 @@ deploy {
}
developerRobotCppStatic(NativeExecutableArtifact) {
libraryDirectory = '/home/systemcore/frc/third-party/lib'
libraryDirectory = '/home/systemcore/wpilib/third-party/lib'
postdeploy << { ctx ->
ctx.execute("echo ''LD_LIBRARY_PATH=/home/systemcore/frc/third-party/lib /home/systemcore/developerRobotCppStatic' > /home/systemcore/robotCommand")
ctx.execute("echo ''LD_LIBRARY_PATH=/home/systemcore/wpilib/third-party/lib /home/systemcore/developerRobotCppStatic' > /home/systemcore/robotCommand")
ctx.execute("chmod +x /home/systemcore/robotCommand; chown systemcore /home/systemcore/robotCommand")
ctx.execute("sudo setcap cap_sys_nice+eip \"/home/systemcore/developerRobotCppStatic\"")
ctx.execute('chmod +x developerRobotCppStatic')
@@ -121,7 +121,7 @@ deploy {
}
developerRobotCppJava(NativeExecutableArtifact) {
libraryDirectory = '/home/systemcore/frc/third-party/lib'
libraryDirectory = '/home/systemcore/wpilib/third-party/lib'
def excludes = getLibraryFilter().getExcludes()
excludes.add('**/*.so.debug')
excludes.add('**/*.so.*.debug')
@@ -130,7 +130,7 @@ deploy {
developerRobotJava(JavaArtifact) {
jarTask = shadowJar
postdeploy << { ctx ->
ctx.execute("echo '/usr/bin/java -XX:+UseG1GC -Djava.library.path=/home/systemcore/frc/third-party/lib -jar /home/systemcore/developerRobot-all.jar' > /home/systemcore/robotCommand")
ctx.execute("echo '/usr/bin/java -XX:+UseG1GC -Djava.library.path=/home/systemcore/wpilib/third-party/lib -jar /home/systemcore/developerRobot-all.jar' > /home/systemcore/robotCommand")
ctx.execute("chmod +x /home/systemcore/robotCommand; chown systemcore /home/systemcore/robotCommand")
}
}

View File

@@ -28,7 +28,7 @@ mockito-core = { module = "org.mockito:mockito-core", version = "4.1.0" }
# Note that these are also Gradle plugins and cannot be used with the plugin specification
# due to their presence on the classpath without version information.
wpilib-gradle-vscode = { module = "org.wpilib:gradle-cpp-vscode", version = "2027.0.0" }
wpilib-native-utils = { module = "org.wpilib:native-utils", version = "2027.1.1" }
wpilib-native-utils = { module = "org.wpilib:native-utils", version = "2027.4.1" }
[bundles]
ejml = ["ejml-simple"]
@@ -48,6 +48,6 @@ wpilib-gradle-jni = { id = "org.wpilib.GradleJni", version = "2027.0.0" }
# Note: these plugins can't be used. Their JARs are on the classpath for buildSrc,
# which doesn't retain version information.
# wpilib-gradle-vscode = { id = "org.wpilib.GradleVsCode", version = "2027.0.0" }
# wpilib-native-utils = { id = "org.wpilib.NativeUtils", version = "2027.1.1" }
# wpilib-native-utils = { id = "org.wpilib.NativeUtils", version = "2027.4.1" }
wpilib-repositories = { id = "org.wpilib.WPILibRepositoriesPlugin", version = "2027.0.0" }
wpilib-versioning = { id = "org.wpilib.WPILibVersioningPlugin", version = "2027.0.1" }

View File

@@ -422,7 +422,7 @@ def define_pybind_library(name, pkgcfgs = []):
"//wpiutil:robotpy-wpiutil",
],
strip_path_prefixes = ["hal/src/main/python", "hal"],
summary = "Binary wrapper for FRC HAL",
summary = "Binary wrapper for WPILib HAL",
project_urls = {"Source code": "https://github.com/robotpy/mostrobotpy"},
author_email = "RobotPy Development Team <robotpy@googlegroups.com>",
requires = ["pyntcore==0.0.0", "robotpy-native-wpihal==0.0.0", "robotpy-wpiutil==0.0.0"],

View File

@@ -13,7 +13,7 @@ package org.wpilib.hardware.hal;
@SuppressWarnings("PMD.MissingStaticMethodInNonInstantiatableClass")
public final class CANAPITypes {
/**
* FRC CAN device type.
* FIRST CAN device type.
*
* <p>This enum represents different types of CAN devices. Teams are encouraged to use the
* kMiscellaneous for custom or miscellaneous devices.
@@ -64,7 +64,7 @@ public final class CANAPITypes {
}
/**
* FRC CAN manufacturer ID.
* FIRST CAN manufacturer ID.
*
* <p>This enum represents different manufacturer IDs for CAN devices. Teams are encouraged to use
* the kTeamUse manufacturer ID for custom or team-specific devices.

View File

@@ -6,7 +6,7 @@
#include <jni.h>
#ifdef __FRC_SYSTEMCORE__
#ifdef __FIRST_SYSTEMCORE__
#include <signal.h>
#endif
@@ -95,7 +95,7 @@ JNIEXPORT void JNICALL
Java_org_wpilib_hardware_hal_HAL_terminate
(JNIEnv*, jclass)
{
#ifdef __FRC_SYSTEMCORE__
#ifdef __FIRST_SYSTEMCORE__
::raise(SIGKILL);
#endif
}

View File

@@ -40,11 +40,6 @@
#define HAL_WARN_CANSessionMux_SocketBufferFull_MESSAGE \
"CAN: Socket Buffer full. Generally caused by sending too many packets."
#define ERR_FRCSystem_NetCommNotResponding_MESSAGE \
"FRCSystem: NetComm not responding"
#define ERR_FRCSystem_NoDSConnection_MESSAGE \
"FRCSystem: No driver station connected"
#define HAL_SUCCESS 0
#define SAMPLE_RATE_TOO_HIGH 1001

View File

@@ -137,7 +137,7 @@ inline int16_t getHandleTypedIndex(HAL_Handle handle, HAL_HandleEnum enumType,
if (!isHandleType(handle, enumType)) {
return InvalidHandleIndex;
}
#if !defined(__FRC_SYSTEMCORE__)
#if !defined(__FIRST_SYSTEMCORE__)
if (!isHandleCorrectVersion(handle, version)) {
return InvalidHandleIndex;
}

View File

@@ -54,8 +54,8 @@ static_assert(std::is_standard_layout_v<JoystickDataCache>);
static std::atomic_bool gShutdown{false};
struct FRCDriverStation {
~FRCDriverStation() { gShutdown = true; }
struct FIRSTDriverStation {
~FIRSTDriverStation() { gShutdown = true; }
wpi::util::EventVector newDataEvents;
wpi::util::mutex cacheMutex;
wpi::util::mutex tcpCacheMutex;
@@ -114,11 +114,11 @@ void TcpCache::Update() {
}
}
static ::FRCDriverStation* driverStation;
static ::FIRSTDriverStation* driverStation;
namespace wpi::hal::init {
void InitializeDriverStation() {
static FRCDriverStation ds;
static FIRSTDriverStation ds;
driverStation = &ds;
}
} // namespace wpi::hal::init

View File

@@ -200,13 +200,13 @@ struct SystemServerDriverStation {
~SystemServerDriverStation() { ntInst.RemoveListener(controlDataListener); }
};
struct FRCDriverStation {
struct FIRSTDriverStation {
wpi::util::EventVector newDataEvents;
};
} // namespace
static ::SystemServerDriverStation* systemServerDs;
static ::FRCDriverStation* driverStation;
static ::FIRSTDriverStation* driverStation;
void SystemServerDriverStation::HandleListener(const wpi::nt::Event& event) {
auto valueEvent = event.GetValueEventData();
@@ -378,10 +378,10 @@ void TcpCache::Update() {
}
namespace wpi::hal::init {
void InitializeFRCDriverStation() {
void InitializeFIRSTDriverStation() {
InitializeDashboardOpMode();
newestControlWord.value = 0;
static FRCDriverStation ds;
static FIRSTDriverStation ds;
driverStation = &ds;
}
} // namespace wpi::hal::init

View File

@@ -47,7 +47,7 @@ void InitializeHAL() {
InitializeDIO();
InitializeDutyCycle();
InitializeEncoder();
InitializeFRCDriverStation();
InitializeFIRSTDriverStation();
InitializeI2C();
InitializeIMU();
InitializeMain();

View File

@@ -29,7 +29,7 @@ extern void InitializeDigitalInternal();
extern void InitializeDIO();
extern void InitializeDutyCycle();
extern void InitializeEncoder();
extern void InitializeFRCDriverStation();
extern void InitializeFIRSTDriverStation();
extern void InitializeHAL();
extern void InitializeI2C();
extern void InitializeIMU();

View File

@@ -22,7 +22,7 @@ SEMIWRAP_PYBIND11_MODULE(m) {
m.def(
"resetGlobalHandles",
[]() {
#ifndef __FRC_SYSTEMCORE__
#ifndef __FIRST_SYSTEMCORE__
HALSIM_ResetGlobalHandles();
#endif
},

View File

@@ -1,6 +1,4 @@
#ifndef __FRC_SYSTEMCORE__
#ifndef __FIRST_SYSTEMCORE__
#include "wpi/hal/Notifier.hpp"
#include "wpi/hal/handles/HandlesInternal.hpp"
#include "wpi/hal/simulation/NotifierData.h"

View File

@@ -60,7 +60,7 @@ SEMIWRAP_PYBIND11_MODULE(m) {
initWrapper(m);
#ifdef __FRC_SYSTEMCORE__
#ifdef __FIRST_SYSTEMCORE__
m.attr("__halplatform__") = "Systemcore";
m.attr("__hal_simulation__") = false;
#else

View File

@@ -12,7 +12,7 @@ requires = [
[project]
name = "robotpy-hal"
version = "0.0.0"
description = "Binary wrapper for FRC HAL"
description = "Binary wrapper for WPILib HAL"
authors = [
{name = "RobotPy Development Team", email = "robotpy@googlegroups.com"},
]

View File

@@ -3,14 +3,14 @@ strip_prefixes:
functions:
HAL_LoadOneExtension:
ifndef: __FRC_SYSTEMCORE__
ifndef: __FIRST_SYSTEMCORE__
HAL_LoadExtensions:
ifndef: __FRC_SYSTEMCORE__
ifndef: __FIRST_SYSTEMCORE__
HAL_RegisterExtension:
ignore: true
HAL_RegisterExtensionListener:
ignore: true
HAL_SetShowExtensionsNotFoundMessages:
ifndef: __FRC_SYSTEMCORE__
ifndef: __FIRST_SYSTEMCORE__
HAL_OnShutdown:
ignore: true

View File

@@ -260,7 +260,7 @@ inline_code: |2
return (bool)self;
})
.def_property_readonly("name", [](const wpi::hal::SimDevice &self) -> py::str {
#ifdef __FRC_SYSTEMCORE__
#ifdef __FIRST_SYSTEMCORE__
return "<invalid>";
#else
if (!self) {
@@ -276,7 +276,7 @@ inline_code: |2
#endif
})
.def("__repr__", [](const wpi::hal::SimDevice &self) -> py::str {
#ifdef __FRC_SYSTEMCORE__
#ifdef __FIRST_SYSTEMCORE__
return "<SimDevice (invalid)>";
#else
if (!self) {
@@ -309,7 +309,7 @@ inline_code: |2
cls_SimEnum
.def_property("value", &SimEnum::Get, &SimEnum::Set)
.def("__repr__", [](const SimEnum &self) -> py::str {
#ifdef __FRC_SYSTEMCORE__
#ifdef __FIRST_SYSTEMCORE__
return "<SimEnum (invalid)>";
#else
if (self) {

View File

@@ -7,7 +7,7 @@ Protocol Revision 2.0 (0x0200), 1/8/2013
This document defines a network protocol for a key-value store that may be read
from and written to by multiple remote clients. A central server, most often
running on a FIRST FRC robot controller, is responsible for providing
running on a FIRST robot controller, is responsible for providing
information consistency and for facilitating communication between clients.
This document describes protocol revision 2.0 (0x0200).

View File

@@ -7,7 +7,7 @@ Protocol Revision 3.0 (0x0300), 6/12/2015
This document defines a network protocol for a key-value store that may be read
from and written to by multiple remote clients. A central server, most often
running on a FIRST FRC robot controller, is responsible for providing
running on a FIRST robot controller, is responsible for providing
information consistency and for facilitating communication between clients.
This document describes protocol revision 3.0 (0x0300).

View File

@@ -863,7 +863,7 @@ This was considered, but rejected for two reasons: encoding overhead and spec/im
[[trade-timestamp]]
=== Timestamp format
The spec uses integer microseconds. This seems to be a reasonable enough resolution for FRC use and is common with the FPGA clock resolution.
The spec uses integer microseconds. This seems to be a reasonable enough resolution for FIRST use and is common with the unix clock resolution.
[[unresolved-questions]]
== Unresolved Questions

View File

@@ -486,7 +486,7 @@ def define_pybind_library(name, pkgcfgs = []):
"//wpiutil:robotpy-wpiutil",
],
strip_path_prefixes = ["ntcore/src/main/python", "ntcore"],
summary = "Binary wrappers for the FRC ntcore library",
summary = "Binary wrappers for the FIRST ntcore library",
project_urls = {"Source code": "https://github.com/robotpy/mostrobotpy"},
author_email = "RobotPy Development Team <robotpy@googlegroups.com>",
requires = ["robotpy-native-ntcore==0.0.0", "robotpy-wpiutil==0.0.0", "robotpy-wpinet==0.0.0", "robotpy-wpilog==0.0.0"],

View File

@@ -15,7 +15,7 @@ requires = [
[project]
name = "pyntcore"
version = "0.0.0"
description = "Binary wrappers for the FRC ntcore library"
description = "Binary wrappers for the FIRST ntcore library"
authors = [
{name = "RobotPy Development Team", email = "robotpy@googlegroups.com"},
]

View File

@@ -37,7 +37,7 @@ void ReportErrorV(int32_t status, const char* fileName, int lineNumber,
const char* funcName, fmt::string_view format,
fmt::format_args args) {
// TODO when we get a low level interface
// #ifdef __FRC_SYSTEMCORE__
// #ifdef __FIRST_SYSTEMCORE__
// if (status == 0) {
// return;
// }
@@ -69,7 +69,7 @@ inline void ReportError(int32_t status, const char* fileName, int lineNumber,
namespace RobotController {
inline bool IsSystemTimeValid() {
#ifdef __FRC_SYSTEMCORE__
#ifdef __FIRST_SYSTEMCORE__
// TODO when we get a proper low level library, and time setting
return false;
// uint8_t timeWasSet = 0;
@@ -83,7 +83,7 @@ inline bool IsSystemTimeValid() {
namespace filesystem {
inline std::string GetOperatingDirectory() {
#ifdef __FRC_SYSTEMCORE__
#ifdef __FIRST_SYSTEMCORE__
return "/home/systemcore";
#else
return fs::current_path().string();
@@ -92,7 +92,7 @@ inline std::string GetOperatingDirectory() {
} // namespace filesystem
namespace DriverStation {
// #ifdef __FRC_SYSTEMCORE__
// #ifdef __FIRST_SYSTEMCORE__
// using MatchType = MatchType_t;
// constexpr int kNone = kMatchType_none;
// constexpr int kPractice = kMatchType_practice;
@@ -109,7 +109,7 @@ enum MatchType { kNone, kPractice, kQualification, kElimination };
// #endif
inline void UpdateMatchInfo() {
// #ifdef __FRC_SYSTEMCORE__
// #ifdef __FIRST_SYSTEMCORE__
// gGameSpecificMessageSize = sizeof(gGameSpecificMessage);
// WPILIB_NetworkCommunication_getMatchInfo(gEventName, &gMatchType,
// &gMatchNumber,
@@ -120,7 +120,7 @@ inline void UpdateMatchInfo() {
}
inline MatchType GetMatchType() {
// #ifdef __FRC_SYSTEMCORE__
// #ifdef __FIRST_SYSTEMCORE__
// return gMatchType;
// #else
return kNone;
@@ -128,7 +128,7 @@ inline MatchType GetMatchType() {
}
inline std::string_view GetEventName() {
// #ifdef __FRC_SYSTEMCORE__
// #ifdef __FIRST_SYSTEMCORE__
// return gEventName;
// #else
return "";
@@ -136,7 +136,7 @@ inline std::string_view GetEventName() {
}
inline uint16_t GetMatchNumber() {
// #ifdef __FRC_SYSTEMCORE__
// #ifdef __FIRST_SYSTEMCORE__
// return gMatchNumber;
// #else
return 0;
@@ -144,7 +144,7 @@ inline uint16_t GetMatchNumber() {
}
inline bool IsDSAttached() {
// #ifdef __FRC_SYSTEMCORE__
// #ifdef __FIRST_SYSTEMCORE__
// struct ControlWord_t cw;
// WPILIB_NetworkCommunication_getControlWord(&cw);
// return cw.dsAttached;
@@ -154,7 +154,7 @@ inline bool IsDSAttached() {
}
inline bool IsFMSAttached() {
// #ifdef __FRC_SYSTEMCORE__
// #ifdef __FIRST_SYSTEMCORE__
// struct ControlWord_t cw;
// WPILIB_NetworkCommunication_getControlWord(&cw);
// return cw.fmsAttached;
@@ -173,7 +173,7 @@ inline void RemoveRefreshedDataEventHandle(WPI_EventHandle event) {}
} // namespace DriverStation
// #ifdef __FRC_SYSTEMCORE__
// #ifdef __FIRST_SYSTEMCORE__
// static constexpr int kRoboRIO = 0;
// namespace RobotBase {
// inline int GetRuntimeType() {
@@ -225,7 +225,7 @@ static std::string MakeLogDir(std::string_view dir) {
if (!dir.empty()) {
return std::string{dir};
}
#ifdef __FRC_SYSTEMCORE__
#ifdef __FIRST_SYSTEMCORE__
// prefer a mounted USB drive if one is accessible
std::error_code ec;
auto s = fs::status("/u", ec);

View File

@@ -12,7 +12,7 @@ from wpilib.cameraserver import CameraServer
class MyRobot(wpilib.TimedRobot):
"""
Uses the CameraServer class to automatically capture video from a USB webcam and send it to the
FRC dashboard without doing any vision processing. This is the easiest way to get camera images
dashboard without doing any vision processing. This is the easiest way to get camera images
to the dashboard. Just add this to the robotInit() method in your program.
"""

View File

@@ -38,7 +38,7 @@ class MyRobot(wpilib.TimedRobot):
# Inputs (what we can "put in"): [voltage], in volts.
# Outputs (what we can measure): [velocity], in radians per second.
#
# The Kv and Ka constants are found using the FRC Characterization toolsuite.
# The Kv and Ka constants are found using the SysID tool.
self.flywheelPlant = wpimath.Models.flywheelFromSysId(kFlywheelKv, kFlywheelKa)
# The observer fuses our encoder data and voltage inputs to reject noise.

View File

@@ -3,7 +3,7 @@
"name": "Romi-Vendordep",
"version": "1.0.0",
"uuid": "1010372a-b446-46f4-b229-61e53a26a7dc",
"frcYear": "2027_alpha1",
"wpilibYear": "2027_alpha4",
"mavenUrls": [],
"jsonUrl": "",
"javaDependencies": [

View File

@@ -505,7 +505,7 @@ void GlfwSystemJoystick::GetData(HALJoystickData* data, bool mapGamepad) const {
}
if (m_isGamepad && mapGamepad) {
// the FRC DriverStation maps gamepad (XInput) trigger values to 0-1 range
// the FIRST DriverStation maps gamepad (XInput) trigger values to 0-1 range
// on axis 2 and 3.
data->axes.axes[0] = sysAxes[0];
data->axes.axes[1] = sysAxes[1];

View File

@@ -1643,7 +1643,7 @@ def define_pybind_library(name, pkgcfgs = []):
requirement("robotpy-cli"),
],
strip_path_prefixes = ["wpilibc/src/main/python", "wpilibc"],
summary = "Binary wrapper for FRC WPILib",
summary = "Binary wrapper for WPILib",
project_urls = {"Source code": "https://github.com/robotpy/mostrobotpy"},
author_email = "RobotPy Development Team <robotpy@googlegroups.com>",
requires = ["robotpy-native-wpilib==0.0.0", "robotpy-wpiutil==0.0.0", "robotpy-wpimath==0.0.0", "robotpy-hal==0.0.0", "pyntcore==0.0.0", "robotpy-cli~=2027.0.0a1", "pytest>=3.9", "pytest-reraise"],

View File

@@ -68,7 +68,7 @@ static MotorSafetyManager& GetManager() {
return manager;
}
#ifndef __FRC_SYSTEMCORE__
#ifndef __FIRST_SYSTEMCORE__
namespace wpi::impl {
void ResetMotorSafety() {
auto& manager = GetManager();

View File

@@ -40,7 +40,7 @@ static Instance& GetInstance() {
return *GetInstanceHolder();
}
#ifndef __FRC_SYSTEMCORE__
#ifndef __FIRST_SYSTEMCORE__
namespace wpi::impl {
void ResetSmartDashboardInstance() {
std::make_unique<Instance>().swap(GetInstanceHolder());

View File

@@ -70,7 +70,7 @@ static std::string MakeLogDir(std::string_view dir) {
if (!dir.empty()) {
return std::string{dir};
}
#ifdef __FRC_SYSTEMCORE__
#ifdef __FIRST_SYSTEMCORE__
// prefer a mounted USB drive if one is accessible
std::error_code ec;
auto s = fs::status("/u", ec);

View File

@@ -45,7 +45,7 @@ static Instance& GetInstance() {
return instance;
}
#ifndef __FRC_SYSTEMCORE__
#ifndef __FIRST_SYSTEMCORE__
namespace wpi::impl {
void ResetPreferencesInstance() {
GetInstance() = Instance();

View File

@@ -6,7 +6,7 @@
#include <stdint.h>
#ifdef __FRC_SYSTEMCORE__
#ifdef __FIRST_SYSTEMCORE__
#include <dlfcn.h>
#endif
@@ -107,7 +107,7 @@ class WPILibMathShared : public wpi::math::MathShared {
} // namespace
static void SetupCameraServerShared() {
#ifdef __FRC_SYSTEMCORE__
#ifdef __FIRST_SYSTEMCORE__
#ifdef DYNAMIC_CAMERA_SERVER
#ifdef DYNAMIC_CAMERA_SERVER_DEBUG
auto cameraServerLib = dlopen("libcameraserverd.so", RTLD_NOW);

View File

@@ -24,7 +24,7 @@ namespace wpi {
int RunHALInitialization();
namespace impl {
#ifndef __FRC_SYSTEMCORE__
#ifndef __FIRST_SYSTEMCORE__
void ResetMotorSafety();
#endif
@@ -124,7 +124,7 @@ int StartRobot() {
impl::RunRobot<Robot>(m, &robot);
}
#ifndef __FRC_SYSTEMCORE__
#ifndef __FIRST_SYSTEMCORE__
wpi::impl::ResetMotorSafety();
#endif
HAL_Shutdown();
@@ -254,7 +254,7 @@ class RobotBase {
* @return If the robot is running in the real world.
*/
static constexpr bool IsReal() {
#ifdef __FRC_SYSTEMCORE__
#ifdef __FIRST_SYSTEMCORE__
return true;
#else
return false;
@@ -267,7 +267,7 @@ class RobotBase {
* @return If the robot is running in simulation.
*/
static constexpr bool IsSimulation() {
#ifdef __FRC_SYSTEMCORE__
#ifdef __FIRST_SYSTEMCORE__
return false;
#else
return true;

View File

@@ -1,7 +1,7 @@
RobotPy WPILib
==============
Python version of WPILib - the standard library used for programming FRC
Python version of WPILib - the standard library used for programming FIRST
robots.
Installation

View File

@@ -15,7 +15,7 @@ requires = [
[project]
name = "wpilib"
version = "0.0.0"
description = "Binary wrapper for FRC WPILib"
description = "Binary wrapper for WPILib"
authors = [
{name = "RobotPy Development Team", email = "robotpy@googlegroups.com"},
]

View File

@@ -1,7 +1,7 @@
#include "semiwrap_init.wpilib.simulation._simulation.hpp"
#ifndef __FRC_SYSTEMCORE__
#ifndef __FIRST_SYSTEMCORE__
namespace wpi::impl {
void ResetSmartDashboardInstance();

View File

@@ -30,7 +30,7 @@ static fs::path getMainPath() {
if (locals.contains("main_path")) {
return fs::path(py::cast<std::string>(locals["main_path"]));
} else {
#ifdef __FRC_SYSTEMCORE__
#ifdef __FIRST_SYSTEMCORE__
return fs::path("/home/systemcore/py");
#else
return fs::current_path();

View File

@@ -6,7 +6,7 @@
#include "wpi/hal/HAL.h"
#ifndef __FRC_SYSTEMCORE__
#ifndef __FIRST_SYSTEMCORE__
namespace wpi::impl {
void ResetMotorSafety();
}
@@ -16,7 +16,7 @@ int main(int argc, char** argv) {
HAL_Initialize(500, 0);
::testing::InitGoogleTest(&argc, argv);
int ret = RUN_ALL_TESTS();
#ifndef __FRC_SYSTEMCORE__
#ifndef __FIRST_SYSTEMCORE__
wpi::impl::ResetMotorSafety();
#endif
return ret;

View File

@@ -9,9 +9,9 @@
/**
* Uses the CameraServer class to automatically capture video from a USB webcam
* and send it to the FRC dashboard without doing any vision processing. This is
* the easiest way to get camera images to the dashboard. Just add this to the
* robot class constructor.
* and send it to the dashboard without doing any vision processing. This is
* the easiest way to get camera images to the dashboard. Just add this to
* the robot class constructor.
*/
class Robot : public wpi::TimedRobot {
public:

View File

@@ -49,7 +49,7 @@ void Robot::TeleopPeriodic() {
m_drive.ArcadeDrive(-m_controller.GetRawAxis(2), -m_controller.GetRawAxis(1));
}
#ifndef RUNNING_FRC_TESTS
#ifndef RUNNING_WPILIB_TESTS
int main() {
return wpi::StartRobot<Robot>();
}

View File

@@ -8,7 +8,7 @@
</head>
<body>
The WPI Robotics library (WPILibJ) is a set of Java classes that interfaces
to the hardware in the FRC control system and your robot. There are classes
to the hardware in the FIRST control system and your robot. There are classes
to handle sensors, motors, the driver station, and a number of other
utility functions like timing and field management. The library is designed
to:

View File

@@ -9,8 +9,8 @@ import org.wpilib.vision.stream.CameraServer;
/**
* Uses the CameraServer class to automatically capture video from a USB webcam and send it to the
* FRC dashboard without doing any vision processing. This is the easiest way to get camera images
* to the dashboard. Just add this to the robot class constructor.
* dashboard without doing any vision processing. This is the easiest way to get camera images to
* the dashboard. Just add this to the robot class constructor.
*/
public class Robot extends TimedRobot {
public Robot() {

View File

@@ -1297,7 +1297,7 @@ def define_pybind_library(name, pkgcfgs = []):
"//wpiutil:robotpy-wpiutil",
],
strip_path_prefixes = ["wpimath/src/main/python", "wpimath"],
summary = "Binary wrapper for FRC WPIMath library",
summary = "Binary wrapper for WPILib Math library",
project_urls = {"Source code": "https://github.com/robotpy/mostrobotpy"},
author_email = "RobotPy Development Team <robotpy@googlegroups.com>",
requires = ["robotpy-native-wpimath==0.0.0", "robotpy-wpiutil==0.0.0"],

View File

@@ -4,7 +4,7 @@
package org.wpilib.math.util;
/** Utility class that converts between commonly used units in FRC. */
/** Utility class that converts between commonly used units in FIRST. */
public final class Units {
private static final double kInchesPerFoot = 12.0;
private static final double kMetersPerInch = 0.0254;

View File

@@ -13,7 +13,7 @@ requires = [
[project]
name = "robotpy-wpimath"
version = "0.0.0"
description = "Binary wrapper for FRC WPIMath library"
description = "Binary wrapper for WPILib Math library"
authors = [
{name = "RobotPy Development Team", email = "robotpy@googlegroups.com"},
]
@@ -1438,7 +1438,7 @@ types = [
default_arg_cast = false
[[tool.semiwrap.export_type_casters.wpimath-casters.headers]]
header = "frc_eigen.h"
header = "wpi_eigen.h"
types = [
"wpi::math::Vectord",
"wpi::math::Matrixd",

View File

@@ -1,5 +1,5 @@
extra_includes:
- frc_eigen.h
- wpi_eigen.h
- wpi/math/linalg/EigenCore.hpp
- pybind11/functional.h

View File

@@ -1,5 +1,5 @@
extra_includes:
- frc_eigen.h
- wpi_eigen.h
- wpi/math/linalg/EigenCore.hpp
- pybind11/functional.h
- pybind11/typing.h

View File

@@ -1,4 +0,0 @@
#pragma once
// the FRC types are just aliases for Eigen types, so use that
#include <pybind11/eigen.h>

View File

@@ -0,0 +1,4 @@
#pragma once
// the WPILib types are just aliases for Eigen types, so use that
#include <pybind11/eigen.h>

View File

@@ -157,7 +157,7 @@ def define_pybind_library(name, pkgcfgs = []):
"//wpiutil:robotpy-wpiutil",
],
strip_path_prefixes = ["wpinet/src/main/python", "wpinet"],
summary = "Binary wrapper for FRC wpinet library",
summary = "Binary wrapper for WPILib networking library",
project_urls = {"Source code": "https://github.com/robotpy/mostrobotpy"},
author_email = "RobotPy Development Team <robotpy@googlegroups.com>",
requires = ["robotpy-native-wpinet==0.0.0", "robotpy-wpiutil==0.0.0"],

View File

@@ -13,7 +13,7 @@ requires = [
[project]
name = "robotpy-wpinet"
version = "0.0.0"
description = "Binary wrapper for FRC wpinet library"
description = "Binary wrapper for WPILib networking library"
authors = [
{name = "RobotPy Development Team", email = "robotpy@googlegroups.com"},
]

View File

@@ -253,7 +253,7 @@ def define_pybind_library(name, pkgcfgs = []):
"//wpiutil:robotpy-native-wpiutil",
],
strip_path_prefixes = ["wpiutil/src/main/python", "wpiutil"],
summary = "Binary wrapper for FRC WPIUtil library",
summary = "Binary wrapper for WPILib utilities library",
project_urls = {"Source code": "https://github.com/robotpy/mostrobotpy"},
author_email = "RobotPy Development Team <robotpy@googlegroups.com>",
requires = ["robotpy-native-wpiutil==0.0.0"],

View File

@@ -130,7 +130,7 @@ JNIEXPORT void JNICALL
Java_org_wpilib_util_WPIUtilJNI_enableMockTime
(JNIEnv*, jclass)
{
#ifdef __FRC_SYSTEMCORE__
#ifdef __FIRST_SYSTEMCORE__
wpi::util::print(stderr,
"WPIUtil: Mocking time is not available on systemcore\n");
#else

View File

@@ -71,7 +71,7 @@ static SendableRegistryInst& GetInstance() {
return *GetInstanceHolder();
}
#ifndef __FRC_SYSTEMCORE__
#ifndef __FIRST_SYSTEMCORE__
namespace wpi::util::impl {
void ResetSendableRegistry() {
std::make_unique<SendableRegistryInst>().swap(GetInstanceHolder());

View File

@@ -83,7 +83,7 @@ uint64_t wpi::util::NowDefault() {
// delta by 1,000,000
uint64_t delta_in_us = delta * 1000000ull / frequency_val;
return delta_in_us + zerotime_val;
#elif defined(__FRC_SYSTEMCORE__)
#elif defined(__FIRST_SYSTEMCORE__)
// We want clock synchronized across the system, so just use steady_clock.
return timestamp();
#else

View File

@@ -13,7 +13,7 @@
namespace wpi::util {
#if defined(__FRC_SYSTEMCORE__) && !defined(WPI_USE_PRIORITY_MUTEX)
#if defined(__FIRST_SYSTEMCORE__) && !defined(WPI_USE_PRIORITY_MUTEX)
#define WPI_USE_PRIORITY_MUTEX
#endif

View File

@@ -11,7 +11,7 @@ requires = [
[project]
name = "robotpy-wpiutil"
version = "0.0.0"
description = "Binary wrapper for FRC WPIUtil library"
description = "Binary wrapper for WPILib utilities library"
authors = [
{name = "RobotPy Development Team", email = "robotpy@googlegroups.com"},
]

View File

@@ -7,7 +7,7 @@ void cleanup_stack_trace_hook();
void setup_safethread_gil();
void cleanup_safethread_gil();
#ifndef __FRC_SYSTEMCORE__
#ifndef __FIRST_SYSTEMCORE__
namespace wpi::util::impl {
void ResetSendableRegistry();

View File

@@ -3,7 +3,7 @@
"name": "XRP-Vendordep",
"version": "1.0.0",
"uuid": "1571a1a5-ed3f-4f07-b7eb-b2beb17394e0",
"frcYear": "2027_alpha1",
"wpilibYear": "2027_alpha4",
"mavenUrls": [],
"jsonUrl": "",
"javaDependencies": [