[bazel][robotpy] Add mirror for robotpy's wpiuil and wpinet libraries (#8062)

Project import generated by Copybara.

GitOrigin-RevId: 92ea93d1b47a82667044bd0af05f7fdb34d2c2c2
This commit is contained in:
PJ Reiniger
2025-08-30 14:55:11 -04:00
committed by GitHub
parent 96004f9bb5
commit bd1dcc4358
96 changed files with 7271 additions and 64 deletions

View File

@@ -0,0 +1,7 @@
defaults:
ignore: true
enums:
WPI_TimestampSource:
value_prefix: WPI_TIMESRC
rename: TimestampSource

View File

@@ -0,0 +1,12 @@
extra_includes:
- wpi/sendable/SendableBuilder.h
classes:
wpi::Sendable:
methods:
InitSendable:
virtual_xform: |-
[&](py::function fn) {
auto builderHandle = py::cast(builder, py::return_value_policy::reference);
fn(builderHandle);
}

View File

@@ -0,0 +1,40 @@
classes:
wpi::SendableBuilder:
enums:
BackendKind:
methods:
SetSmartDashboardType:
SetActuator:
AddBooleanProperty:
PublishConstBoolean:
AddIntegerProperty:
PublishConstInteger:
AddFloatProperty:
PublishConstFloat:
AddDoubleProperty:
PublishConstDouble:
AddStringProperty:
PublishConstString:
AddBooleanArrayProperty:
PublishConstBooleanArray:
AddIntegerArrayProperty:
PublishConstIntegerArray:
AddFloatArrayProperty:
PublishConstFloatArray:
AddDoubleArrayProperty:
PublishConstDoubleArray:
AddStringArrayProperty:
PublishConstStringArray:
AddRawProperty:
PublishConstRaw:
AddSmallStringProperty:
AddSmallBooleanArrayProperty:
AddSmallIntegerArrayProperty:
AddSmallFloatArrayProperty:
AddSmallDoubleArrayProperty:
AddSmallStringArrayProperty:
AddSmallRawProperty:
GetBackendKind:
IsPublished:
Update:
ClearProperties:

View File

@@ -0,0 +1,54 @@
extra_includes:
- wpi/sendable/Sendable.h
- wpi/sendable/SendableBuilder.h
classes:
wpi::SendableRegistry:
nodelete: true
methods:
Add:
overloads:
Sendable*, std::string_view:
keepalive:
- [1, 2]
Sendable*, std::string_view, int:
keepalive:
- [1, 2]
Sendable*, std::string_view, int, int:
keepalive:
- [1, 2]
Sendable*, std::string_view, std::string_view:
keepalive:
- [1, 2]
AddChild:
overloads:
Sendable*, Sendable*:
keepalive:
- [1, 2]
- [2, 3]
Sendable*, void*:
ignore: true
Remove:
Move:
ignore: true
Contains:
GetName:
SetName:
overloads:
Sendable*, std::string_view:
Sendable*, std::string_view, int:
Sendable*, std::string_view, int, int:
Sendable*, std::string_view, std::string_view:
GetSubsystem:
SetSubsystem:
GetDataHandle:
ignore: true
SetData:
ignore: true
GetData:
ignore: true
GetUniqueId:
GetSendable:
Publish:
Update:
EnsureInitialized:

View File

@@ -0,0 +1,5 @@
functions:
GetStackTrace:
GetStackTraceDefault:
SetGetStackTraceImpl:
ignore: true

View File

@@ -0,0 +1,59 @@
defaults:
ignore: true
subpackage: sync
extra_includes:
- pybind11/stl.h
functions:
CreateEvent:
DestroyEvent:
SetEvent:
ResetEvent:
CreateSemaphore:
DestroySemaphore:
ReleaseSemaphore:
param_override:
prevCount:
default: "0"
WaitForObject:
overloads:
WPI_Handle:
WPI_Handle, double, bool*:
WaitForObjects:
overloads:
std::span<const WPI_Handle>, std::span<WPI_Handle>:
param_override:
signaled:
ignore: true
cpp_code: |
[](std::span<const WPI_Handle> handles) {
py::gil_scoped_release release;
std::vector<WPI_Handle> signaled(handles.size());
auto result = wpi::WaitForObjects(handles, signaled);
signaled.resize(result.size());
return signaled;
}
std::initializer_list<WPI_Handle>, std::span<WPI_Handle>:
ignore: true
std::span<const WPI_Handle>, std::span<WPI_Handle>, double, bool*:
param_override:
signaled:
ignore: true
timedOut:
ignore: true
cpp_code: |
[](std::span<const WPI_Handle> handles, double timeout) {
py::gil_scoped_release release;
std::vector<WPI_Handle> signaled(handles.size());
bool timedOut = false;
auto result = wpi::WaitForObjects(handles, signaled, timeout, &timedOut);
signaled.resize(result.size());
return std::make_tuple(signaled, timedOut);
}
std::initializer_list<WPI_Handle>, std::span<WPI_Handle>, double, bool*:
ignore: true
CreateSignalObject:
SetSignalObject:
ResetSignalObject:
DestroySignalObject:

View File

@@ -0,0 +1,22 @@
defaults:
subpackage: wpistruct
functions:
forEachNested:
no_release_gil: true
getTypeName:
no_release_gil: true
getSchema:
no_release_gil: true
getSize:
no_release_gil: true
pack:
no_release_gil: true
packArray:
no_release_gil: true
packInto:
no_release_gil: true
unpack:
no_release_gil: true
unpackArray:
no_release_gil: true