From 929566ab1941e173b752e12ae16955754b0e4787 Mon Sep 17 00:00:00 2001 From: Dustin Spicuzza Date: Thu, 3 Apr 2025 00:41:08 -0400 Subject: [PATCH 01/20] Changes due to removing pydantic --- subprojects/robotpy-hal/gen/CAN.yml | 4 ++-- subprojects/robotpy-hal/gen/CANAPI.yml | 10 +++++----- subprojects/robotpy-hal/gen/I2C.yml | 8 ++++---- subprojects/robotpy-hal/gen/SPI.yml | 12 ++++++------ subprojects/robotpy-hal/gen/SerialPort.yml | 4 ++-- subprojects/robotpy-wpilib/gen/CAN.yml | 8 ++++---- subprojects/robotpy-wpilib/gen/I2C.yml | 12 ++++++------ subprojects/robotpy-wpilib/gen/SPI.yml | 10 +++++----- subprojects/robotpy-wpilib/gen/SerialPort.yml | 4 ++-- .../gen/controls/LinearQuadraticRegulator.yml | 4 ++-- .../gen/controls/TrapezoidProfile.yml | 4 ++-- 11 files changed, 40 insertions(+), 40 deletions(-) diff --git a/subprojects/robotpy-hal/gen/CAN.yml b/subprojects/robotpy-hal/gen/CAN.yml index 5a0ff5f92..eae7ca46e 100644 --- a/subprojects/robotpy-hal/gen/CAN.yml +++ b/subprojects/robotpy-hal/gen/CAN.yml @@ -6,10 +6,10 @@ strip_prefixes: functions: HAL_CAN_SendMessage: buffers: - - { type: in, src: data, len: dataSize } + - { type: IN, src: data, len: dataSize } HAL_CAN_ReceiveMessage: buffers: - - { type: out, src: data, len: dataSize, minsz: 8 } + - { type: OUT, src: data, len: dataSize, minsz: 8 } HAL_CAN_OpenStreamSession: HAL_CAN_CloseStreamSession: HAL_CAN_ReadStreamSession: diff --git a/subprojects/robotpy-hal/gen/CANAPI.yml b/subprojects/robotpy-hal/gen/CANAPI.yml index 367da410d..3d4954f95 100644 --- a/subprojects/robotpy-hal/gen/CANAPI.yml +++ b/subprojects/robotpy-hal/gen/CANAPI.yml @@ -9,18 +9,18 @@ functions: HAL_CleanCAN: HAL_WriteCANPacket: buffers: - - { type: in, src: data, len: length } + - { type: IN, src: data, len: length } HAL_WriteCANPacketRepeating: buffers: - - { type: in, src: data, len: length } + - { type: IN, src: data, len: length } HAL_WriteCANRTRFrame: HAL_StopCANPacketRepeating: HAL_ReadCANPacketNew: buffers: - - { type: out, src: data, len: length, minsz: 8 } + - { type: OUT, src: data, len: length, minsz: 8 } HAL_ReadCANPacketLatest: buffers: - - { type: out, src: data, len: length, minsz: 8 } + - { type: OUT, src: data, len: length, minsz: 8 } HAL_ReadCANPacketTimeout: buffers: - - { type: out, src: data, len: length, minsz: 8 } + - { type: OUT, src: data, len: length, minsz: 8 } diff --git a/subprojects/robotpy-hal/gen/I2C.yml b/subprojects/robotpy-hal/gen/I2C.yml index 14cdf25aa..20c3146fb 100644 --- a/subprojects/robotpy-hal/gen/I2C.yml +++ b/subprojects/robotpy-hal/gen/I2C.yml @@ -7,12 +7,12 @@ functions: HAL_InitializeI2C: HAL_TransactionI2C: buffers: - - { type: in, src: dataToSend, len: sendSize } - - { type: out, src: dataReceived, len: receiveSize } + - { type: IN, src: dataToSend, len: sendSize } + - { type: OUT, src: dataReceived, len: receiveSize } HAL_WriteI2C: buffers: - - { type: in, src: dataToSend, len: sendSize } + - { type: IN, src: dataToSend, len: sendSize } HAL_ReadI2C: buffers: - - { type: out, src: buffer, len: count } + - { type: OUT, src: buffer, len: count } HAL_CloseI2C: diff --git a/subprojects/robotpy-hal/gen/SPI.yml b/subprojects/robotpy-hal/gen/SPI.yml index 72aa8e701..020f8366a 100644 --- a/subprojects/robotpy-hal/gen/SPI.yml +++ b/subprojects/robotpy-hal/gen/SPI.yml @@ -7,15 +7,15 @@ functions: HAL_InitializeSPI: HAL_TransactionSPI: buffers: - - { type: in, src: dataToSend, len: size } - - { type: out, src: dataReceived, len: size } + - { type: IN, src: dataToSend, len: size } + - { type: OUT, src: dataReceived, len: size } # TODO: dataToSend buffer must be at least as long as dataReceived buffer HAL_WriteSPI: buffers: - - { type: in, src: dataToSend, len: sendSize } + - { type: IN, src: dataToSend, len: sendSize } HAL_ReadSPI: buffers: - - { type: out, src: buffer, len: count } + - { type: OUT, src: buffer, len: count } HAL_CloseSPI: HAL_SetSPISpeed: HAL_SetSPIMode: @@ -31,10 +31,10 @@ functions: HAL_StopSPIAuto: HAL_SetSPIAutoTransmitData: buffers: - - { type: in, src: dataToSend, len: dataSize } + - { type: IN, src: dataToSend, len: dataSize } HAL_ForceSPIAutoRead: HAL_ReadSPIAutoReceivedData: buffers: - - { type: out, src: buffer, len: numToRead } + - { type: OUT, src: buffer, len: numToRead } HAL_GetSPIAutoDroppedCount: HAL_ConfigureSPIAutoStall: diff --git a/subprojects/robotpy-hal/gen/SerialPort.yml b/subprojects/robotpy-hal/gen/SerialPort.yml index c69473803..98ec3725d 100644 --- a/subprojects/robotpy-hal/gen/SerialPort.yml +++ b/subprojects/robotpy-hal/gen/SerialPort.yml @@ -23,10 +23,10 @@ functions: HAL_GetSerialBytesReceived: HAL_ReadSerial: buffers: - - { type: out, src: buffer, len: count } + - { type: OUT, src: buffer, len: count } HAL_WriteSerial: buffers: - - { type: in, src: buffer, len: count } + - { type: IN, src: buffer, len: count } HAL_FlushSerial: HAL_ClearSerial: HAL_CloseSerial: diff --git a/subprojects/robotpy-wpilib/gen/CAN.yml b/subprojects/robotpy-wpilib/gen/CAN.yml index fb46c74fe..253c37487 100644 --- a/subprojects/robotpy-wpilib/gen/CAN.yml +++ b/subprojects/robotpy-wpilib/gen/CAN.yml @@ -19,16 +19,16 @@ classes: int, int, int: WritePacket: buffers: - - { type: in, src: data, len: length } + - { type: IN, src: data, len: length } WritePacketNoError: buffers: - - { type: in, src: data, len: length } + - { type: IN, src: data, len: length } WritePacketRepeating: buffers: - - { type: in, src: data, len: length } + - { type: IN, src: data, len: length } WritePacketRepeatingNoError: buffers: - - { type: in, src: data, len: length } + - { type: IN, src: data, len: length } WriteRTRFrame: WriteRTRFrameNoError: StopPacketRepeating: diff --git a/subprojects/robotpy-wpilib/gen/I2C.yml b/subprojects/robotpy-wpilib/gen/I2C.yml index c1a309409..8d266278f 100644 --- a/subprojects/robotpy-wpilib/gen/I2C.yml +++ b/subprojects/robotpy-wpilib/gen/I2C.yml @@ -11,19 +11,19 @@ classes: GetDeviceAddress: Transaction: buffers: - - { type: in, src: dataToSend, len: sendSize } - - { type: out, src: dataReceived, len: receiveSize } + - { type: IN, src: dataToSend, len: sendSize } + - { type: OUT, src: dataReceived, len: receiveSize } AddressOnly: Write: WriteBulk: buffers: - - { type: in, src: data, len: count } + - { type: IN, src: data, len: count } Read: buffers: - - { type: out, src: data, len: count } + - { type: OUT, src: data, len: count } ReadOnly: buffers: - - { type: out, src: buffer, len: count } + - { type: OUT, src: buffer, len: count } VerifySensor: buffers: - - { type: in, src: expected, len: count } + - { type: IN, src: expected, len: count } diff --git a/subprojects/robotpy-wpilib/gen/SPI.yml b/subprojects/robotpy-wpilib/gen/SPI.yml index 3b2eb2507..2caf0b522 100644 --- a/subprojects/robotpy-wpilib/gen/SPI.yml +++ b/subprojects/robotpy-wpilib/gen/SPI.yml @@ -35,14 +35,14 @@ classes: SetChipSelectActiveLow: Write: buffers: - - { type: in, src: data, len: size } + - { type: IN, src: data, len: size } Read: buffers: - - { type: out, src: dataReceived, len: size } + - { type: OUT, src: dataReceived, len: size } Transaction: buffers: - - { type: in, src: dataToSend, len: size } - - { type: out, src: dataReceived, len: size } + - { type: IN, src: dataToSend, len: size } + - { type: OUT, src: dataReceived, len: size } # TODO: dataToSend buffer must be at least as long as dataReceived buffer InitAuto: FreeAuto: @@ -59,7 +59,7 @@ classes: overloads: uint32_t*, int, units::second_t: buffers: - - { type: out, src: buffer, len: numToRead } + - { type: OUT, src: buffer, len: numToRead } uint32_t*, int, double: ignore: true GetAutoDroppedCount: diff --git a/subprojects/robotpy-wpilib/gen/SerialPort.yml b/subprojects/robotpy-wpilib/gen/SerialPort.yml index fc0bdfd7e..5476bb0a2 100644 --- a/subprojects/robotpy-wpilib/gen/SerialPort.yml +++ b/subprojects/robotpy-wpilib/gen/SerialPort.yml @@ -37,12 +37,12 @@ classes: GetBytesReceived: Read: buffers: - - { type: out, src: buffer, len: count } + - { type: OUT, src: buffer, len: count } Write: overloads: const char*, int: buffers: - - { type: in, src: buffer, len: count } + - { type: IN, src: buffer, len: count } std::string_view: ignore: true SetTimeout: diff --git a/subprojects/robotpy-wpimath/gen/controls/LinearQuadraticRegulator.yml b/subprojects/robotpy-wpimath/gen/controls/LinearQuadraticRegulator.yml index 7dc516a2b..1f492cf1f 100644 --- a/subprojects/robotpy-wpimath/gen/controls/LinearQuadraticRegulator.yml +++ b/subprojects/robotpy-wpimath/gen/controls/LinearQuadraticRegulator.yml @@ -38,8 +38,8 @@ classes: const StateVector&, const StateVector&: LatencyCompensate: template_impls: - - [1] - - [2] + - ["1"] + - ["2"] template_inline_code: | cls_LinearQuadraticRegulator .def(py::init&, const wpi::array&, const wpi::array&, units::second_t>()) diff --git a/subprojects/robotpy-wpimath/gen/controls/TrapezoidProfile.yml b/subprojects/robotpy-wpimath/gen/controls/TrapezoidProfile.yml index 4944e409f..f8a75ff3a 100644 --- a/subprojects/robotpy-wpimath/gen/controls/TrapezoidProfile.yml +++ b/subprojects/robotpy-wpimath/gen/controls/TrapezoidProfile.yml @@ -77,10 +77,10 @@ classes: param_override: maxVelocity_: name: maxVelocity - default: 0 + default: "0" maxAcceleration_: name: maxAcceleration - default: 0 + default: "0" template_inline_code: | { std::string clsNameCopy = clsName; From fd8e6a8699322597e9c16471db898f167f5a86e6 Mon Sep 17 00:00:00 2001 From: Dustin Spicuzza Date: Thu, 3 Apr 2025 23:32:34 -0400 Subject: [PATCH 02/20] Add native library packages - Fixes #101 --- .../robotpy-native-apriltag/.gitignore | 2 + .../robotpy-native-apriltag/pyproject.toml | 41 +++++++++++++++ subprojects/robotpy-native-ntcore/.gitignore | 2 + .../robotpy-native-ntcore/pyproject.toml | 41 +++++++++++++++ subprojects/robotpy-native-romi/.gitignore | 2 + .../robotpy-native-romi/pyproject.toml | 39 ++++++++++++++ subprojects/robotpy-native-wpihal/.gitignore | 2 + .../robotpy-native-wpihal/pyproject.toml | 39 ++++++++++++++ subprojects/robotpy-native-wpilib/.gitignore | 2 + .../robotpy-native-wpilib/pyproject.toml | 47 +++++++++++++++++ subprojects/robotpy-native-wpimath/.gitignore | 2 + .../robotpy-native-wpimath/pyproject.toml | 39 ++++++++++++++ subprojects/robotpy-native-wpinet/.gitignore | 2 + .../robotpy-native-wpinet/pyproject.toml | 39 ++++++++++++++ subprojects/robotpy-native-wpiutil/.gitignore | 2 + .../robotpy-native-wpiutil/pyproject.toml | 52 +++++++++++++++++++ subprojects/robotpy-native-xrp/.gitignore | 2 + subprojects/robotpy-native-xrp/pyproject.toml | 39 ++++++++++++++ 18 files changed, 394 insertions(+) create mode 100644 subprojects/robotpy-native-apriltag/.gitignore create mode 100644 subprojects/robotpy-native-apriltag/pyproject.toml create mode 100644 subprojects/robotpy-native-ntcore/.gitignore create mode 100644 subprojects/robotpy-native-ntcore/pyproject.toml create mode 100644 subprojects/robotpy-native-romi/.gitignore create mode 100644 subprojects/robotpy-native-romi/pyproject.toml create mode 100644 subprojects/robotpy-native-wpihal/.gitignore create mode 100644 subprojects/robotpy-native-wpihal/pyproject.toml create mode 100644 subprojects/robotpy-native-wpilib/.gitignore create mode 100644 subprojects/robotpy-native-wpilib/pyproject.toml create mode 100644 subprojects/robotpy-native-wpimath/.gitignore create mode 100644 subprojects/robotpy-native-wpimath/pyproject.toml create mode 100644 subprojects/robotpy-native-wpinet/.gitignore create mode 100644 subprojects/robotpy-native-wpinet/pyproject.toml create mode 100644 subprojects/robotpy-native-wpiutil/.gitignore create mode 100644 subprojects/robotpy-native-wpiutil/pyproject.toml create mode 100644 subprojects/robotpy-native-xrp/.gitignore create mode 100644 subprojects/robotpy-native-xrp/pyproject.toml diff --git a/subprojects/robotpy-native-apriltag/.gitignore b/subprojects/robotpy-native-apriltag/.gitignore new file mode 100644 index 000000000..a32b856a6 --- /dev/null +++ b/subprojects/robotpy-native-apriltag/.gitignore @@ -0,0 +1,2 @@ +/dist +/src diff --git a/subprojects/robotpy-native-apriltag/pyproject.toml b/subprojects/robotpy-native-apriltag/pyproject.toml new file mode 100644 index 000000000..6d0f88fc8 --- /dev/null +++ b/subprojects/robotpy-native-apriltag/pyproject.toml @@ -0,0 +1,41 @@ +[build-system] +build-backend = "hatchling.build" +requires = [ + "hatchling", + "hatch-nativelib~=0.2.0", + "hatch-robotpy~=0.2", + "robotpy-native-wpiutil==2025.3.2", + "robotpy-native-wpimath==2025.3.2", +] + +[project] +name = "robotpy-native-apriltag" +version = "2025.3.2" +description = "WPILib AprilTag Library" +license = "BSD-3-Clause" + +dependencies = [ + "robotpy-native-wpiutil==2025.3.2", + "robotpy-native-wpimath==2025.3.2", +] + +[tool.hatch.build.targets.wheel] +packages = ["src/native"] + +[[tool.hatch.build.hooks.robotpy.maven_lib_download]] +artifact_id = "apriltag-cpp" +group_id = "edu.wpi.first.apriltag" +repo_url = "https://frcmaven.wpi.edu/artifactory/release" +version = "2025.3.2" + +extract_to = "src/native/apriltag" +libs = ["apriltag"] + +[[tool.hatch.build.hooks.nativelib.pcfile]] +pcfile = "src/native/apriltag/robotpy-native-apriltag.pc" +name = "apriltag" + +includedir = "src/native/apriltag/include" +libdir = "src/native/apriltag/lib" +shared_libraries = ["apriltag"] +requires = ["robotpy-native-wpiutil", "robotpy-native-wpimath"] diff --git a/subprojects/robotpy-native-ntcore/.gitignore b/subprojects/robotpy-native-ntcore/.gitignore new file mode 100644 index 000000000..a32b856a6 --- /dev/null +++ b/subprojects/robotpy-native-ntcore/.gitignore @@ -0,0 +1,2 @@ +/dist +/src diff --git a/subprojects/robotpy-native-ntcore/pyproject.toml b/subprojects/robotpy-native-ntcore/pyproject.toml new file mode 100644 index 000000000..83f83e7b5 --- /dev/null +++ b/subprojects/robotpy-native-ntcore/pyproject.toml @@ -0,0 +1,41 @@ +[build-system] +build-backend = "hatchling.build" +requires = [ + "hatchling", + "hatch-nativelib~=0.2.0", + "hatch-robotpy~=0.2", + "robotpy-native-wpiutil==2025.3.2", + "robotpy-native-wpinet==2025.3.2", +] + +[project] +name = "robotpy-native-ntcore" +version = "2025.3.2" +description = "WPILib NetworkTables Library" +license = "BSD-3-Clause" + +dependencies = [ + "robotpy-native-wpiutil==2025.3.2", + "robotpy-native-wpinet==2025.3.2", +] + +[tool.hatch.build.targets.wheel] +packages = ["src/native"] + +[[tool.hatch.build.hooks.robotpy.maven_lib_download]] +artifact_id = "ntcore-cpp" +group_id = "edu.wpi.first.ntcore" +repo_url = "https://frcmaven.wpi.edu/artifactory/release" +version = "2025.3.2" + +extract_to = "src/native/ntcore" +libs = ["ntcore"] + +[[tool.hatch.build.hooks.nativelib.pcfile]] +pcfile = "src/native/ntcore/robotpy-native-ntcore.pc" +name = "ntcore" + +includedir = "src/native/ntcore/include" +libdir = "src/native/ntcore/lib" +shared_libraries = ["ntcore"] +requires = ["robotpy-native-wpinet", "robotpy-native-wpiutil"] diff --git a/subprojects/robotpy-native-romi/.gitignore b/subprojects/robotpy-native-romi/.gitignore new file mode 100644 index 000000000..a32b856a6 --- /dev/null +++ b/subprojects/robotpy-native-romi/.gitignore @@ -0,0 +1,2 @@ +/dist +/src diff --git a/subprojects/robotpy-native-romi/pyproject.toml b/subprojects/robotpy-native-romi/pyproject.toml new file mode 100644 index 000000000..476883671 --- /dev/null +++ b/subprojects/robotpy-native-romi/pyproject.toml @@ -0,0 +1,39 @@ +[build-system] +build-backend = "hatchling.build" +requires = [ + "hatchling", + "hatch-nativelib~=0.2.0", + "hatch-robotpy~=0.2", + "robotpy-native-wpilib==2025.3.2", +] + +[project] +name = "robotpy-native-romi" +version = "2025.3.2" +description = "WPILib Romi support library" +license = "BSD-3-Clause" + +dependencies = [ + "robotpy-native-wpilib==2025.3.2", +] + +[tool.hatch.build.targets.wheel] +packages = ["src/native"] + +[[tool.hatch.build.hooks.robotpy.maven_lib_download]] +artifact_id = "romiVendordep-cpp" +group_id = "edu.wpi.first.romiVendordep" +repo_url = "https://frcmaven.wpi.edu/artifactory/release" +version = "2025.3.2" + +extract_to = "src/native/romi" +libs = ["romiVendordep"] + +[[tool.hatch.build.hooks.nativelib.pcfile]] +pcfile = "src/native/romi/robotpy-native-romi.pc" +name = "romi" + +includedir = "src/native/romi/include" +libdir = "src/native/romi/lib" +shared_libraries = ["romiVendordep"] +requires = ["robotpy-native-wpilib"] diff --git a/subprojects/robotpy-native-wpihal/.gitignore b/subprojects/robotpy-native-wpihal/.gitignore new file mode 100644 index 000000000..a32b856a6 --- /dev/null +++ b/subprojects/robotpy-native-wpihal/.gitignore @@ -0,0 +1,2 @@ +/dist +/src diff --git a/subprojects/robotpy-native-wpihal/pyproject.toml b/subprojects/robotpy-native-wpihal/pyproject.toml new file mode 100644 index 000000000..0ee6480eb --- /dev/null +++ b/subprojects/robotpy-native-wpihal/pyproject.toml @@ -0,0 +1,39 @@ +[build-system] +build-backend = "hatchling.build" +requires = [ + "hatchling", + "hatch-nativelib~=0.2.0", + "hatch-robotpy~=0.2", + "robotpy-native-wpiutil==2025.3.2", +] + +[project] +name = "robotpy-native-wpihal" +version = "2025.3.2" +description = "WPILib HAL implementation" +license = "BSD-3-Clause" + +dependencies = [ + "robotpy-native-wpiutil==2025.3.2", +] + +[tool.hatch.build.targets.wheel] +packages = ["src/native"] + +[[tool.hatch.build.hooks.robotpy.maven_lib_download]] +artifact_id = "hal-cpp" +group_id = "edu.wpi.first.hal" +repo_url = "https://frcmaven.wpi.edu/artifactory/release" +version = "2025.3.2" + +extract_to = "src/native/wpihal" +libs = ["wpiHal"] + +[[tool.hatch.build.hooks.nativelib.pcfile]] +pcfile = "src/native/wpihal/robotpy-native-wpihal.pc" +name = "wpihal" + +includedir = "src/native/wpihal/include" +libdir = "src/native/wpihal/lib" +shared_libraries = ["wpiHal"] +requires = ["robotpy-native-wpiutil"] diff --git a/subprojects/robotpy-native-wpilib/.gitignore b/subprojects/robotpy-native-wpilib/.gitignore new file mode 100644 index 000000000..a32b856a6 --- /dev/null +++ b/subprojects/robotpy-native-wpilib/.gitignore @@ -0,0 +1,2 @@ +/dist +/src diff --git a/subprojects/robotpy-native-wpilib/pyproject.toml b/subprojects/robotpy-native-wpilib/pyproject.toml new file mode 100644 index 000000000..9a418fa63 --- /dev/null +++ b/subprojects/robotpy-native-wpilib/pyproject.toml @@ -0,0 +1,47 @@ +[build-system] +build-backend = "hatchling.build" +requires = [ + "hatchling", + "hatch-nativelib~=0.2.0", + "hatch-robotpy~=0.2", + "robotpy-native-wpiutil==2025.3.2", + "robotpy-native-wpinet==2025.3.2", + "robotpy-native-ntcore==2025.3.2", + "robotpy-native-wpimath==2025.3.2", + "robotpy-native-wpihal==2025.3.2", +] + +[project] +name = "robotpy-native-wpilib" +version = "2025.3.2" +description = "WPILib Robotics Library" +license = "BSD-3-Clause" + +dependencies = [ + "robotpy-native-wpiutil==2025.3.2", + "robotpy-native-wpinet==2025.3.2", + "robotpy-native-ntcore==2025.3.2", + "robotpy-native-wpimath==2025.3.2", + "robotpy-native-wpihal==2025.3.2", +] + +[tool.hatch.build.targets.wheel] +packages = ["src/native"] + +[[tool.hatch.build.hooks.robotpy.maven_lib_download]] +artifact_id = "wpilibc-cpp" +group_id = "edu.wpi.first.wpilibc" +repo_url = "https://frcmaven.wpi.edu/artifactory/release" +version = "2025.3.2" + +extract_to = "src/native/wpilib" +libs = ["wpilibc"] + +[[tool.hatch.build.hooks.nativelib.pcfile]] +pcfile = "src/native/wpilib/robotpy-native-wpilib.pc" +name = "wpilib" + +includedir = "src/native/wpilib/include" +libdir = "src/native/wpilib/lib" +shared_libraries = ["wpilibc"] +requires = ["robotpy-native-wpiutil", "robotpy-native-wpinet", "robotpy-native-ntcore", "robotpy-native-wpimath", "robotpy-native-wpihal"] diff --git a/subprojects/robotpy-native-wpimath/.gitignore b/subprojects/robotpy-native-wpimath/.gitignore new file mode 100644 index 000000000..a32b856a6 --- /dev/null +++ b/subprojects/robotpy-native-wpimath/.gitignore @@ -0,0 +1,2 @@ +/dist +/src diff --git a/subprojects/robotpy-native-wpimath/pyproject.toml b/subprojects/robotpy-native-wpimath/pyproject.toml new file mode 100644 index 000000000..72b8bcd3c --- /dev/null +++ b/subprojects/robotpy-native-wpimath/pyproject.toml @@ -0,0 +1,39 @@ +[build-system] +build-backend = "hatchling.build" +requires = [ + "hatchling", + "hatch-nativelib~=0.2.0", + "hatch-robotpy~=0.2", + "robotpy-native-wpiutil==2025.3.2", +] + +[project] +name = "robotpy-native-wpimath" +version = "2025.3.2" +description = "WPILib Math Library" +license = "BSD-3-Clause" + +dependencies = [ + "robotpy-native-wpiutil==2025.3.2", +] + +[tool.hatch.build.targets.wheel] +packages = ["src/native"] + +[[tool.hatch.build.hooks.robotpy.maven_lib_download]] +artifact_id = "wpimath-cpp" +group_id = "edu.wpi.first.wpimath" +repo_url = "https://frcmaven.wpi.edu/artifactory/release" +version = "2025.3.2" + +extract_to = "src/native/wpimath" +libs = ["wpimath"] + +[[tool.hatch.build.hooks.nativelib.pcfile]] +pcfile = "src/native/wpimath/robotpy-native-wpimath.pc" +name = "wpimath" + +includedir = "src/native/wpimath/include" +libdir = "src/native/wpimath/lib" +shared_libraries = ["wpimath"] +requires = ["robotpy-native-wpiutil"] diff --git a/subprojects/robotpy-native-wpinet/.gitignore b/subprojects/robotpy-native-wpinet/.gitignore new file mode 100644 index 000000000..a32b856a6 --- /dev/null +++ b/subprojects/robotpy-native-wpinet/.gitignore @@ -0,0 +1,2 @@ +/dist +/src diff --git a/subprojects/robotpy-native-wpinet/pyproject.toml b/subprojects/robotpy-native-wpinet/pyproject.toml new file mode 100644 index 000000000..ac928d9d1 --- /dev/null +++ b/subprojects/robotpy-native-wpinet/pyproject.toml @@ -0,0 +1,39 @@ +[build-system] +build-backend = "hatchling.build" +requires = [ + "hatchling", + "hatch-nativelib~=0.2.0", + "hatch-robotpy~=0.2", + "robotpy-native-wpiutil==2025.3.2", +] + +[project] +name = "robotpy-native-wpinet" +version = "2025.3.2" +description = "WPILib Networking Library" +license = "BSD-3-Clause" + +dependencies = [ + "robotpy-native-wpiutil==2025.3.2", +] + +[tool.hatch.build.targets.wheel] +packages = ["src/native"] + +[[tool.hatch.build.hooks.robotpy.maven_lib_download]] +artifact_id = "wpinet-cpp" +group_id = "edu.wpi.first.wpinet" +repo_url = "https://frcmaven.wpi.edu/artifactory/release" +version = "2025.3.2" + +extract_to = "src/native/wpinet" +libs = ["wpinet"] + +[[tool.hatch.build.hooks.nativelib.pcfile]] +pcfile = "src/native/wpinet/robotpy-native-wpinet.pc" +name = "wpinet" + +includedir = "src/native/wpinet/include" +libdir = "src/native/wpinet/lib" +shared_libraries = ["wpinet"] +requires = ["robotpy-native-wpiutil"] diff --git a/subprojects/robotpy-native-wpiutil/.gitignore b/subprojects/robotpy-native-wpiutil/.gitignore new file mode 100644 index 000000000..a32b856a6 --- /dev/null +++ b/subprojects/robotpy-native-wpiutil/.gitignore @@ -0,0 +1,2 @@ +/dist +/src diff --git a/subprojects/robotpy-native-wpiutil/pyproject.toml b/subprojects/robotpy-native-wpiutil/pyproject.toml new file mode 100644 index 000000000..e0a6e6045 --- /dev/null +++ b/subprojects/robotpy-native-wpiutil/pyproject.toml @@ -0,0 +1,52 @@ +[build-system] +build-backend = "hatchling.build" +requires = [ + "hatchling", + "hatch-nativelib~=0.2.0", + "hatch-robotpy~=0.2", +] + +[project] +name = "robotpy-native-wpiutil" +version = "2025.3.2" +description = "WPILib Utility Library" +license = "BSD-3-Clause" + +dependencies = [ + "msvc-runtime>=14.42.34433; platform_system == 'Windows'" +] + +[tool.hatch.build.targets.wheel] +packages = ["src/native"] + +[[tool.hatch.build.hooks.robotpy.maven_lib_download]] +artifact_id = "wpiutil-cpp" +group_id = "edu.wpi.first.wpiutil" +repo_url = "https://frcmaven.wpi.edu/artifactory/release" +version = "2025.3.2" + +extract_to = "src/native/wpiutil" +libs = ["wpiutil"] + +[[tool.hatch.build.hooks.nativelib.pcfile]] +pcfile = "src/native/wpiutil/robotpy-native-wpiutil.pc" +name = "wpiutil" + +includedir = "src/native/wpiutil/include" +libdir = "src/native/wpiutil/lib" +shared_libraries = ["wpiutil"] + +enable_if = "platform_system != 'Windows'" + +[[tool.hatch.build.hooks.nativelib.pcfile]] +pcfile = "src/native/wpiutil/robotpy-native-wpiutil.pc" +name = "wpiutil" + +includedir = "src/native/wpiutil/include" +libdir = "src/native/wpiutil/lib" +shared_libraries = ["wpiutil"] + +# All wpilib projects require this flag +extra_cflags = "/Zc:preprocessor" + +enable_if = "platform_system == 'Windows'" diff --git a/subprojects/robotpy-native-xrp/.gitignore b/subprojects/robotpy-native-xrp/.gitignore new file mode 100644 index 000000000..a32b856a6 --- /dev/null +++ b/subprojects/robotpy-native-xrp/.gitignore @@ -0,0 +1,2 @@ +/dist +/src diff --git a/subprojects/robotpy-native-xrp/pyproject.toml b/subprojects/robotpy-native-xrp/pyproject.toml new file mode 100644 index 000000000..7499b4d60 --- /dev/null +++ b/subprojects/robotpy-native-xrp/pyproject.toml @@ -0,0 +1,39 @@ +[build-system] +build-backend = "hatchling.build" +requires = [ + "hatchling", + "hatch-nativelib~=0.2.0", + "hatch-robotpy~=0.2", + "robotpy-native-wpilib==2025.3.2", +] + +[project] +name = "robotpy-native-xrp" +version = "2025.3.2" +description = "WPILib XRP vendor library" +license = "BSD-3-Clause" + +dependencies = [ + "robotpy-native-wpilib==2025.3.2", +] + +[tool.hatch.build.targets.wheel] +packages = ["src/native"] + +[[tool.hatch.build.hooks.robotpy.maven_lib_download]] +artifact_id = "xrpVendordep-cpp" +group_id = "edu.wpi.first.xrpVendordep" +repo_url = "https://frcmaven.wpi.edu/artifactory/release" +version = "2025.3.2" + +extract_to = "src/native/xrp" +libs = ["xrpVendordep"] + +[[tool.hatch.build.hooks.nativelib.pcfile]] +pcfile = "src/native/xrp/robotpy-native-xrp.pc" +name = "xrp" + +includedir = "src/native/xrp/include" +libdir = "src/native/xrp/lib" +shared_libraries = ["xrpVendordep"] +requires = ["robotpy-native-wpilib"] From 7e318f9d5386dbdfddebe5906b0ccb4feb2808d4 Mon Sep 17 00:00:00 2001 From: Dustin Spicuzza Date: Thu, 3 Apr 2025 20:58:17 -0400 Subject: [PATCH 03/20] Upgrade robotpy-wpiutil to semiwrap --- subprojects/robotpy-wpiutil/.gitignore | 9 +- subprojects/robotpy-wpiutil/gen/RawFrame.yml | 20 --- subprojects/robotpy-wpiutil/meson.build | 14 ++ subprojects/robotpy-wpiutil/pyproject.toml | 124 ++++++++++-------- subprojects/robotpy-wpiutil/setup.py | 5 - .../robotpy-wpiutil/wpiutil/__init__.py | 2 +- .../robotpy-wpiutil/wpiutil/src/main.cpp | 4 +- .../robotpy-wpiutil/wrapcfg/.gitignore | 1 + .../{gen => wrapcfg}/DataLog.yml | 34 ++--- .../DataLogBackgroundWriter.yml | 2 +- .../{gen => wrapcfg}/DataLogReader.yml | 10 +- .../{gen => wrapcfg}/DataLogWriter.yml | 2 +- .../robotpy-wpiutil/wrapcfg/RawFrame.yml | 9 ++ .../{gen => wrapcfg}/Sendable.yml | 3 +- .../{gen => wrapcfg}/SendableBuilder.yml | 2 +- .../{gen => wrapcfg}/SendableHelper.yml | 2 +- .../{gen => wrapcfg}/SendableRegistry.yml | 4 +- .../{gen => wrapcfg}/StackTrace.yml | 0 .../{gen => wrapcfg}/Synchronization.yml | 69 +--------- .../{gen => wrapcfg}/WPyStruct.yml | 0 .../wrapcfg/modules/.gitignore | 1 + .../wrapcfg/trampolines/.gitignore | 1 + 22 files changed, 133 insertions(+), 185 deletions(-) delete mode 100644 subprojects/robotpy-wpiutil/gen/RawFrame.yml create mode 100644 subprojects/robotpy-wpiutil/meson.build delete mode 100644 subprojects/robotpy-wpiutil/setup.py create mode 100644 subprojects/robotpy-wpiutil/wrapcfg/.gitignore rename subprojects/robotpy-wpiutil/{gen => wrapcfg}/DataLog.yml (96%) rename subprojects/robotpy-wpiutil/{gen => wrapcfg}/DataLogBackgroundWriter.yml (93%) rename subprojects/robotpy-wpiutil/{gen => wrapcfg}/DataLogReader.yml (98%) rename subprojects/robotpy-wpiutil/{gen => wrapcfg}/DataLogWriter.yml (97%) create mode 100644 subprojects/robotpy-wpiutil/wrapcfg/RawFrame.yml rename subprojects/robotpy-wpiutil/{gen => wrapcfg}/Sendable.yml (89%) rename subprojects/robotpy-wpiutil/{gen => wrapcfg}/SendableBuilder.yml (97%) rename subprojects/robotpy-wpiutil/{gen => wrapcfg}/SendableHelper.yml (94%) rename subprojects/robotpy-wpiutil/{gen => wrapcfg}/SendableRegistry.yml (96%) rename subprojects/robotpy-wpiutil/{gen => wrapcfg}/StackTrace.yml (100%) rename subprojects/robotpy-wpiutil/{gen => wrapcfg}/Synchronization.yml (63%) rename subprojects/robotpy-wpiutil/{gen => wrapcfg}/WPyStruct.yml (100%) create mode 100644 subprojects/robotpy-wpiutil/wrapcfg/modules/.gitignore create mode 100644 subprojects/robotpy-wpiutil/wrapcfg/trampolines/.gitignore diff --git a/subprojects/robotpy-wpiutil/.gitignore b/subprojects/robotpy-wpiutil/.gitignore index 871fb0b95..50e912050 100644 --- a/subprojects/robotpy-wpiutil/.gitignore +++ b/subprojects/robotpy-wpiutil/.gitignore @@ -8,14 +8,15 @@ .vscode __pycache__ -/wpiutil/include -/wpiutil/lib -/wpiutil/_init_wpiutil.py -/wpiutil/pkgcfg.py +/wpiutil/trampolines +/wpiutil/_init__wpiutil.py /wpiutil/version.py /dist /build +*.pc +*.pybind11.json + /tests/cpp/build /tests/cpp/wpiutil_test/_initmodule.py /tests/cpp/wpiutil_test/pkgcfg.py diff --git a/subprojects/robotpy-wpiutil/gen/RawFrame.yml b/subprojects/robotpy-wpiutil/gen/RawFrame.yml deleted file mode 100644 index 06244deaa..000000000 --- a/subprojects/robotpy-wpiutil/gen/RawFrame.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- - -enums: - WPI_PixelFormat: - ignore: true - WPI_TimestampSource: - value_prefix: WPI_TIMESRC - rename: TimestampSource - -# We only care about the enum exposed above. We can safely ignore everything else -functions: - WPI_AllocateRawFrameData: - ignore: true - WPI_FreeRawFrameData: - ignore: true - WPI_SetRawFrameData: - ignore: true -classes: - RawFrame: - ignore: true diff --git a/subprojects/robotpy-wpiutil/meson.build b/subprojects/robotpy-wpiutil/meson.build new file mode 100644 index 000000000..d77992ede --- /dev/null +++ b/subprojects/robotpy-wpiutil/meson.build @@ -0,0 +1,14 @@ +project('robotpy-wpiutil', ['cpp'], + default_options: ['warning_level=1', 'cpp_std=c++20', + 'b_colorout=auto', 'optimization=2', 'b_pie=true']) + +subdir('wrapcfg') + +wpiutil_sources += files( + 'wpiutil/src/main.cpp', + 'wpiutil/src/safethread_gil.cpp', + 'wpiutil/src/stacktracehook.cpp', + 'wpiutil/src/wpistruct/wpystruct_fns.cpp', +) + +subdir('wrapcfg/modules') diff --git a/subprojects/robotpy-wpiutil/pyproject.toml b/subprojects/robotpy-wpiutil/pyproject.toml index f084e2426..db8beb2a2 100644 --- a/subprojects/robotpy-wpiutil/pyproject.toml +++ b/subprojects/robotpy-wpiutil/pyproject.toml @@ -1,63 +1,66 @@ -[tool.robotpy-build.metadata] +[build-system] +build-backend = "hatchling.build" +requires = [ + "semiwrap", "hatch-meson", "hatch-vcs", "hatchling", + "native.wpiutil==2025.3.2", +] + +[project] name = "robotpy-wpiutil" +dynamic = ["version"] description = "Binary wrapper for FRC WPIUtil library" -author = "RobotPy Development Team" -author_email = "robotpy@googlegroups.com" -url = "https://github.com/robotpy/robotpy-wpiutil" +authors = [ + {name = "RobotPy Development Team", email = "robotpy@googlegroups.com"}, +] license = "BSD-3-Clause" install_requires = [ + "native.wpiutil==2025.3.2", "msvc-runtime>=14.42.34433; platform_system == 'Windows'" ] -[build-system] -requires = [ - "robotpy-build~=2025.1.0", -] +[project.urls] +"Source code" = "https://github.com/robotpy/mostrobotpy" -[tool.robotpy-build] -base_package = "wpiutil" -update_init = [ - "wpiutil", - "wpiutil.log wpiutil._wpiutil.log", - "wpiutil.sync wpiutil._wpiutil.sync", - "wpiutil.wpistruct wpiutil._wpiutil.wpistruct", -] -scan_headers_ignore = [ - "fmt/*", - "google/*", - "wpi/*", - "wpystruct_fns.h", - "pb.h", - "pb_common.h", - "pb_decode.h", - "pb_encode.h", -] +[tool.hatch.version] +source = "vcs" +raw-options.root = "../.." + +[tool.hatch.build.hooks.vcs] +version-file = "wpiutil/version.py" -[tool.robotpy-build.wrappers."wpiutil"] -name = "wpiutil" -sources = [ - "wpiutil/src/main.cpp", - "wpiutil/src/safethread_gil.cpp", - "wpiutil/src/stacktracehook.cpp", - "wpiutil/src/wpistruct/wpystruct_fns.cpp", -] -extra_includes = [ - "wpiutil/src/wpistruct", - "wpiutil/src/type_casters", -] -generation_data = "gen" -[tool.robotpy-build.wrappers."wpiutil".maven_lib_download] -artifact_id = "wpiutil-cpp" -group_id = "edu.wpi.first.wpiutil" -repo_url = "https://frcmaven.wpi.edu/artifactory/release" -# repo_url = "https://frcmaven.wpi.edu/artifactory/development" -version = "2025.3.2" +[tool.hatch.build.hooks.semiwrap] +# update_init = [ +# "wpiutil", +# "wpiutil.log wpiutil._wpiutil.log", +# "wpiutil.sync wpiutil._wpiutil.sync", +# "wpiutil.wpistruct wpiutil._wpiutil.wpistruct", +# ] +# scan_headers_ignore = [ +# "fmt/*", +# "google/*", +# "wpi/*", +# "wpystruct_fns.h", +# "pb.h", +# "pb_common.h", +# "pb_decode.h", +# "pb_encode.h", +# ] -libs = ["wpiutil"] +[tool.hatch.build.hooks.meson] + + +[tool.semiwrap] +[tool.semiwrap.extension_modules."wpiutil._wpiutil"] +name = "wpiutil" +includes = [ + "wpiutil/src/wpistruct", +] +wraps = ["native.wpiutil"] +depends = ["wpiutil-casters"] -[tool.robotpy-build.wrappers."wpiutil".autogen_headers] +[tool.semiwrap.extension_modules."wpiutil._wpiutil".headers] # wpi DataLog = "wpi/DataLog.h" DataLogReader = "wpi/DataLogReader.h" @@ -75,38 +78,45 @@ SendableRegistry = "wpi/sendable/SendableRegistry.h" WPyStruct = "src/wpistruct/wpystruct_fns.h" -[[tool.robotpy-build.wrappers."wpiutil".type_casters]] +[tool.semiwrap.export_type_casters.wpiutil-casters] +pypackage = "wpiutil" +includedir = [ + "wpiutil/src/type_casters", + "wpiutil/src/wpistruct", +] + +[[tool.semiwrap.export_type_casters.wpiutil-casters.headers]] header = "wpi_array_type_caster.h" types = ["wpi::array"] -[[tool.robotpy-build.wrappers."wpiutil".type_casters]] +[[tool.semiwrap.export_type_casters.wpiutil-casters.headers]] header = "wpi_json_type_caster.h" types = ["wpi::json"] -[[tool.robotpy-build.wrappers."wpiutil".type_casters]] +[[tool.semiwrap.export_type_casters.wpiutil-casters.headers]] header = "wpi_span_type_caster.h" types = ["std::span"] -[[tool.robotpy-build.wrappers."wpiutil".type_casters]] +[[tool.semiwrap.export_type_casters.wpiutil-casters.headers]] header = "wpi_smallset_type_caster.h" types = ["wpi::SmallSet"] -[[tool.robotpy-build.wrappers."wpiutil".type_casters]] +[[tool.semiwrap.export_type_casters.wpiutil-casters.headers]] header = "wpi_smallvector_type_caster.h" types = ["wpi::SmallVector"] -[[tool.robotpy-build.wrappers."wpiutil".type_casters]] +[[tool.semiwrap.export_type_casters.wpiutil-casters.headers]] header = "wpi_smallvectorimpl_type_caster.h" types = ["wpi::SmallVectorImpl"] -[[tool.robotpy-build.wrappers."wpiutil".type_casters]] +[[tool.semiwrap.export_type_casters.wpiutil-casters.headers]] header = "wpi_string_map_caster.h" types = ["wpi::StringMap"] -[[tool.robotpy-build.wrappers."wpiutil".type_casters]] +[[tool.semiwrap.export_type_casters.wpiutil-casters.headers]] header = "wpi_ct_string_type_caster.h" types = ["wpi::ct_string"] -[[tool.robotpy-build.wrappers."wpiutil".type_casters]] +[[tool.semiwrap.export_type_casters.wpiutil-casters.headers]] header = "wpystruct.h" -types = ["WPyStruct"] \ No newline at end of file +types = ["WPyStruct"] diff --git a/subprojects/robotpy-wpiutil/setup.py b/subprojects/robotpy-wpiutil/setup.py deleted file mode 100644 index 3542d0c9a..000000000 --- a/subprojects/robotpy-wpiutil/setup.py +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env python3 - -from robotpy_build.setup import setup - -setup() diff --git a/subprojects/robotpy-wpiutil/wpiutil/__init__.py b/subprojects/robotpy-wpiutil/wpiutil/__init__.py index 6e6783e26..1000413ea 100644 --- a/subprojects/robotpy-wpiutil/wpiutil/__init__.py +++ b/subprojects/robotpy-wpiutil/wpiutil/__init__.py @@ -1,4 +1,4 @@ -from . import _init_wpiutil +from . import _init__wpiutil # autogenerated by 'robotpy-build create-imports wpiutil wpiutil._wpiutil' from ._wpiutil import ( diff --git a/subprojects/robotpy-wpiutil/wpiutil/src/main.cpp b/subprojects/robotpy-wpiutil/wpiutil/src/main.cpp index 646be1779..a4c8e7b96 100644 --- a/subprojects/robotpy-wpiutil/wpiutil/src/main.cpp +++ b/subprojects/robotpy-wpiutil/wpiutil/src/main.cpp @@ -1,5 +1,5 @@ -#include +#include void setup_stack_trace_hook(py::object fn); void cleanup_stack_trace_hook(); @@ -24,7 +24,7 @@ void cleanup_sendable_registry() {} #endif -RPYBUILD_PYBIND11_MODULE(m) { +SEMIWRAP_PYBIND11_MODULE(m) { initWrapper(m); static int unused; diff --git a/subprojects/robotpy-wpiutil/wrapcfg/.gitignore b/subprojects/robotpy-wpiutil/wrapcfg/.gitignore new file mode 100644 index 000000000..d698f7257 --- /dev/null +++ b/subprojects/robotpy-wpiutil/wrapcfg/.gitignore @@ -0,0 +1 @@ +/meson.build diff --git a/subprojects/robotpy-wpiutil/gen/DataLog.yml b/subprojects/robotpy-wpiutil/wrapcfg/DataLog.yml similarity index 96% rename from subprojects/robotpy-wpiutil/gen/DataLog.yml rename to subprojects/robotpy-wpiutil/wrapcfg/DataLog.yml index 85789bee4..1ccff49c3 100644 --- a/subprojects/robotpy-wpiutil/gen/DataLog.yml +++ b/subprojects/robotpy-wpiutil/wrapcfg/DataLog.yml @@ -5,7 +5,7 @@ defaults: enums: ControlRecordType: classes: - DataLog: + wpi::log::DataLog: subpackage: log attributes: kBlockSize: @@ -71,7 +71,7 @@ classes: ignore: true BufferHalfFull: BufferFull: - DataLogEntry: + wpi::log::DataLogEntry: subpackage: log force_no_trampoline: true methods: @@ -82,7 +82,7 @@ classes: "": ignore: true DataLog&, std::string_view, std::string_view, std::string_view, int64_t: - DataLogValueEntryImpl: + wpi::log::DataLogValueEntryImpl: template_params: - T force_no_trampoline: true @@ -99,7 +99,7 @@ classes: "": ignore: true DataLog&, std::string_view, std::string_view, std::string_view, int64_t: - RawLogEntry: + wpi::log::RawLogEntry: subpackage: log force_no_trampoline: true attributes: @@ -114,7 +114,7 @@ classes: DataLog&, std::string_view, std::string_view, std::string_view, int64_t: Append: Update: - BooleanLogEntry: + wpi::log::BooleanLogEntry: subpackage: log force_no_trampoline: true attributes: @@ -128,7 +128,7 @@ classes: DataLog&, std::string_view, std::string_view, int64_t: Append: Update: - IntegerLogEntry: + wpi::log::IntegerLogEntry: subpackage: log force_no_trampoline: true attributes: @@ -142,7 +142,7 @@ classes: DataLog&, std::string_view, std::string_view, int64_t: Append: Update: - FloatLogEntry: + wpi::log::FloatLogEntry: subpackage: log force_no_trampoline: true attributes: @@ -156,7 +156,7 @@ classes: DataLog&, std::string_view, std::string_view, int64_t: Append: Update: - DoubleLogEntry: + wpi::log::DoubleLogEntry: subpackage: log force_no_trampoline: true attributes: @@ -170,7 +170,7 @@ classes: DataLog&, std::string_view, std::string_view, int64_t: Append: Update: - StringLogEntry: + wpi::log::StringLogEntry: subpackage: log force_no_trampoline: true attributes: @@ -185,7 +185,7 @@ classes: DataLog&, std::string_view, std::string_view, std::string_view, int64_t: Append: Update: - BooleanArrayLogEntry: + wpi::log::BooleanArrayLogEntry: subpackage: log force_no_trampoline: true attributes: @@ -218,7 +218,7 @@ classes: ignore: true std::span, int64_t: ignore: true - IntegerArrayLogEntry: + wpi::log::IntegerArrayLogEntry: subpackage: log force_no_trampoline: true attributes: @@ -240,7 +240,7 @@ classes: std::span, int64_t: std::initializer_list, int64_t: ignore: true - FloatArrayLogEntry: + wpi::log::FloatArrayLogEntry: subpackage: log force_no_trampoline: true attributes: @@ -262,7 +262,7 @@ classes: std::span, int64_t: std::initializer_list, int64_t: ignore: true - DoubleArrayLogEntry: + wpi::log::DoubleArrayLogEntry: subpackage: log force_no_trampoline: true attributes: @@ -284,7 +284,7 @@ classes: std::span, int64_t: std::initializer_list, int64_t: ignore: true - StringArrayLogEntry: + wpi::log::StringArrayLogEntry: subpackage: log force_no_trampoline: true attributes: @@ -310,7 +310,7 @@ classes: std::span, int64_t: std::initializer_list, int64_t: ignore: true - StructLogEntry: + wpi::log::StructLogEntry: force_no_trampoline: true template_params: - T @@ -339,7 +339,7 @@ classes: return std::make_shared>(log, name, metadata, info, timestamp); } Append: - StructArrayLogEntry: + wpi::log::StructArrayLogEntry: force_no_trampoline: true template_params: - T @@ -372,7 +372,7 @@ classes: U&&, int64_t: ignore: true std::span, int64_t: - ProtobufLogEntry: + wpi::log::ProtobufLogEntry: subpackage: log force_no_trampoline: true ignore: true diff --git a/subprojects/robotpy-wpiutil/gen/DataLogBackgroundWriter.yml b/subprojects/robotpy-wpiutil/wrapcfg/DataLogBackgroundWriter.yml similarity index 93% rename from subprojects/robotpy-wpiutil/gen/DataLogBackgroundWriter.yml rename to subprojects/robotpy-wpiutil/wrapcfg/DataLogBackgroundWriter.yml index fbb78b251..36b548306 100644 --- a/subprojects/robotpy-wpiutil/gen/DataLogBackgroundWriter.yml +++ b/subprojects/robotpy-wpiutil/wrapcfg/DataLogBackgroundWriter.yml @@ -1,7 +1,7 @@ --- classes: - DataLogBackgroundWriter: + wpi::log::DataLogBackgroundWriter: methods: DataLogBackgroundWriter: overloads: diff --git a/subprojects/robotpy-wpiutil/gen/DataLogReader.yml b/subprojects/robotpy-wpiutil/wrapcfg/DataLogReader.yml similarity index 98% rename from subprojects/robotpy-wpiutil/gen/DataLogReader.yml rename to subprojects/robotpy-wpiutil/wrapcfg/DataLogReader.yml index eea2dd1e6..15a429f7f 100644 --- a/subprojects/robotpy-wpiutil/gen/DataLogReader.yml +++ b/subprojects/robotpy-wpiutil/wrapcfg/DataLogReader.yml @@ -1,7 +1,7 @@ --- classes: - StartRecordData: + wpi::log::StartRecordData: subpackage: log attributes: entry: @@ -12,14 +12,14 @@ classes: access: readonly metadata: access: readonly - MetadataRecordData: + wpi::log::MetadataRecordData: subpackage: log attributes: entry: access: readonly metadata: access: readonly - DataLogRecord: + wpi::log::DataLogRecord: subpackage: log methods: DataLogRecord: @@ -264,9 +264,9 @@ classes: } return arr; } - DataLogIterator: + wpi::log::DataLogIterator: ignore: true - DataLogReader: + wpi::log::DataLogReader: subpackage: log typealias: - wpi::MemoryBuffer diff --git a/subprojects/robotpy-wpiutil/gen/DataLogWriter.yml b/subprojects/robotpy-wpiutil/wrapcfg/DataLogWriter.yml similarity index 97% rename from subprojects/robotpy-wpiutil/gen/DataLogWriter.yml rename to subprojects/robotpy-wpiutil/wrapcfg/DataLogWriter.yml index 72a99a013..4a58a87d5 100644 --- a/subprojects/robotpy-wpiutil/gen/DataLogWriter.yml +++ b/subprojects/robotpy-wpiutil/wrapcfg/DataLogWriter.yml @@ -1,7 +1,7 @@ --- classes: - DataLogWriter: + wpi::log::DataLogWriter: methods: DataLogWriter: overloads: diff --git a/subprojects/robotpy-wpiutil/wrapcfg/RawFrame.yml b/subprojects/robotpy-wpiutil/wrapcfg/RawFrame.yml new file mode 100644 index 000000000..b9b0dddf0 --- /dev/null +++ b/subprojects/robotpy-wpiutil/wrapcfg/RawFrame.yml @@ -0,0 +1,9 @@ +--- + +defaults: + ignore: true + +enums: + WPI_TimestampSource: + value_prefix: WPI_TIMESRC + rename: TimestampSource diff --git a/subprojects/robotpy-wpiutil/gen/Sendable.yml b/subprojects/robotpy-wpiutil/wrapcfg/Sendable.yml similarity index 89% rename from subprojects/robotpy-wpiutil/gen/Sendable.yml rename to subprojects/robotpy-wpiutil/wrapcfg/Sendable.yml index 6b4c4f4dc..28700de1e 100644 --- a/subprojects/robotpy-wpiutil/gen/Sendable.yml +++ b/subprojects/robotpy-wpiutil/wrapcfg/Sendable.yml @@ -4,8 +4,7 @@ extra_includes: - wpi/sendable/SendableBuilder.h classes: - Sendable: - shared_ptr: true + wpi::Sendable: methods: InitSendable: virtual_xform: | diff --git a/subprojects/robotpy-wpiutil/gen/SendableBuilder.yml b/subprojects/robotpy-wpiutil/wrapcfg/SendableBuilder.yml similarity index 97% rename from subprojects/robotpy-wpiutil/gen/SendableBuilder.yml rename to subprojects/robotpy-wpiutil/wrapcfg/SendableBuilder.yml index 4a4517191..5686b6108 100644 --- a/subprojects/robotpy-wpiutil/gen/SendableBuilder.yml +++ b/subprojects/robotpy-wpiutil/wrapcfg/SendableBuilder.yml @@ -1,7 +1,7 @@ --- classes: - SendableBuilder: + wpi::SendableBuilder: enums: BackendKind: methods: diff --git a/subprojects/robotpy-wpiutil/gen/SendableHelper.yml b/subprojects/robotpy-wpiutil/wrapcfg/SendableHelper.yml similarity index 94% rename from subprojects/robotpy-wpiutil/gen/SendableHelper.yml rename to subprojects/robotpy-wpiutil/wrapcfg/SendableHelper.yml index d617cd3c1..63299223d 100644 --- a/subprojects/robotpy-wpiutil/gen/SendableHelper.yml +++ b/subprojects/robotpy-wpiutil/wrapcfg/SendableHelper.yml @@ -1,7 +1,7 @@ --- classes: - SendableHelper: + wpi::SendableHelper: ignore: true # CRTP shared_ptr: true methods: diff --git a/subprojects/robotpy-wpiutil/gen/SendableRegistry.yml b/subprojects/robotpy-wpiutil/wrapcfg/SendableRegistry.yml similarity index 96% rename from subprojects/robotpy-wpiutil/gen/SendableRegistry.yml rename to subprojects/robotpy-wpiutil/wrapcfg/SendableRegistry.yml index 7c3121cbf..a083c5b3a 100644 --- a/subprojects/robotpy-wpiutil/gen/SendableRegistry.yml +++ b/subprojects/robotpy-wpiutil/wrapcfg/SendableRegistry.yml @@ -5,7 +5,7 @@ extra_includes: - wpi/sendable/SendableBuilder.h classes: - SendableRegistry: + wpi::SendableRegistry: nodelete: true methods: SetLiveWindowBuilderFactory: @@ -72,5 +72,5 @@ classes: Update: ForeachLiveWindow: ignore: true - SendableRegistry::CallbackData: + wpi::SendableRegistry::CallbackData: ignore: true diff --git a/subprojects/robotpy-wpiutil/gen/StackTrace.yml b/subprojects/robotpy-wpiutil/wrapcfg/StackTrace.yml similarity index 100% rename from subprojects/robotpy-wpiutil/gen/StackTrace.yml rename to subprojects/robotpy-wpiutil/wrapcfg/StackTrace.yml diff --git a/subprojects/robotpy-wpiutil/gen/Synchronization.yml b/subprojects/robotpy-wpiutil/wrapcfg/Synchronization.yml similarity index 63% rename from subprojects/robotpy-wpiutil/gen/Synchronization.yml rename to subprojects/robotpy-wpiutil/wrapcfg/Synchronization.yml index 8eb1fb3f9..63943c16d 100644 --- a/subprojects/robotpy-wpiutil/gen/Synchronization.yml +++ b/subprojects/robotpy-wpiutil/wrapcfg/Synchronization.yml @@ -1,23 +1,11 @@ --- +defaults: + ignore: true + extra_includes: - pybind11/stl.h -attributes: - kInvalidHandle: - ignore: true - kHandleTypeEvent: - ignore: true - kHandleTypeSemaphore: - ignore: true - kHandleTypeCSBase: - ignore: true - kHandleTypeNTBase: - ignore: true - kHandleTypeHALBase: - ignore: true - kHandleTypeUserBase: - ignore: true functions: CreateEvent: subpackage: sync @@ -85,54 +73,3 @@ functions: subpackage: sync DestroySignalObject: subpackage: sync - WPI_CreateEvent: - ignore: true - WPI_DestroyEvent: - ignore: true - WPI_SetEvent: - ignore: true - WPI_ResetEvent: - ignore: true - WPI_CreateSemaphore: - ignore: true - WPI_DestroySemaphore: - ignore: true - WPI_ReleaseSemaphore: - ignore: true - WPI_WaitForObject: - ignore: true - WPI_WaitForObjectTimeout: - ignore: true - WPI_WaitForObjects: - ignore: true - WPI_WaitForObjectsTimeout: - ignore: true - WPI_CreateSignalObject: - ignore: true - WPI_SetSignalObject: - ignore: true - WPI_ResetSignalObject: - ignore: true - WPI_DestroySignalObject: - ignore: true -classes: - Event: - ignore: true - methods: - Event: - GetHandle: - Set: - Reset: - Semaphore: - ignore: true - methods: - Semaphore: - GetHandle: - Release: - SignalObject: - ignore: true - methods: - SignalObject: - GetHandle: - Set: - Reset: diff --git a/subprojects/robotpy-wpiutil/gen/WPyStruct.yml b/subprojects/robotpy-wpiutil/wrapcfg/WPyStruct.yml similarity index 100% rename from subprojects/robotpy-wpiutil/gen/WPyStruct.yml rename to subprojects/robotpy-wpiutil/wrapcfg/WPyStruct.yml diff --git a/subprojects/robotpy-wpiutil/wrapcfg/modules/.gitignore b/subprojects/robotpy-wpiutil/wrapcfg/modules/.gitignore new file mode 100644 index 000000000..d698f7257 --- /dev/null +++ b/subprojects/robotpy-wpiutil/wrapcfg/modules/.gitignore @@ -0,0 +1 @@ +/meson.build diff --git a/subprojects/robotpy-wpiutil/wrapcfg/trampolines/.gitignore b/subprojects/robotpy-wpiutil/wrapcfg/trampolines/.gitignore new file mode 100644 index 000000000..d698f7257 --- /dev/null +++ b/subprojects/robotpy-wpiutil/wrapcfg/trampolines/.gitignore @@ -0,0 +1 @@ +/meson.build From d6732056ebfaacb49649430d0d905949cb0e46d6 Mon Sep 17 00:00:00 2001 From: Dustin Spicuzza Date: Wed, 9 Apr 2025 00:29:08 -0400 Subject: [PATCH 04/20] Update robotpy-wpiutil test package to semiwrap --- subprojects/robotpy-wpiutil/meson.build | 4 +- subprojects/robotpy-wpiutil/pyproject.toml | 63 ++++++++++--------- .../{wrapcfg => semiwrap}/.gitignore | 0 .../{wrapcfg => semiwrap}/DataLog.yml | 0 .../DataLogBackgroundWriter.yml | 0 .../{wrapcfg => semiwrap}/DataLogReader.yml | 0 .../{wrapcfg => semiwrap}/DataLogWriter.yml | 0 .../{wrapcfg => semiwrap}/RawFrame.yml | 0 .../{wrapcfg => semiwrap}/Sendable.yml | 0 .../{wrapcfg => semiwrap}/SendableBuilder.yml | 0 .../{wrapcfg => semiwrap}/SendableHelper.yml | 2 - .../SendableRegistry.yml | 0 .../{wrapcfg => semiwrap}/StackTrace.yml | 0 .../{wrapcfg => semiwrap}/Synchronization.yml | 0 .../{wrapcfg => semiwrap}/WPyStruct.yml | 0 .../{wrapcfg => semiwrap}/modules/.gitignore | 0 .../trampolines/.gitignore | 0 .../robotpy-wpiutil/tests/cpp/meson.build | 17 +++++ .../robotpy-wpiutil/tests/cpp/pyproject.toml | 27 +++----- .../robotpy-wpiutil/tests/cpp/setup.py | 5 -- .../tests/cpp/wpiutil_test/__init__.py | 2 +- .../tests/cpp/wpiutil_test/module.cpp | 4 +- .../tests/cpp/wpiutil_test/sendable_test.cpp | 2 +- .../robotpy-wpiutil/tests/run_tests.py | 9 +-- .../robotpy-wpiutil/wpiutil/__init__.py | 2 +- .../robotpy-wpiutil/wpiutil/log/__init__.py | 2 +- subprojects/robotpy-wpiutil/wpiutil/py.typed | 0 .../wpiutil/src/safethread_gil.cpp | 2 +- .../wpiutil/src/stacktracehook.cpp | 2 +- .../wpiutil/src/wpistruct/wpystruct.h | 2 +- .../robotpy-wpiutil/wpiutil/sync/__init__.py | 2 +- .../wpiutil/wpistruct/__init__.py | 2 +- 32 files changed, 73 insertions(+), 76 deletions(-) rename subprojects/robotpy-wpiutil/{wrapcfg => semiwrap}/.gitignore (100%) rename subprojects/robotpy-wpiutil/{wrapcfg => semiwrap}/DataLog.yml (100%) rename subprojects/robotpy-wpiutil/{wrapcfg => semiwrap}/DataLogBackgroundWriter.yml (100%) rename subprojects/robotpy-wpiutil/{wrapcfg => semiwrap}/DataLogReader.yml (100%) rename subprojects/robotpy-wpiutil/{wrapcfg => semiwrap}/DataLogWriter.yml (100%) rename subprojects/robotpy-wpiutil/{wrapcfg => semiwrap}/RawFrame.yml (100%) rename subprojects/robotpy-wpiutil/{wrapcfg => semiwrap}/Sendable.yml (100%) rename subprojects/robotpy-wpiutil/{wrapcfg => semiwrap}/SendableBuilder.yml (100%) rename subprojects/robotpy-wpiutil/{wrapcfg => semiwrap}/SendableHelper.yml (94%) rename subprojects/robotpy-wpiutil/{wrapcfg => semiwrap}/SendableRegistry.yml (100%) rename subprojects/robotpy-wpiutil/{wrapcfg => semiwrap}/StackTrace.yml (100%) rename subprojects/robotpy-wpiutil/{wrapcfg => semiwrap}/Synchronization.yml (100%) rename subprojects/robotpy-wpiutil/{wrapcfg => semiwrap}/WPyStruct.yml (100%) rename subprojects/robotpy-wpiutil/{wrapcfg => semiwrap}/modules/.gitignore (100%) rename subprojects/robotpy-wpiutil/{wrapcfg => semiwrap}/trampolines/.gitignore (100%) create mode 100644 subprojects/robotpy-wpiutil/tests/cpp/meson.build delete mode 100644 subprojects/robotpy-wpiutil/tests/cpp/setup.py create mode 100644 subprojects/robotpy-wpiutil/wpiutil/py.typed diff --git a/subprojects/robotpy-wpiutil/meson.build b/subprojects/robotpy-wpiutil/meson.build index d77992ede..daa5de5c2 100644 --- a/subprojects/robotpy-wpiutil/meson.build +++ b/subprojects/robotpy-wpiutil/meson.build @@ -2,7 +2,7 @@ project('robotpy-wpiutil', ['cpp'], default_options: ['warning_level=1', 'cpp_std=c++20', 'b_colorout=auto', 'optimization=2', 'b_pie=true']) -subdir('wrapcfg') +subdir('semiwrap') wpiutil_sources += files( 'wpiutil/src/main.cpp', @@ -11,4 +11,4 @@ wpiutil_sources += files( 'wpiutil/src/wpistruct/wpystruct_fns.cpp', ) -subdir('wrapcfg/modules') +subdir('semiwrap/modules') diff --git a/subprojects/robotpy-wpiutil/pyproject.toml b/subprojects/robotpy-wpiutil/pyproject.toml index db8beb2a2..5d71e7e34 100644 --- a/subprojects/robotpy-wpiutil/pyproject.toml +++ b/subprojects/robotpy-wpiutil/pyproject.toml @@ -1,63 +1,66 @@ [build-system] build-backend = "hatchling.build" requires = [ - "semiwrap", "hatch-meson", "hatch-vcs", "hatchling", - "native.wpiutil==2025.3.2", + "semiwrap~=0.1", + "hatch-meson~=0.1.0b2", + "hatch-robotpy~=0.2", + "hatchling", + "robotpy-native-wpiutil==2025.3.2", ] [project] name = "robotpy-wpiutil" -dynamic = ["version"] +version = "2025.3.2.2" description = "Binary wrapper for FRC WPIUtil library" authors = [ {name = "RobotPy Development Team", email = "robotpy@googlegroups.com"}, ] license = "BSD-3-Clause" -install_requires = [ - "native.wpiutil==2025.3.2", - "msvc-runtime>=14.42.34433; platform_system == 'Windows'" +dependencies = [ + "robotpy-native-wpiutil==2025.3.2", ] [project.urls] "Source code" = "https://github.com/robotpy/mostrobotpy" -[tool.hatch.version] -source = "vcs" -raw-options.root = "../.." - -[tool.hatch.build.hooks.vcs] -version-file = "wpiutil/version.py" - +[tool.hatch.build.hooks.robotpy] +version_file = "wpiutil/version.py" [tool.hatch.build.hooks.semiwrap] -# update_init = [ -# "wpiutil", -# "wpiutil.log wpiutil._wpiutil.log", -# "wpiutil.sync wpiutil._wpiutil.sync", -# "wpiutil.wpistruct wpiutil._wpiutil.wpistruct", -# ] -# scan_headers_ignore = [ -# "fmt/*", -# "google/*", -# "wpi/*", -# "wpystruct_fns.h", -# "pb.h", -# "pb_common.h", -# "pb_decode.h", -# "pb_encode.h", -# ] [tool.hatch.build.hooks.meson] +[tool.hatch.build.targets.wheel] +packages = ["wpiutil"] + [tool.semiwrap] +update_init = [ + "wpiutil", + "wpiutil.log wpiutil._wpiutil.log", + "wpiutil.sync wpiutil._wpiutil.sync", + "wpiutil.wpistruct wpiutil._wpiutil.wpistruct", +] +scan_headers_ignore = [ + "debugging.hpp", + "debugging/*", + "fmt/*", + "google/*", + "wpi/*", + "wpystruct_fns.h", + "pb.h", + "pb_common.h", + "pb_decode.h", + "pb_encode.h", +] + [tool.semiwrap.extension_modules."wpiutil._wpiutil"] name = "wpiutil" includes = [ "wpiutil/src/wpistruct", ] -wraps = ["native.wpiutil"] +wraps = ["robotpy-native-wpiutil"] depends = ["wpiutil-casters"] [tool.semiwrap.extension_modules."wpiutil._wpiutil".headers] diff --git a/subprojects/robotpy-wpiutil/wrapcfg/.gitignore b/subprojects/robotpy-wpiutil/semiwrap/.gitignore similarity index 100% rename from subprojects/robotpy-wpiutil/wrapcfg/.gitignore rename to subprojects/robotpy-wpiutil/semiwrap/.gitignore diff --git a/subprojects/robotpy-wpiutil/wrapcfg/DataLog.yml b/subprojects/robotpy-wpiutil/semiwrap/DataLog.yml similarity index 100% rename from subprojects/robotpy-wpiutil/wrapcfg/DataLog.yml rename to subprojects/robotpy-wpiutil/semiwrap/DataLog.yml diff --git a/subprojects/robotpy-wpiutil/wrapcfg/DataLogBackgroundWriter.yml b/subprojects/robotpy-wpiutil/semiwrap/DataLogBackgroundWriter.yml similarity index 100% rename from subprojects/robotpy-wpiutil/wrapcfg/DataLogBackgroundWriter.yml rename to subprojects/robotpy-wpiutil/semiwrap/DataLogBackgroundWriter.yml diff --git a/subprojects/robotpy-wpiutil/wrapcfg/DataLogReader.yml b/subprojects/robotpy-wpiutil/semiwrap/DataLogReader.yml similarity index 100% rename from subprojects/robotpy-wpiutil/wrapcfg/DataLogReader.yml rename to subprojects/robotpy-wpiutil/semiwrap/DataLogReader.yml diff --git a/subprojects/robotpy-wpiutil/wrapcfg/DataLogWriter.yml b/subprojects/robotpy-wpiutil/semiwrap/DataLogWriter.yml similarity index 100% rename from subprojects/robotpy-wpiutil/wrapcfg/DataLogWriter.yml rename to subprojects/robotpy-wpiutil/semiwrap/DataLogWriter.yml diff --git a/subprojects/robotpy-wpiutil/wrapcfg/RawFrame.yml b/subprojects/robotpy-wpiutil/semiwrap/RawFrame.yml similarity index 100% rename from subprojects/robotpy-wpiutil/wrapcfg/RawFrame.yml rename to subprojects/robotpy-wpiutil/semiwrap/RawFrame.yml diff --git a/subprojects/robotpy-wpiutil/wrapcfg/Sendable.yml b/subprojects/robotpy-wpiutil/semiwrap/Sendable.yml similarity index 100% rename from subprojects/robotpy-wpiutil/wrapcfg/Sendable.yml rename to subprojects/robotpy-wpiutil/semiwrap/Sendable.yml diff --git a/subprojects/robotpy-wpiutil/wrapcfg/SendableBuilder.yml b/subprojects/robotpy-wpiutil/semiwrap/SendableBuilder.yml similarity index 100% rename from subprojects/robotpy-wpiutil/wrapcfg/SendableBuilder.yml rename to subprojects/robotpy-wpiutil/semiwrap/SendableBuilder.yml diff --git a/subprojects/robotpy-wpiutil/wrapcfg/SendableHelper.yml b/subprojects/robotpy-wpiutil/semiwrap/SendableHelper.yml similarity index 94% rename from subprojects/robotpy-wpiutil/wrapcfg/SendableHelper.yml rename to subprojects/robotpy-wpiutil/semiwrap/SendableHelper.yml index 63299223d..063898da5 100644 --- a/subprojects/robotpy-wpiutil/wrapcfg/SendableHelper.yml +++ b/subprojects/robotpy-wpiutil/semiwrap/SendableHelper.yml @@ -1,9 +1,7 @@ ---- classes: wpi::SendableHelper: ignore: true # CRTP - shared_ptr: true methods: GetName: SetName: diff --git a/subprojects/robotpy-wpiutil/wrapcfg/SendableRegistry.yml b/subprojects/robotpy-wpiutil/semiwrap/SendableRegistry.yml similarity index 100% rename from subprojects/robotpy-wpiutil/wrapcfg/SendableRegistry.yml rename to subprojects/robotpy-wpiutil/semiwrap/SendableRegistry.yml diff --git a/subprojects/robotpy-wpiutil/wrapcfg/StackTrace.yml b/subprojects/robotpy-wpiutil/semiwrap/StackTrace.yml similarity index 100% rename from subprojects/robotpy-wpiutil/wrapcfg/StackTrace.yml rename to subprojects/robotpy-wpiutil/semiwrap/StackTrace.yml diff --git a/subprojects/robotpy-wpiutil/wrapcfg/Synchronization.yml b/subprojects/robotpy-wpiutil/semiwrap/Synchronization.yml similarity index 100% rename from subprojects/robotpy-wpiutil/wrapcfg/Synchronization.yml rename to subprojects/robotpy-wpiutil/semiwrap/Synchronization.yml diff --git a/subprojects/robotpy-wpiutil/wrapcfg/WPyStruct.yml b/subprojects/robotpy-wpiutil/semiwrap/WPyStruct.yml similarity index 100% rename from subprojects/robotpy-wpiutil/wrapcfg/WPyStruct.yml rename to subprojects/robotpy-wpiutil/semiwrap/WPyStruct.yml diff --git a/subprojects/robotpy-wpiutil/wrapcfg/modules/.gitignore b/subprojects/robotpy-wpiutil/semiwrap/modules/.gitignore similarity index 100% rename from subprojects/robotpy-wpiutil/wrapcfg/modules/.gitignore rename to subprojects/robotpy-wpiutil/semiwrap/modules/.gitignore diff --git a/subprojects/robotpy-wpiutil/wrapcfg/trampolines/.gitignore b/subprojects/robotpy-wpiutil/semiwrap/trampolines/.gitignore similarity index 100% rename from subprojects/robotpy-wpiutil/wrapcfg/trampolines/.gitignore rename to subprojects/robotpy-wpiutil/semiwrap/trampolines/.gitignore diff --git a/subprojects/robotpy-wpiutil/tests/cpp/meson.build b/subprojects/robotpy-wpiutil/tests/cpp/meson.build new file mode 100644 index 000000000..ce0ca130a --- /dev/null +++ b/subprojects/robotpy-wpiutil/tests/cpp/meson.build @@ -0,0 +1,17 @@ +project('wpiutil-test', ['cpp'], + default_options: ['warning_level=1', 'cpp_std=c++20', + 'b_colorout=auto', 'optimization=2', 'b_pie=true']) + +py = import('python').find_installation() + +py.extension_module( + 'module', + sources: files( + 'wpiutil_test/module.cpp', + 'wpiutil_test/sendable_test.cpp', + 'wpiutil_test/struct_test.cpp', + ), + install: true, + subdir: 'wpiutil_test', + dependencies: [dependency('semiwrap'), dependency('wpiutil')], +) diff --git a/subprojects/robotpy-wpiutil/tests/cpp/pyproject.toml b/subprojects/robotpy-wpiutil/tests/cpp/pyproject.toml index 2555a0c60..155ad6e19 100644 --- a/subprojects/robotpy-wpiutil/tests/cpp/pyproject.toml +++ b/subprojects/robotpy-wpiutil/tests/cpp/pyproject.toml @@ -1,24 +1,11 @@ [build-system] -requires = ["robotpy-build"] - -[tool.robotpy-build] -base_package = "wpiutil_test" - -[tool.robotpy-build.wrappers."wpiutil_test"] -name = "wpiutil_test" -extension = "module" -depends = ["wpiutil"] -sources = [ - "wpiutil_test/module.cpp", - "wpiutil_test/sendable_test.cpp", - "wpiutil_test/struct_test.cpp", +build-backend = "hatchling.build" +requires = [ + "hatch-meson", "hatchling" ] -[tool.robotpy-build.metadata] +[project] name = "wpiutil_test" -description = "Test project for verifying robotpy-build behavior" -author = "RobotPy Development Team" -author_email = "robotpy@googlegroups.com" -license = "BSD-3-Clause" -install_requires = [] -url = "" \ No newline at end of file +version = "0.0.1" + +[tool.hatch.build.hooks.meson] diff --git a/subprojects/robotpy-wpiutil/tests/cpp/setup.py b/subprojects/robotpy-wpiutil/tests/cpp/setup.py deleted file mode 100644 index 3542d0c9a..000000000 --- a/subprojects/robotpy-wpiutil/tests/cpp/setup.py +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env python3 - -from robotpy_build.setup import setup - -setup() diff --git a/subprojects/robotpy-wpiutil/tests/cpp/wpiutil_test/__init__.py b/subprojects/robotpy-wpiutil/tests/cpp/wpiutil_test/__init__.py index 05b53543b..9eaa5eb37 100644 --- a/subprojects/robotpy-wpiutil/tests/cpp/wpiutil_test/__init__.py +++ b/subprojects/robotpy-wpiutil/tests/cpp/wpiutil_test/__init__.py @@ -1 +1 @@ -from . import _initmodule +import wpiutil diff --git a/subprojects/robotpy-wpiutil/tests/cpp/wpiutil_test/module.cpp b/subprojects/robotpy-wpiutil/tests/cpp/wpiutil_test/module.cpp index 914b68f95..ca045a8a0 100644 --- a/subprojects/robotpy-wpiutil/tests/cpp/wpiutil_test/module.cpp +++ b/subprojects/robotpy-wpiutil/tests/cpp/wpiutil_test/module.cpp @@ -1,5 +1,5 @@ // clang-format off -#include +#include #include #include @@ -153,7 +153,7 @@ void sendable_test(py::module &m); void struct_test(py::module &m); -RPYBUILD_PYBIND11_MODULE(m) { +PYBIND11_MODULE(module, m) { sendable_test(m); struct_test(m); diff --git a/subprojects/robotpy-wpiutil/tests/cpp/wpiutil_test/sendable_test.cpp b/subprojects/robotpy-wpiutil/tests/cpp/wpiutil_test/sendable_test.cpp index ccc1ef84c..bc3d7cb49 100644 --- a/subprojects/robotpy-wpiutil/tests/cpp/wpiutil_test/sendable_test.cpp +++ b/subprojects/robotpy-wpiutil/tests/cpp/wpiutil_test/sendable_test.cpp @@ -1,7 +1,7 @@ #include #include -#include +#include #include #include diff --git a/subprojects/robotpy-wpiutil/tests/run_tests.py b/subprojects/robotpy-wpiutil/tests/run_tests.py index 0ba160eff..80c5f49df 100755 --- a/subprojects/robotpy-wpiutil/tests/run_tests.py +++ b/subprojects/robotpy-wpiutil/tests/run_tests.py @@ -9,9 +9,6 @@ root = abspath(dirname(__file__)) os.chdir(root) - env = os.environ.copy() - env["SETUPTOOLS_SCM_PRETEND_VERSION"] = "0.0.1" - subprocess.check_call( [ sys.executable, @@ -19,11 +16,11 @@ "pip", "--disable-pip-version-check", "install", + "-v", + "--force-reinstall", "--no-build-isolation", - "-e", - "cpp", + "./cpp", ], - env=env, ) subprocess.check_call([sys.executable, "-m", "pytest"]) diff --git a/subprojects/robotpy-wpiutil/wpiutil/__init__.py b/subprojects/robotpy-wpiutil/wpiutil/__init__.py index 1000413ea..6dccafed1 100644 --- a/subprojects/robotpy-wpiutil/wpiutil/__init__.py +++ b/subprojects/robotpy-wpiutil/wpiutil/__init__.py @@ -1,6 +1,6 @@ from . import _init__wpiutil -# autogenerated by 'robotpy-build create-imports wpiutil wpiutil._wpiutil' +# autogenerated by 'semiwrap create-imports wpiutil wpiutil._wpiutil' from ._wpiutil import ( ControlRecordType, DataLogBackgroundWriter, diff --git a/subprojects/robotpy-wpiutil/wpiutil/log/__init__.py b/subprojects/robotpy-wpiutil/wpiutil/log/__init__.py index da36f1d80..d724c267c 100644 --- a/subprojects/robotpy-wpiutil/wpiutil/log/__init__.py +++ b/subprojects/robotpy-wpiutil/wpiutil/log/__init__.py @@ -1,4 +1,4 @@ -# autogenerated by 'robotpy-build create-imports wpiutil.log wpiutil._wpiutil.log' +# autogenerated by 'semiwrap create-imports wpiutil.log wpiutil._wpiutil.log' from .._wpiutil.log import ( BooleanArrayLogEntry, BooleanLogEntry, diff --git a/subprojects/robotpy-wpiutil/wpiutil/py.typed b/subprojects/robotpy-wpiutil/wpiutil/py.typed new file mode 100644 index 000000000..e69de29bb diff --git a/subprojects/robotpy-wpiutil/wpiutil/src/safethread_gil.cpp b/subprojects/robotpy-wpiutil/wpiutil/src/safethread_gil.cpp index 131d6fd4a..c7bb7ba70 100644 --- a/subprojects/robotpy-wpiutil/wpiutil/src/safethread_gil.cpp +++ b/subprojects/robotpy-wpiutil/wpiutil/src/safethread_gil.cpp @@ -1,7 +1,7 @@ #include #include -#include +#include using OnThreadStartFn = void *(*)(); using OnThreadEndFn = void (*)(void *); diff --git a/subprojects/robotpy-wpiutil/wpiutil/src/stacktracehook.cpp b/subprojects/robotpy-wpiutil/wpiutil/src/stacktracehook.cpp index 1dc4db606..97e560229 100644 --- a/subprojects/robotpy-wpiutil/wpiutil/src/stacktracehook.cpp +++ b/subprojects/robotpy-wpiutil/wpiutil/src/stacktracehook.cpp @@ -1,5 +1,5 @@ -#include +#include #include py::object &get_hook_ref() { diff --git a/subprojects/robotpy-wpiutil/wpiutil/src/wpistruct/wpystruct.h b/subprojects/robotpy-wpiutil/wpiutil/src/wpistruct/wpystruct.h index ac97747a6..f9b3876c8 100644 --- a/subprojects/robotpy-wpiutil/wpiutil/src/wpistruct/wpystruct.h +++ b/subprojects/robotpy-wpiutil/wpiutil/src/wpistruct/wpystruct.h @@ -10,7 +10,7 @@ #include #include -#include +#include static inline std::string pytypename(const py::type &t) { return ((PyTypeObject *)t.ptr())->tp_name; diff --git a/subprojects/robotpy-wpiutil/wpiutil/sync/__init__.py b/subprojects/robotpy-wpiutil/wpiutil/sync/__init__.py index 1ea57e0b4..6c6285852 100644 --- a/subprojects/robotpy-wpiutil/wpiutil/sync/__init__.py +++ b/subprojects/robotpy-wpiutil/wpiutil/sync/__init__.py @@ -1,4 +1,4 @@ -# autogenerated by 'robotpy-build create-imports wpiutil.sync wpiutil._wpiutil.sync' +# autogenerated by 'semiwrap create-imports wpiutil.sync wpiutil._wpiutil.sync' from .._wpiutil.sync import ( createEvent, createSemaphore, diff --git a/subprojects/robotpy-wpiutil/wpiutil/wpistruct/__init__.py b/subprojects/robotpy-wpiutil/wpiutil/wpistruct/__init__.py index b9f8c7e5e..6cfffe5b6 100644 --- a/subprojects/robotpy-wpiutil/wpiutil/wpistruct/__init__.py +++ b/subprojects/robotpy-wpiutil/wpiutil/wpistruct/__init__.py @@ -3,7 +3,7 @@ mechanism to implement your own custom structs using Python (see :func:`wpiutil.wpistruct.make_wpistruct`). """ -# autogenerated by 'robotpy-build create-imports wpiutil.wpistruct wpiutil._wpiutil.wpistruct' +# autogenerated by 'semiwrap create-imports wpiutil.wpistruct wpiutil._wpiutil.wpistruct' from .._wpiutil.wpistruct import ( forEachNested, getSchema, From 1c8af9054fccdbce048653a76a23b3a2839ddb91 Mon Sep 17 00:00:00 2001 From: Dustin Spicuzza Date: Wed, 9 Apr 2025 00:56:29 -0400 Subject: [PATCH 05/20] Update robotpy-wpinet to semiwrap --- subprojects/robotpy-wpinet/.gitignore | 11 +-- subprojects/robotpy-wpinet/meson.build | 11 +++ subprojects/robotpy-wpinet/pyproject.toml | 77 ++++++++++--------- .../robotpy-wpinet/semiwrap/.gitignore | 3 + .../{gen => semiwrap}/PortForwarder.yml | 2 +- .../{gen => semiwrap}/WebServer.yml | 2 +- subprojects/robotpy-wpinet/setup.py | 5 -- subprojects/robotpy-wpinet/wpinet/__init__.py | 4 +- .../robotpy-wpinet/wpinet/src/main.cpp | 4 +- 9 files changed, 65 insertions(+), 54 deletions(-) create mode 100644 subprojects/robotpy-wpinet/meson.build create mode 100644 subprojects/robotpy-wpinet/semiwrap/.gitignore rename subprojects/robotpy-wpinet/{gen => semiwrap}/PortForwarder.yml (84%) rename subprojects/robotpy-wpinet/{gen => semiwrap}/WebServer.yml (87%) delete mode 100644 subprojects/robotpy-wpinet/setup.py diff --git a/subprojects/robotpy-wpinet/.gitignore b/subprojects/robotpy-wpinet/.gitignore index b94ec8e60..d6782d589 100644 --- a/subprojects/robotpy-wpinet/.gitignore +++ b/subprojects/robotpy-wpinet/.gitignore @@ -10,14 +10,9 @@ __pycache__ /wpinet/include /wpinet/lib -/wpinet/py.typed -/wpinet/_init_wpinet.py -/wpinet/pkgcfg.py +/wpinet/_init__wpinet.py +/wpinet/wpinet.pc +/wpinet/trampolines /wpinet/version.py /dist /build - -/tests/cpp/build -/tests/cpp/wpinet_test/_initmodule.py -/tests/cpp/wpinet_test/pkgcfg.py -/tests/cpp/wpinet_test/version.py \ No newline at end of file diff --git a/subprojects/robotpy-wpinet/meson.build b/subprojects/robotpy-wpinet/meson.build new file mode 100644 index 000000000..4ef0e902d --- /dev/null +++ b/subprojects/robotpy-wpinet/meson.build @@ -0,0 +1,11 @@ +project('robotpy-wpinet', ['cpp'], + default_options: ['warning_level=1', 'cpp_std=c++20', + 'b_colorout=auto', 'optimization=2', 'b_pie=true']) + +subdir('semiwrap') + +wpinet_sources += files( + 'wpinet/src/main.cpp', +) + +subdir('semiwrap/modules') diff --git a/subprojects/robotpy-wpinet/pyproject.toml b/subprojects/robotpy-wpinet/pyproject.toml index 7159004e9..88053ba31 100644 --- a/subprojects/robotpy-wpinet/pyproject.toml +++ b/subprojects/robotpy-wpinet/pyproject.toml @@ -1,47 +1,54 @@ -[tool.robotpy-build] -base_package = "wpinet" +[build-system] +build-backend = "hatchling.build" +requires = [ + "semiwrap~=0.1", + "hatch-meson~=0.1.0b2", + "hatchling", + "robotpy-native-wpinet==2025.3.2", + "robotpy-wpiutil==2025.3.2.2" +] + +[project] +name = "robotpy-wpinet" +version = "2025.3.2.2" +description = "Binary wrapper for FRC wpinet library" +authors = [ + {name = "RobotPy Development Team", email = "robotpy@googlegroups.com"}, +] +license = "BSD-3-Clause" +dependencies = [ + "robotpy-native-wpinet==2025.3.2", + "robotpy-wpiutil==2025.3.2.2" +] + +[project.urls] +"Source code" = "https://github.com/robotpy/mostrobotpy" + + +[tool.hatch.build.hooks.robotpy] +version_file = "wpinet/version.py" + +[tool.hatch.build.hooks.semiwrap] + +[tool.hatch.build.hooks.meson] + +[tool.hatch.build.targets.wheel] +packages = ["wpinet"] + + +[tool.semiwrap] update_init = [ "wpinet" ] # we don't wrap anything here scan_headers_ignore = ["*"] -[tool.robotpy-build.wrappers."wpinet"] +[tool.semiwrap.extension_modules."wpinet._wpinet"] name = "wpinet" -sources = [ - "wpinet/src/main.cpp", -] - +wraps = ["robotpy-native-wpinet"] depends = ["wpiutil"] -generation_data = "gen" -[tool.robotpy-build.wrappers."wpinet".maven_lib_download] -artifact_id = "wpinet-cpp" -group_id = "edu.wpi.first.wpinet" -# repo_url = "https://frcmaven.wpi.edu/artifactory/release" -repo_url = "https://frcmaven.wpi.edu/artifactory/release" -version = "2025.3.2" - -libs = ["wpinet"] - -[tool.robotpy-build.wrappers."wpinet".autogen_headers] +[tool.semiwrap.extension_modules."wpinet._wpinet".headers] # wpinet PortForwarder = "wpinet/PortForwarder.h" WebServer = "wpinet/WebServer.h" - -[tool.robotpy-build.metadata] -name = "robotpy-wpinet" -description = "Binary wrapper for FRC wpinet library" -author = "RobotPy Development Team" -author_email = "robotpy@googlegroups.com" -url = "https://github.com/robotpy/robotpy-wpinet" -license = "BSD-3-Clause" -install_requires = [ - "robotpy-wpiutil==THIS_VERSION", -] - -[build-system] -requires = [ - "robotpy-build~=2025.1.0", - "robotpy-wpiutil~=2025.3.2", -] diff --git a/subprojects/robotpy-wpinet/semiwrap/.gitignore b/subprojects/robotpy-wpinet/semiwrap/.gitignore new file mode 100644 index 000000000..6cdce1027 --- /dev/null +++ b/subprojects/robotpy-wpinet/semiwrap/.gitignore @@ -0,0 +1,3 @@ +/meson.build +/modules/meson.build +/trampolines/meson.build diff --git a/subprojects/robotpy-wpinet/gen/PortForwarder.yml b/subprojects/robotpy-wpinet/semiwrap/PortForwarder.yml similarity index 84% rename from subprojects/robotpy-wpinet/gen/PortForwarder.yml rename to subprojects/robotpy-wpinet/semiwrap/PortForwarder.yml index e78074e06..64e172eae 100644 --- a/subprojects/robotpy-wpinet/gen/PortForwarder.yml +++ b/subprojects/robotpy-wpinet/semiwrap/PortForwarder.yml @@ -1,5 +1,5 @@ classes: - PortForwarder: + wpi::PortForwarder: nodelete: true methods: GetInstance: diff --git a/subprojects/robotpy-wpinet/gen/WebServer.yml b/subprojects/robotpy-wpinet/semiwrap/WebServer.yml similarity index 87% rename from subprojects/robotpy-wpinet/gen/WebServer.yml rename to subprojects/robotpy-wpinet/semiwrap/WebServer.yml index fb44843be..c16074fb2 100644 --- a/subprojects/robotpy-wpinet/gen/WebServer.yml +++ b/subprojects/robotpy-wpinet/semiwrap/WebServer.yml @@ -1,7 +1,7 @@ --- classes: - WebServer: + wpi::WebServer: nodelete: true methods: GetInstance: diff --git a/subprojects/robotpy-wpinet/setup.py b/subprojects/robotpy-wpinet/setup.py deleted file mode 100644 index 3542d0c9a..000000000 --- a/subprojects/robotpy-wpinet/setup.py +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env python3 - -from robotpy_build.setup import setup - -setup() diff --git a/subprojects/robotpy-wpinet/wpinet/__init__.py b/subprojects/robotpy-wpinet/wpinet/__init__.py index 8c93a2c6c..b3261c177 100644 --- a/subprojects/robotpy-wpinet/wpinet/__init__.py +++ b/subprojects/robotpy-wpinet/wpinet/__init__.py @@ -1,7 +1,7 @@ -from . import _init_wpinet +from . import _init__wpinet -# autogenerated by 'robotpy-build create-imports wpinet wpinet._wpinet' +# autogenerated by 'semiwrap create-imports wpinet wpinet._wpinet' from ._wpinet import PortForwarder, WebServer __all__ = ["PortForwarder", "WebServer"] diff --git a/subprojects/robotpy-wpinet/wpinet/src/main.cpp b/subprojects/robotpy-wpinet/wpinet/src/main.cpp index cafc08dd7..0c1b0adab 100644 --- a/subprojects/robotpy-wpinet/wpinet/src/main.cpp +++ b/subprojects/robotpy-wpinet/wpinet/src/main.cpp @@ -1,4 +1,4 @@ -#include +#include -RPYBUILD_PYBIND11_MODULE(m) { initWrapper(m); } +SEMIWRAP_PYBIND11_MODULE(m) { initWrapper(m); } From 3dc1c55e6840044c08573315f7b5b82a5d86e4e0 Mon Sep 17 00:00:00 2001 From: Dustin Spicuzza Date: Wed, 9 Apr 2025 22:31:34 -0400 Subject: [PATCH 06/20] Update pyntcore to semiwrap --- subprojects/pyntcore/.gitignore | 8 +- subprojects/pyntcore/meson.build | 14 ++++ subprojects/pyntcore/ntcore/__init__.py | 4 +- subprojects/pyntcore/ntcore/meta/__init__.py | 2 +- subprojects/pyntcore/ntcore/py.typed | 0 .../pyntcore/ntcore/src/nt_instance.cpp | 2 +- subprojects/pyntcore/ntcore/src/ntcore.cpp | 4 +- subprojects/pyntcore/ntcore/src/py2value.h | 2 +- subprojects/pyntcore/ntcore/src/pyentry.h | 2 +- subprojects/pyntcore/pyproject.toml | 76 +++++++++++-------- subprojects/pyntcore/semiwrap/.gitignore | 3 + .../{gen => semiwrap}/BooleanArrayTopic.yml | 17 ++--- .../{gen => semiwrap}/BooleanTopic.yml | 21 +++-- .../{gen => semiwrap}/ConnectionListener.yml | 9 +-- .../{gen => semiwrap}/DoubleArrayTopic.yml | 21 +++-- .../{gen => semiwrap}/DoubleTopic.yml | 17 ++--- .../{gen => semiwrap}/FloatArrayTopic.yml | 17 ++--- .../pyntcore/{gen => semiwrap}/FloatTopic.yml | 17 ++--- .../{gen => semiwrap}/GenericEntry.yml | 13 ++-- .../{gen => semiwrap}/IntegerArrayTopic.yml | 17 ++--- .../{gen => semiwrap}/IntegerTopic.yml | 17 ++--- .../{gen => semiwrap}/MultiSubscriber.yml | 5 +- .../pyntcore/{gen => semiwrap}/NTSendable.yml | 5 +- .../{gen => semiwrap}/NTSendableBuilder.yml | 3 +- .../{gen => semiwrap}/NetworkTable.yml | 3 +- .../{gen => semiwrap}/NetworkTableEntry.yml | 5 +- .../NetworkTableInstance.yml | 9 +-- .../NetworkTableListener.yml | 9 +-- .../{gen => semiwrap}/NetworkTableType.yml | 1 - .../{gen => semiwrap}/NetworkTableValue.yml | 27 ++++--- .../pyntcore/{gen => semiwrap}/RawTopic.yml | 17 ++--- .../{gen => semiwrap}/StringArrayTopic.yml | 17 ++--- .../{gen => semiwrap}/StringTopic.yml | 17 ++--- .../{gen => semiwrap}/StructArrayTopic.yml | 19 +++-- .../{gen => semiwrap}/StructTopic.yml | 17 ++--- .../pyntcore/{gen => semiwrap}/Topic.yml | 13 ++-- .../{gen => semiwrap}/TopicListener.yml | 11 ++- .../{gen => semiwrap}/ValueListener.yml | 11 ++- .../pyntcore/{gen => semiwrap}/ntcore_cpp.yml | 47 ++++++------ .../{gen => semiwrap}/ntcore_cpp_types.yml | 7 +- subprojects/pyntcore/setup.py | 5 -- 41 files changed, 261 insertions(+), 270 deletions(-) create mode 100644 subprojects/pyntcore/meson.build create mode 100644 subprojects/pyntcore/ntcore/py.typed create mode 100644 subprojects/pyntcore/semiwrap/.gitignore rename subprojects/pyntcore/{gen => semiwrap}/BooleanArrayTopic.yml (94%) rename subprojects/pyntcore/{gen => semiwrap}/BooleanTopic.yml (93%) rename subprojects/pyntcore/{gen => semiwrap}/ConnectionListener.yml (79%) rename subprojects/pyntcore/{gen => semiwrap}/DoubleArrayTopic.yml (94%) rename subprojects/pyntcore/{gen => semiwrap}/DoubleTopic.yml (94%) rename subprojects/pyntcore/{gen => semiwrap}/FloatArrayTopic.yml (95%) rename subprojects/pyntcore/{gen => semiwrap}/FloatTopic.yml (95%) rename subprojects/pyntcore/{gen => semiwrap}/GenericEntry.yml (94%) rename subprojects/pyntcore/{gen => semiwrap}/IntegerArrayTopic.yml (94%) rename subprojects/pyntcore/{gen => semiwrap}/IntegerTopic.yml (94%) rename subprojects/pyntcore/{gen => semiwrap}/MultiSubscriber.yml (94%) rename subprojects/pyntcore/{gen => semiwrap}/NTSendable.yml (90%) rename subprojects/pyntcore/{gen => semiwrap}/NTSendableBuilder.yml (93%) rename subprojects/pyntcore/{gen => semiwrap}/NetworkTable.yml (99%) rename subprojects/pyntcore/{gen => semiwrap}/NetworkTableEntry.yml (98%) rename subprojects/pyntcore/{gen => semiwrap}/NetworkTableInstance.yml (98%) rename subprojects/pyntcore/{gen => semiwrap}/NetworkTableListener.yml (95%) rename subprojects/pyntcore/{gen => semiwrap}/NetworkTableType.yml (87%) rename subprojects/pyntcore/{gen => semiwrap}/NetworkTableValue.yml (90%) rename subprojects/pyntcore/{gen => semiwrap}/RawTopic.yml (95%) rename subprojects/pyntcore/{gen => semiwrap}/StringArrayTopic.yml (94%) rename subprojects/pyntcore/{gen => semiwrap}/StringTopic.yml (95%) rename subprojects/pyntcore/{gen => semiwrap}/StructArrayTopic.yml (96%) rename subprojects/pyntcore/{gen => semiwrap}/StructTopic.yml (96%) rename subprojects/pyntcore/{gen => semiwrap}/Topic.yml (96%) rename subprojects/pyntcore/{gen => semiwrap}/TopicListener.yml (92%) rename subprojects/pyntcore/{gen => semiwrap}/ValueListener.yml (94%) rename subprojects/pyntcore/{gen => semiwrap}/ntcore_cpp.yml (95%) rename subprojects/pyntcore/{gen => semiwrap}/ntcore_cpp_types.yml (96%) delete mode 100755 subprojects/pyntcore/setup.py diff --git a/subprojects/pyntcore/.gitignore b/subprojects/pyntcore/.gitignore index 3f0a20aaa..7c544c7a1 100644 --- a/subprojects/pyntcore/.gitignore +++ b/subprojects/pyntcore/.gitignore @@ -10,10 +10,8 @@ __pycache__ /build /dist -/ntcore/include /ntcore/lib -/ntcore/_init_ntcore.py -/ntcore/pkgcfg.py +/ntcore/_init__ntcore.py +/ntcore/ntcore.pc /ntcore/version.py -/ntcore/py.typed -/ntcore/rpy-include \ No newline at end of file +/ntcore/trampolines \ No newline at end of file diff --git a/subprojects/pyntcore/meson.build b/subprojects/pyntcore/meson.build new file mode 100644 index 000000000..8a29b0628 --- /dev/null +++ b/subprojects/pyntcore/meson.build @@ -0,0 +1,14 @@ +project('pyntcore', ['cpp'], + default_options: ['warning_level=1', 'cpp_std=c++20', + 'b_colorout=auto', 'optimization=2', 'b_pie=true']) + +subdir('semiwrap') + +ntcore_sources += files( + 'ntcore/src/ntcore.cpp', + 'ntcore/src/nt_instance.cpp', + 'ntcore/src/py2value.cpp', + 'ntcore/src/pyentry.cpp', +) + +subdir('semiwrap/modules') diff --git a/subprojects/pyntcore/ntcore/__init__.py b/subprojects/pyntcore/ntcore/__init__.py index d193f81d2..76a9905bf 100644 --- a/subprojects/pyntcore/ntcore/__init__.py +++ b/subprojects/pyntcore/ntcore/__init__.py @@ -1,6 +1,6 @@ -from . import _init_ntcore +from . import _init__ntcore -# autogenerated by 'robotpy-build create-imports ntcore ntcore._ntcore' +# autogenerated by 'semiwrap create-imports ntcore ntcore._ntcore' from ._ntcore import ( BooleanArrayEntry, BooleanArrayPublisher, diff --git a/subprojects/pyntcore/ntcore/meta/__init__.py b/subprojects/pyntcore/ntcore/meta/__init__.py index ba1de00c1..73453762d 100644 --- a/subprojects/pyntcore/ntcore/meta/__init__.py +++ b/subprojects/pyntcore/ntcore/meta/__init__.py @@ -1,4 +1,4 @@ -# autogenerated by 'robotpy-build create-imports ntcore.meta ntcore._ntcore.meta' +# autogenerated by 'semiwrap create-imports ntcore.meta ntcore._ntcore.meta' from .._ntcore.meta import ( Client, ClientPublisher, diff --git a/subprojects/pyntcore/ntcore/py.typed b/subprojects/pyntcore/ntcore/py.typed new file mode 100644 index 000000000..e69de29bb diff --git a/subprojects/pyntcore/ntcore/src/nt_instance.cpp b/subprojects/pyntcore/ntcore/src/nt_instance.cpp index 9416b47e2..9924c44da 100644 --- a/subprojects/pyntcore/ntcore/src/nt_instance.cpp +++ b/subprojects/pyntcore/ntcore/src/nt_instance.cpp @@ -1,4 +1,4 @@ -#include +#include #include "nt_instance.h" #include "ntcore_cpp.h" diff --git a/subprojects/pyntcore/ntcore/src/ntcore.cpp b/subprojects/pyntcore/ntcore/src/ntcore.cpp index d96736c93..169563a1e 100644 --- a/subprojects/pyntcore/ntcore/src/ntcore.cpp +++ b/subprojects/pyntcore/ntcore/src/ntcore.cpp @@ -1,8 +1,8 @@ -#include +#include #include "nt_instance.h" -RPYBUILD_PYBIND11_MODULE(m) { +SEMIWRAP_PYBIND11_MODULE(m) { initWrapper(m); static int unused; diff --git a/subprojects/pyntcore/ntcore/src/py2value.h b/subprojects/pyntcore/ntcore/src/py2value.h index 7643b3e34..410ba5a7c 100644 --- a/subprojects/pyntcore/ntcore/src/py2value.h +++ b/subprojects/pyntcore/ntcore/src/py2value.h @@ -1,5 +1,5 @@ -#include +#include #include #include #include diff --git a/subprojects/pyntcore/ntcore/src/pyentry.h b/subprojects/pyntcore/ntcore/src/pyentry.h index 1e1d09ad2..8693ccfe7 100644 --- a/subprojects/pyntcore/ntcore/src/pyentry.h +++ b/subprojects/pyntcore/ntcore/src/pyentry.h @@ -1,5 +1,5 @@ -#include +#include #include #include diff --git a/subprojects/pyntcore/pyproject.toml b/subprojects/pyntcore/pyproject.toml index 0f023b24c..9ab331328 100644 --- a/subprojects/pyntcore/pyproject.toml +++ b/subprojects/pyntcore/pyproject.toml @@ -1,24 +1,46 @@ -[tool.robotpy-build.metadata] +[build-system] +build-backend = "hatchling.build" +requires = [ + "semiwrap~=0.1", + "hatch-meson~=0.1.0b2", + "hatch-robotpy~=0.2", + "hatchling", + "robotpy-native-ntcore==2025.3.2", + "robotpy-wpiutil==2025.3.2.2", + "robotpy-wpinet==2025.3.2.2", +] + + +[project] name = "pyntcore" +version = "2025.3.2.2" description = "Binary wrappers for the FRC ntcore library" -author = "RobotPy Development Team" -author_email = "robotpy@googlegroups.com" -url = "https://github.com/robotpy/pyntcore" +authors = [ + {name = "RobotPy Development Team", email = "robotpy@googlegroups.com"}, +] license = "BSD-3-Clause" -install_requires = [ - "robotpy-wpiutil==THIS_VERSION", - "robotpy-wpinet==THIS_VERSION", +dependencies = [ + "robotpy-native-ntcore==2025.3.2", + "robotpy-wpiutil==2025.3.2.2", + "robotpy-wpinet==2025.3.2.2", ] -[build-system] -requires = [ - "robotpy-build~=2025.1.0", - "robotpy-wpiutil~=2025.3.2", - "robotpy-wpinet~=2025.3.2", -] +[project.urls] +"Source code" = "https://github.com/robotpy/mostrobotpy" + + +[tool.hatch.build.hooks.robotpy] +version_file = "ntcore/version.py" -[tool.robotpy-build] -base_package = "ntcore" +[tool.hatch.build.hooks.semiwrap] + +[tool.hatch.build.hooks.meson] + +[tool.hatch.build.targets.wheel] +packages = ["ntcore"] + + +[tool.semiwrap] update_init = [ "ntcore", "ntcore.meta ntcore._ntcore.meta" @@ -31,29 +53,17 @@ scan_headers_ignore = [ "ntcore_c.h", "ntcore_c_types.h", "ntcore_test.h", -] -[tool.robotpy-build.wrappers."ntcore".maven_lib_download] -artifact_id = "ntcore-cpp" -group_id = "edu.wpi.first.ntcore" -repo_url = "https://frcmaven.wpi.edu/artifactory/release" -version = "2025.3.2" - -libs = ["ntcore"] - -[tool.robotpy-build.wrappers."ntcore"] -name = "ntcore" -sources = [ - "ntcore/src/ntcore.cpp", - "ntcore/src/nt_instance.cpp", - "ntcore/src/py2value.cpp", - "ntcore/src/pyentry.cpp", + "src/*", ] +[tool.semiwrap.extension_modules."ntcore._ntcore"] +name = "ntcore" +wraps = ["robotpy-native-ntcore"] depends = ["wpiutil", "wpinet"] -generation_data = "gen" -[tool.robotpy-build.wrappers."ntcore".autogen_headers] + +[tool.semiwrap.extension_modules."ntcore._ntcore".headers] # networktables BooleanArrayTopic = "networktables/BooleanArrayTopic.h" BooleanTopic = "networktables/BooleanTopic.h" diff --git a/subprojects/pyntcore/semiwrap/.gitignore b/subprojects/pyntcore/semiwrap/.gitignore new file mode 100644 index 000000000..6cdce1027 --- /dev/null +++ b/subprojects/pyntcore/semiwrap/.gitignore @@ -0,0 +1,3 @@ +/meson.build +/modules/meson.build +/trampolines/meson.build diff --git a/subprojects/pyntcore/gen/BooleanArrayTopic.yml b/subprojects/pyntcore/semiwrap/BooleanArrayTopic.yml similarity index 94% rename from subprojects/pyntcore/gen/BooleanArrayTopic.yml rename to subprojects/pyntcore/semiwrap/BooleanArrayTopic.yml index 8bd711b0e..89302e3d5 100644 --- a/subprojects/pyntcore/gen/BooleanArrayTopic.yml +++ b/subprojects/pyntcore/semiwrap/BooleanArrayTopic.yml @@ -1,11 +1,10 @@ ---- classes: - BooleanArraySubscriber: + nt::BooleanArraySubscriber: methods: BooleanArraySubscriber: overloads: - "": + '': ignore: true NT_Subscriber, ParamType: ignore: true @@ -39,11 +38,11 @@ classes: py::gil_scoped_release release; *self = BooleanArraySubscriber(); }) - BooleanArrayPublisher: + nt::BooleanArrayPublisher: methods: BooleanArrayPublisher: overloads: - "": + '': ignore: true NT_Publisher: ignore: true @@ -62,11 +61,11 @@ classes: py::gil_scoped_release release; *self = BooleanArrayPublisher(); }) - BooleanArrayEntry: + nt::BooleanArrayEntry: methods: BooleanArrayEntry: overloads: - "": + '': ignore: true NT_Entry, ParamType: ignore: true @@ -86,13 +85,13 @@ classes: py::gil_scoped_release release; *self = BooleanArrayEntry(); }) - BooleanArrayTopic: + nt::BooleanArrayTopic: attributes: kTypeString: methods: BooleanArrayTopic: overloads: - "": + '': ignore: true NT_Topic: ignore: true diff --git a/subprojects/pyntcore/gen/BooleanTopic.yml b/subprojects/pyntcore/semiwrap/BooleanTopic.yml similarity index 93% rename from subprojects/pyntcore/gen/BooleanTopic.yml rename to subprojects/pyntcore/semiwrap/BooleanTopic.yml index 8790236d7..11b1ded17 100644 --- a/subprojects/pyntcore/gen/BooleanTopic.yml +++ b/subprojects/pyntcore/semiwrap/BooleanTopic.yml @@ -1,11 +1,10 @@ ---- classes: - BooleanSubscriber: + nt::BooleanSubscriber: methods: BooleanSubscriber: overloads: - "": + '': ignore: true NT_Subscriber, ParamType: ignore: true @@ -31,11 +30,11 @@ classes: py::gil_scoped_release release; *self = BooleanSubscriber(); }) - BooleanPublisher: + nt::BooleanPublisher: methods: BooleanPublisher: overloads: - "": + '': ignore: true NT_Publisher: ignore: true @@ -54,11 +53,11 @@ classes: py::gil_scoped_release release; *self = BooleanPublisher(); }) - BooleanEntry: + nt::BooleanEntry: methods: BooleanEntry: overloads: - "": + '': ignore: true NT_Entry, ParamType: ignore: true @@ -78,13 +77,13 @@ classes: py::gil_scoped_release release; *self = BooleanEntry(); }) - BooleanTopic: + nt::BooleanTopic: attributes: kTypeString: methods: BooleanTopic: overloads: - "": + '': ignore: true NT_Topic: ignore: true @@ -95,7 +94,7 @@ classes: PublishEx: GetEntry: GetEntryEx: - inline_code: | + inline_code: |- .def("close", [](BooleanTopic *self) { py::gil_scoped_release release; *self = BooleanTopic(); @@ -106,4 +105,4 @@ classes: .def("__exit__", [](BooleanTopic *self, py::args args) { py::gil_scoped_release release; *self = BooleanTopic(); - }) \ No newline at end of file + }) diff --git a/subprojects/pyntcore/gen/ConnectionListener.yml b/subprojects/pyntcore/semiwrap/ConnectionListener.yml similarity index 79% rename from subprojects/pyntcore/gen/ConnectionListener.yml rename to subprojects/pyntcore/semiwrap/ConnectionListener.yml index db597440e..5fe5366ae 100644 --- a/subprojects/pyntcore/gen/ConnectionListener.yml +++ b/subprojects/pyntcore/semiwrap/ConnectionListener.yml @@ -1,18 +1,17 @@ ---- classes: - ConnectionListener: + nt::ConnectionListener: methods: ConnectionListener: overloads: - "": + '': nt::NetworkTableInstance, bool, std::function: GetHandle: - ConnectionListenerPoller: + nt::ConnectionListenerPoller: methods: ConnectionListenerPoller: overloads: - "": + '': nt::NetworkTableInstance: GetHandle: Add: diff --git a/subprojects/pyntcore/gen/DoubleArrayTopic.yml b/subprojects/pyntcore/semiwrap/DoubleArrayTopic.yml similarity index 94% rename from subprojects/pyntcore/gen/DoubleArrayTopic.yml rename to subprojects/pyntcore/semiwrap/DoubleArrayTopic.yml index 9177d109c..5da171b61 100644 --- a/subprojects/pyntcore/gen/DoubleArrayTopic.yml +++ b/subprojects/pyntcore/semiwrap/DoubleArrayTopic.yml @@ -1,11 +1,10 @@ ---- classes: - DoubleArraySubscriber: + nt::DoubleArraySubscriber: methods: DoubleArraySubscriber: overloads: - "": + '': ignore: true NT_Subscriber, ParamType: ignore: true @@ -39,11 +38,11 @@ classes: py::gil_scoped_release release; *self = DoubleArraySubscriber(); }) - DoubleArrayPublisher: + nt::DoubleArrayPublisher: methods: DoubleArrayPublisher: overloads: - "": + '': ignore: true NT_Publisher: ignore: true @@ -62,11 +61,11 @@ classes: py::gil_scoped_release release; *self = DoubleArrayPublisher(); }) - DoubleArrayEntry: + nt::DoubleArrayEntry: methods: DoubleArrayEntry: overloads: - "": + '': ignore: true NT_Entry, ParamType: ignore: true @@ -86,13 +85,13 @@ classes: py::gil_scoped_release release; *self = DoubleArrayEntry(); }) - DoubleArrayTopic: + nt::DoubleArrayTopic: attributes: kTypeString: methods: DoubleArrayTopic: overloads: - "": + '': ignore: true NT_Topic: ignore: true @@ -103,7 +102,7 @@ classes: PublishEx: GetEntry: GetEntryEx: - inline_code: | + inline_code: |- .def("close", [](DoubleArrayTopic *self) { py::gil_scoped_release release; *self = DoubleArrayTopic(); @@ -114,4 +113,4 @@ classes: .def("__exit__", [](DoubleArrayTopic *self, py::args args) { py::gil_scoped_release release; *self = DoubleArrayTopic(); - }) \ No newline at end of file + }) diff --git a/subprojects/pyntcore/gen/DoubleTopic.yml b/subprojects/pyntcore/semiwrap/DoubleTopic.yml similarity index 94% rename from subprojects/pyntcore/gen/DoubleTopic.yml rename to subprojects/pyntcore/semiwrap/DoubleTopic.yml index d0332b408..f800f9382 100644 --- a/subprojects/pyntcore/gen/DoubleTopic.yml +++ b/subprojects/pyntcore/semiwrap/DoubleTopic.yml @@ -1,11 +1,10 @@ ---- classes: - DoubleSubscriber: + nt::DoubleSubscriber: methods: DoubleSubscriber: overloads: - "": + '': ignore: true NT_Subscriber, ParamType: ignore: true @@ -31,11 +30,11 @@ classes: py::gil_scoped_release release; *self = DoubleSubscriber(); }) - DoublePublisher: + nt::DoublePublisher: methods: DoublePublisher: overloads: - "": + '': ignore: true NT_Publisher: ignore: true @@ -54,11 +53,11 @@ classes: py::gil_scoped_release release; *self = DoublePublisher(); }) - DoubleEntry: + nt::DoubleEntry: methods: DoubleEntry: overloads: - "": + '': ignore: true NT_Entry, ParamType: ignore: true @@ -78,13 +77,13 @@ classes: py::gil_scoped_release release; *self = DoubleEntry(); }) - DoubleTopic: + nt::DoubleTopic: attributes: kTypeString: methods: DoubleTopic: overloads: - "": + '': ignore: true NT_Topic: ignore: true diff --git a/subprojects/pyntcore/gen/FloatArrayTopic.yml b/subprojects/pyntcore/semiwrap/FloatArrayTopic.yml similarity index 95% rename from subprojects/pyntcore/gen/FloatArrayTopic.yml rename to subprojects/pyntcore/semiwrap/FloatArrayTopic.yml index 724c2750e..81d987363 100644 --- a/subprojects/pyntcore/gen/FloatArrayTopic.yml +++ b/subprojects/pyntcore/semiwrap/FloatArrayTopic.yml @@ -1,11 +1,10 @@ ---- classes: - FloatArraySubscriber: + nt::FloatArraySubscriber: methods: FloatArraySubscriber: overloads: - "": + '': ignore: true NT_Subscriber, ParamType: ignore: true @@ -39,11 +38,11 @@ classes: py::gil_scoped_release release; *self = FloatArraySubscriber(); }) - FloatArrayPublisher: + nt::FloatArrayPublisher: methods: FloatArrayPublisher: overloads: - "": + '': ignore: true NT_Publisher: ignore: true @@ -62,11 +61,11 @@ classes: py::gil_scoped_release release; *self = FloatArrayPublisher(); }) - FloatArrayEntry: + nt::FloatArrayEntry: methods: FloatArrayEntry: overloads: - "": + '': ignore: true NT_Entry, ParamType: ignore: true @@ -86,13 +85,13 @@ classes: py::gil_scoped_release release; *self = FloatArrayEntry(); }) - FloatArrayTopic: + nt::FloatArrayTopic: attributes: kTypeString: methods: FloatArrayTopic: overloads: - "": + '': ignore: true NT_Topic: ignore: true diff --git a/subprojects/pyntcore/gen/FloatTopic.yml b/subprojects/pyntcore/semiwrap/FloatTopic.yml similarity index 95% rename from subprojects/pyntcore/gen/FloatTopic.yml rename to subprojects/pyntcore/semiwrap/FloatTopic.yml index c6c59fc52..664abc377 100644 --- a/subprojects/pyntcore/gen/FloatTopic.yml +++ b/subprojects/pyntcore/semiwrap/FloatTopic.yml @@ -1,11 +1,10 @@ ---- classes: - FloatSubscriber: + nt::FloatSubscriber: methods: FloatSubscriber: overloads: - "": + '': ignore: true NT_Subscriber, ParamType: ignore: true @@ -31,11 +30,11 @@ classes: py::gil_scoped_release release; *self = FloatSubscriber(); }) - FloatPublisher: + nt::FloatPublisher: methods: FloatPublisher: overloads: - "": + '': ignore: true NT_Publisher: ignore: true @@ -54,11 +53,11 @@ classes: py::gil_scoped_release release; *self = FloatPublisher(); }) - FloatEntry: + nt::FloatEntry: methods: FloatEntry: overloads: - "": + '': ignore: true NT_Entry, ParamType: ignore: true @@ -78,13 +77,13 @@ classes: py::gil_scoped_release release; *self = FloatEntry(); }) - FloatTopic: + nt::FloatTopic: attributes: kTypeString: methods: FloatTopic: overloads: - "": + '': ignore: true NT_Topic: ignore: true diff --git a/subprojects/pyntcore/gen/GenericEntry.yml b/subprojects/pyntcore/semiwrap/GenericEntry.yml similarity index 94% rename from subprojects/pyntcore/gen/GenericEntry.yml rename to subprojects/pyntcore/semiwrap/GenericEntry.yml index ca2b22690..d8a2e785f 100644 --- a/subprojects/pyntcore/gen/GenericEntry.yml +++ b/subprojects/pyntcore/semiwrap/GenericEntry.yml @@ -1,14 +1,13 @@ ---- extra_includes: - src/nt_type_caster.h classes: - GenericSubscriber: + nt::GenericSubscriber: methods: GenericSubscriber: overloads: - "": + '': ignore: true NT_Subscriber: ignore: true @@ -26,11 +25,11 @@ classes: GetStringArray: ReadQueue: GetTopic: - GenericPublisher: + nt::GenericPublisher: methods: GenericPublisher: overloads: - "": + '': ignore: true NT_Publisher: ignore: true @@ -62,11 +61,11 @@ classes: SetDefaultDoubleArray: SetDefaultStringArray: GetTopic: - GenericEntry: + nt::GenericEntry: methods: GenericEntry: overloads: - "": + '': ignore: true NT_Entry: ignore: true diff --git a/subprojects/pyntcore/gen/IntegerArrayTopic.yml b/subprojects/pyntcore/semiwrap/IntegerArrayTopic.yml similarity index 94% rename from subprojects/pyntcore/gen/IntegerArrayTopic.yml rename to subprojects/pyntcore/semiwrap/IntegerArrayTopic.yml index bc0d7d2c4..6c441386d 100644 --- a/subprojects/pyntcore/gen/IntegerArrayTopic.yml +++ b/subprojects/pyntcore/semiwrap/IntegerArrayTopic.yml @@ -1,11 +1,10 @@ ---- classes: - IntegerArraySubscriber: + nt::IntegerArraySubscriber: methods: IntegerArraySubscriber: overloads: - "": + '': ignore: true NT_Subscriber, ParamType: ignore: true @@ -39,11 +38,11 @@ classes: py::gil_scoped_release release; *self = IntegerArraySubscriber(); }) - IntegerArrayPublisher: + nt::IntegerArrayPublisher: methods: IntegerArrayPublisher: overloads: - "": + '': ignore: true NT_Publisher: ignore: true @@ -62,11 +61,11 @@ classes: py::gil_scoped_release release; *self = IntegerArrayPublisher(); }) - IntegerArrayEntry: + nt::IntegerArrayEntry: methods: IntegerArrayEntry: overloads: - "": + '': ignore: true NT_Entry, ParamType: ignore: true @@ -86,13 +85,13 @@ classes: py::gil_scoped_release release; *self = IntegerArrayEntry(); }) - IntegerArrayTopic: + nt::IntegerArrayTopic: attributes: kTypeString: methods: IntegerArrayTopic: overloads: - "": + '': ignore: true NT_Topic: ignore: true diff --git a/subprojects/pyntcore/gen/IntegerTopic.yml b/subprojects/pyntcore/semiwrap/IntegerTopic.yml similarity index 94% rename from subprojects/pyntcore/gen/IntegerTopic.yml rename to subprojects/pyntcore/semiwrap/IntegerTopic.yml index 61686441f..423e4e90d 100644 --- a/subprojects/pyntcore/gen/IntegerTopic.yml +++ b/subprojects/pyntcore/semiwrap/IntegerTopic.yml @@ -1,11 +1,10 @@ ---- classes: - IntegerSubscriber: + nt::IntegerSubscriber: methods: IntegerSubscriber: overloads: - "": + '': ignore: true NT_Subscriber, ParamType: ignore: true @@ -31,11 +30,11 @@ classes: py::gil_scoped_release release; *self = IntegerSubscriber(); }) - IntegerPublisher: + nt::IntegerPublisher: methods: IntegerPublisher: overloads: - "": + '': ignore: true NT_Publisher: ignore: true @@ -54,11 +53,11 @@ classes: py::gil_scoped_release release; *self = IntegerPublisher(); }) - IntegerEntry: + nt::IntegerEntry: methods: IntegerEntry: overloads: - "": + '': ignore: true NT_Entry, ParamType: ignore: true @@ -78,13 +77,13 @@ classes: py::gil_scoped_release release; *self = IntegerEntry(); }) - IntegerTopic: + nt::IntegerTopic: attributes: kTypeString: methods: IntegerTopic: overloads: - "": + '': ignore: true NT_Topic: ignore: true diff --git a/subprojects/pyntcore/gen/MultiSubscriber.yml b/subprojects/pyntcore/semiwrap/MultiSubscriber.yml similarity index 94% rename from subprojects/pyntcore/gen/MultiSubscriber.yml rename to subprojects/pyntcore/semiwrap/MultiSubscriber.yml index dfe0f82bd..e2c8a9fb0 100644 --- a/subprojects/pyntcore/gen/MultiSubscriber.yml +++ b/subprojects/pyntcore/semiwrap/MultiSubscriber.yml @@ -1,11 +1,10 @@ ---- classes: - MultiSubscriber: + nt::MultiSubscriber: methods: MultiSubscriber: overloads: - "": + '': ignore: true NetworkTableInstance, std::span, const PubSubOptions&: GetHandle: diff --git a/subprojects/pyntcore/gen/NTSendable.yml b/subprojects/pyntcore/semiwrap/NTSendable.yml similarity index 90% rename from subprojects/pyntcore/gen/NTSendable.yml rename to subprojects/pyntcore/semiwrap/NTSendable.yml index 3e59f7128..b105e6fa1 100644 --- a/subprojects/pyntcore/gen/NTSendable.yml +++ b/subprojects/pyntcore/semiwrap/NTSendable.yml @@ -1,9 +1,8 @@ ---- extra_includes: - - networktables/NTSendableBuilder.h +- networktables/NTSendableBuilder.h classes: - NTSendable: + nt::NTSendable: methods: InitSendable: overloads: diff --git a/subprojects/pyntcore/gen/NTSendableBuilder.yml b/subprojects/pyntcore/semiwrap/NTSendableBuilder.yml similarity index 93% rename from subprojects/pyntcore/gen/NTSendableBuilder.yml rename to subprojects/pyntcore/semiwrap/NTSendableBuilder.yml index 63e00fea0..9682b6f93 100644 --- a/subprojects/pyntcore/gen/NTSendableBuilder.yml +++ b/subprojects/pyntcore/semiwrap/NTSendableBuilder.yml @@ -1,7 +1,6 @@ ---- classes: - NTSendableBuilder: + nt::NTSendableBuilder: force_type_casters: - std::function typealias: diff --git a/subprojects/pyntcore/gen/NetworkTable.yml b/subprojects/pyntcore/semiwrap/NetworkTable.yml similarity index 99% rename from subprojects/pyntcore/gen/NetworkTable.yml rename to subprojects/pyntcore/semiwrap/NetworkTable.yml index 907b003d8..7cb42285d 100644 --- a/subprojects/pyntcore/gen/NetworkTable.yml +++ b/subprojects/pyntcore/semiwrap/NetworkTable.yml @@ -1,4 +1,3 @@ ---- extra_includes: - networktables/BooleanArrayTopic.h @@ -21,7 +20,7 @@ extra_includes: - wpystruct.h classes: - NetworkTable: + nt::NetworkTable: attributes: PATH_SEPARATOR_CHAR: methods: diff --git a/subprojects/pyntcore/gen/NetworkTableEntry.yml b/subprojects/pyntcore/semiwrap/NetworkTableEntry.yml similarity index 98% rename from subprojects/pyntcore/gen/NetworkTableEntry.yml rename to subprojects/pyntcore/semiwrap/NetworkTableEntry.yml index e1f340311..3d2d1b5d2 100644 --- a/subprojects/pyntcore/gen/NetworkTableEntry.yml +++ b/subprojects/pyntcore/semiwrap/NetworkTableEntry.yml @@ -1,4 +1,3 @@ ---- extra_includes: - networktables/NetworkTableInstance.h - networktables/Topic.h @@ -8,14 +7,14 @@ extra_includes: inline_code: | #include classes: - NetworkTableEntry: + nt::NetworkTableEntry: enums: Flags: arithmetic: true methods: NetworkTableEntry: overloads: - "": + '': ignore: true NT_Entry: ignore: true diff --git a/subprojects/pyntcore/gen/NetworkTableInstance.yml b/subprojects/pyntcore/semiwrap/NetworkTableInstance.yml similarity index 98% rename from subprojects/pyntcore/gen/NetworkTableInstance.yml rename to subprojects/pyntcore/semiwrap/NetworkTableInstance.yml index cc875e728..cc3d29192 100644 --- a/subprojects/pyntcore/gen/NetworkTableInstance.yml +++ b/subprojects/pyntcore/semiwrap/NetworkTableInstance.yml @@ -1,4 +1,3 @@ ---- extra_includes: - networktables/BooleanArrayTopic.h @@ -22,7 +21,7 @@ extra_includes: - wpystruct.h classes: - NetworkTableInstance: + nt::NetworkTableInstance: force_type_casters: - std::function attributes: @@ -37,7 +36,7 @@ classes: methods: NetworkTableInstance: overloads: - "": + '': ignore: true NT_Inst: ignore: true @@ -86,13 +85,13 @@ classes: } GetTopics: overloads: - "": + '': std::string_view: std::string_view, unsigned int: std::string_view, std::span: GetTopicInfo: overloads: - "": + '': std::string_view: std::string_view, unsigned int: std::string_view, std::span: diff --git a/subprojects/pyntcore/gen/NetworkTableListener.yml b/subprojects/pyntcore/semiwrap/NetworkTableListener.yml similarity index 95% rename from subprojects/pyntcore/gen/NetworkTableListener.yml rename to subprojects/pyntcore/semiwrap/NetworkTableListener.yml index 7acb91417..8f9c91716 100644 --- a/subprojects/pyntcore/gen/NetworkTableListener.yml +++ b/subprojects/pyntcore/semiwrap/NetworkTableListener.yml @@ -1,13 +1,12 @@ ---- classes: - NetworkTableListener: + nt::NetworkTableListener: force_type_casters: - std::function methods: NetworkTableListener: overloads: - "": + '': CreateListener: overloads: NetworkTableInstance, std::span, unsigned int, ListenerCallback: @@ -32,11 +31,11 @@ classes: py::gil_scoped_release release; *self = NetworkTableListener(); }) - NetworkTableListenerPoller: + nt::NetworkTableListenerPoller: methods: NetworkTableListenerPoller: overloads: - "": + '': NetworkTableInstance: GetHandle: AddListener: diff --git a/subprojects/pyntcore/gen/NetworkTableType.yml b/subprojects/pyntcore/semiwrap/NetworkTableType.yml similarity index 87% rename from subprojects/pyntcore/gen/NetworkTableType.yml rename to subprojects/pyntcore/semiwrap/NetworkTableType.yml index e00dabb38..2740cddb8 100644 --- a/subprojects/pyntcore/gen/NetworkTableType.yml +++ b/subprojects/pyntcore/semiwrap/NetworkTableType.yml @@ -1,4 +1,3 @@ ---- enums: NetworkTableType: diff --git a/subprojects/pyntcore/gen/NetworkTableValue.yml b/subprojects/pyntcore/semiwrap/NetworkTableValue.yml similarity index 90% rename from subprojects/pyntcore/gen/NetworkTableValue.yml rename to subprojects/pyntcore/semiwrap/NetworkTableValue.yml index 5d7c86b49..baf042bf2 100644 --- a/subprojects/pyntcore/gen/NetworkTableValue.yml +++ b/subprojects/pyntcore/semiwrap/NetworkTableValue.yml @@ -1,4 +1,3 @@ ---- extra_includes: - networktables/NetworkTableType.h @@ -9,11 +8,11 @@ functions: ignore: true classes: - Value: + nt::Value: methods: Value: overloads: - "": + '': ignore: true NT_Type, size_t, int64_t, const private_init&: ignore: true @@ -85,16 +84,16 @@ classes: } GetBooleanArray: cpp_code: | - [](Value *self) -> py::object { - pyntcore::ensure_value_is(NT_BOOLEAN_ARRAY, self); - auto v = self->value(); - py::list l(v.data.arr_boolean.size); - for (size_t i = 0; i < v.data.arr_boolean.size; i++) { - auto b = py::bool_(v.data.arr_boolean.arr[i]); - PyList_SET_ITEM(l.ptr(), i, b.release().ptr()); - } - return std::move(l); + [](Value *self) -> py::object { + pyntcore::ensure_value_is(NT_BOOLEAN_ARRAY, self); + auto v = self->value(); + py::list l(v.data.arr_boolean.size); + for (size_t i = 0; i < v.data.arr_boolean.size; i++) { + auto b = py::bool_(v.data.arr_boolean.arr[i]); + PyList_SET_ITEM(l.ptr(), i, b.release().ptr()); } + return std::move(l); + } GetIntegerArray: cpp_code: | [](Value *self) { @@ -173,7 +172,7 @@ classes: ignore: true std::vector&&, int64_t: operator==: - inline_code: | + inline_code: |- .def_static("makeValue", [](py::handle value) { return pyntcore::py2ntvalue(value); }, py::arg("value")) @@ -184,4 +183,4 @@ classes: auto typestr = pyntcore::nttype2str(self.type()); auto valrepr = py::repr(pyntcore::ntvalue2py(self)); return py::str("").format(typestr, valrepr); - }) \ No newline at end of file + }) diff --git a/subprojects/pyntcore/gen/RawTopic.yml b/subprojects/pyntcore/semiwrap/RawTopic.yml similarity index 95% rename from subprojects/pyntcore/gen/RawTopic.yml rename to subprojects/pyntcore/semiwrap/RawTopic.yml index fd992c208..c0cc73340 100644 --- a/subprojects/pyntcore/gen/RawTopic.yml +++ b/subprojects/pyntcore/semiwrap/RawTopic.yml @@ -1,14 +1,13 @@ ---- extra_includes: - src/nt_type_caster.h classes: - RawSubscriber: + nt::RawSubscriber: methods: RawSubscriber: overloads: - "": + '': ignore: true NT_Subscriber, ParamType: ignore: true @@ -42,11 +41,11 @@ classes: py::gil_scoped_release release; *self = RawSubscriber(); }) - RawPublisher: + nt::RawPublisher: methods: RawPublisher: overloads: - "": + '': ignore: true NT_Publisher: ignore: true @@ -65,11 +64,11 @@ classes: py::gil_scoped_release release; *self = RawPublisher(); }) - RawEntry: + nt::RawEntry: methods: RawEntry: overloads: - "": + '': ignore: true NT_Entry, ParamType: ignore: true @@ -89,11 +88,11 @@ classes: py::gil_scoped_release release; *self = RawEntry(); }) - RawTopic: + nt::RawTopic: methods: RawTopic: overloads: - "": + '': ignore: true NT_Topic: ignore: true diff --git a/subprojects/pyntcore/gen/StringArrayTopic.yml b/subprojects/pyntcore/semiwrap/StringArrayTopic.yml similarity index 94% rename from subprojects/pyntcore/gen/StringArrayTopic.yml rename to subprojects/pyntcore/semiwrap/StringArrayTopic.yml index bbf6cc36d..0f6c7c379 100644 --- a/subprojects/pyntcore/gen/StringArrayTopic.yml +++ b/subprojects/pyntcore/semiwrap/StringArrayTopic.yml @@ -1,11 +1,10 @@ ---- classes: - StringArraySubscriber: + nt::StringArraySubscriber: methods: StringArraySubscriber: overloads: - "": + '': ignore: true NT_Subscriber, ParamType: ignore: true @@ -31,11 +30,11 @@ classes: py::gil_scoped_release release; *self = StringArraySubscriber(); }) - StringArrayPublisher: + nt::StringArrayPublisher: methods: StringArrayPublisher: overloads: - "": + '': ignore: true NT_Publisher: ignore: true @@ -54,11 +53,11 @@ classes: py::gil_scoped_release release; *self = StringArrayPublisher(); }) - StringArrayEntry: + nt::StringArrayEntry: methods: StringArrayEntry: overloads: - "": + '': ignore: true NT_Entry, ParamType: ignore: true @@ -78,13 +77,13 @@ classes: py::gil_scoped_release release; *self = StringArrayEntry(); }) - StringArrayTopic: + nt::StringArrayTopic: attributes: kTypeString: methods: StringArrayTopic: overloads: - "": + '': ignore: true NT_Topic: ignore: true diff --git a/subprojects/pyntcore/gen/StringTopic.yml b/subprojects/pyntcore/semiwrap/StringTopic.yml similarity index 95% rename from subprojects/pyntcore/gen/StringTopic.yml rename to subprojects/pyntcore/semiwrap/StringTopic.yml index 05afa8c9b..a61c7868c 100644 --- a/subprojects/pyntcore/gen/StringTopic.yml +++ b/subprojects/pyntcore/semiwrap/StringTopic.yml @@ -1,11 +1,10 @@ ---- classes: - StringSubscriber: + nt::StringSubscriber: methods: StringSubscriber: overloads: - "": + '': ignore: true NT_Subscriber, ParamType: ignore: true @@ -39,11 +38,11 @@ classes: py::gil_scoped_release release; *self = StringSubscriber(); }) - StringPublisher: + nt::StringPublisher: methods: StringPublisher: overloads: - "": + '': ignore: true NT_Publisher: ignore: true @@ -62,11 +61,11 @@ classes: py::gil_scoped_release release; *self = StringPublisher(); }) - StringEntry: + nt::StringEntry: methods: StringEntry: overloads: - "": + '': ignore: true NT_Entry, ParamType: ignore: true @@ -86,13 +85,13 @@ classes: py::gil_scoped_release release; *self = StringEntry(); }) - StringTopic: + nt::StringTopic: attributes: kTypeString: methods: StringTopic: overloads: - "": + '': ignore: true NT_Topic: ignore: true diff --git a/subprojects/pyntcore/gen/StructArrayTopic.yml b/subprojects/pyntcore/semiwrap/StructArrayTopic.yml similarity index 96% rename from subprojects/pyntcore/gen/StructArrayTopic.yml rename to subprojects/pyntcore/semiwrap/StructArrayTopic.yml index aa852b4fa..b6dd1f199 100644 --- a/subprojects/pyntcore/gen/StructArrayTopic.yml +++ b/subprojects/pyntcore/semiwrap/StructArrayTopic.yml @@ -1,14 +1,13 @@ ---- classes: - StructArraySubscriber: + nt::StructArraySubscriber: template_params: - T - I methods: StructArraySubscriber: overloads: - "": + '': ignore: true NT_Subscriber, U&&, I...: ignore: true @@ -38,14 +37,14 @@ classes: py::gil_scoped_release release; *self = nt::StructArraySubscriber(); }) - StructArrayPublisher: + nt::StructArrayPublisher: template_params: - T - I methods: StructArrayPublisher: overloads: - "": + '': ignore: true NT_Publisher, I...: ignore: true @@ -72,7 +71,7 @@ classes: py::gil_scoped_release release; *self = nt::StructArrayPublisher(); }) - StructArrayEntry: + nt::StructArrayEntry: template_params: - T - I @@ -82,7 +81,7 @@ classes: methods: StructArrayEntry: overloads: - "": + '': ignore: true NT_Entry, U&&, const I&...: ignore: true @@ -102,14 +101,14 @@ classes: py::gil_scoped_release release; *self = nt::StructArrayEntry(); }) - StructArrayTopic: + nt::StructArrayTopic: template_params: - T - I methods: StructArrayTopic: overloads: - "": + '': ignore: true NT_Topic, I...: ignore: true @@ -166,4 +165,4 @@ templates: qualname: nt::StructArrayTopic params: - WPyStruct - - WPyStructInfo \ No newline at end of file + - WPyStructInfo diff --git a/subprojects/pyntcore/gen/StructTopic.yml b/subprojects/pyntcore/semiwrap/StructTopic.yml similarity index 96% rename from subprojects/pyntcore/gen/StructTopic.yml rename to subprojects/pyntcore/semiwrap/StructTopic.yml index 230a9de8e..0bc7fce80 100644 --- a/subprojects/pyntcore/gen/StructTopic.yml +++ b/subprojects/pyntcore/semiwrap/StructTopic.yml @@ -1,14 +1,13 @@ ---- classes: - StructSubscriber: + nt::StructSubscriber: template_params: - T - I methods: StructSubscriber: overloads: - "": + '': ignore: true NT_Subscriber, T, I...: ignore: true @@ -36,14 +35,14 @@ classes: py::gil_scoped_release release; *self = nt::StructSubscriber(); }) - StructPublisher: + nt::StructPublisher: template_params: - T - I methods: StructPublisher: overloads: - "": + '': ignore: true NT_Publisher, I...: ignore: true @@ -62,7 +61,7 @@ classes: py::gil_scoped_release release; *self = nt::StructPublisher(); }) - StructEntry: + nt::StructEntry: template_params: - T - I @@ -72,7 +71,7 @@ classes: methods: StructEntry: overloads: - "": + '': ignore: true NT_Entry, T, const I&...: ignore: true @@ -92,14 +91,14 @@ classes: py::gil_scoped_release release; *self = nt::StructEntry(); }) - StructTopic: + nt::StructTopic: template_params: - T - I methods: StructTopic: overloads: - "": + '': ignore: true NT_Topic, I...: ignore: true diff --git a/subprojects/pyntcore/gen/Topic.yml b/subprojects/pyntcore/semiwrap/Topic.yml similarity index 96% rename from subprojects/pyntcore/gen/Topic.yml rename to subprojects/pyntcore/semiwrap/Topic.yml index 71216356b..dd363ab0a 100644 --- a/subprojects/pyntcore/gen/Topic.yml +++ b/subprojects/pyntcore/semiwrap/Topic.yml @@ -1,15 +1,14 @@ ---- extra_includes: - networktables/GenericEntry.h - networktables/NetworkTableInstance.h classes: - Topic: + nt::Topic: methods: Topic: overloads: - "": + '': ignore: true NT_Topic: ignore: true @@ -50,7 +49,7 @@ classes: std::string name = self.cast().GetName(); return py::str("<{} {!r}>").format(type_name, name); }) - Subscriber: + nt::Subscriber: attributes: m_subHandle: methods: @@ -61,7 +60,7 @@ classes: GetTopic: Subscriber: overloads: - "": + '': ignore: true NT_Subscriber: ignore: true @@ -71,7 +70,7 @@ classes: auto topic = self.cast().GetTopic(); return py::str("<{} {!r}>").format(type_name, topic.GetName()); }) - Publisher: + nt::Publisher: attributes: m_pubHandle: methods: @@ -80,7 +79,7 @@ classes: GetTopic: Publisher: overloads: - "": + '': ignore: true NT_Publisher: ignore: true diff --git a/subprojects/pyntcore/gen/TopicListener.yml b/subprojects/pyntcore/semiwrap/TopicListener.yml similarity index 92% rename from subprojects/pyntcore/gen/TopicListener.yml rename to subprojects/pyntcore/semiwrap/TopicListener.yml index 7ddcae335..ceae48fa8 100644 --- a/subprojects/pyntcore/gen/TopicListener.yml +++ b/subprojects/pyntcore/semiwrap/TopicListener.yml @@ -1,17 +1,16 @@ ---- classes: - TopicListenerFlags: + nt::TopicListenerFlags: attributes: kImmediate: kPublish: kUnpublish: kProperties: - TopicListener: + nt::TopicListener: methods: TopicListener: overloads: - "": + '': ignore: true ? nt::NetworkTableInstance, std::span, unsigned int, std::function @@ -21,11 +20,11 @@ classes: nt::MultiSubscriber&, unsigned int, std::function: nt::NetworkTableEntry&, unsigned int, std::function: GetHandle: - TopicListenerPoller: + nt::TopicListenerPoller: methods: TopicListenerPoller: overloads: - "": + '': ignore: true nt::NetworkTableInstance: GetHandle: diff --git a/subprojects/pyntcore/gen/ValueListener.yml b/subprojects/pyntcore/semiwrap/ValueListener.yml similarity index 94% rename from subprojects/pyntcore/gen/ValueListener.yml rename to subprojects/pyntcore/semiwrap/ValueListener.yml index b29e03746..ce085cf47 100644 --- a/subprojects/pyntcore/gen/ValueListener.yml +++ b/subprojects/pyntcore/semiwrap/ValueListener.yml @@ -1,15 +1,14 @@ ---- classes: - ValueListenerFlags: + nt::ValueListenerFlags: attributes: kImmediate: kLocal: - ValueListener: + nt::ValueListener: methods: ValueListener: overloads: - "": + '': ignore: true nt::Subscriber&, unsigned int, std::function: nt::MultiSubscriber&, unsigned int, std::function: @@ -29,11 +28,11 @@ classes: py::gil_scoped_release release; *self = ValueListener(); }) - ValueListenerPoller: + nt::ValueListenerPoller: methods: ValueListenerPoller: overloads: - "": + '': ignore: true nt::NetworkTableInstance: GetHandle: diff --git a/subprojects/pyntcore/gen/ntcore_cpp.yml b/subprojects/pyntcore/semiwrap/ntcore_cpp.yml similarity index 95% rename from subprojects/pyntcore/gen/ntcore_cpp.yml rename to subprojects/pyntcore/semiwrap/ntcore_cpp.yml index fe41a82b2..a0736ef53 100644 --- a/subprojects/pyntcore/gen/ntcore_cpp.yml +++ b/subprojects/pyntcore/semiwrap/ntcore_cpp.yml @@ -1,4 +1,3 @@ ---- defaults: ignore: true @@ -32,7 +31,7 @@ functions: DecodeClients: subpackage: meta classes: - EventFlags: + nt::EventFlags: attributes: kNone: kImmediate: @@ -48,7 +47,7 @@ classes: kValueAll: kLogMessage: kTimeSync: - TopicInfo: + nt::TopicInfo: attributes: name: type_str: @@ -72,7 +71,7 @@ classes: return py::str("") .format(self.name, self.type_str); }) - ConnectionInfo: + nt::ConnectionInfo: attributes: remote_id: remote_ip: @@ -88,7 +87,7 @@ classes: .format(self.remote_id, self.remote_ip, self.remote_port, self.last_update, self.protocol_version); }) - ValueEventData: + nt::ValueEventData: attributes: topic: ignore: true @@ -98,7 +97,7 @@ classes: methods: ValueEventData: overloads: - "": + '': ignore: true NT_Topic, NT_Handle, Value: ignore: true @@ -111,7 +110,7 @@ classes: return py::str("") .format(topicInfo.name, topicInfo.type_str, self.value); }) - LogMessage: + nt::LogMessage: attributes: level: filename: @@ -120,11 +119,11 @@ classes: methods: LogMessage: overloads: - "": + '': ignore: true unsigned int, std::string_view, unsigned int, std::string_view: ignore: true - TimeSyncEventData: + nt::TimeSyncEventData: attributes: serverTimeOffset: rtt2: @@ -132,10 +131,10 @@ classes: methods: TimeSyncEventData: overloads: - "": + '': ignore: true int64_t, int64_t, bool: - Event: + nt::Event: attributes: listener: flags: @@ -144,7 +143,7 @@ classes: methods: Event: overloads: - "": + '': ignore: true NT_Listener, unsigned int, ConnectionInfo: ignore: true @@ -166,31 +165,31 @@ classes: overloads: '[const]': ignore: true - "": + '': ignore: true GetTopicInfo: overloads: '[const]': ignore: true - "": + '': ignore: true GetValueEventData: overloads: '[const]': ignore: true - "": + '': ignore: true GetLogMessage: overloads: '[const]': ignore: true - "": + '': ignore: true GetTimeSyncEventData: overloads: '[const]': ignore: true - "": + '': ignore: true inline_code: | .def_property_readonly("data", [](nt::Event *self){ @@ -200,7 +199,7 @@ classes: return py::str("") .format(self.listener, self.flags, self.data); }) - PubSubOptions: + nt::PubSubOptions: force_no_default_constructor: true attributes: kDefaultPeriodic: @@ -289,36 +288,36 @@ classes: will not appear in metatopics. )" ) - SubscriberOptions: + nt::meta::SubscriberOptions: subpackage: meta attributes: periodic: topicsOnly: sendAll: prefixMatch: - TopicPublisher: + nt::meta::TopicPublisher: subpackage: meta attributes: client: pubuid: - TopicSubscriber: + nt::meta::TopicSubscriber: subpackage: meta attributes: client: subuid: options: - ClientPublisher: + nt::meta::ClientPublisher: subpackage: meta attributes: uid: topic: - ClientSubscriber: + nt::meta::ClientSubscriber: subpackage: meta attributes: uid: topics: options: - Client: + nt::meta::Client: subpackage: meta attributes: id: diff --git a/subprojects/pyntcore/gen/ntcore_cpp_types.yml b/subprojects/pyntcore/semiwrap/ntcore_cpp_types.yml similarity index 96% rename from subprojects/pyntcore/gen/ntcore_cpp_types.yml rename to subprojects/pyntcore/semiwrap/ntcore_cpp_types.yml index aa0e866de..be420eacc 100644 --- a/subprojects/pyntcore/gen/ntcore_cpp_types.yml +++ b/subprojects/pyntcore/semiwrap/ntcore_cpp_types.yml @@ -1,4 +1,3 @@ ---- extra_includes: - src/nt_type_caster.h @@ -8,7 +7,7 @@ defaults: report_ignored_missing: false classes: - Timestamped: + nt::Timestamped: template_params: - T attributes: @@ -18,7 +17,7 @@ classes: methods: Timestamped: overloads: - "": + '': int64_t, int64_t, T: inline_code: | ; @@ -81,4 +80,4 @@ templates: TimestampedStructArray: qualname: nt::Timestamped params: - - std::vector \ No newline at end of file + - std::vector diff --git a/subprojects/pyntcore/setup.py b/subprojects/pyntcore/setup.py deleted file mode 100755 index 3542d0c9a..000000000 --- a/subprojects/pyntcore/setup.py +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env python3 - -from robotpy_build.setup import setup - -setup() From 23eb5dcea956670ea9415136845d659fe3157f12 Mon Sep 17 00:00:00 2001 From: Dustin Spicuzza Date: Wed, 9 Apr 2025 23:23:42 -0400 Subject: [PATCH 07/20] Update robotpy-hal to semiwrap --- subprojects/robotpy-hal/.gitignore | 14 ++- subprojects/robotpy-hal/hal/__init__.py | 4 +- subprojects/robotpy-hal/hal/_initialize.py | 2 +- subprojects/robotpy-hal/hal/py.typed | 0 .../robotpy-hal/hal/simulation/__init__.py | 4 +- .../robotpy-hal/hal/simulation/main.cpp | 4 +- subprojects/robotpy-hal/hal/src/hal.cpp | 4 +- subprojects/robotpy-hal/meson.build | 16 ++++ subprojects/robotpy-hal/pyproject.toml | 93 ++++++++++--------- subprojects/robotpy-hal/semiwrap/.gitignore | 3 + .../{gen => semiwrap}/Accelerometer.yml | 0 .../{gen => semiwrap}/AddressableLED.yml | 0 .../{gen => semiwrap}/AddressableLEDTypes.yml | 1 - .../{gen => semiwrap}/AnalogAccumulator.yml | 0 .../{gen => semiwrap}/AnalogGyro.yml | 0 .../{gen => semiwrap}/AnalogInput.yml | 0 .../{gen => semiwrap}/AnalogOutput.yml | 0 .../{gen => semiwrap}/AnalogTrigger.yml | 0 .../robotpy-hal/{gen => semiwrap}/CAN.yml | 1 - .../robotpy-hal/{gen => semiwrap}/CANAPI.yml | 0 .../{gen => semiwrap}/CANAPITypes.yml | 0 .../robotpy-hal/{gen => semiwrap}/CTREPCM.yml | 0 .../{gen => semiwrap}/Constants.yml | 0 .../robotpy-hal/{gen => semiwrap}/Counter.yml | 0 .../robotpy-hal/{gen => semiwrap}/DIO.yml | 0 .../{gen => semiwrap}/DriverStation.yml | 0 .../{gen => semiwrap}/DriverStationTypes.yml | 7 -- .../{gen => semiwrap}/DutyCycle.yml | 0 .../robotpy-hal/{gen => semiwrap}/Encoder.yml | 0 .../{gen => semiwrap}/Extensions.yml | 0 .../{gen => semiwrap}/FRCUsageReporting.yml | 0 .../robotpy-hal/{gen => semiwrap}/HALBase.yml | 0 .../{gen => semiwrap}/HandlesInternal.yml | 2 +- .../robotpy-hal/{gen => semiwrap}/I2C.yml | 0 .../{gen => semiwrap}/I2CTypes.yml | 0 .../{gen => semiwrap}/Interrupts.yml | 0 .../robotpy-hal/{gen => semiwrap}/LEDs.yml | 0 .../robotpy-hal/{gen => semiwrap}/Main.yml | 0 .../{gen => semiwrap}/Notifier.yml | 0 .../robotpy-hal/{gen => semiwrap}/PWM.yml | 0 .../robotpy-hal/{gen => semiwrap}/Ports.yml | 0 .../robotpy-hal/{gen => semiwrap}/Power.yml | 0 .../{gen => semiwrap}/PowerDistribution.yml | 3 - .../robotpy-hal/{gen => semiwrap}/REVPH.yml | 4 - .../robotpy-hal/{gen => semiwrap}/Relay.yml | 0 .../robotpy-hal/{gen => semiwrap}/SPI.yml | 0 .../{gen => semiwrap}/SPITypes.yml | 0 .../{gen => semiwrap}/SerialHelper.yml | 2 +- .../{gen => semiwrap}/SerialPort.yml | 0 .../{gen => semiwrap}/SimDevice.yml | 59 +++++------- .../robotpy-hal/{gen => semiwrap}/Threads.yml | 0 .../simulation/AccelerometerData.yml | 0 .../simulation/AddressableLEDData.yml | 0 .../simulation/AnalogGyroData.yml | 0 .../simulation/AnalogInData.yml | 0 .../simulation/AnalogOutData.yml | 0 .../simulation/AnalogTriggerData.yml | 0 .../simulation/CTREPCMData.yml | 14 +-- .../{gen => semiwrap}/simulation/CanData.yml | 0 .../{gen => semiwrap}/simulation/DIOData.yml | 0 .../simulation/DigitalPWMData.yml | 0 .../simulation/DriverStationData.yml | 1 - .../simulation/DutyCycleData.yml | 0 .../simulation/EncoderData.yml | 0 .../{gen => semiwrap}/simulation/I2CData.yml | 0 .../simulation/MockHooks.yml | 0 .../simulation/NotifierData.yml | 1 - .../simulation/NotifyListener.yml | 1 - .../{gen => semiwrap}/simulation/PWMData.yml | 0 .../simulation/PowerDistributionData.yml | 0 .../simulation/REVPHData.yml | 0 .../simulation/RelayData.yml | 0 .../{gen => semiwrap}/simulation/Reset.yml | 0 .../simulation/RoboRioData.yml | 0 .../simulation/SPIAccelerometerData.yml | 0 .../{gen => semiwrap}/simulation/SPIData.yml | 0 .../simulation/SimCallbackRegistry.yml | 2 - .../simulation/SimDataValue.yml | 2 - .../simulation/SimDeviceData.yml | 6 -- subprojects/robotpy-hal/setup.py | 5 - 80 files changed, 115 insertions(+), 140 deletions(-) create mode 100644 subprojects/robotpy-hal/hal/py.typed create mode 100644 subprojects/robotpy-hal/meson.build create mode 100644 subprojects/robotpy-hal/semiwrap/.gitignore rename subprojects/robotpy-hal/{gen => semiwrap}/Accelerometer.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/AddressableLED.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/AddressableLEDTypes.yml (87%) rename subprojects/robotpy-hal/{gen => semiwrap}/AnalogAccumulator.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/AnalogGyro.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/AnalogInput.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/AnalogOutput.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/AnalogTrigger.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/CAN.yml (95%) rename subprojects/robotpy-hal/{gen => semiwrap}/CANAPI.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/CANAPITypes.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/CTREPCM.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/Constants.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/Counter.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/DIO.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/DriverStation.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/DriverStationTypes.yml (85%) rename subprojects/robotpy-hal/{gen => semiwrap}/DutyCycle.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/Encoder.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/Extensions.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/FRCUsageReporting.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/HALBase.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/HandlesInternal.yml (94%) rename subprojects/robotpy-hal/{gen => semiwrap}/I2C.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/I2CTypes.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/Interrupts.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/LEDs.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/Main.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/Notifier.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/PWM.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/Ports.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/Power.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/PowerDistribution.yml (97%) rename subprojects/robotpy-hal/{gen => semiwrap}/REVPH.yml (95%) rename subprojects/robotpy-hal/{gen => semiwrap}/Relay.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/SPI.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/SPITypes.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/SerialHelper.yml (88%) rename subprojects/robotpy-hal/{gen => semiwrap}/SerialPort.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/SimDevice.yml (96%) rename subprojects/robotpy-hal/{gen => semiwrap}/Threads.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/simulation/AccelerometerData.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/simulation/AddressableLEDData.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/simulation/AnalogGyroData.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/simulation/AnalogInData.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/simulation/AnalogOutData.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/simulation/AnalogTriggerData.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/simulation/CTREPCMData.yml (81%) rename subprojects/robotpy-hal/{gen => semiwrap}/simulation/CanData.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/simulation/DIOData.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/simulation/DigitalPWMData.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/simulation/DriverStationData.yml (99%) rename subprojects/robotpy-hal/{gen => semiwrap}/simulation/DutyCycleData.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/simulation/EncoderData.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/simulation/I2CData.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/simulation/MockHooks.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/simulation/NotifierData.yml (91%) rename subprojects/robotpy-hal/{gen => semiwrap}/simulation/NotifyListener.yml (92%) rename subprojects/robotpy-hal/{gen => semiwrap}/simulation/PWMData.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/simulation/PowerDistributionData.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/simulation/REVPHData.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/simulation/RelayData.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/simulation/Reset.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/simulation/RoboRioData.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/simulation/SPIAccelerometerData.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/simulation/SPIData.yml (100%) rename subprojects/robotpy-hal/{gen => semiwrap}/simulation/SimCallbackRegistry.yml (85%) rename subprojects/robotpy-hal/{gen => semiwrap}/simulation/SimDataValue.yml (89%) rename subprojects/robotpy-hal/{gen => semiwrap}/simulation/SimDeviceData.yml (95%) delete mode 100644 subprojects/robotpy-hal/setup.py diff --git a/subprojects/robotpy-hal/.gitignore b/subprojects/robotpy-hal/.gitignore index f3dad2bee..6d1232984 100644 --- a/subprojects/robotpy-hal/.gitignore +++ b/subprojects/robotpy-hal/.gitignore @@ -8,15 +8,13 @@ .vscode __pycache__ -/hal/include -/hal/lib -/hal/rpy-include -/hal/_init_wpiHal.py -/hal/py.typed -/hal/pkgcfg.py +/hal/trampolines +/hal/_init__wpiHal.py /hal/version.py -/hal/simulation/_init_simulation.py -/hal/simulation/pkgcfg.py +/hal/wpihal.pc +/hal/simulation/_init__simulation.py +/hal/simulation/hal_simulation.pc +/hal/simulation/trampolines /dist /build \ No newline at end of file diff --git a/subprojects/robotpy-hal/hal/__init__.py b/subprojects/robotpy-hal/hal/__init__.py index 96d193e0e..adbb2f20b 100644 --- a/subprojects/robotpy-hal/hal/__init__.py +++ b/subprojects/robotpy-hal/hal/__init__.py @@ -4,9 +4,9 @@ from . import _initialize from .exceptions import HALError -from . import _init_wpiHal +from . import _init__wpiHal from ._wpiHal import * from ._wpiHal import __hal_simulation__ -del _init_wpiHal +del _init__wpiHal diff --git a/subprojects/robotpy-hal/hal/_initialize.py b/subprojects/robotpy-hal/hal/_initialize.py index 4ac2a7ffd..e6fe6541e 100644 --- a/subprojects/robotpy-hal/hal/_initialize.py +++ b/subprojects/robotpy-hal/hal/_initialize.py @@ -1,4 +1,4 @@ -from . import exceptions, _init_wpiHal, _wpiHal +from . import exceptions, _init__wpiHal, _wpiHal # Always initialize HAL here, disable extension notice because we'll handle # that for users diff --git a/subprojects/robotpy-hal/hal/py.typed b/subprojects/robotpy-hal/hal/py.typed new file mode 100644 index 000000000..e69de29bb diff --git a/subprojects/robotpy-hal/hal/simulation/__init__.py b/subprojects/robotpy-hal/hal/simulation/__init__.py index 92a162e99..9617a1f11 100644 --- a/subprojects/robotpy-hal/hal/simulation/__init__.py +++ b/subprojects/robotpy-hal/hal/simulation/__init__.py @@ -1,4 +1,4 @@ -from . import _init_simulation +from . import _init__simulation from ._simulation import * -del _init_simulation +del _init__simulation diff --git a/subprojects/robotpy-hal/hal/simulation/main.cpp b/subprojects/robotpy-hal/hal/simulation/main.cpp index 354b75c1f..8b9c53b8a 100644 --- a/subprojects/robotpy-hal/hal/simulation/main.cpp +++ b/subprojects/robotpy-hal/hal/simulation/main.cpp @@ -1,5 +1,5 @@ -#include +#include #include #include "sim_cb.h" @@ -7,7 +7,7 @@ void HALSIM_ResetGlobalHandles(); -RPYBUILD_PYBIND11_MODULE(m) { +SEMIWRAP_PYBIND11_MODULE(m) { py::class_ cls_SimCB(m, "SimCB"); cls_SimCB.doc() = "Simulation callback handle"; diff --git a/subprojects/robotpy-hal/hal/src/hal.cpp b/subprojects/robotpy-hal/hal/src/hal.cpp index 9df839130..147da5601 100644 --- a/subprojects/robotpy-hal/hal/src/hal.cpp +++ b/subprojects/robotpy-hal/hal/src/hal.cpp @@ -3,13 +3,13 @@ #include #include #include -#include +#include using namespace pybind11::literals; static py::module_ sys_module; -RPYBUILD_PYBIND11_MODULE(m) { +SEMIWRAP_PYBIND11_MODULE(m) { // Add this manually so it can be used from SimValue py::enum_(m, "Type") diff --git a/subprojects/robotpy-hal/meson.build b/subprojects/robotpy-hal/meson.build new file mode 100644 index 000000000..b2f44841b --- /dev/null +++ b/subprojects/robotpy-hal/meson.build @@ -0,0 +1,16 @@ +project('robotpy-hal', ['cpp'], + default_options: ['warning_level=1', 'cpp_std=c++20', + 'b_colorout=auto', 'optimization=2', 'b_pie=true']) + +subdir('semiwrap') + +wpihal_sources += files( + 'hal/src/hal.cpp', +) + +hal_simulation_sources += files( + 'hal/simulation/main.cpp', + 'hal/simulation/resethandles.cpp', +) + +subdir('semiwrap/modules') diff --git a/subprojects/robotpy-hal/pyproject.toml b/subprojects/robotpy-hal/pyproject.toml index 2f06a22b3..bf6ea391c 100644 --- a/subprojects/robotpy-hal/pyproject.toml +++ b/subprojects/robotpy-hal/pyproject.toml @@ -1,27 +1,49 @@ -[tool.robotpy-build.metadata] +[build-system] +build-backend = "hatchling.build" +requires = [ + "semiwrap~=0.1", + "hatch-meson~=0.1.0b2", + "hatchling", + "robotpy-native-wpihal==2025.3.2", + "robotpy-wpiutil==2025.3.2.2", +] + +[project] name = "robotpy-hal" +version = "2025.3.2.2" description = "Binary wrapper for FRC HAL" -author = "RobotPy Development Team" -author_email = "robotpy@googlegroups.com" -url = "https://github.com/robotpy/robotpy-hal" +authors = [ + {name = "RobotPy Development Team", email = "robotpy@googlegroups.com"}, +] license = "BSD-3-Clause" -install_requires = [ - "robotpy-wpiutil==THIS_VERSION", +dependencies = [ + "robotpy-native-wpihal==2025.3.2", + "robotpy-wpiutil==2025.3.2.2", ] -[build-system] -requires = [ - "robotpy-build~=2025.1.0", - "robotpy-wpiutil~=2025.3.2", -] +[project.urls] +"Source code" = "https://github.com/robotpy/mostrobotpy" + + +[tool.hatch.build.hooks.robotpy] +version_file = "hal/version.py" + +[tool.hatch.build.hooks.semiwrap] + +[tool.hatch.build.hooks.meson] -[tool.robotpy-build] -base_package = "hal" +[tool.hatch.build.targets.wheel] +packages = ["hal"] + + +[tool.semiwrap] +update_init = [] scan_headers_ignore = [ "hal/ChipObject.h", "hal/DMA.h", "hal/Errors.h", "hal/HAL.h", + "hal/UsageReporting.h", "hal/Types.h", "hal/Value.h", @@ -45,29 +67,17 @@ scan_headers_ignore = [ "hal/simulation/SPIData.h", "hal/simulation/SimCallbackRegistry.h", "hal/simulation/SimDataValue.h", -] - - -[tool.robotpy-build.wrappers."hal".maven_lib_download] -artifact_id = "hal-cpp" -group_id = "edu.wpi.first.hal" -# repo_url = "https://frcmaven.wpi.edu/artifactory/release" -repo_url = "https://frcmaven.wpi.edu/artifactory/release" -version = "2025.3.2" - -libs = ["wpiHal"] -[tool.robotpy-build.wrappers."hal"] - -name = "wpiHal" -sources = [ - "hal/src/hal.cpp" + "sim_cb.h", + "sim_value_cb.h", ] -generation_data = "gen" +[tool.semiwrap.extension_modules."hal._wpiHal"] +name = "wpihal" +wraps = ["robotpy-native-wpihal"] depends = ["wpiutil"] -[tool.robotpy-build.wrappers."hal".autogen_headers] +[tool.semiwrap.extension_modules."hal._wpiHal".headers] # hal Accelerometer = "hal/Accelerometer.h" AddressableLED = "hal/AddressableLED.h" @@ -116,7 +126,7 @@ Threads = "hal/Threads.h" # Value = "hal/Value.h" # hal/cpp -# SerialHelper = "hal/cpp/SerialHelper.h" +SerialHelper = { header="hal/cpp/SerialHelper.h", enable_if="platform_machine == 'roborio'" } # UnsafeDIO = "hal/cpp/UnsafeDIO.h" # fpga_clock = "hal/cpp/fpga_clock.h" @@ -133,23 +143,14 @@ HandlesInternal = "hal/handles/HandlesInternal.h" # HMB = "hal/roborio/HMB.h" # InterruptManager = "hal/roborio/InterruptManager.h" -[tool.robotpy-build.wrappers."hal".autogen_headers.override.platform_linux_athena] -SerialHelper = "hal/cpp/SerialHelper.h" - - -[tool.robotpy-build.wrappers."hal.simulation"] +[tool.semiwrap.extension_modules."hal.simulation._simulation"] name = "hal_simulation" -extension = "_simulation" -sources = [ - "hal/simulation/main.cpp", - "hal/simulation/resethandles.cpp", -] - -generation_data = "gen/simulation" -depends = ["wpiutil", "wpiHal"] +wraps = ["robotpy-native-wpihal"] +depends = ["wpiutil"] +yaml_path = "semiwrap/simulation" -[tool.robotpy-build.wrappers."hal.simulation".autogen_headers] +[tool.semiwrap.extension_modules."hal.simulation._simulation".headers] AccelerometerData = "hal/simulation/AccelerometerData.h" AddressableLEDData = "hal/simulation/AddressableLEDData.h" AnalogGyroData = "hal/simulation/AnalogGyroData.h" diff --git a/subprojects/robotpy-hal/semiwrap/.gitignore b/subprojects/robotpy-hal/semiwrap/.gitignore new file mode 100644 index 000000000..6cdce1027 --- /dev/null +++ b/subprojects/robotpy-hal/semiwrap/.gitignore @@ -0,0 +1,3 @@ +/meson.build +/modules/meson.build +/trampolines/meson.build diff --git a/subprojects/robotpy-hal/gen/Accelerometer.yml b/subprojects/robotpy-hal/semiwrap/Accelerometer.yml similarity index 100% rename from subprojects/robotpy-hal/gen/Accelerometer.yml rename to subprojects/robotpy-hal/semiwrap/Accelerometer.yml diff --git a/subprojects/robotpy-hal/gen/AddressableLED.yml b/subprojects/robotpy-hal/semiwrap/AddressableLED.yml similarity index 100% rename from subprojects/robotpy-hal/gen/AddressableLED.yml rename to subprojects/robotpy-hal/semiwrap/AddressableLED.yml diff --git a/subprojects/robotpy-hal/gen/AddressableLEDTypes.yml b/subprojects/robotpy-hal/semiwrap/AddressableLEDTypes.yml similarity index 87% rename from subprojects/robotpy-hal/gen/AddressableLEDTypes.yml rename to subprojects/robotpy-hal/semiwrap/AddressableLEDTypes.yml index 60b2bbd82..90ca15620 100644 --- a/subprojects/robotpy-hal/gen/AddressableLEDTypes.yml +++ b/subprojects/robotpy-hal/semiwrap/AddressableLEDTypes.yml @@ -5,7 +5,6 @@ strip_prefixes: classes: HAL_AddressableLEDData: - shared_ptr: true attributes: b: g: diff --git a/subprojects/robotpy-hal/gen/AnalogAccumulator.yml b/subprojects/robotpy-hal/semiwrap/AnalogAccumulator.yml similarity index 100% rename from subprojects/robotpy-hal/gen/AnalogAccumulator.yml rename to subprojects/robotpy-hal/semiwrap/AnalogAccumulator.yml diff --git a/subprojects/robotpy-hal/gen/AnalogGyro.yml b/subprojects/robotpy-hal/semiwrap/AnalogGyro.yml similarity index 100% rename from subprojects/robotpy-hal/gen/AnalogGyro.yml rename to subprojects/robotpy-hal/semiwrap/AnalogGyro.yml diff --git a/subprojects/robotpy-hal/gen/AnalogInput.yml b/subprojects/robotpy-hal/semiwrap/AnalogInput.yml similarity index 100% rename from subprojects/robotpy-hal/gen/AnalogInput.yml rename to subprojects/robotpy-hal/semiwrap/AnalogInput.yml diff --git a/subprojects/robotpy-hal/gen/AnalogOutput.yml b/subprojects/robotpy-hal/semiwrap/AnalogOutput.yml similarity index 100% rename from subprojects/robotpy-hal/gen/AnalogOutput.yml rename to subprojects/robotpy-hal/semiwrap/AnalogOutput.yml diff --git a/subprojects/robotpy-hal/gen/AnalogTrigger.yml b/subprojects/robotpy-hal/semiwrap/AnalogTrigger.yml similarity index 100% rename from subprojects/robotpy-hal/gen/AnalogTrigger.yml rename to subprojects/robotpy-hal/semiwrap/AnalogTrigger.yml diff --git a/subprojects/robotpy-hal/gen/CAN.yml b/subprojects/robotpy-hal/semiwrap/CAN.yml similarity index 95% rename from subprojects/robotpy-hal/gen/CAN.yml rename to subprojects/robotpy-hal/semiwrap/CAN.yml index eae7ca46e..bb1414ff2 100644 --- a/subprojects/robotpy-hal/gen/CAN.yml +++ b/subprojects/robotpy-hal/semiwrap/CAN.yml @@ -17,7 +17,6 @@ functions: HAL_CAN_GetCANStatus: classes: HAL_CANStreamMessage: - shared_ptr: true attributes: messageID: timeStamp: diff --git a/subprojects/robotpy-hal/gen/CANAPI.yml b/subprojects/robotpy-hal/semiwrap/CANAPI.yml similarity index 100% rename from subprojects/robotpy-hal/gen/CANAPI.yml rename to subprojects/robotpy-hal/semiwrap/CANAPI.yml diff --git a/subprojects/robotpy-hal/gen/CANAPITypes.yml b/subprojects/robotpy-hal/semiwrap/CANAPITypes.yml similarity index 100% rename from subprojects/robotpy-hal/gen/CANAPITypes.yml rename to subprojects/robotpy-hal/semiwrap/CANAPITypes.yml diff --git a/subprojects/robotpy-hal/gen/CTREPCM.yml b/subprojects/robotpy-hal/semiwrap/CTREPCM.yml similarity index 100% rename from subprojects/robotpy-hal/gen/CTREPCM.yml rename to subprojects/robotpy-hal/semiwrap/CTREPCM.yml diff --git a/subprojects/robotpy-hal/gen/Constants.yml b/subprojects/robotpy-hal/semiwrap/Constants.yml similarity index 100% rename from subprojects/robotpy-hal/gen/Constants.yml rename to subprojects/robotpy-hal/semiwrap/Constants.yml diff --git a/subprojects/robotpy-hal/gen/Counter.yml b/subprojects/robotpy-hal/semiwrap/Counter.yml similarity index 100% rename from subprojects/robotpy-hal/gen/Counter.yml rename to subprojects/robotpy-hal/semiwrap/Counter.yml diff --git a/subprojects/robotpy-hal/gen/DIO.yml b/subprojects/robotpy-hal/semiwrap/DIO.yml similarity index 100% rename from subprojects/robotpy-hal/gen/DIO.yml rename to subprojects/robotpy-hal/semiwrap/DIO.yml diff --git a/subprojects/robotpy-hal/gen/DriverStation.yml b/subprojects/robotpy-hal/semiwrap/DriverStation.yml similarity index 100% rename from subprojects/robotpy-hal/gen/DriverStation.yml rename to subprojects/robotpy-hal/semiwrap/DriverStation.yml diff --git a/subprojects/robotpy-hal/gen/DriverStationTypes.yml b/subprojects/robotpy-hal/semiwrap/DriverStationTypes.yml similarity index 85% rename from subprojects/robotpy-hal/gen/DriverStationTypes.yml rename to subprojects/robotpy-hal/semiwrap/DriverStationTypes.yml index c84888e28..d3a1bfdf9 100644 --- a/subprojects/robotpy-hal/gen/DriverStationTypes.yml +++ b/subprojects/robotpy-hal/semiwrap/DriverStationTypes.yml @@ -1,4 +1,3 @@ ---- strip_prefixes: - HAL_ @@ -10,7 +9,6 @@ enums: value_prefix: HAL_kMatchType classes: HAL_ControlWord: - shared_ptr: false attributes: enabled: autonomous: @@ -20,23 +18,19 @@ classes: dsAttached: control_reserved: HAL_JoystickAxes: - shared_ptr: false attributes: count: axes: raw: HAL_JoystickPOVs: - shared_ptr: false attributes: count: povs: HAL_JoystickButtons: - shared_ptr: false attributes: buttons: count: HAL_JoystickDescriptor: - shared_ptr: false attributes: isXbox: type: @@ -46,7 +40,6 @@ classes: buttonCount: povCount: HAL_MatchInfo: - shared_ptr: false attributes: eventName: matchType: diff --git a/subprojects/robotpy-hal/gen/DutyCycle.yml b/subprojects/robotpy-hal/semiwrap/DutyCycle.yml similarity index 100% rename from subprojects/robotpy-hal/gen/DutyCycle.yml rename to subprojects/robotpy-hal/semiwrap/DutyCycle.yml diff --git a/subprojects/robotpy-hal/gen/Encoder.yml b/subprojects/robotpy-hal/semiwrap/Encoder.yml similarity index 100% rename from subprojects/robotpy-hal/gen/Encoder.yml rename to subprojects/robotpy-hal/semiwrap/Encoder.yml diff --git a/subprojects/robotpy-hal/gen/Extensions.yml b/subprojects/robotpy-hal/semiwrap/Extensions.yml similarity index 100% rename from subprojects/robotpy-hal/gen/Extensions.yml rename to subprojects/robotpy-hal/semiwrap/Extensions.yml diff --git a/subprojects/robotpy-hal/gen/FRCUsageReporting.yml b/subprojects/robotpy-hal/semiwrap/FRCUsageReporting.yml similarity index 100% rename from subprojects/robotpy-hal/gen/FRCUsageReporting.yml rename to subprojects/robotpy-hal/semiwrap/FRCUsageReporting.yml diff --git a/subprojects/robotpy-hal/gen/HALBase.yml b/subprojects/robotpy-hal/semiwrap/HALBase.yml similarity index 100% rename from subprojects/robotpy-hal/gen/HALBase.yml rename to subprojects/robotpy-hal/semiwrap/HALBase.yml diff --git a/subprojects/robotpy-hal/gen/HandlesInternal.yml b/subprojects/robotpy-hal/semiwrap/HandlesInternal.yml similarity index 94% rename from subprojects/robotpy-hal/gen/HandlesInternal.yml rename to subprojects/robotpy-hal/semiwrap/HandlesInternal.yml index b5c746b66..0f8678923 100644 --- a/subprojects/robotpy-hal/gen/HandlesInternal.yml +++ b/subprojects/robotpy-hal/semiwrap/HandlesInternal.yml @@ -20,5 +20,5 @@ functions: createPortHandleForSPI: createHandle: classes: - HandleBase: + hal::HandleBase: ignore: true diff --git a/subprojects/robotpy-hal/gen/I2C.yml b/subprojects/robotpy-hal/semiwrap/I2C.yml similarity index 100% rename from subprojects/robotpy-hal/gen/I2C.yml rename to subprojects/robotpy-hal/semiwrap/I2C.yml diff --git a/subprojects/robotpy-hal/gen/I2CTypes.yml b/subprojects/robotpy-hal/semiwrap/I2CTypes.yml similarity index 100% rename from subprojects/robotpy-hal/gen/I2CTypes.yml rename to subprojects/robotpy-hal/semiwrap/I2CTypes.yml diff --git a/subprojects/robotpy-hal/gen/Interrupts.yml b/subprojects/robotpy-hal/semiwrap/Interrupts.yml similarity index 100% rename from subprojects/robotpy-hal/gen/Interrupts.yml rename to subprojects/robotpy-hal/semiwrap/Interrupts.yml diff --git a/subprojects/robotpy-hal/gen/LEDs.yml b/subprojects/robotpy-hal/semiwrap/LEDs.yml similarity index 100% rename from subprojects/robotpy-hal/gen/LEDs.yml rename to subprojects/robotpy-hal/semiwrap/LEDs.yml diff --git a/subprojects/robotpy-hal/gen/Main.yml b/subprojects/robotpy-hal/semiwrap/Main.yml similarity index 100% rename from subprojects/robotpy-hal/gen/Main.yml rename to subprojects/robotpy-hal/semiwrap/Main.yml diff --git a/subprojects/robotpy-hal/gen/Notifier.yml b/subprojects/robotpy-hal/semiwrap/Notifier.yml similarity index 100% rename from subprojects/robotpy-hal/gen/Notifier.yml rename to subprojects/robotpy-hal/semiwrap/Notifier.yml diff --git a/subprojects/robotpy-hal/gen/PWM.yml b/subprojects/robotpy-hal/semiwrap/PWM.yml similarity index 100% rename from subprojects/robotpy-hal/gen/PWM.yml rename to subprojects/robotpy-hal/semiwrap/PWM.yml diff --git a/subprojects/robotpy-hal/gen/Ports.yml b/subprojects/robotpy-hal/semiwrap/Ports.yml similarity index 100% rename from subprojects/robotpy-hal/gen/Ports.yml rename to subprojects/robotpy-hal/semiwrap/Ports.yml diff --git a/subprojects/robotpy-hal/gen/Power.yml b/subprojects/robotpy-hal/semiwrap/Power.yml similarity index 100% rename from subprojects/robotpy-hal/gen/Power.yml rename to subprojects/robotpy-hal/semiwrap/Power.yml diff --git a/subprojects/robotpy-hal/gen/PowerDistribution.yml b/subprojects/robotpy-hal/semiwrap/PowerDistribution.yml similarity index 97% rename from subprojects/robotpy-hal/gen/PowerDistribution.yml rename to subprojects/robotpy-hal/semiwrap/PowerDistribution.yml index 82e9d57eb..d6edb233d 100644 --- a/subprojects/robotpy-hal/gen/PowerDistribution.yml +++ b/subprojects/robotpy-hal/semiwrap/PowerDistribution.yml @@ -36,7 +36,6 @@ functions: ifdef: __FRC_ROBORIO__ classes: HAL_PowerDistributionVersion: - shared_ptr: true attributes: firmwareMajor: firmwareMinor: @@ -45,7 +44,6 @@ classes: hardwareMajor: uniqueId: HAL_PowerDistributionFaults: - shared_ptr: true attributes: channel0BreakerFault: channel1BreakerFault: @@ -75,7 +73,6 @@ classes: canWarning: hardwareFault: HAL_PowerDistributionStickyFaults: - shared_ptr: true attributes: channel0BreakerFault: channel1BreakerFault: diff --git a/subprojects/robotpy-hal/gen/REVPH.yml b/subprojects/robotpy-hal/semiwrap/REVPH.yml similarity index 95% rename from subprojects/robotpy-hal/gen/REVPH.yml rename to subprojects/robotpy-hal/semiwrap/REVPH.yml index 866c74805..e3acc3e04 100644 --- a/subprojects/robotpy-hal/gen/REVPH.yml +++ b/subprojects/robotpy-hal/semiwrap/REVPH.yml @@ -33,7 +33,6 @@ functions: HAL_GetREVPHSolenoidDisabledList: classes: HAL_REVPHVersion: - shared_ptr: true attributes: firmwareMajor: firmwareMinor: @@ -42,14 +41,12 @@ classes: hardwareMajor: uniqueId: HAL_REVPHCompressorConfig: - shared_ptr: true attributes: minAnalogVoltage: maxAnalogVoltage: forceDisable: useDigital: HAL_REVPHFaults: - shared_ptr: true attributes: channel0Fault: channel1Fault: @@ -74,7 +71,6 @@ classes: canWarning: hardwareFault: HAL_REVPHStickyFaults: - shared_ptr: true attributes: compressorOverCurrent: compressorOpen: diff --git a/subprojects/robotpy-hal/gen/Relay.yml b/subprojects/robotpy-hal/semiwrap/Relay.yml similarity index 100% rename from subprojects/robotpy-hal/gen/Relay.yml rename to subprojects/robotpy-hal/semiwrap/Relay.yml diff --git a/subprojects/robotpy-hal/gen/SPI.yml b/subprojects/robotpy-hal/semiwrap/SPI.yml similarity index 100% rename from subprojects/robotpy-hal/gen/SPI.yml rename to subprojects/robotpy-hal/semiwrap/SPI.yml diff --git a/subprojects/robotpy-hal/gen/SPITypes.yml b/subprojects/robotpy-hal/semiwrap/SPITypes.yml similarity index 100% rename from subprojects/robotpy-hal/gen/SPITypes.yml rename to subprojects/robotpy-hal/semiwrap/SPITypes.yml diff --git a/subprojects/robotpy-hal/gen/SerialHelper.yml b/subprojects/robotpy-hal/semiwrap/SerialHelper.yml similarity index 88% rename from subprojects/robotpy-hal/gen/SerialHelper.yml rename to subprojects/robotpy-hal/semiwrap/SerialHelper.yml index d25a876f5..14bad9710 100644 --- a/subprojects/robotpy-hal/gen/SerialHelper.yml +++ b/subprojects/robotpy-hal/semiwrap/SerialHelper.yml @@ -1,7 +1,7 @@ --- classes: - SerialHelper: + hal::SerialHelper: methods: SerialHelper: GetVISASerialPortName: diff --git a/subprojects/robotpy-hal/gen/SerialPort.yml b/subprojects/robotpy-hal/semiwrap/SerialPort.yml similarity index 100% rename from subprojects/robotpy-hal/gen/SerialPort.yml rename to subprojects/robotpy-hal/semiwrap/SerialPort.yml diff --git a/subprojects/robotpy-hal/gen/SimDevice.yml b/subprojects/robotpy-hal/semiwrap/SimDevice.yml similarity index 96% rename from subprojects/robotpy-hal/gen/SimDevice.yml rename to subprojects/robotpy-hal/semiwrap/SimDevice.yml index a798067b6..56b473a60 100644 --- a/subprojects/robotpy-hal/gen/SimDevice.yml +++ b/subprojects/robotpy-hal/semiwrap/SimDevice.yml @@ -1,11 +1,9 @@ ---- - defaults: ignore: true report_ignored_missing: false extra_includes: -- "hal/simulation/SimDeviceData.h" +- hal/simulation/SimDeviceData.h strip_prefixes: - HAL_ @@ -13,17 +11,16 @@ strip_prefixes: enums: HAL_SimValueDirection: classes: - SimValue: + hal::SimValue: doc: | Readonly wrapper around a HAL simulator value. - + It is not useful to construct these directly -- they are returned from :meth:`.SimDeviceSim.getValue` or :meth:`.SimDevice.createValue`. - shared_ptr: false methods: SimValue: overloads: - "": + '': ignore: true HAL_SimValueHandle: param_override: @@ -33,18 +30,17 @@ classes: ignore: true SetValue: ignore: true - SimInt: + hal::SimInt: doc: | Wrapper around a HAL simulator int value handle. - + It is not useful to construct these directly, they are returned from various functions. - shared_ptr: false force_no_trampoline: true methods: SimInt: overloads: - "": + '': ignore: true HAL_SimValueHandle: param_override: @@ -53,18 +49,17 @@ classes: Get: Set: Reset: - SimLong: + hal::SimLong: doc: | Wrapper around a HAL simulator long value handle. - + It is not useful to construct these directly, they are returned from various functions. - shared_ptr: false force_no_trampoline: true methods: SimLong: overloads: - "": + '': ignore: true HAL_SimValueHandle: param_override: @@ -73,18 +68,17 @@ classes: Get: Set: Reset: - SimDouble: + hal::SimDouble: doc: | Wrapper around a HAL simulator double value. - + It is not useful to construct these directly -- they are returned from :meth:`.SimDeviceSim.getDouble` or :meth:`.SimDevice.createDouble`. - shared_ptr: false force_no_trampoline: true methods: SimDouble: overloads: - "": + '': ignore: true HAL_SimValueHandle: param_override: @@ -93,18 +87,17 @@ classes: Get: Set: Reset: - SimEnum: + hal::SimEnum: doc: | Wrapper around a HAL simulator enum value. - + It is not useful to construct these directly -- they are returned from :meth:`.SimDeviceSim.getEnum` or :meth:`.SimDevice.createEnum`. - shared_ptr: false force_no_trampoline: true methods: SimEnum: overloads: - "": + '': ignore: true HAL_SimValueHandle: param_override: @@ -112,18 +105,17 @@ classes: name: handle Get: Set: - SimBoolean: + hal::SimBoolean: doc: | Wrapper around a HAL simulator boolean value. - + It is not useful to construct these directly -- they are returned from :meth:`.SimDeviceSim.getBoolean` or :meth:`.SimDevice.createBoolean`. - shared_ptr: false force_no_trampoline: true methods: SimBoolean: overloads: - "": + '': ignore: true HAL_SimValueHandle: param_override: @@ -131,7 +123,7 @@ classes: name: handle Get: Set: - SimDevice: + hal::SimDevice: doc: | Wrapper around a HAL simulation 'device' @@ -140,7 +132,6 @@ classes: .. note:: To interact with an existing device use :class:`hal.simulation.SimDeviceSim` instead. - shared_ptr: false force_type_casters: - wpi::SmallVector enums: @@ -148,7 +139,7 @@ classes: methods: SimDevice: overloads: - "": + '': ignore: true const char*: const char*, int: @@ -192,7 +183,7 @@ classes: CreateInt: CreateLong: -inline_code: | +inline_code: |2 cls_SimValue .def_property_readonly("value", [](const hal::SimValue &self) -> py::object { @@ -251,7 +242,7 @@ inline_code: | return ""; } }); - + cls_SimBoolean .def_property("value", &SimBoolean::Get, &SimBoolean::Set, release_gil()) .def("__repr__", [](const SimBoolean &self) -> py::str { @@ -302,7 +293,7 @@ inline_code: | return py::str("SimDevice(name={!r})").format(py::str(name)); #endif }); - + cls_SimDouble .def_property("value", &SimDouble::Get, &SimDouble::Set, release_gil()) .def("__repr__", [](const SimDouble &self) -> py::str { @@ -317,7 +308,7 @@ inline_code: | return ""; } }); - + cls_SimEnum .def_property("value", &SimEnum::Get, &SimEnum::Set) .def("__repr__", [](const SimEnum &self) -> py::str { diff --git a/subprojects/robotpy-hal/gen/Threads.yml b/subprojects/robotpy-hal/semiwrap/Threads.yml similarity index 100% rename from subprojects/robotpy-hal/gen/Threads.yml rename to subprojects/robotpy-hal/semiwrap/Threads.yml diff --git a/subprojects/robotpy-hal/gen/simulation/AccelerometerData.yml b/subprojects/robotpy-hal/semiwrap/simulation/AccelerometerData.yml similarity index 100% rename from subprojects/robotpy-hal/gen/simulation/AccelerometerData.yml rename to subprojects/robotpy-hal/semiwrap/simulation/AccelerometerData.yml diff --git a/subprojects/robotpy-hal/gen/simulation/AddressableLEDData.yml b/subprojects/robotpy-hal/semiwrap/simulation/AddressableLEDData.yml similarity index 100% rename from subprojects/robotpy-hal/gen/simulation/AddressableLEDData.yml rename to subprojects/robotpy-hal/semiwrap/simulation/AddressableLEDData.yml diff --git a/subprojects/robotpy-hal/gen/simulation/AnalogGyroData.yml b/subprojects/robotpy-hal/semiwrap/simulation/AnalogGyroData.yml similarity index 100% rename from subprojects/robotpy-hal/gen/simulation/AnalogGyroData.yml rename to subprojects/robotpy-hal/semiwrap/simulation/AnalogGyroData.yml diff --git a/subprojects/robotpy-hal/gen/simulation/AnalogInData.yml b/subprojects/robotpy-hal/semiwrap/simulation/AnalogInData.yml similarity index 100% rename from subprojects/robotpy-hal/gen/simulation/AnalogInData.yml rename to subprojects/robotpy-hal/semiwrap/simulation/AnalogInData.yml diff --git a/subprojects/robotpy-hal/gen/simulation/AnalogOutData.yml b/subprojects/robotpy-hal/semiwrap/simulation/AnalogOutData.yml similarity index 100% rename from subprojects/robotpy-hal/gen/simulation/AnalogOutData.yml rename to subprojects/robotpy-hal/semiwrap/simulation/AnalogOutData.yml diff --git a/subprojects/robotpy-hal/gen/simulation/AnalogTriggerData.yml b/subprojects/robotpy-hal/semiwrap/simulation/AnalogTriggerData.yml similarity index 100% rename from subprojects/robotpy-hal/gen/simulation/AnalogTriggerData.yml rename to subprojects/robotpy-hal/semiwrap/simulation/AnalogTriggerData.yml diff --git a/subprojects/robotpy-hal/gen/simulation/CTREPCMData.yml b/subprojects/robotpy-hal/semiwrap/simulation/CTREPCMData.yml similarity index 81% rename from subprojects/robotpy-hal/gen/simulation/CTREPCMData.yml rename to subprojects/robotpy-hal/semiwrap/simulation/CTREPCMData.yml index 45243b83e..009039054 100644 --- a/subprojects/robotpy-hal/gen/simulation/CTREPCMData.yml +++ b/subprojects/robotpy-hal/semiwrap/simulation/CTREPCMData.yml @@ -1,4 +1,5 @@ --- + strip_prefixes: - HALSIM_ @@ -7,43 +8,42 @@ functions: HALSIM_RegisterCTREPCMInitializedCallback: ignore: true HALSIM_CancelCTREPCMInitializedCallback: + ignore: true HALSIM_GetCTREPCMInitialized: HALSIM_SetCTREPCMInitialized: HALSIM_RegisterCTREPCMSolenoidOutputCallback: ignore: true - HALSIM_CancelCTREPCMInitializedCallback: HALSIM_CancelCTREPCMSolenoidOutputCallback: + ignore: true HALSIM_GetCTREPCMSolenoidOutput: HALSIM_SetCTREPCMSolenoidOutput: HALSIM_RegisterCTREPCMCompressorOnCallback: ignore: true - HALSIM_CancelCTREPCMInitializedCallback: HALSIM_CancelCTREPCMCompressorOnCallback: + ignore: true HALSIM_GetCTREPCMCompressorOn: HALSIM_SetCTREPCMCompressorOn: HALSIM_RegisterCTREPCMClosedLoopEnabledCallback: ignore: true - HALSIM_CancelCTREPCMInitializedCallback: HALSIM_CancelCTREPCMClosedLoopEnabledCallback: + ignore: true HALSIM_GetCTREPCMClosedLoopEnabled: HALSIM_SetCTREPCMClosedLoopEnabled: HALSIM_RegisterCTREPCMPressureSwitchCallback: ignore: true - HALSIM_CancelCTREPCMInitializedCallback: HALSIM_CancelCTREPCMPressureSwitchCallback: + ignore: true HALSIM_GetCTREPCMPressureSwitch: HALSIM_SetCTREPCMPressureSwitch: HALSIM_RegisterCTREPCMCompressorCurrentCallback: ignore: true - HALSIM_CancelCTREPCMInitializedCallback: HALSIM_CancelCTREPCMCompressorCurrentCallback: + ignore: true HALSIM_GetCTREPCMCompressorCurrent: HALSIM_SetCTREPCMCompressorCurrent: HALSIM_GetCTREPCMAllSolenoids: HALSIM_SetCTREPCMAllSolenoids: HALSIM_RegisterCTREPCMAllNonSolenoidCallbacks: ignore: true - HALSIM_CancelCTREPCMInitializedCallback: HALSIM_RegisterCTREPCMAllSolenoidCallbacks: ignore: true - HALSIM_CancelCTREPCMInitializedCallback: diff --git a/subprojects/robotpy-hal/gen/simulation/CanData.yml b/subprojects/robotpy-hal/semiwrap/simulation/CanData.yml similarity index 100% rename from subprojects/robotpy-hal/gen/simulation/CanData.yml rename to subprojects/robotpy-hal/semiwrap/simulation/CanData.yml diff --git a/subprojects/robotpy-hal/gen/simulation/DIOData.yml b/subprojects/robotpy-hal/semiwrap/simulation/DIOData.yml similarity index 100% rename from subprojects/robotpy-hal/gen/simulation/DIOData.yml rename to subprojects/robotpy-hal/semiwrap/simulation/DIOData.yml diff --git a/subprojects/robotpy-hal/gen/simulation/DigitalPWMData.yml b/subprojects/robotpy-hal/semiwrap/simulation/DigitalPWMData.yml similarity index 100% rename from subprojects/robotpy-hal/gen/simulation/DigitalPWMData.yml rename to subprojects/robotpy-hal/semiwrap/simulation/DigitalPWMData.yml diff --git a/subprojects/robotpy-hal/gen/simulation/DriverStationData.yml b/subprojects/robotpy-hal/semiwrap/simulation/DriverStationData.yml similarity index 99% rename from subprojects/robotpy-hal/gen/simulation/DriverStationData.yml rename to subprojects/robotpy-hal/semiwrap/simulation/DriverStationData.yml index 8e4964d5c..b8e54f233 100644 --- a/subprojects/robotpy-hal/gen/simulation/DriverStationData.yml +++ b/subprojects/robotpy-hal/semiwrap/simulation/DriverStationData.yml @@ -7,7 +7,6 @@ functions: HALSIM_ResetDriverStationData: HALSIM_RegisterDriverStationEnabledCallback: ignore: true - ignore: true HALSIM_CancelDriverStationEnabledCallback: HALSIM_GetDriverStationEnabled: HALSIM_SetDriverStationEnabled: diff --git a/subprojects/robotpy-hal/gen/simulation/DutyCycleData.yml b/subprojects/robotpy-hal/semiwrap/simulation/DutyCycleData.yml similarity index 100% rename from subprojects/robotpy-hal/gen/simulation/DutyCycleData.yml rename to subprojects/robotpy-hal/semiwrap/simulation/DutyCycleData.yml diff --git a/subprojects/robotpy-hal/gen/simulation/EncoderData.yml b/subprojects/robotpy-hal/semiwrap/simulation/EncoderData.yml similarity index 100% rename from subprojects/robotpy-hal/gen/simulation/EncoderData.yml rename to subprojects/robotpy-hal/semiwrap/simulation/EncoderData.yml diff --git a/subprojects/robotpy-hal/gen/simulation/I2CData.yml b/subprojects/robotpy-hal/semiwrap/simulation/I2CData.yml similarity index 100% rename from subprojects/robotpy-hal/gen/simulation/I2CData.yml rename to subprojects/robotpy-hal/semiwrap/simulation/I2CData.yml diff --git a/subprojects/robotpy-hal/gen/simulation/MockHooks.yml b/subprojects/robotpy-hal/semiwrap/simulation/MockHooks.yml similarity index 100% rename from subprojects/robotpy-hal/gen/simulation/MockHooks.yml rename to subprojects/robotpy-hal/semiwrap/simulation/MockHooks.yml diff --git a/subprojects/robotpy-hal/gen/simulation/NotifierData.yml b/subprojects/robotpy-hal/semiwrap/simulation/NotifierData.yml similarity index 91% rename from subprojects/robotpy-hal/gen/simulation/NotifierData.yml rename to subprojects/robotpy-hal/semiwrap/simulation/NotifierData.yml index 1abfca9ec..37dc67c3f 100644 --- a/subprojects/robotpy-hal/gen/simulation/NotifierData.yml +++ b/subprojects/robotpy-hal/semiwrap/simulation/NotifierData.yml @@ -9,7 +9,6 @@ functions: HALSIM_GetNotifierInfo: classes: HALSIM_NotifierInfo: - shared_ptr: true attributes: handle: name: diff --git a/subprojects/robotpy-hal/gen/simulation/NotifyListener.yml b/subprojects/robotpy-hal/semiwrap/simulation/NotifyListener.yml similarity index 92% rename from subprojects/robotpy-hal/gen/simulation/NotifyListener.yml rename to subprojects/robotpy-hal/semiwrap/simulation/NotifyListener.yml index 0e67d1577..4368e80c5 100644 --- a/subprojects/robotpy-hal/gen/simulation/NotifyListener.yml +++ b/subprojects/robotpy-hal/semiwrap/simulation/NotifyListener.yml @@ -6,7 +6,6 @@ strip_prefixes: classes: HalCallbackListener: ignore: true # TODO - shared_ptr: true attributes: callback: param: diff --git a/subprojects/robotpy-hal/gen/simulation/PWMData.yml b/subprojects/robotpy-hal/semiwrap/simulation/PWMData.yml similarity index 100% rename from subprojects/robotpy-hal/gen/simulation/PWMData.yml rename to subprojects/robotpy-hal/semiwrap/simulation/PWMData.yml diff --git a/subprojects/robotpy-hal/gen/simulation/PowerDistributionData.yml b/subprojects/robotpy-hal/semiwrap/simulation/PowerDistributionData.yml similarity index 100% rename from subprojects/robotpy-hal/gen/simulation/PowerDistributionData.yml rename to subprojects/robotpy-hal/semiwrap/simulation/PowerDistributionData.yml diff --git a/subprojects/robotpy-hal/gen/simulation/REVPHData.yml b/subprojects/robotpy-hal/semiwrap/simulation/REVPHData.yml similarity index 100% rename from subprojects/robotpy-hal/gen/simulation/REVPHData.yml rename to subprojects/robotpy-hal/semiwrap/simulation/REVPHData.yml diff --git a/subprojects/robotpy-hal/gen/simulation/RelayData.yml b/subprojects/robotpy-hal/semiwrap/simulation/RelayData.yml similarity index 100% rename from subprojects/robotpy-hal/gen/simulation/RelayData.yml rename to subprojects/robotpy-hal/semiwrap/simulation/RelayData.yml diff --git a/subprojects/robotpy-hal/gen/simulation/Reset.yml b/subprojects/robotpy-hal/semiwrap/simulation/Reset.yml similarity index 100% rename from subprojects/robotpy-hal/gen/simulation/Reset.yml rename to subprojects/robotpy-hal/semiwrap/simulation/Reset.yml diff --git a/subprojects/robotpy-hal/gen/simulation/RoboRioData.yml b/subprojects/robotpy-hal/semiwrap/simulation/RoboRioData.yml similarity index 100% rename from subprojects/robotpy-hal/gen/simulation/RoboRioData.yml rename to subprojects/robotpy-hal/semiwrap/simulation/RoboRioData.yml diff --git a/subprojects/robotpy-hal/gen/simulation/SPIAccelerometerData.yml b/subprojects/robotpy-hal/semiwrap/simulation/SPIAccelerometerData.yml similarity index 100% rename from subprojects/robotpy-hal/gen/simulation/SPIAccelerometerData.yml rename to subprojects/robotpy-hal/semiwrap/simulation/SPIAccelerometerData.yml diff --git a/subprojects/robotpy-hal/gen/simulation/SPIData.yml b/subprojects/robotpy-hal/semiwrap/simulation/SPIData.yml similarity index 100% rename from subprojects/robotpy-hal/gen/simulation/SPIData.yml rename to subprojects/robotpy-hal/semiwrap/simulation/SPIData.yml diff --git a/subprojects/robotpy-hal/gen/simulation/SimCallbackRegistry.yml b/subprojects/robotpy-hal/semiwrap/simulation/SimCallbackRegistry.yml similarity index 85% rename from subprojects/robotpy-hal/gen/simulation/SimCallbackRegistry.yml rename to subprojects/robotpy-hal/semiwrap/simulation/SimCallbackRegistry.yml index cf1f62ce1..ce980aef9 100644 --- a/subprojects/robotpy-hal/gen/simulation/SimCallbackRegistry.yml +++ b/subprojects/robotpy-hal/semiwrap/simulation/SimCallbackRegistry.yml @@ -3,7 +3,6 @@ classes: SimCallbackRegistryBase: ignore: true # TODO - shared_ptr: true methods: Cancel: Reset: @@ -12,7 +11,6 @@ classes: DoReset: SimCallbackRegistry: ignore: true # TODO - shared_ptr: true methods: Register: Invoke: diff --git a/subprojects/robotpy-hal/gen/simulation/SimDataValue.yml b/subprojects/robotpy-hal/semiwrap/simulation/SimDataValue.yml similarity index 89% rename from subprojects/robotpy-hal/gen/simulation/SimDataValue.yml rename to subprojects/robotpy-hal/semiwrap/simulation/SimDataValue.yml index 6f8399798..47e6459c4 100644 --- a/subprojects/robotpy-hal/gen/simulation/SimDataValue.yml +++ b/subprojects/robotpy-hal/semiwrap/simulation/SimDataValue.yml @@ -3,7 +3,6 @@ classes: SimDataValueBase: ignore: true - shared_ptr: true attributes: m_value: methods: @@ -16,7 +15,6 @@ classes: DoSet: SimDataValue: ignore: true - shared_ptr: true methods: SimDataValue: overloads: diff --git a/subprojects/robotpy-hal/gen/simulation/SimDeviceData.yml b/subprojects/robotpy-hal/semiwrap/simulation/SimDeviceData.yml similarity index 95% rename from subprojects/robotpy-hal/gen/simulation/SimDeviceData.yml rename to subprojects/robotpy-hal/semiwrap/simulation/SimDeviceData.yml index 793bac0ae..462f24a78 100644 --- a/subprojects/robotpy-hal/gen/simulation/SimDeviceData.yml +++ b/subprojects/robotpy-hal/semiwrap/simulation/SimDeviceData.yml @@ -16,8 +16,6 @@ functions: ignore: true HALSIM_RegisterSimDeviceFreedCallback: ignore: true - HALSIM_CancelSimDeviceCreatedCallback: - ignore: true HALSIM_CancelSimDeviceFreedCallback: ignore: true HALSIM_GetSimDeviceHandle: @@ -42,8 +40,6 @@ functions: cb->SetUID(uid); return std::move(cb); } - HALSIM_CancelSimDeviceCreatedCallback: - ignore: true HALSIM_CancelSimValueCreatedCallback: ignore: true HALSIM_RegisterSimValueChangedCallback: @@ -65,8 +61,6 @@ functions: cb->SetUID(uid); return std::move(cb); } - HALSIM_CancelSimDeviceCreatedCallback: - ignore: true HALSIM_CancelSimValueChangedCallback: ignore: true HALSIM_RegisterSimValueResetCallback: diff --git a/subprojects/robotpy-hal/setup.py b/subprojects/robotpy-hal/setup.py deleted file mode 100644 index 3542d0c9a..000000000 --- a/subprojects/robotpy-hal/setup.py +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env python3 - -from robotpy_build.setup import setup - -setup() From 3199617f64c9c4e773008cc6260312c5601a19f9 Mon Sep 17 00:00:00 2001 From: Dustin Spicuzza Date: Fri, 18 Apr 2025 01:26:56 -0400 Subject: [PATCH 08/20] Update robotpy-wpimath to semiwrap --- .../robotpy-hal/semiwrap/SimDevice.yml | 2 +- subprojects/robotpy-wpimath/.gitignore | 43 +- subprojects/robotpy-wpimath/meson.build | 35 + subprojects/robotpy-wpimath/pyproject.toml | 440 ++--- .../robotpy-wpimath/semiwrap/.gitignore | 3 + .../{gen => semiwrap}/ComputerVisionUtil.yml | 0 .../{gen => semiwrap}/MathUtil.yml | 0 .../controls/ArmFeedforward.yml | 5 +- .../controls/BangBangController.yml | 3 +- .../CentripetalAccelerationConstraint.yml | 9 +- ...ControlAffinePlantInversionFeedforward.yml | 7 +- .../{gen => semiwrap}/controls/DCMotor.yml | 5 +- .../DifferentialDriveAccelerationLimiter.yml | 3 +- .../controls/DifferentialDriveFeedforward.yml | 3 +- .../DifferentialDriveKinematicsConstraint.yml | 9 +- .../DifferentialDrivePoseEstimator.yml | 3 +- .../DifferentialDrivePoseEstimator3d.yml | 3 +- .../DifferentialDriveVoltageConstraint.yml | 7 +- .../DifferentialDriveWheelVoltages.yml | 4 +- .../controls/ElevatorFeedforward.yml | 5 +- .../controls/EllipticalRegionConstraint.yml | 9 +- .../controls/ExponentialProfile.yml | 9 +- .../controls/ExtendedKalmanFilter.yml | 13 +- .../controls/HolonomicDriveController.yml | 3 +- .../controls/ImplicitModelFollower.yml | 9 +- .../controls/KalmanFilter.yml | 11 +- .../LTVDifferentialDriveController.yml | 7 +- .../controls/LTVUnicycleController.yml | 3 +- .../LinearPlantInversionFeedforward.yml | 9 +- .../controls/LinearQuadraticRegulator.yml | 9 +- .../controls/LinearSystem.yml | 7 +- .../controls/LinearSystemId.yml | 3 +- .../controls/LinearSystemLoop.yml | 7 +- .../controls/LinearSystemLoopz.yml | 3 +- .../controls/MaxVelocityConstraint.yml | 8 +- .../MecanumDriveKinematicsConstraint.yml | 9 +- .../controls/MecanumDrivePoseEstimator.yml | 3 +- .../controls/MecanumDrivePoseEstimator3d.yml | 3 +- .../controls/PIDController.yml | 3 +- .../controls/PoseEstimator.yml | 3 +- .../controls/PoseEstimator3d.yml | 3 +- .../controls/ProfiledPIDController.yml | 9 +- .../controls/RamseteController.yml | 5 +- .../controls/RectangularRegionConstraint.yml | 9 +- .../controls/SimpleMotorFeedforward.yml | 9 +- .../controls/SimulatedAnnealing.yml | 5 +- .../SwerveDriveKinematicsConstraint.yml | 5 +- .../controls/SwerveDrivePoseEstimator.yml | 5 +- .../controls/SwerveDrivePoseEstimator3d.yml | 5 +- .../{gen => semiwrap}/controls/Trajectory.yml | 11 +- .../controls/TrajectoryConfig.yml | 9 +- .../controls/TrajectoryConstraint.yml | 10 +- .../controls/TrajectoryGenerator.yml | 5 +- .../controls/TrajectoryParameterizer.yml | 5 +- .../controls/TrajectoryUtil.yml | 5 +- .../controls/TrapezoidProfile.yml | 21 +- .../controls/TravelingSalesman.yml | 3 +- .../{gen => semiwrap}/filter/Debouncer.yml | 3 +- .../{gen => semiwrap}/filter/LinearFilter.yml | 7 +- .../{gen => semiwrap}/filter/MedianFilter.yml | 7 +- .../filter/SlewRateLimiter.yml | 5 +- .../geometry/CoordinateAxis.yml | 3 +- .../geometry/CoordinateSystem.yml | 3 +- .../{gen => semiwrap}/geometry/Ellipse2d.yml | 11 +- .../{gen => semiwrap}/geometry/Pose2d.yml | 8 +- .../{gen => semiwrap}/geometry/Pose3d.yml | 8 +- .../{gen => semiwrap}/geometry/Quaternion.yml | 8 +- .../geometry/Rectangle2d.yml | 11 +- .../{gen => semiwrap}/geometry/Rotation2d.yml | 12 +- .../{gen => semiwrap}/geometry/Rotation3d.yml | 8 +- .../geometry/Transform2d.yml | 5 +- .../geometry/Transform3d.yml | 8 +- .../geometry/Translation2d.yml | 10 +- .../geometry/Translation3d.yml | 12 +- .../{gen => semiwrap}/geometry/Twist2d.yml | 6 +- .../{gen => semiwrap}/geometry/Twist3d.yml | 11 +- .../TimeInterpolatableBuffer.yml | 2 +- .../kinematics/ChassisSpeeds.yml | 5 +- .../DifferentialDriveKinematics.yml | 3 +- .../kinematics/DifferentialDriveOdometry.yml | 3 +- .../DifferentialDriveOdometry3d.yml | 3 +- .../DifferentialDriveWheelPositions.yml | 3 +- .../DifferentialDriveWheelSpeeds.yml | 5 +- .../kinematics/Kinematics.yml | 3 +- .../kinematics/MecanumDriveKinematics.yml | 3 +- .../kinematics/MecanumDriveOdometry.yml | 3 +- .../kinematics/MecanumDriveOdometry3d.yml | 3 +- .../kinematics/MecanumDriveWheelPositions.yml | 3 +- .../kinematics/MecanumDriveWheelSpeeds.yml | 5 +- .../{gen => semiwrap}/kinematics/Odometry.yml | 3 +- .../kinematics/Odometry3d.yml | 3 +- .../kinematics/SwerveDriveKinematics.yml | 10 +- .../kinematics/SwerveDriveOdometry.yml | 3 +- .../kinematics/SwerveDriveOdometry3d.yml | 5 +- .../kinematics/SwerveModulePosition.yml | 3 +- .../kinematics/SwerveModuleState.yml | 5 +- .../spline/CubicHermiteSpline.yml | 3 +- .../spline/QuinticHermiteSpline.yml | 3 +- .../{gen => semiwrap}/spline/Spline.yml | 5 +- .../{gen => semiwrap}/spline/SplineHelper.yml | 6 +- .../spline/SplineParameterizer.yml | 11 +- subprojects/robotpy-wpimath/setup.py | 5 - .../robotpy-wpimath/wpimath/__init__.py | 28 +- .../wpimath/_controls/__init__.py | 2 +- .../wpimath/_controls/controls.cpp | 4 +- .../_impl/src/PyTrajectoryConstraint.h | 2 +- .../wpimath/_impl/src/eigen/Eigen/SparseCore | 69 - .../eigen/Eigen/src/SparseCore/AmbiVector.h | 378 ---- .../Eigen/src/SparseCore/CompressedStorage.h | 274 --- .../ConservativeSparseSparseProduct.h | 352 ---- .../Eigen/src/SparseCore/MappedSparseMatrix.h | 67 - .../eigen/Eigen/src/SparseCore/SparseAssign.h | 270 --- .../eigen/Eigen/src/SparseCore/SparseBlock.h | 571 ------- .../Eigen/src/SparseCore/SparseColEtree.h | 206 --- .../src/SparseCore/SparseCompressedBase.h | 370 ---- .../src/SparseCore/SparseCwiseBinaryOp.h | 722 -------- .../Eigen/src/SparseCore/SparseCwiseUnaryOp.h | 150 -- .../Eigen/src/SparseCore/SparseDenseProduct.h | 342 ---- .../src/SparseCore/SparseDiagonalProduct.h | 138 -- .../eigen/Eigen/src/SparseCore/SparseDot.h | 98 -- .../eigen/Eigen/src/SparseCore/SparseFuzzy.h | 29 - .../eigen/Eigen/src/SparseCore/SparseMap.h | 305 ---- .../eigen/Eigen/src/SparseCore/SparseMatrix.h | 1518 ----------------- .../Eigen/src/SparseCore/SparseMatrixBase.h | 398 ----- .../Eigen/src/SparseCore/SparsePermutation.h | 178 -- .../Eigen/src/SparseCore/SparseProduct.h | 181 -- .../eigen/Eigen/src/SparseCore/SparseRedux.h | 49 - .../eigen/Eigen/src/SparseCore/SparseRef.h | 397 ----- .../src/SparseCore/SparseSelfAdjointView.h | 659 ------- .../Eigen/src/SparseCore/SparseSolverBase.h | 124 -- .../SparseSparseProductWithPruning.h | 198 --- .../Eigen/src/SparseCore/SparseTranspose.h | 92 - .../src/SparseCore/SparseTriangularView.h | 189 -- .../eigen/Eigen/src/SparseCore/SparseUtil.h | 186 -- .../eigen/Eigen/src/SparseCore/SparseVector.h | 478 ------ .../eigen/Eigen/src/SparseCore/SparseView.h | 254 --- .../Eigen/src/SparseCore/TriangularSolver.h | 315 ---- .../_impl/src/type_casters/frc_eigen.h | 4 + .../wpimath/controller/__init__.py | 2 +- .../wpimath/estimator/__init__.py | 2 +- .../wpimath/filter/__init__.py | 4 +- .../robotpy-wpimath/wpimath/filter/filter.cpp | 4 +- .../wpimath/geometry/__init__.py | 4 +- .../wpimath/geometry/geometry.cpp | 4 +- .../wpimath/interpolation/__init__.py | 2 +- .../wpimath/interpolation/interpolation.cpp | 4 +- .../wpimath/kinematics/__init__.py | 2 +- .../wpimath/kinematics/kinematics.cpp | 4 +- .../wpimath/optimization/__init__.py | 2 +- .../robotpy-wpimath/wpimath/path/__init__.py | 2 +- subprojects/robotpy-wpimath/wpimath/py.typed | 0 .../wpimath/spline/__init__.py | 4 +- .../robotpy-wpimath/wpimath/spline/spline.cpp | 4 +- .../robotpy-wpimath/wpimath/src/wpimath.cpp | 4 +- .../wpimath/system/__init__.py | 2 +- .../wpimath/trajectory/__init__.py | 2 +- .../wpimath/trajectory/constraint/__init__.py | 2 +- 157 files changed, 523 insertions(+), 10227 deletions(-) create mode 100644 subprojects/robotpy-wpimath/meson.build create mode 100644 subprojects/robotpy-wpimath/semiwrap/.gitignore rename subprojects/robotpy-wpimath/{gen => semiwrap}/ComputerVisionUtil.yml (100%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/MathUtil.yml (100%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/ArmFeedforward.yml (96%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/BangBangController.yml (93%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/CentripetalAccelerationConstraint.yml (77%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/ControlAffinePlantInversionFeedforward.yml (93%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/DCMotor.yml (95%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/DifferentialDriveAccelerationLimiter.yml (90%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/DifferentialDriveFeedforward.yml (97%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/DifferentialDriveKinematicsConstraint.yml (86%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/DifferentialDrivePoseEstimator.yml (98%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/DifferentialDrivePoseEstimator3d.yml (92%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/DifferentialDriveVoltageConstraint.yml (64%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/DifferentialDriveWheelVoltages.yml (91%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/ElevatorFeedforward.yml (95%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/EllipticalRegionConstraint.yml (89%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/ExponentialProfile.yml (91%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/ExtendedKalmanFilter.yml (94%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/HolonomicDriveController.yml (94%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/ImplicitModelFollower.yml (86%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/KalmanFilter.yml (91%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/LTVDifferentialDriveController.yml (71%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/LTVUnicycleController.yml (95%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/LinearPlantInversionFeedforward.yml (93%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/LinearQuadraticRegulator.yml (96%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/LinearSystem.yml (97%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/LinearSystemId.yml (99%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/LinearSystemLoop.yml (97%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/LinearSystemLoopz.yml (98%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/MaxVelocityConstraint.yml (85%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/MecanumDriveKinematicsConstraint.yml (86%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/MecanumDrivePoseEstimator.yml (98%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/MecanumDrivePoseEstimator3d.yml (92%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/PIDController.yml (97%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/PoseEstimator.yml (98%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/PoseEstimator3d.yml (98%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/ProfiledPIDController.yml (95%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/RamseteController.yml (94%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/RectangularRegionConstraint.yml (80%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/SimpleMotorFeedforward.yml (94%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/SimulatedAnnealing.yml (80%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/SwerveDriveKinematicsConstraint.yml (94%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/SwerveDrivePoseEstimator.yml (96%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/SwerveDrivePoseEstimator3d.yml (93%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/Trajectory.yml (93%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/TrajectoryConfig.yml (97%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/TrajectoryConstraint.yml (89%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/TrajectoryGenerator.yml (93%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/TrajectoryParameterizer.yml (74%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/TrajectoryUtil.yml (77%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/TrapezoidProfile.yml (92%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/controls/TravelingSalesman.yml (91%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/filter/Debouncer.yml (91%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/filter/LinearFilter.yml (92%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/filter/MedianFilter.yml (77%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/filter/SlewRateLimiter.yml (87%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/geometry/CoordinateAxis.yml (81%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/geometry/CoordinateSystem.yml (94%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/geometry/Ellipse2d.yml (90%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/geometry/Pose2d.yml (95%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/geometry/Pose3d.yml (95%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/geometry/Quaternion.yml (91%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/geometry/Rectangle2d.yml (90%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/geometry/Rotation2d.yml (88%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/geometry/Rotation3d.yml (95%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/geometry/Transform2d.yml (97%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/geometry/Transform3d.yml (94%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/geometry/Translation2d.yml (95%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/geometry/Translation3d.yml (93%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/geometry/Twist2d.yml (97%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/geometry/Twist3d.yml (95%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/interpolation/TimeInterpolatableBuffer.yml (97%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/kinematics/ChassisSpeeds.yml (98%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/kinematics/DifferentialDriveKinematics.yml (93%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/kinematics/DifferentialDriveOdometry.yml (80%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/kinematics/DifferentialDriveOdometry3d.yml (77%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/kinematics/DifferentialDriveWheelPositions.yml (74%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/kinematics/DifferentialDriveWheelSpeeds.yml (96%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/kinematics/Kinematics.yml (98%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/kinematics/MecanumDriveKinematics.yml (98%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/kinematics/MecanumDriveOdometry.yml (84%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/kinematics/MecanumDriveOdometry3d.yml (72%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/kinematics/MecanumDriveWheelPositions.yml (82%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/kinematics/MecanumDriveWheelSpeeds.yml (98%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/kinematics/Odometry.yml (98%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/kinematics/Odometry3d.yml (98%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/kinematics/SwerveDriveKinematics.yml (98%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/kinematics/SwerveDriveOdometry.yml (94%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/kinematics/SwerveDriveOdometry3d.yml (92%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/kinematics/SwerveModulePosition.yml (97%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/kinematics/SwerveModuleState.yml (95%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/spline/CubicHermiteSpline.yml (89%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/spline/QuinticHermiteSpline.yml (86%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/spline/Spline.yml (95%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/spline/SplineHelper.yml (82%) rename subprojects/robotpy-wpimath/{gen => semiwrap}/spline/SplineParameterizer.yml (56%) delete mode 100644 subprojects/robotpy-wpimath/setup.py delete mode 100644 subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/SparseCore delete mode 100644 subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/AmbiVector.h delete mode 100644 subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/CompressedStorage.h delete mode 100644 subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h delete mode 100644 subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/MappedSparseMatrix.h delete mode 100644 subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseAssign.h delete mode 100644 subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseBlock.h delete mode 100644 subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseColEtree.h delete mode 100644 subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseCompressedBase.h delete mode 100644 subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseCwiseBinaryOp.h delete mode 100644 subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseCwiseUnaryOp.h delete mode 100644 subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseDenseProduct.h delete mode 100644 subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseDiagonalProduct.h delete mode 100644 subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseDot.h delete mode 100644 subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseFuzzy.h delete mode 100644 subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseMap.h delete mode 100644 subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseMatrix.h delete mode 100644 subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseMatrixBase.h delete mode 100644 subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparsePermutation.h delete mode 100644 subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseProduct.h delete mode 100644 subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseRedux.h delete mode 100644 subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseRef.h delete mode 100644 subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseSelfAdjointView.h delete mode 100644 subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseSolverBase.h delete mode 100644 subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseSparseProductWithPruning.h delete mode 100644 subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseTranspose.h delete mode 100644 subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseTriangularView.h delete mode 100644 subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseUtil.h delete mode 100644 subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseVector.h delete mode 100644 subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseView.h delete mode 100644 subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/TriangularSolver.h create mode 100644 subprojects/robotpy-wpimath/wpimath/_impl/src/type_casters/frc_eigen.h create mode 100644 subprojects/robotpy-wpimath/wpimath/py.typed diff --git a/subprojects/robotpy-hal/semiwrap/SimDevice.yml b/subprojects/robotpy-hal/semiwrap/SimDevice.yml index 56b473a60..156d59cf8 100644 --- a/subprojects/robotpy-hal/semiwrap/SimDevice.yml +++ b/subprojects/robotpy-hal/semiwrap/SimDevice.yml @@ -183,7 +183,7 @@ classes: CreateInt: CreateLong: -inline_code: |2 +inline_code: | cls_SimValue .def_property_readonly("value", [](const hal::SimValue &self) -> py::object { diff --git a/subprojects/robotpy-wpimath/.gitignore b/subprojects/robotpy-wpimath/.gitignore index 39aedb312..0b37645b2 100644 --- a/subprojects/robotpy-wpimath/.gitignore +++ b/subprojects/robotpy-wpimath/.gitignore @@ -17,26 +17,31 @@ build dist MANIFEST -/wpimath/py.typed -/wpimath/pkgcfg.py /wpimath/version.py -/wpimath/_init_wpimath.py -/wpimath/_controls/_init_controls.py -/wpimath/_controls/pkgcfg.py -/wpimath/filter/_init_filter.py -/wpimath/filter/pkgcfg.py -/wpimath/geometry/_init_geometry.py -/wpimath/geometry/pkgcfg.py -/wpimath/interfaces/_init_interfaces.py -/wpimath/interfaces/pkgcfg.py -/wpimath/interpolation/_init_interpolation.py -/wpimath/interpolation/pkgcfg.py -/wpimath/kinematics/_init_kinematics.py -/wpimath/kinematics/pkgcfg.py -/wpimath/spline/_init_spline.py -/wpimath/spline/pkgcfg.py -/wpimath/trajectory/_init_trajectory.py -/wpimath/trajectory/pkgcfg.py +/wpimath/_init__wpimath.py +/wpimath/wpimath.pc +/wpimath/wpimath-casters.pc +/wpimath/wpimath-casters.pybind11.json +/wpimath/_controls/_init__controls.py +/wpimath/_controls/wpimath_controls.pc +/wpimath/_controls/trampolines/ +/wpimath/filter/_init__filter.py +/wpimath/filter/wpimath_filter.pc +/wpimath/filter/trampolines/ +/wpimath/geometry/_init__geometry.py +/wpimath/geometry/wpimath_geometry.pc +/wpimath/geometry/trampolines/ +/wpimath/interfaces/_init__interfaces.py +/wpimath/interpolation/_init__interpolation.py +/wpimath/interpolation/wpimath_interpolation.pc +/wpimath/interpolation/trampolines/ +/wpimath/kinematics/_init__kinematics.py +/wpimath/kinematics/wpimath_kinematics.pc +/wpimath/kinematics/trampolines/ +/wpimath/spline/_init__spline.py +/wpimath/spline/wpimath_spline.pc +/wpimath/spline/trampolines/ +/wpimath/trajectory/_init__trajectory.py rpy-include /wpimath/_impl/_init_wpimath_cpp.py diff --git a/subprojects/robotpy-wpimath/meson.build b/subprojects/robotpy-wpimath/meson.build new file mode 100644 index 000000000..025134f82 --- /dev/null +++ b/subprojects/robotpy-wpimath/meson.build @@ -0,0 +1,35 @@ +project('robotpy-wpimath', ['cpp'], + default_options: ['warning_level=1', 'cpp_std=c++20', + 'b_colorout=auto', 'optimization=2', 'b_pie=true']) + +subdir('semiwrap') + +wpimath_sources += files( + 'wpimath/src/wpimath.cpp', +) + +wpimath_controls_sources += files( + 'wpimath/_controls/controls.cpp', +) + +wpimath_filter_sources += files( + 'wpimath/filter/filter.cpp', +) + +wpimath_geometry_sources += files( + 'wpimath/geometry/geometry.cpp', +) + +wpimath_interpolation_sources += files( + 'wpimath/interpolation/interpolation.cpp', +) + +wpimath_kinematics_sources += files( + 'wpimath/kinematics/kinematics.cpp', +) + +wpimath_spline_sources += files( + 'wpimath/spline/spline.cpp', +) + +subdir('semiwrap/modules') diff --git a/subprojects/robotpy-wpimath/pyproject.toml b/subprojects/robotpy-wpimath/pyproject.toml index 913cc21db..ab472a835 100644 --- a/subprojects/robotpy-wpimath/pyproject.toml +++ b/subprojects/robotpy-wpimath/pyproject.toml @@ -1,24 +1,44 @@ -[tool.robotpy-build.metadata] -author = "RobotPy Development Team" -author_email = "robotpy@googlegroups.com" -description = "Binary wrapper for FRC WPIMath library" -license = "BSD-3-Clause" -name = "robotpy-wpimath" -url = "https://github.com/robotpy/robotpy-wpimath" -install_requires = [ - "robotpy-wpiutil==THIS_VERSION", -] - [build-system] +build-backend = "hatchling.build" requires = [ - "robotpy-build~=2025.1.0", - "robotpy-wpiutil~=2025.3.2", + "semiwrap~=0.1", + "hatch-meson~=0.1.0b2", + "hatch-robotpy~=0.2", + "hatchling", + "robotpy-native-wpimath==2025.3.2", + "robotpy-wpiutil==2025.3.2.2", # "numpy", # broken in raspbian CI ] -[tool.robotpy-build] -base_package = "wpimath" +[project] +name = "robotpy-wpimath" +version = "2025.3.2.2" +description = "Binary wrapper for FRC WPIMath library" +authors = [ + {name = "RobotPy Development Team", email = "robotpy@googlegroups.com"}, +] +license = "BSD-3-Clause" +dependencies = [ + "robotpy-native-wpimath==2025.3.2", + "robotpy-wpiutil==2025.3.2.2", +] + +[project.urls] +"Source code" = "https://github.com/robotpy/mostrobotpy" + + +[tool.hatch.build.hooks.robotpy] +version_file = "wpimath/version.py" + +[tool.hatch.build.hooks.semiwrap] + +[tool.hatch.build.hooks.meson] +[tool.hatch.build.targets.wheel] +packages = ["wpimath"] + + +[tool.semiwrap] update_init = [ "wpimath", "wpimath.controller wpimath._controls._controls.controller", @@ -77,21 +97,13 @@ scan_headers_ignore = [ "_units_base_type_caster.h", ] -[tool.robotpy-build.wrappers."wpimath._impl".maven_lib_download] -artifact_id = "wpimath-cpp" -group_id = "edu.wpi.first.wpimath" -repo_url = "https://frcmaven.wpi.edu/artifactory/release" -version = "2025.3.2" - +[tool.semiwrap.export_type_casters.wpimath-casters] +pypackage = "wpimath" +requires = ["wpiutil"] +includedir = ["wpimath/_impl/src", "wpimath/_impl/src/type_casters"] -libs = ["wpimath"] -[tool.robotpy-build.wrappers."wpimath._impl"] -depends = ["wpiutil"] -extra_includes = ["wpimath/_impl/src", "wpimath/_impl/src/eigen", "wpimath/_impl/src/type_casters"] -name = "wpimath_cpp" - -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_acceleration_type_caster.h" types = [ "units::feet_per_second_squared_t", @@ -100,7 +112,7 @@ types = [ ] default_arg_cast = true -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_acceleration_type_caster.h" types = [ "units::feet_per_second_squared", @@ -112,7 +124,7 @@ types = [ ] default_arg_cast = false -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_angle_type_caster.h" types = [ "units::arcminute_t", @@ -129,7 +141,7 @@ types = [ ] default_arg_cast = true -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_angle_type_caster.h" types = [ "units::arcminute", @@ -157,7 +169,7 @@ types = [ ] default_arg_cast = false -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_angular_acceleration_type_caster.h" types = [ "units::radians_per_second_squared_t", @@ -166,7 +178,7 @@ types = [ ] default_arg_cast = true -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_angular_acceleration_type_caster.h" types = [ "units::radians_per_second_squared", @@ -175,7 +187,7 @@ types = [ ] default_arg_cast = false -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_angular_velocity_type_caster.h" types = [ "units::degrees_per_second_t", @@ -186,7 +198,7 @@ types = [ ] default_arg_cast = true -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_angular_velocity_type_caster.h" types = [ "units::degrees_per_second", @@ -197,7 +209,7 @@ types = [ ] default_arg_cast = false -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_area_type_caster.h" types = [ "units::acre_t", @@ -210,7 +222,7 @@ types = [ ] default_arg_cast = true -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_area_type_caster.h" types = [ "units::acre", @@ -230,7 +242,7 @@ types = [ ] default_arg_cast = false -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_capacitance_type_caster.h" types = [ "units::farad_t", @@ -241,7 +253,7 @@ types = [ ] default_arg_cast = true -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_capacitance_type_caster.h" types = [ "units::farad", @@ -257,7 +269,7 @@ types = [ ] default_arg_cast = false -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_charge_type_caster.h" types = [ "units::ampere_hour_t", @@ -273,7 +285,7 @@ types = [ ] default_arg_cast = true -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_charge_type_caster.h" types = [ "units::ampere_hour", @@ -299,7 +311,7 @@ types = [ ] default_arg_cast = false -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_concentration_type_caster.h" types = [ "units::percent_t", @@ -309,7 +321,7 @@ types = [ ] default_arg_cast = true -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_concentration_type_caster.h" types = [ "units::parts_per_billion", @@ -323,7 +335,7 @@ types = [ ] default_arg_cast = false -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_conductance_type_caster.h" types = [ "units::kilosiemens_t", @@ -334,7 +346,7 @@ types = [ ] default_arg_cast = true -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_conductance_type_caster.h" types = [ "units::kilosiemens", @@ -350,7 +362,7 @@ types = [ ] default_arg_cast = false -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_current_type_caster.h" types = [ "units::ampere_t", @@ -361,7 +373,7 @@ types = [ ] default_arg_cast = true -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_current_type_caster.h" types = [ "units::ampere", @@ -377,7 +389,7 @@ types = [ ] default_arg_cast = false -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_data_type_caster.h" types = [ "units::exabit_t", @@ -385,7 +397,7 @@ types = [ ] default_arg_cast = true -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_data_type_caster.h" types = [ "units::exabit", @@ -395,7 +407,7 @@ types = [ ] default_arg_cast = false -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_data_transfer_rate_type_caster.h" types = [ "units::exabits_per_second_t", @@ -403,7 +415,7 @@ types = [ ] default_arg_cast = true -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_data_transfer_rate_type_caster.h" types = [ "units::exabits_per_second", @@ -413,7 +425,7 @@ types = [ ] default_arg_cast = false -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_density_type_caster.h" types = [ "units::grams_per_milliliter_t", @@ -429,7 +441,7 @@ types = [ ] default_arg_cast = true -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_density_type_caster.h" types = [ "units::grams_per_milliliter", @@ -455,7 +467,7 @@ types = [ ] default_arg_cast = false -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_energy_type_caster.h" types = [ "units::british_thermal_unit_59_t", @@ -478,7 +490,7 @@ types = [ ] default_arg_cast = true -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_energy_type_caster.h" types = [ "units::british_thermal_unit", @@ -518,7 +530,7 @@ types = [ ] default_arg_cast = false -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_force_type_caster.h" types = [ "units::dyne_t", @@ -533,7 +545,7 @@ types = [ ] default_arg_cast = true -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_force_type_caster.h" types = [ "units::dyne", @@ -557,7 +569,7 @@ types = [ ] default_arg_cast = false -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_frequency_type_caster.h" types = [ "units::hertz_t", @@ -568,7 +580,7 @@ types = [ ] default_arg_cast = true -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_frequency_type_caster.h" types = [ "units::hertz", @@ -584,7 +596,7 @@ types = [ ] default_arg_cast = false -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_illuminance_type_caster.h" types = [ "units::footcandle_t", @@ -598,7 +610,7 @@ types = [ ] default_arg_cast = true -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_illuminance_type_caster.h" types = [ "units::footcandle", @@ -620,7 +632,7 @@ types = [ ] default_arg_cast = false -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_impedance_type_caster.h" types = [ "units::kiloohm_t", @@ -631,7 +643,7 @@ types = [ ] default_arg_cast = true -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_impedance_type_caster.h" types = [ "units::kiloohm", @@ -647,7 +659,7 @@ types = [ ] default_arg_cast = false -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_inductance_type_caster.h" types = [ "units::henry_t", @@ -658,7 +670,7 @@ types = [ ] default_arg_cast = true -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_inductance_type_caster.h" types = [ "units::henries", @@ -674,7 +686,7 @@ types = [ ] default_arg_cast = false -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_length_type_caster.h" types = [ "units::angstrom_t", @@ -703,7 +715,7 @@ types = [ ] default_arg_cast = true -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_length_type_caster.h" types = [ "units::angstrom", @@ -753,7 +765,7 @@ types = [ ] default_arg_cast = false -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_luminous_flux_type_caster.h" types = [ "units::kilolumen_t", @@ -764,7 +776,7 @@ types = [ ] default_arg_cast = true -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_luminous_flux_type_caster.h" types = [ "units::kilolumen", @@ -780,7 +792,7 @@ types = [ ] default_arg_cast = false -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_luminous_intensity_type_caster.h" types = [ "units::candela_t", @@ -791,7 +803,7 @@ types = [ ] default_arg_cast = true -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_luminous_intensity_type_caster.h" types = [ "units::candela", @@ -807,7 +819,7 @@ types = [ ] default_arg_cast = false -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_magnetic_field_strength_type_caster.h" types = [ "units::gauss_t", @@ -819,7 +831,7 @@ types = [ ] default_arg_cast = true -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_magnetic_field_strength_type_caster.h" types = [ "units::gauss", @@ -837,7 +849,7 @@ types = [ ] default_arg_cast = false -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_magnetic_flux_type_caster.h" types = [ "units::kiloweber_t", @@ -849,7 +861,7 @@ types = [ ] default_arg_cast = true -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_magnetic_flux_type_caster.h" types = [ "units::kiloweber", @@ -867,7 +879,7 @@ types = [ ] default_arg_cast = false -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_mass_type_caster.h" types = [ "units::carat_t", @@ -886,7 +898,7 @@ types = [ ] default_arg_cast = true -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_mass_type_caster.h" types = [ "units::carat", @@ -918,14 +930,14 @@ types = [ ] default_arg_cast = false -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_moment_of_inertia_type_caster.h" types = [ "units::kilogram_square_meter_t", ] default_arg_cast = true -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_moment_of_inertia_type_caster.h" types = [ "units::kilogram_square_meter", @@ -933,7 +945,7 @@ types = [ ] default_arg_cast = false -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_power_type_caster.h" types = [ "units::horsepower_t", @@ -945,7 +957,7 @@ types = [ ] default_arg_cast = true -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_power_type_caster.h" types = [ "units::horsepower", @@ -963,7 +975,7 @@ types = [ ] default_arg_cast = false -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_pressure_type_caster.h" types = [ "units::atmosphere_t", @@ -979,7 +991,7 @@ types = [ ] default_arg_cast = true -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_pressure_type_caster.h" types = [ "units::atmosphere", @@ -1005,7 +1017,7 @@ types = [ ] default_arg_cast = false -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_radiation_type_caster.h" types = [ "units::becquerel_t", @@ -1029,7 +1041,7 @@ types = [ ] default_arg_cast = true -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_radiation_type_caster.h" types = [ "units::becquerel", @@ -1071,7 +1083,7 @@ types = [ ] default_arg_cast = false -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_solid_angle_type_caster.h" types = [ "units::degree_squared_t", @@ -1084,7 +1096,7 @@ types = [ ] default_arg_cast = true -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_solid_angle_type_caster.h" types = [ "units::degree_squared", @@ -1104,14 +1116,14 @@ types = [ ] default_arg_cast = false -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_substance_type_caster.h" types = [ "units::mole_t", ] default_arg_cast = true -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_substance_type_caster.h" types = [ "units::mole", @@ -1119,7 +1131,7 @@ types = [ ] default_arg_cast = false -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_temperature_type_caster.h" types = [ "units::celsius_t", @@ -1130,7 +1142,7 @@ types = [ ] default_arg_cast = true -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_temperature_type_caster.h" types = [ "units::celsius", @@ -1146,7 +1158,7 @@ types = [ ] default_arg_cast = false -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_time_type_caster.h" types = [ "units::day_t", @@ -1164,7 +1176,7 @@ types = [ ] default_arg_cast = true -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_time_type_caster.h" types = [ "units::day", @@ -1194,7 +1206,7 @@ types = [ ] default_arg_cast = false -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_torque_type_caster.h" types = [ "units::foot_pound_t", @@ -1205,7 +1217,7 @@ types = [ ] default_arg_cast = true -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_torque_type_caster.h" types = [ "units::foot_pound", @@ -1221,7 +1233,7 @@ types = [ ] default_arg_cast = false -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_velocity_type_caster.h" types = [ "units::feet_per_second_t", @@ -1232,7 +1244,7 @@ types = [ ] default_arg_cast = true -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_velocity_type_caster.h" types = [ "units::feet_per_second", @@ -1248,7 +1260,7 @@ types = [ ] default_arg_cast = false -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_voltage_type_caster.h" types = [ "units::abvolt_t", @@ -1261,7 +1273,7 @@ types = [ ] default_arg_cast = true -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_voltage_type_caster.h" types = [ "units::abvolt", @@ -1281,7 +1293,7 @@ types = [ ] default_arg_cast = false -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_volume_type_caster.h" types = [ "units::barrel_t", @@ -1320,7 +1332,7 @@ types = [ ] default_arg_cast = true -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_volume_type_caster.h" types = [ "units::barrel", @@ -1392,14 +1404,14 @@ types = [ ] default_arg_cast = false -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_compound_type_caster.h" types = [ "units::curvature_t", ] default_arg_cast = true -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_compound_type_caster.h" types = [ "units::compound_unit", @@ -1407,7 +1419,7 @@ types = [ ] default_arg_cast = false -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_misc_type_caster.h" types = [ "units::dimensionless_t", @@ -1417,7 +1429,7 @@ types = [ ] default_arg_cast = true -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] header = "units_misc_type_caster.h" types = [ "units::dimensionless", @@ -1427,21 +1439,20 @@ types = [ ] default_arg_cast = false -[[tool.robotpy-build.wrappers."wpimath._impl".type_casters]] -header = "pybind11/eigen.h" +[[tool.semiwrap.export_type_casters.wpimath-casters.headers]] +header = "frc_eigen.h" types = [ "frc::Vectord", "frc::Matrixd", ] -[tool.robotpy-build.wrappers."wpimath"] -depends = ["wpiutil", "wpimath_cpp", "wpimath_geometry"] +[tool.semiwrap.extension_modules."wpimath._wpimath"] name = "wpimath" -extension = "_wpimath" -sources = ["wpimath/src/wpimath.cpp"] -generation_data = "gen" +wraps = ["robotpy-native-wpimath"] +includes = ["wpimath/_impl/src"] +depends = ["wpiutil", "wpimath-casters"] -[tool.robotpy-build.wrappers."wpimath".autogen_headers] +[tool.semiwrap.extension_modules."wpimath._wpimath".headers] # frc ComputerVisionUtil = "frc/ComputerVisionUtil.h" # DARE = "frc/DARE.h" @@ -1450,14 +1461,106 @@ MathUtil = "frc/MathUtil.h" # StateSpaceUtil = "frc/StateSpaceUtil.h" -[tool.robotpy-build.wrappers."wpimath._controls"] +[tool.semiwrap.extension_modules."wpimath.filter._filter"] +name = "wpimath_filter" +wraps = ["robotpy-native-wpimath"] +depends = ["wpimath"] +yaml_path = "semiwrap/filter" + +[tool.semiwrap.extension_modules."wpimath.filter._filter".headers] +Debouncer = "frc/filter/Debouncer.h" +LinearFilter = "frc/filter/LinearFilter.h" +MedianFilter = "frc/filter/MedianFilter.h" +SlewRateLimiter = "frc/filter/SlewRateLimiter.h" + + +[tool.semiwrap.extension_modules."wpimath.geometry._geometry"] +name = "wpimath_geometry" +wraps = ["robotpy-native-wpimath"] +depends = ["wpimath"] +includes = ["wpimath/geometry/include"] +yaml_path = "semiwrap/geometry" + +[tool.semiwrap.extension_modules."wpimath.geometry._geometry".headers] +# frc/geometry +CoordinateAxis = "frc/geometry/CoordinateAxis.h" +CoordinateSystem = "frc/geometry/CoordinateSystem.h" +Ellipse2d = "frc/geometry/Ellipse2d.h" +Pose2d = "frc/geometry/Pose2d.h" +Pose3d = "frc/geometry/Pose3d.h" +Quaternion = "frc/geometry/Quaternion.h" +Rectangle2d = "frc/geometry/Rectangle2d.h" +Rotation2d = "frc/geometry/Rotation2d.h" +Rotation3d = "frc/geometry/Rotation3d.h" +Transform2d = "frc/geometry/Transform2d.h" +Transform3d = "frc/geometry/Transform3d.h" +Translation2d = "frc/geometry/Translation2d.h" +Translation3d = "frc/geometry/Translation3d.h" +Twist2d = "frc/geometry/Twist2d.h" +Twist3d = "frc/geometry/Twist3d.h" + +[tool.semiwrap.extension_modules."wpimath.interpolation._interpolation"] +name = "wpimath_interpolation" +wraps = ["robotpy-native-wpimath"] +depends = ["wpimath_geometry"] +yaml_path = "semiwrap/interpolation" + +[tool.semiwrap.extension_modules."wpimath.interpolation._interpolation".headers] +# frc/interpolation +TimeInterpolatableBuffer = "frc/interpolation/TimeInterpolatableBuffer.h" + + +[tool.semiwrap.extension_modules."wpimath.kinematics._kinematics"] +name = "wpimath_kinematics" +wraps = ["robotpy-native-wpimath"] +depends = ["wpimath_geometry"] +yaml_path = "semiwrap/kinematics" + +[tool.semiwrap.extension_modules."wpimath.kinematics._kinematics".headers] +# frc/kinematics +ChassisSpeeds = "frc/kinematics/ChassisSpeeds.h" +DifferentialDriveKinematics = "frc/kinematics/DifferentialDriveKinematics.h" +DifferentialDriveOdometry3d = "frc/kinematics/DifferentialDriveOdometry3d.h" +DifferentialDriveOdometry = "frc/kinematics/DifferentialDriveOdometry.h" +DifferentialDriveWheelPositions = "frc/kinematics/DifferentialDriveWheelPositions.h" +DifferentialDriveWheelSpeeds = "frc/kinematics/DifferentialDriveWheelSpeeds.h" +Kinematics = "frc/kinematics/Kinematics.h" +MecanumDriveKinematics = "frc/kinematics/MecanumDriveKinematics.h" +MecanumDriveOdometry = "frc/kinematics/MecanumDriveOdometry.h" +MecanumDriveOdometry3d = "frc/kinematics/MecanumDriveOdometry3d.h" +MecanumDriveWheelPositions = "frc/kinematics/MecanumDriveWheelPositions.h" +MecanumDriveWheelSpeeds = "frc/kinematics/MecanumDriveWheelSpeeds.h" +Odometry = "frc/kinematics/Odometry.h" +Odometry3d = "frc/kinematics/Odometry3d.h" +SwerveDriveKinematics = "frc/kinematics/SwerveDriveKinematics.h" +SwerveDriveOdometry = "frc/kinematics/SwerveDriveOdometry.h" +SwerveDriveOdometry3d = "frc/kinematics/SwerveDriveOdometry3d.h" +SwerveModulePosition = "frc/kinematics/SwerveModulePosition.h" +SwerveModuleState = "frc/kinematics/SwerveModuleState.h" + + +[tool.semiwrap.extension_modules."wpimath.spline._spline"] +name = "wpimath_spline" +wraps = ["robotpy-native-wpimath"] +depends = ["wpimath_geometry"] +yaml_path = "semiwrap/spline" + +[tool.semiwrap.extension_modules."wpimath.spline._spline".headers] +# frc/spline +CubicHermiteSpline = "frc/spline/CubicHermiteSpline.h" +QuinticHermiteSpline = "frc/spline/QuinticHermiteSpline.h" +Spline = "frc/spline/Spline.h" +SplineHelper = "frc/spline/SplineHelper.h" +SplineParameterizer = "frc/spline/SplineParameterizer.h" + + +[tool.semiwrap.extension_modules."wpimath._controls._controls"] name = "wpimath_controls" -extension = "_controls" -sources = ["wpimath/_controls/controls.cpp"] -depends = ["wpiutil", "wpimath_cpp", "wpimath_geometry", "wpimath_kinematics", "wpimath_spline"] -generation_data = "gen/controls" +wraps = ["robotpy-native-wpimath"] +depends = ["wpimath", "wpimath_geometry", "wpimath_kinematics", "wpimath_spline"] +yaml_path = "semiwrap/controls" -[tool.robotpy-build.wrappers."wpimath._controls".autogen_headers] +[tool.semiwrap.extension_modules."wpimath._controls._controls".headers] # frc/controller ArmFeedforward = "frc/controller/ArmFeedforward.h" BangBangController = "frc/controller/BangBangController.h" @@ -1530,102 +1633,3 @@ MecanumDriveKinematicsConstraint = "frc/trajectory/constraint/MecanumDriveKinema RectangularRegionConstraint = "frc/trajectory/constraint/RectangularRegionConstraint.h" SwerveDriveKinematicsConstraint = "frc/trajectory/constraint/SwerveDriveKinematicsConstraint.h" TrajectoryConstraint = "frc/trajectory/constraint/TrajectoryConstraint.h" - -[tool.robotpy-build.wrappers."wpimath.filter"] - -depends = ["wpiutil", "wpimath_cpp"] -name = "wpimath_filter" -extension = "_filter" -sources = ["wpimath/filter/filter.cpp"] -generation_data = "gen/filter" - -[tool.robotpy-build.wrappers."wpimath.filter".autogen_headers] -Debouncer = "frc/filter/Debouncer.h" -LinearFilter = "frc/filter/LinearFilter.h" -MedianFilter = "frc/filter/MedianFilter.h" -SlewRateLimiter = "frc/filter/SlewRateLimiter.h" - -[tool.robotpy-build.wrappers."wpimath.geometry"] - -name = "wpimath_geometry" -extension = "_geometry" -extra_includes = ["wpimath/geometry/include"] -sources = ["wpimath/geometry/geometry.cpp"] -depends = ["wpiutil", "wpimath_cpp"] -generation_data = "gen/geometry" - -[tool.robotpy-build.wrappers."wpimath.geometry".autogen_headers] -# frc/geometry -CoordinateAxis = "frc/geometry/CoordinateAxis.h" -CoordinateSystem = "frc/geometry/CoordinateSystem.h" -Ellipse2d = "frc/geometry/Ellipse2d.h" -Pose2d = "frc/geometry/Pose2d.h" -Pose3d = "frc/geometry/Pose3d.h" -Quaternion = "frc/geometry/Quaternion.h" -Rectangle2d = "frc/geometry/Rectangle2d.h" -Rotation2d = "frc/geometry/Rotation2d.h" -Rotation3d = "frc/geometry/Rotation3d.h" -Transform2d = "frc/geometry/Transform2d.h" -Transform3d = "frc/geometry/Transform3d.h" -Translation2d = "frc/geometry/Translation2d.h" -Translation3d = "frc/geometry/Translation3d.h" -Twist2d = "frc/geometry/Twist2d.h" -Twist3d = "frc/geometry/Twist3d.h" - -[tool.robotpy-build.wrappers."wpimath.interpolation"] - -name = "wpimath_interpolation" -extension = "_interpolation" -sources = ["wpimath/interpolation/interpolation.cpp"] -depends = ["wpiutil", "wpimath_cpp", "wpimath_geometry"] -generation_data = "gen/interpolation" - -[tool.robotpy-build.wrappers."wpimath.interpolation".autogen_headers] -# frc/interpolation -TimeInterpolatableBuffer = "frc/interpolation/TimeInterpolatableBuffer.h" - -[tool.robotpy-build.wrappers."wpimath.kinematics"] - -name = "wpimath_kinematics" -extension = "_kinematics" -sources = ["wpimath/kinematics/kinematics.cpp"] -depends = ["wpiutil", "wpimath_cpp", "wpimath_geometry"] -generation_data = "gen/kinematics" - -[tool.robotpy-build.wrappers."wpimath.kinematics".autogen_headers] -# frc/kinematics -ChassisSpeeds = "frc/kinematics/ChassisSpeeds.h" -DifferentialDriveKinematics = "frc/kinematics/DifferentialDriveKinematics.h" -DifferentialDriveOdometry3d = "frc/kinematics/DifferentialDriveOdometry3d.h" -DifferentialDriveOdometry = "frc/kinematics/DifferentialDriveOdometry.h" -DifferentialDriveWheelPositions = "frc/kinematics/DifferentialDriveWheelPositions.h" -DifferentialDriveWheelSpeeds = "frc/kinematics/DifferentialDriveWheelSpeeds.h" -Kinematics = "frc/kinematics/Kinematics.h" -MecanumDriveKinematics = "frc/kinematics/MecanumDriveKinematics.h" -MecanumDriveOdometry = "frc/kinematics/MecanumDriveOdometry.h" -MecanumDriveOdometry3d = "frc/kinematics/MecanumDriveOdometry3d.h" -MecanumDriveWheelPositions = "frc/kinematics/MecanumDriveWheelPositions.h" -MecanumDriveWheelSpeeds = "frc/kinematics/MecanumDriveWheelSpeeds.h" -Odometry = "frc/kinematics/Odometry.h" -Odometry3d = "frc/kinematics/Odometry3d.h" -SwerveDriveKinematics = "frc/kinematics/SwerveDriveKinematics.h" -SwerveDriveOdometry = "frc/kinematics/SwerveDriveOdometry.h" -SwerveDriveOdometry3d = "frc/kinematics/SwerveDriveOdometry3d.h" -SwerveModulePosition = "frc/kinematics/SwerveModulePosition.h" -SwerveModuleState = "frc/kinematics/SwerveModuleState.h" - -[tool.robotpy-build.wrappers."wpimath.spline"] - -name = "wpimath_spline" -extension = "_spline" -sources = ["wpimath/spline/spline.cpp"] -depends = ["wpiutil", "wpimath_cpp", "wpimath_geometry"] -generation_data = "gen/spline" - -[tool.robotpy-build.wrappers."wpimath.spline".autogen_headers] -# frc/spline -CubicHermiteSpline = "frc/spline/CubicHermiteSpline.h" -QuinticHermiteSpline = "frc/spline/QuinticHermiteSpline.h" -Spline = "frc/spline/Spline.h" -SplineHelper = "frc/spline/SplineHelper.h" -SplineParameterizer = "frc/spline/SplineParameterizer.h" diff --git a/subprojects/robotpy-wpimath/semiwrap/.gitignore b/subprojects/robotpy-wpimath/semiwrap/.gitignore new file mode 100644 index 000000000..6cdce1027 --- /dev/null +++ b/subprojects/robotpy-wpimath/semiwrap/.gitignore @@ -0,0 +1,3 @@ +/meson.build +/modules/meson.build +/trampolines/meson.build diff --git a/subprojects/robotpy-wpimath/gen/ComputerVisionUtil.yml b/subprojects/robotpy-wpimath/semiwrap/ComputerVisionUtil.yml similarity index 100% rename from subprojects/robotpy-wpimath/gen/ComputerVisionUtil.yml rename to subprojects/robotpy-wpimath/semiwrap/ComputerVisionUtil.yml diff --git a/subprojects/robotpy-wpimath/gen/MathUtil.yml b/subprojects/robotpy-wpimath/semiwrap/MathUtil.yml similarity index 100% rename from subprojects/robotpy-wpimath/gen/MathUtil.yml rename to subprojects/robotpy-wpimath/semiwrap/MathUtil.yml diff --git a/subprojects/robotpy-wpimath/gen/controls/ArmFeedforward.yml b/subprojects/robotpy-wpimath/semiwrap/controls/ArmFeedforward.yml similarity index 96% rename from subprojects/robotpy-wpimath/gen/controls/ArmFeedforward.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/ArmFeedforward.yml index 059139e12..ea9f1c8a6 100644 --- a/subprojects/robotpy-wpimath/gen/controls/ArmFeedforward.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/ArmFeedforward.yml @@ -1,8 +1,5 @@ ---- - classes: - ArmFeedforward: - shared_ptr: true + frc::ArmFeedforward: subpackage: controller force_type_casters: - units::radians_per_second_squared diff --git a/subprojects/robotpy-wpimath/gen/controls/BangBangController.yml b/subprojects/robotpy-wpimath/semiwrap/controls/BangBangController.yml similarity index 93% rename from subprojects/robotpy-wpimath/gen/controls/BangBangController.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/BangBangController.yml index a05150e34..045f47ace 100644 --- a/subprojects/robotpy-wpimath/gen/controls/BangBangController.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/BangBangController.yml @@ -1,7 +1,6 @@ ---- classes: - BangBangController: + frc::BangBangController: subpackage: controller ignored_bases: - wpi::SendableHelper diff --git a/subprojects/robotpy-wpimath/gen/controls/CentripetalAccelerationConstraint.yml b/subprojects/robotpy-wpimath/semiwrap/controls/CentripetalAccelerationConstraint.yml similarity index 77% rename from subprojects/robotpy-wpimath/gen/controls/CentripetalAccelerationConstraint.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/CentripetalAccelerationConstraint.yml index 5857a26d9..fa6b402f0 100644 --- a/subprojects/robotpy-wpimath/gen/controls/CentripetalAccelerationConstraint.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/CentripetalAccelerationConstraint.yml @@ -1,9 +1,6 @@ ---- - classes: - CentripetalAccelerationConstraint: + frc::CentripetalAccelerationConstraint: subpackage: constraint - shared_ptr: true typealias: - frc::TrajectoryConstraint::MinMax methods: @@ -11,8 +8,8 @@ classes: MaxVelocity: MinMaxAcceleration: -inline_code: | +inline_code: |- cls_CentripetalAccelerationConstraint .def_static("fromFps", [](units::feet_per_second_squared_t maxCentripetalAcceleration) { return std::make_shared(maxCentripetalAcceleration); - }, py::arg("maxCentripetalAcceleration")); \ No newline at end of file + }, py::arg("maxCentripetalAcceleration")); diff --git a/subprojects/robotpy-wpimath/gen/controls/ControlAffinePlantInversionFeedforward.yml b/subprojects/robotpy-wpimath/semiwrap/controls/ControlAffinePlantInversionFeedforward.yml similarity index 93% rename from subprojects/robotpy-wpimath/gen/controls/ControlAffinePlantInversionFeedforward.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/ControlAffinePlantInversionFeedforward.yml index 5a3c1c61a..33f20b572 100644 --- a/subprojects/robotpy-wpimath/gen/controls/ControlAffinePlantInversionFeedforward.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/ControlAffinePlantInversionFeedforward.yml @@ -1,8 +1,5 @@ ---- - classes: - ControlAffinePlantInversionFeedforward: - shared_ptr: true + frc::ControlAffinePlantInversionFeedforward: template_params: - int States - int Inputs @@ -22,7 +19,7 @@ classes: Reset: overloads: const StateVector&: - "": + '': Calculate: overloads: const StateVector&: diff --git a/subprojects/robotpy-wpimath/gen/controls/DCMotor.yml b/subprojects/robotpy-wpimath/semiwrap/controls/DCMotor.yml similarity index 95% rename from subprojects/robotpy-wpimath/gen/controls/DCMotor.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/DCMotor.yml index 3b2bb2967..ad342c291 100644 --- a/subprojects/robotpy-wpimath/gen/controls/DCMotor.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/DCMotor.yml @@ -1,11 +1,8 @@ ---- - extra_includes: - wpystruct.h classes: - DCMotor: - shared_ptr: true + frc::DCMotor: subpackage: plant attributes: nominalVoltage: diff --git a/subprojects/robotpy-wpimath/gen/controls/DifferentialDriveAccelerationLimiter.yml b/subprojects/robotpy-wpimath/semiwrap/controls/DifferentialDriveAccelerationLimiter.yml similarity index 90% rename from subprojects/robotpy-wpimath/gen/controls/DifferentialDriveAccelerationLimiter.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/DifferentialDriveAccelerationLimiter.yml index 917badddf..77863cb0e 100644 --- a/subprojects/robotpy-wpimath/gen/controls/DifferentialDriveAccelerationLimiter.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/DifferentialDriveAccelerationLimiter.yml @@ -1,7 +1,6 @@ ---- classes: - DifferentialDriveAccelerationLimiter: + frc::DifferentialDriveAccelerationLimiter: subpackage: controller methods: DifferentialDriveAccelerationLimiter: diff --git a/subprojects/robotpy-wpimath/gen/controls/DifferentialDriveFeedforward.yml b/subprojects/robotpy-wpimath/semiwrap/controls/DifferentialDriveFeedforward.yml similarity index 97% rename from subprojects/robotpy-wpimath/gen/controls/DifferentialDriveFeedforward.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/DifferentialDriveFeedforward.yml index 40a57c001..ab7b34edd 100644 --- a/subprojects/robotpy-wpimath/gen/controls/DifferentialDriveFeedforward.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/DifferentialDriveFeedforward.yml @@ -1,7 +1,6 @@ ---- classes: - DifferentialDriveFeedforward: + frc::DifferentialDriveFeedforward: force_type_casters: - units::meters_per_second - units::meters_per_second_squared diff --git a/subprojects/robotpy-wpimath/gen/controls/DifferentialDriveKinematicsConstraint.yml b/subprojects/robotpy-wpimath/semiwrap/controls/DifferentialDriveKinematicsConstraint.yml similarity index 86% rename from subprojects/robotpy-wpimath/gen/controls/DifferentialDriveKinematicsConstraint.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/DifferentialDriveKinematicsConstraint.yml index b795a29b7..16e621bc9 100644 --- a/subprojects/robotpy-wpimath/gen/controls/DifferentialDriveKinematicsConstraint.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/DifferentialDriveKinematicsConstraint.yml @@ -1,9 +1,6 @@ ---- - classes: - DifferentialDriveKinematicsConstraint: + frc::DifferentialDriveKinematicsConstraint: subpackage: constraint - shared_ptr: true typealias: - frc::TrajectoryConstraint::MinMax methods: @@ -11,10 +8,10 @@ classes: MaxVelocity: MinMaxAcceleration: -inline_code: | +inline_code: |- cls_DifferentialDriveKinematicsConstraint .def_static("fromFps", [](const DifferentialDriveKinematics& kinematics, units::feet_per_second_t maxSpeed) { return std::make_shared(kinematics, maxSpeed); }, py::arg("kinematics"), py::arg("maxSpeed")) - ; \ No newline at end of file + ; diff --git a/subprojects/robotpy-wpimath/gen/controls/DifferentialDrivePoseEstimator.yml b/subprojects/robotpy-wpimath/semiwrap/controls/DifferentialDrivePoseEstimator.yml similarity index 98% rename from subprojects/robotpy-wpimath/gen/controls/DifferentialDrivePoseEstimator.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/DifferentialDrivePoseEstimator.yml index 73a4f44f4..5a315318b 100644 --- a/subprojects/robotpy-wpimath/gen/controls/DifferentialDrivePoseEstimator.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/DifferentialDrivePoseEstimator.yml @@ -1,7 +1,6 @@ ---- classes: - DifferentialDrivePoseEstimator: + frc::DifferentialDrivePoseEstimator: subpackage: estimator force_no_trampoline: true doc: | diff --git a/subprojects/robotpy-wpimath/gen/controls/DifferentialDrivePoseEstimator3d.yml b/subprojects/robotpy-wpimath/semiwrap/controls/DifferentialDrivePoseEstimator3d.yml similarity index 92% rename from subprojects/robotpy-wpimath/gen/controls/DifferentialDrivePoseEstimator3d.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/DifferentialDrivePoseEstimator3d.yml index 9cba98539..43bc25b7f 100644 --- a/subprojects/robotpy-wpimath/gen/controls/DifferentialDrivePoseEstimator3d.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/DifferentialDrivePoseEstimator3d.yml @@ -1,7 +1,6 @@ ---- classes: - DifferentialDrivePoseEstimator3d: + frc::DifferentialDrivePoseEstimator3d: subpackage: estimator force_no_trampoline: true methods: diff --git a/subprojects/robotpy-wpimath/gen/controls/DifferentialDriveVoltageConstraint.yml b/subprojects/robotpy-wpimath/semiwrap/controls/DifferentialDriveVoltageConstraint.yml similarity index 64% rename from subprojects/robotpy-wpimath/gen/controls/DifferentialDriveVoltageConstraint.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/DifferentialDriveVoltageConstraint.yml index d802e37ea..08c13f30a 100644 --- a/subprojects/robotpy-wpimath/gen/controls/DifferentialDriveVoltageConstraint.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/DifferentialDriveVoltageConstraint.yml @@ -1,12 +1,9 @@ ---- - classes: - DifferentialDriveVoltageConstraint: + frc::DifferentialDriveVoltageConstraint: subpackage: constraint - shared_ptr: true typealias: - frc::TrajectoryConstraint::MinMax methods: DifferentialDriveVoltageConstraint: MaxVelocity: - MinMaxAcceleration: \ No newline at end of file + MinMaxAcceleration: diff --git a/subprojects/robotpy-wpimath/gen/controls/DifferentialDriveWheelVoltages.yml b/subprojects/robotpy-wpimath/semiwrap/controls/DifferentialDriveWheelVoltages.yml similarity index 91% rename from subprojects/robotpy-wpimath/gen/controls/DifferentialDriveWheelVoltages.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/DifferentialDriveWheelVoltages.yml index 238b882e2..dfa87a8c1 100644 --- a/subprojects/robotpy-wpimath/gen/controls/DifferentialDriveWheelVoltages.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/DifferentialDriveWheelVoltages.yml @@ -1,7 +1,7 @@ --- classes: - DifferentialDriveWheelVoltages: + frc::DifferentialDriveWheelVoltages: subpackage: controller force_no_default_constructor: true attributes: @@ -11,7 +11,7 @@ classes: extra_includes: - wpystruct.h -inline_code: +inline_code: | cls_DifferentialDriveWheelVoltages .def(py::init(), py::arg("left") = 0, py::arg("right") = 0) diff --git a/subprojects/robotpy-wpimath/gen/controls/ElevatorFeedforward.yml b/subprojects/robotpy-wpimath/semiwrap/controls/ElevatorFeedforward.yml similarity index 95% rename from subprojects/robotpy-wpimath/gen/controls/ElevatorFeedforward.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/ElevatorFeedforward.yml index 6e241fcb3..6c82c59c7 100644 --- a/subprojects/robotpy-wpimath/gen/controls/ElevatorFeedforward.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/ElevatorFeedforward.yml @@ -1,7 +1,6 @@ ---- classes: - ElevatorFeedforward: + frc::ElevatorFeedforward: force_type_casters: - units::meters_per_second - meters_per_second_squared @@ -9,7 +8,7 @@ classes: methods: ElevatorFeedforward: overloads: - "": + '': units::volt_t, units::volt_t, units::unit_t, units::unit_t: Calculate: overloads: diff --git a/subprojects/robotpy-wpimath/gen/controls/EllipticalRegionConstraint.yml b/subprojects/robotpy-wpimath/semiwrap/controls/EllipticalRegionConstraint.yml similarity index 89% rename from subprojects/robotpy-wpimath/gen/controls/EllipticalRegionConstraint.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/EllipticalRegionConstraint.yml index b7833d5bf..355d70614 100644 --- a/subprojects/robotpy-wpimath/gen/controls/EllipticalRegionConstraint.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/EllipticalRegionConstraint.yml @@ -1,15 +1,12 @@ ---- - extra_includes: - PyTrajectoryConstraint.h classes: - EllipticalRegionConstraint: - shared_ptr: true + frc::EllipticalRegionConstraint: template_params: - - typename Constraint + - typename Constraint typealias: - - frc::TrajectoryConstraint::MinMax + - frc::TrajectoryConstraint::MinMax methods: EllipticalRegionConstraint: overloads: diff --git a/subprojects/robotpy-wpimath/gen/controls/ExponentialProfile.yml b/subprojects/robotpy-wpimath/semiwrap/controls/ExponentialProfile.yml similarity index 91% rename from subprojects/robotpy-wpimath/gen/controls/ExponentialProfile.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/ExponentialProfile.yml index 0675c656a..aa3c0c47f 100644 --- a/subprojects/robotpy-wpimath/gen/controls/ExponentialProfile.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/ExponentialProfile.yml @@ -1,7 +1,6 @@ ---- classes: - ExponentialProfile: + frc::ExponentialProfile: force_type_casters: - units::meters_per_second_t template_params: @@ -17,7 +16,7 @@ classes: CalculateProfileTiming: overloads: const State&, const State& [const]: - ExponentialProfile::Constraints: + frc::ExponentialProfile::Constraints: attributes: maxInput: A: @@ -38,7 +37,7 @@ classes: return typename frc::ExponentialProfile::Constraints(maxInput, kv, ka); }, py::arg("maxInput"), py::arg("kV"), py::arg("kA")) - ExponentialProfile::State: + frc::ExponentialProfile::State: force_no_default_constructor: true attributes: position: @@ -47,7 +46,7 @@ classes: operator==: inline_code: | .def(py::init()) - ExponentialProfile::ProfileTiming: + frc::ExponentialProfile::ProfileTiming: attributes: inflectionTime: totalTime: diff --git a/subprojects/robotpy-wpimath/gen/controls/ExtendedKalmanFilter.yml b/subprojects/robotpy-wpimath/semiwrap/controls/ExtendedKalmanFilter.yml similarity index 94% rename from subprojects/robotpy-wpimath/gen/controls/ExtendedKalmanFilter.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/ExtendedKalmanFilter.yml index 07a80fb08..9fd84c68e 100644 --- a/subprojects/robotpy-wpimath/gen/controls/ExtendedKalmanFilter.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/ExtendedKalmanFilter.yml @@ -1,8 +1,5 @@ ---- - classes: - ExtendedKalmanFilter: - shared_ptr: true + frc::ExtendedKalmanFilter: template_params: - int States - int Inputs @@ -40,14 +37,12 @@ classes: const InputVector&, const OutputVector&, const Matrixd&: ? const InputVector&, const Vectord&, std::function (const StateVector&, const InputVector&)>, const Matrixd& - : - ignore: true + : ignore: true ? const InputVector&, const Vectord&, std::function (const StateVector&, const InputVector&)>, const Matrixd&, std::function (const Vectord&, const Vectord&)>, std::function - : - ignore: true + : ignore: true templates: @@ -64,7 +59,7 @@ templates: params: - 2 - 1 - - 1 + - 1 ExtendedKalmanFilter_2_1_2: qualname: frc::ExtendedKalmanFilter subpackage: estimator diff --git a/subprojects/robotpy-wpimath/gen/controls/HolonomicDriveController.yml b/subprojects/robotpy-wpimath/semiwrap/controls/HolonomicDriveController.yml similarity index 94% rename from subprojects/robotpy-wpimath/gen/controls/HolonomicDriveController.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/HolonomicDriveController.yml index 7ffa25e59..9bdd570cc 100644 --- a/subprojects/robotpy-wpimath/gen/controls/HolonomicDriveController.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/HolonomicDriveController.yml @@ -1,7 +1,6 @@ ---- classes: - HolonomicDriveController: + frc::HolonomicDriveController: subpackage: controller methods: HolonomicDriveController: diff --git a/subprojects/robotpy-wpimath/gen/controls/ImplicitModelFollower.yml b/subprojects/robotpy-wpimath/semiwrap/controls/ImplicitModelFollower.yml similarity index 86% rename from subprojects/robotpy-wpimath/gen/controls/ImplicitModelFollower.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/ImplicitModelFollower.yml index 4ee51ed02..7ef0a1e89 100644 --- a/subprojects/robotpy-wpimath/gen/controls/ImplicitModelFollower.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/ImplicitModelFollower.yml @@ -1,7 +1,6 @@ ---- classes: - ImplicitModelFollower: + frc::ImplicitModelFollower: template_params: - int States - int Inputs @@ -10,7 +9,9 @@ classes: overloads: const LinearSystem&, const LinearSystem&: ignore: true - const Matrixd&, const Matrixd&, const Matrixd&, const Matrixd&: + ? const Matrixd&, const Matrixd&, const + Matrixd&, const Matrixd& + : U: overloads: '[const]': @@ -46,4 +47,4 @@ templates: subpackage: controller params: - 2 - - 2 \ No newline at end of file + - 2 diff --git a/subprojects/robotpy-wpimath/gen/controls/KalmanFilter.yml b/subprojects/robotpy-wpimath/semiwrap/controls/KalmanFilter.yml similarity index 91% rename from subprojects/robotpy-wpimath/gen/controls/KalmanFilter.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/KalmanFilter.yml index 396cd6f7f..77465a777 100644 --- a/subprojects/robotpy-wpimath/gen/controls/KalmanFilter.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/KalmanFilter.yml @@ -1,8 +1,5 @@ ---- - classes: - KalmanFilter: - shared_ptr: true + frc::KalmanFilter: template_params: - int States - int Inputs @@ -41,14 +38,14 @@ templates: - 1 - 1 - 1 - KalmanFilter_2_1_1: + KalmanFilter_2_1_1: qualname: frc::KalmanFilter subpackage: estimator params: - 2 - 1 - - 1 - KalmanFilter_2_1_2: + - 1 + KalmanFilter_2_1_2: qualname: frc::KalmanFilter subpackage: estimator params: diff --git a/subprojects/robotpy-wpimath/gen/controls/LTVDifferentialDriveController.yml b/subprojects/robotpy-wpimath/semiwrap/controls/LTVDifferentialDriveController.yml similarity index 71% rename from subprojects/robotpy-wpimath/gen/controls/LTVDifferentialDriveController.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/LTVDifferentialDriveController.yml index 3fc7288a5..e06dd06bc 100644 --- a/subprojects/robotpy-wpimath/gen/controls/LTVDifferentialDriveController.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/LTVDifferentialDriveController.yml @@ -1,7 +1,6 @@ ---- classes: - LTVDifferentialDriveController: + frc::LTVDifferentialDriveController: subpackage: controller methods: LTVDifferentialDriveController: @@ -9,7 +8,7 @@ classes: SetTolerance: Calculate: overloads: - ? const Pose2d&, units::meters_per_second_t, units::meters_per_second_t, const Pose2d&, - units::meters_per_second_t, units::meters_per_second_t + ? const Pose2d&, units::meters_per_second_t, units::meters_per_second_t, + const Pose2d&, units::meters_per_second_t, units::meters_per_second_t : const Pose2d&, units::meters_per_second_t, units::meters_per_second_t, const Trajectory::State&: diff --git a/subprojects/robotpy-wpimath/gen/controls/LTVUnicycleController.yml b/subprojects/robotpy-wpimath/semiwrap/controls/LTVUnicycleController.yml similarity index 95% rename from subprojects/robotpy-wpimath/gen/controls/LTVUnicycleController.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/LTVUnicycleController.yml index 4b80b6d43..5b8d084d9 100644 --- a/subprojects/robotpy-wpimath/gen/controls/LTVUnicycleController.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/LTVUnicycleController.yml @@ -1,7 +1,6 @@ ---- classes: - LTVUnicycleController: + frc::LTVUnicycleController: subpackage: controller methods: LTVUnicycleController: diff --git a/subprojects/robotpy-wpimath/gen/controls/LinearPlantInversionFeedforward.yml b/subprojects/robotpy-wpimath/semiwrap/controls/LinearPlantInversionFeedforward.yml similarity index 93% rename from subprojects/robotpy-wpimath/gen/controls/LinearPlantInversionFeedforward.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/LinearPlantInversionFeedforward.yml index ba15bcbd6..6727c54bb 100644 --- a/subprojects/robotpy-wpimath/gen/controls/LinearPlantInversionFeedforward.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/LinearPlantInversionFeedforward.yml @@ -1,8 +1,5 @@ ---- - classes: - LinearPlantInversionFeedforward: - shared_ptr: true + frc::LinearPlantInversionFeedforward: template_params: - int States - int Inputs @@ -23,7 +20,7 @@ classes: Reset: overloads: const StateVector&: - "": + '': Calculate: overloads: const StateVector&: @@ -53,4 +50,4 @@ templates: subpackage: controller params: - 3 - - 2 \ No newline at end of file + - 2 diff --git a/subprojects/robotpy-wpimath/gen/controls/LinearQuadraticRegulator.yml b/subprojects/robotpy-wpimath/semiwrap/controls/LinearQuadraticRegulator.yml similarity index 96% rename from subprojects/robotpy-wpimath/gen/controls/LinearQuadraticRegulator.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/LinearQuadraticRegulator.yml index 1f492cf1f..32477cc8e 100644 --- a/subprojects/robotpy-wpimath/gen/controls/LinearQuadraticRegulator.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/LinearQuadraticRegulator.yml @@ -1,8 +1,5 @@ ---- - classes: - LinearQuadraticRegulator: - shared_ptr: true + frc::LinearQuadraticRegulator: template_params: - int States - int Inputs @@ -38,8 +35,8 @@ classes: const StateVector&, const StateVector&: LatencyCompensate: template_impls: - - ["1"] - - ["2"] + - ['1'] + - ['2'] template_inline_code: | cls_LinearQuadraticRegulator .def(py::init&, const wpi::array&, const wpi::array&, units::second_t>()) diff --git a/subprojects/robotpy-wpimath/gen/controls/LinearSystem.yml b/subprojects/robotpy-wpimath/semiwrap/controls/LinearSystem.yml similarity index 97% rename from subprojects/robotpy-wpimath/gen/controls/LinearSystem.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/LinearSystem.yml index 50133b637..174ec2609 100644 --- a/subprojects/robotpy-wpimath/gen/controls/LinearSystem.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/LinearSystem.yml @@ -1,8 +1,5 @@ ---- - classes: - LinearSystem: - shared_ptr: true + frc::LinearSystem: template_params: - int States - int Inputs @@ -115,4 +112,4 @@ templates: params: - 3 - 2 - - 3 \ No newline at end of file + - 3 diff --git a/subprojects/robotpy-wpimath/gen/controls/LinearSystemId.yml b/subprojects/robotpy-wpimath/semiwrap/controls/LinearSystemId.yml similarity index 99% rename from subprojects/robotpy-wpimath/gen/controls/LinearSystemId.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/LinearSystemId.yml index 4064c75bc..f8b0039c9 100644 --- a/subprojects/robotpy-wpimath/gen/controls/LinearSystemId.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/LinearSystemId.yml @@ -1,7 +1,6 @@ ---- classes: - LinearSystemId: + frc::LinearSystemId: subpackage: plant typealias: - kv_meters = units::unit_t>> diff --git a/subprojects/robotpy-wpimath/gen/controls/LinearSystemLoop.yml b/subprojects/robotpy-wpimath/semiwrap/controls/LinearSystemLoop.yml similarity index 97% rename from subprojects/robotpy-wpimath/gen/controls/LinearSystemLoop.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/LinearSystemLoop.yml index e7f48743c..e3e3a5479 100644 --- a/subprojects/robotpy-wpimath/gen/controls/LinearSystemLoop.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/LinearSystemLoop.yml @@ -1,8 +1,5 @@ ---- - classes: - LinearSystemLoop: - shared_ptr: true + frc::LinearSystemLoop: template_params: - int States - int Inputs @@ -69,7 +66,7 @@ templates: params: - 2 - 1 - - 1 + - 1 LinearSystemLoop_2_1_2: qualname: frc::LinearSystemLoop subpackage: system diff --git a/subprojects/robotpy-wpimath/gen/controls/LinearSystemLoopz.yml b/subprojects/robotpy-wpimath/semiwrap/controls/LinearSystemLoopz.yml similarity index 98% rename from subprojects/robotpy-wpimath/gen/controls/LinearSystemLoopz.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/LinearSystemLoopz.yml index cb0d882b5..e7f72c994 100644 --- a/subprojects/robotpy-wpimath/gen/controls/LinearSystemLoopz.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/LinearSystemLoopz.yml @@ -1,7 +1,6 @@ ---- classes: - LinearSystemLoop: + frc::LinearSystemLoop: methods: LinearSystemLoop: overloads: diff --git a/subprojects/robotpy-wpimath/gen/controls/MaxVelocityConstraint.yml b/subprojects/robotpy-wpimath/semiwrap/controls/MaxVelocityConstraint.yml similarity index 85% rename from subprojects/robotpy-wpimath/gen/controls/MaxVelocityConstraint.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/MaxVelocityConstraint.yml index 50b249c88..24481edd8 100644 --- a/subprojects/robotpy-wpimath/gen/controls/MaxVelocityConstraint.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/MaxVelocityConstraint.yml @@ -1,9 +1,7 @@ ---- classes: - MaxVelocityConstraint: + frc::MaxVelocityConstraint: subpackage: constraint - shared_ptr: true typealias: - frc::TrajectoryConstraint::MinMax methods: @@ -11,9 +9,9 @@ classes: MaxVelocity: MinMaxAcceleration: -inline_code: +inline_code: |- cls_MaxVelocityConstraint .def_static("fromFps", [](units::feet_per_second_t maxVelocity) { return std::make_shared(maxVelocity); }, py::arg("maxVelocity")) - ; \ No newline at end of file + ; diff --git a/subprojects/robotpy-wpimath/gen/controls/MecanumDriveKinematicsConstraint.yml b/subprojects/robotpy-wpimath/semiwrap/controls/MecanumDriveKinematicsConstraint.yml similarity index 86% rename from subprojects/robotpy-wpimath/gen/controls/MecanumDriveKinematicsConstraint.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/MecanumDriveKinematicsConstraint.yml index 3656f477d..810dc900e 100644 --- a/subprojects/robotpy-wpimath/gen/controls/MecanumDriveKinematicsConstraint.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/MecanumDriveKinematicsConstraint.yml @@ -1,9 +1,6 @@ ---- - classes: - MecanumDriveKinematicsConstraint: + frc::MecanumDriveKinematicsConstraint: subpackage: constraint - shared_ptr: true typealias: - frc::TrajectoryConstraint::MinMax methods: @@ -11,10 +8,10 @@ classes: MaxVelocity: MinMaxAcceleration: -inline_code: | +inline_code: |- cls_MecanumDriveKinematicsConstraint .def_static("fromFps", [](const frc::MecanumDriveKinematics& kinematics, units::feet_per_second_t maxSpeed) { return std::make_shared(kinematics, maxSpeed); }, py::arg("kinematics"), py::arg("maxSpeed")) - ; \ No newline at end of file + ; diff --git a/subprojects/robotpy-wpimath/gen/controls/MecanumDrivePoseEstimator.yml b/subprojects/robotpy-wpimath/semiwrap/controls/MecanumDrivePoseEstimator.yml similarity index 98% rename from subprojects/robotpy-wpimath/gen/controls/MecanumDrivePoseEstimator.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/MecanumDrivePoseEstimator.yml index ea2f06ff6..c65ad84d2 100644 --- a/subprojects/robotpy-wpimath/gen/controls/MecanumDrivePoseEstimator.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/MecanumDrivePoseEstimator.yml @@ -1,7 +1,6 @@ ---- classes: - MecanumDrivePoseEstimator: + frc::MecanumDrivePoseEstimator: subpackage: estimator force_no_trampoline: true doc: | diff --git a/subprojects/robotpy-wpimath/gen/controls/MecanumDrivePoseEstimator3d.yml b/subprojects/robotpy-wpimath/semiwrap/controls/MecanumDrivePoseEstimator3d.yml similarity index 92% rename from subprojects/robotpy-wpimath/gen/controls/MecanumDrivePoseEstimator3d.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/MecanumDrivePoseEstimator3d.yml index 26a146099..a7ace2ed1 100644 --- a/subprojects/robotpy-wpimath/gen/controls/MecanumDrivePoseEstimator3d.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/MecanumDrivePoseEstimator3d.yml @@ -1,7 +1,6 @@ ---- classes: - MecanumDrivePoseEstimator3d: + frc::MecanumDrivePoseEstimator3d: subpackage: estimator force_no_trampoline: true methods: diff --git a/subprojects/robotpy-wpimath/gen/controls/PIDController.yml b/subprojects/robotpy-wpimath/semiwrap/controls/PIDController.yml similarity index 97% rename from subprojects/robotpy-wpimath/gen/controls/PIDController.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/PIDController.yml index 85b7809ef..e85682657 100644 --- a/subprojects/robotpy-wpimath/gen/controls/PIDController.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/PIDController.yml @@ -1,7 +1,6 @@ ---- classes: - PIDController: + frc::PIDController: subpackage: controller ignored_bases: - wpi::SendableHelper diff --git a/subprojects/robotpy-wpimath/gen/controls/PoseEstimator.yml b/subprojects/robotpy-wpimath/semiwrap/controls/PoseEstimator.yml similarity index 98% rename from subprojects/robotpy-wpimath/gen/controls/PoseEstimator.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/PoseEstimator.yml index d1adda6eb..a1e9a356a 100644 --- a/subprojects/robotpy-wpimath/gen/controls/PoseEstimator.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/PoseEstimator.yml @@ -1,4 +1,3 @@ ---- extra_includes: - frc/kinematics/DifferentialDriveWheelPositions.h @@ -9,7 +8,7 @@ extra_includes: classes: - PoseEstimator: + frc::PoseEstimator: template_params: - WheelSpeeds - WheelPositions diff --git a/subprojects/robotpy-wpimath/gen/controls/PoseEstimator3d.yml b/subprojects/robotpy-wpimath/semiwrap/controls/PoseEstimator3d.yml similarity index 98% rename from subprojects/robotpy-wpimath/gen/controls/PoseEstimator3d.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/PoseEstimator3d.yml index 638382ac4..739891f6f 100644 --- a/subprojects/robotpy-wpimath/gen/controls/PoseEstimator3d.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/PoseEstimator3d.yml @@ -1,4 +1,3 @@ ---- extra_includes: - frc/kinematics/DifferentialDriveWheelPositions.h @@ -8,7 +7,7 @@ extra_includes: - frc/kinematics/SwerveDriveKinematics.h classes: - PoseEstimator3d: + frc::PoseEstimator3d: template_params: - WheelSpeeds - WheelPositions diff --git a/subprojects/robotpy-wpimath/gen/controls/ProfiledPIDController.yml b/subprojects/robotpy-wpimath/semiwrap/controls/ProfiledPIDController.yml similarity index 95% rename from subprojects/robotpy-wpimath/gen/controls/ProfiledPIDController.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/ProfiledPIDController.yml index 2eb14552c..e352cca71 100644 --- a/subprojects/robotpy-wpimath/gen/controls/ProfiledPIDController.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/ProfiledPIDController.yml @@ -1,4 +1,3 @@ ---- functions: IncrementAndGetProfiledPIDControllerInstances: @@ -6,7 +5,7 @@ functions: ReportProfiledPIDController: ignore: true classes: - ProfiledPIDController: + frc::ProfiledPIDController: force_type_casters: - units::radians_per_second template_params: @@ -73,11 +72,11 @@ templates: subpackage: controller qualname: frc::ProfiledPIDController params: - - units::dimensionless::scalar - + - units::dimensionless::scalar + # needed for HolonomicDriveController ProfiledPIDControllerRadians: subpackage: controller qualname: frc::ProfiledPIDController params: - - units::radian \ No newline at end of file + - units::radian diff --git a/subprojects/robotpy-wpimath/gen/controls/RamseteController.yml b/subprojects/robotpy-wpimath/semiwrap/controls/RamseteController.yml similarity index 94% rename from subprojects/robotpy-wpimath/gen/controls/RamseteController.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/RamseteController.yml index 5ab22708b..69d1f3d9c 100644 --- a/subprojects/robotpy-wpimath/gen/controls/RamseteController.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/RamseteController.yml @@ -1,7 +1,6 @@ ---- classes: - RamseteController: + frc::RamseteController: subpackage: controller methods: RamseteController: @@ -13,7 +12,7 @@ classes: units::unit_t{b}, units::unit_t{zeta}); } - "": + '': AtReference: SetTolerance: Calculate: diff --git a/subprojects/robotpy-wpimath/gen/controls/RectangularRegionConstraint.yml b/subprojects/robotpy-wpimath/semiwrap/controls/RectangularRegionConstraint.yml similarity index 80% rename from subprojects/robotpy-wpimath/gen/controls/RectangularRegionConstraint.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/RectangularRegionConstraint.yml index 772fee9d5..fe8167add 100644 --- a/subprojects/robotpy-wpimath/gen/controls/RectangularRegionConstraint.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/RectangularRegionConstraint.yml @@ -1,15 +1,12 @@ ---- - extra_includes: - PyTrajectoryConstraint.h classes: - RectangularRegionConstraint: - shared_ptr: true + frc::RectangularRegionConstraint: template_params: - - typename Constraint + - typename Constraint typealias: - - frc::TrajectoryConstraint::MinMax + - frc::TrajectoryConstraint::MinMax methods: RectangularRegionConstraint: overloads: diff --git a/subprojects/robotpy-wpimath/gen/controls/SimpleMotorFeedforward.yml b/subprojects/robotpy-wpimath/semiwrap/controls/SimpleMotorFeedforward.yml similarity index 94% rename from subprojects/robotpy-wpimath/gen/controls/SimpleMotorFeedforward.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/SimpleMotorFeedforward.yml index 890198b7a..0a79c8b6d 100644 --- a/subprojects/robotpy-wpimath/gen/controls/SimpleMotorFeedforward.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/SimpleMotorFeedforward.yml @@ -1,11 +1,8 @@ ---- - extra_includes: - units/dimensionless.h classes: - SimpleMotorFeedforward: - shared_ptr: true + frc::SimpleMotorFeedforward: force_type_casters: - units::meters_per_second - units::meters_per_second_squared @@ -50,10 +47,10 @@ templates: qualname: frc::SimpleMotorFeedforward subpackage: controller params: - - units::meter + - units::meter SimpleMotorFeedforwardRadians: qualname: frc::SimpleMotorFeedforward subpackage: controller params: - - units::radian + - units::radian diff --git a/subprojects/robotpy-wpimath/gen/controls/SimulatedAnnealing.yml b/subprojects/robotpy-wpimath/semiwrap/controls/SimulatedAnnealing.yml similarity index 80% rename from subprojects/robotpy-wpimath/gen/controls/SimulatedAnnealing.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/SimulatedAnnealing.yml index 184d23542..398312cfd 100644 --- a/subprojects/robotpy-wpimath/gen/controls/SimulatedAnnealing.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/SimulatedAnnealing.yml @@ -1,10 +1,9 @@ ---- extra_includes: - gilsafe_object.h classes: - SimulatedAnnealing: + frc::SimulatedAnnealing: template_params: - State methods: @@ -16,4 +15,4 @@ templates: qualname: frc::SimulatedAnnealing subpackage: optimization params: - - rpy::gilsafe_object + - semiwrap::gilsafe_object diff --git a/subprojects/robotpy-wpimath/gen/controls/SwerveDriveKinematicsConstraint.yml b/subprojects/robotpy-wpimath/semiwrap/controls/SwerveDriveKinematicsConstraint.yml similarity index 94% rename from subprojects/robotpy-wpimath/gen/controls/SwerveDriveKinematicsConstraint.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/SwerveDriveKinematicsConstraint.yml index c0864edcc..8f08b4bfc 100644 --- a/subprojects/robotpy-wpimath/gen/controls/SwerveDriveKinematicsConstraint.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/SwerveDriveKinematicsConstraint.yml @@ -1,8 +1,5 @@ ---- - classes: - SwerveDriveKinematicsConstraint: - shared_ptr: true + frc::SwerveDriveKinematicsConstraint: template_params: - size_t NumModules typealias: diff --git a/subprojects/robotpy-wpimath/gen/controls/SwerveDrivePoseEstimator.yml b/subprojects/robotpy-wpimath/semiwrap/controls/SwerveDrivePoseEstimator.yml similarity index 96% rename from subprojects/robotpy-wpimath/gen/controls/SwerveDrivePoseEstimator.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/SwerveDrivePoseEstimator.yml index ca55e09e9..c93e32d4a 100644 --- a/subprojects/robotpy-wpimath/gen/controls/SwerveDrivePoseEstimator.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/SwerveDrivePoseEstimator.yml @@ -1,10 +1,9 @@ ---- extra_includes: -- "frc/kinematics/SwerveModuleState.h" +- frc/kinematics/SwerveModuleState.h classes: - SwerveDrivePoseEstimator: + frc::SwerveDrivePoseEstimator: force_no_trampoline: true doc: | This class wraps Swerve Drive Odometry to fuse latency-compensated diff --git a/subprojects/robotpy-wpimath/gen/controls/SwerveDrivePoseEstimator3d.yml b/subprojects/robotpy-wpimath/semiwrap/controls/SwerveDrivePoseEstimator3d.yml similarity index 93% rename from subprojects/robotpy-wpimath/gen/controls/SwerveDrivePoseEstimator3d.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/SwerveDrivePoseEstimator3d.yml index 1bfee11f8..08633cff9 100644 --- a/subprojects/robotpy-wpimath/gen/controls/SwerveDrivePoseEstimator3d.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/SwerveDrivePoseEstimator3d.yml @@ -1,10 +1,9 @@ ---- extra_includes: -- "frc/kinematics/SwerveModuleState.h" +- frc/kinematics/SwerveModuleState.h classes: - SwerveDrivePoseEstimator3d: + frc::SwerveDrivePoseEstimator3d: force_no_trampoline: true template_params: - size_t NumModules diff --git a/subprojects/robotpy-wpimath/gen/controls/Trajectory.yml b/subprojects/robotpy-wpimath/semiwrap/controls/Trajectory.yml similarity index 93% rename from subprojects/robotpy-wpimath/gen/controls/Trajectory.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/Trajectory.yml index f0d8cf341..0f390a54a 100644 --- a/subprojects/robotpy-wpimath/gen/controls/Trajectory.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/Trajectory.yml @@ -1,6 +1,5 @@ ---- extra_includes: - - rpy/geometryToString.h +- rpy/geometryToString.h functions: to_json: @@ -8,15 +7,14 @@ functions: from_json: ignore: true classes: - Trajectory: + frc::Trajectory: subpackage: trajectory - shared_ptr: true force_type_casters: - units::curvature_t methods: Trajectory: overloads: - "": + '': const std::vector&: TotalTime: States: @@ -27,9 +25,8 @@ classes: operator+: operator==: operator!=: - Trajectory::State: + frc::Trajectory::State: force_no_default_constructor: true - shared_ptr: false attributes: t: velocity: diff --git a/subprojects/robotpy-wpimath/gen/controls/TrajectoryConfig.yml b/subprojects/robotpy-wpimath/semiwrap/controls/TrajectoryConfig.yml similarity index 97% rename from subprojects/robotpy-wpimath/gen/controls/TrajectoryConfig.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/TrajectoryConfig.yml index 60ef7f963..d543b842b 100644 --- a/subprojects/robotpy-wpimath/gen/controls/TrajectoryConfig.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/TrajectoryConfig.yml @@ -1,12 +1,9 @@ ---- - extra_includes: - PyTrajectoryConstraint.h classes: - TrajectoryConfig: + frc::TrajectoryConfig: subpackage: trajectory - shared_ptr: true methods: TrajectoryConfig: SetStartVelocity: @@ -29,7 +26,7 @@ classes: ignore: true # seems hard, let me know if you need it IsReversed: -inline_code: | +inline_code: |- cls_TrajectoryConfig .def_static("fromFps", [](units::feet_per_second_t maxVelocity, units::feet_per_second_squared_t maxAcceleration) { return std::make_shared(maxVelocity, maxAcceleration); @@ -72,4 +69,4 @@ inline_code: | "\n" ":param kinematics: The swerve drive kinematics.") ) - ; \ No newline at end of file + ; diff --git a/subprojects/robotpy-wpimath/gen/controls/TrajectoryConstraint.yml b/subprojects/robotpy-wpimath/semiwrap/controls/TrajectoryConstraint.yml similarity index 89% rename from subprojects/robotpy-wpimath/gen/controls/TrajectoryConstraint.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/TrajectoryConstraint.yml index 32aa01fed..8c912dbea 100644 --- a/subprojects/robotpy-wpimath/gen/controls/TrajectoryConstraint.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/TrajectoryConstraint.yml @@ -1,17 +1,13 @@ ---- - classes: - TrajectoryConstraint: + frc::TrajectoryConstraint: subpackage: constraint - shared_ptr: true force_type_casters: - - units::meters_per_second_squared + - units::meters_per_second_squared methods: TrajectoryConstraint: MaxVelocity: MinMaxAcceleration: - TrajectoryConstraint::MinMax: - shared_ptr: false + frc::TrajectoryConstraint::MinMax: attributes: minAcceleration: maxAcceleration: diff --git a/subprojects/robotpy-wpimath/gen/controls/TrajectoryGenerator.yml b/subprojects/robotpy-wpimath/semiwrap/controls/TrajectoryGenerator.yml similarity index 93% rename from subprojects/robotpy-wpimath/gen/controls/TrajectoryGenerator.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/TrajectoryGenerator.yml index 9cc1d923c..f454754ce 100644 --- a/subprojects/robotpy-wpimath/gen/controls/TrajectoryGenerator.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/TrajectoryGenerator.yml @@ -1,13 +1,10 @@ ---- - extra_includes: - frc/spline/CubicHermiteSpline.h - frc/spline/QuinticHermiteSpline.h classes: - TrajectoryGenerator: + frc::TrajectoryGenerator: subpackage: trajectory - shared_ptr: true force_type_casters: - units::unit_t - units::curvature_t diff --git a/subprojects/robotpy-wpimath/gen/controls/TrajectoryParameterizer.yml b/subprojects/robotpy-wpimath/semiwrap/controls/TrajectoryParameterizer.yml similarity index 74% rename from subprojects/robotpy-wpimath/gen/controls/TrajectoryParameterizer.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/TrajectoryParameterizer.yml index e3b3cf815..62c484a70 100644 --- a/subprojects/robotpy-wpimath/gen/controls/TrajectoryParameterizer.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/TrajectoryParameterizer.yml @@ -1,9 +1,6 @@ ---- - classes: - TrajectoryParameterizer: + frc::TrajectoryParameterizer: subpackage: trajectory - shared_ptr: true force_type_casters: - units::unit_t - units::curvature_t diff --git a/subprojects/robotpy-wpimath/gen/controls/TrajectoryUtil.yml b/subprojects/robotpy-wpimath/semiwrap/controls/TrajectoryUtil.yml similarity index 77% rename from subprojects/robotpy-wpimath/gen/controls/TrajectoryUtil.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/TrajectoryUtil.yml index e8c8a2d11..063b37a07 100644 --- a/subprojects/robotpy-wpimath/gen/controls/TrajectoryUtil.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/TrajectoryUtil.yml @@ -1,9 +1,6 @@ ---- - classes: - TrajectoryUtil: + frc::TrajectoryUtil: subpackage: trajectory - shared_ptr: true methods: ToPathweaverJson: FromPathweaverJson: diff --git a/subprojects/robotpy-wpimath/gen/controls/TrapezoidProfile.yml b/subprojects/robotpy-wpimath/semiwrap/controls/TrapezoidProfile.yml similarity index 92% rename from subprojects/robotpy-wpimath/gen/controls/TrapezoidProfile.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/TrapezoidProfile.yml index f8a75ff3a..3d70fcebe 100644 --- a/subprojects/robotpy-wpimath/gen/controls/TrapezoidProfile.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/TrapezoidProfile.yml @@ -1,8 +1,5 @@ ---- - classes: - TrapezoidProfile: - shared_ptr: false + frc::TrapezoidProfile: force_type_casters: - units::second_t - units::radians_per_second @@ -63,24 +60,23 @@ classes: "velocity=" + std::to_string(self.velocity()) + ")"; }); } - TrapezoidProfile::Constraints: - shared_ptr: false + frc::TrapezoidProfile::Constraints: attributes: maxVelocity: maxAcceleration: methods: Constraints: overloads: - "": + '': ignore: true Velocity_t, Acceleration_t: param_override: maxVelocity_: name: maxVelocity - default: "0" + default: '0' maxAcceleration_: name: maxAcceleration - default: "0" + default: '0' template_inline_code: | { std::string clsNameCopy = clsName; @@ -92,9 +88,8 @@ classes: "maxAcceleration=" + std::to_string(self.maxAcceleration()) + ")"; }); } - TrapezoidProfile::State: + frc::TrapezoidProfile::State: force_no_default_constructor: true - shared_ptr: false attributes: position: velocity: @@ -109,11 +104,11 @@ templates: subpackage: trajectory qualname: frc::TrapezoidProfile params: - - units::dimensionless::scalar + - units::dimensionless::scalar # needed for HolonomicDriveController TrapezoidProfileRadians: subpackage: trajectory qualname: frc::TrapezoidProfile params: - - units::radian + - units::radian diff --git a/subprojects/robotpy-wpimath/gen/controls/TravelingSalesman.yml b/subprojects/robotpy-wpimath/semiwrap/controls/TravelingSalesman.yml similarity index 91% rename from subprojects/robotpy-wpimath/gen/controls/TravelingSalesman.yml rename to subprojects/robotpy-wpimath/semiwrap/controls/TravelingSalesman.yml index f50c9d031..2dad791fd 100644 --- a/subprojects/robotpy-wpimath/gen/controls/TravelingSalesman.yml +++ b/subprojects/robotpy-wpimath/semiwrap/controls/TravelingSalesman.yml @@ -1,7 +1,6 @@ ---- classes: - TravelingSalesman: + frc::TravelingSalesman: subpackage: path methods: TravelingSalesman: diff --git a/subprojects/robotpy-wpimath/gen/filter/Debouncer.yml b/subprojects/robotpy-wpimath/semiwrap/filter/Debouncer.yml similarity index 91% rename from subprojects/robotpy-wpimath/gen/filter/Debouncer.yml rename to subprojects/robotpy-wpimath/semiwrap/filter/Debouncer.yml index 674a3155a..33737da99 100644 --- a/subprojects/robotpy-wpimath/gen/filter/Debouncer.yml +++ b/subprojects/robotpy-wpimath/semiwrap/filter/Debouncer.yml @@ -1,7 +1,6 @@ ---- classes: - Debouncer: + frc::Debouncer: enums: DebounceType: methods: diff --git a/subprojects/robotpy-wpimath/gen/filter/LinearFilter.yml b/subprojects/robotpy-wpimath/semiwrap/filter/LinearFilter.yml similarity index 92% rename from subprojects/robotpy-wpimath/gen/filter/LinearFilter.yml rename to subprojects/robotpy-wpimath/semiwrap/filter/LinearFilter.yml index ea2c7b57f..98b044af4 100644 --- a/subprojects/robotpy-wpimath/gen/filter/LinearFilter.yml +++ b/subprojects/robotpy-wpimath/semiwrap/filter/LinearFilter.yml @@ -1,8 +1,5 @@ ---- - classes: - LinearFilter: - shared_ptr: true + frc::LinearFilter: template_params: - T methods: @@ -16,7 +13,7 @@ classes: MovingAverage: Reset: overloads: - "": + '': std::span, std::span: Calculate: LastValue: diff --git a/subprojects/robotpy-wpimath/gen/filter/MedianFilter.yml b/subprojects/robotpy-wpimath/semiwrap/filter/MedianFilter.yml similarity index 77% rename from subprojects/robotpy-wpimath/gen/filter/MedianFilter.yml rename to subprojects/robotpy-wpimath/semiwrap/filter/MedianFilter.yml index 995d0fa36..28f21609f 100644 --- a/subprojects/robotpy-wpimath/gen/filter/MedianFilter.yml +++ b/subprojects/robotpy-wpimath/semiwrap/filter/MedianFilter.yml @@ -1,8 +1,5 @@ ---- - classes: - MedianFilter: - shared_ptr: true + frc::MedianFilter: template_params: - T methods: @@ -15,4 +12,4 @@ templates: MedianFilter: qualname: frc::MedianFilter params: - - double \ No newline at end of file + - double diff --git a/subprojects/robotpy-wpimath/gen/filter/SlewRateLimiter.yml b/subprojects/robotpy-wpimath/semiwrap/filter/SlewRateLimiter.yml similarity index 87% rename from subprojects/robotpy-wpimath/gen/filter/SlewRateLimiter.yml rename to subprojects/robotpy-wpimath/semiwrap/filter/SlewRateLimiter.yml index 0e1c5510e..d55412762 100644 --- a/subprojects/robotpy-wpimath/gen/filter/SlewRateLimiter.yml +++ b/subprojects/robotpy-wpimath/semiwrap/filter/SlewRateLimiter.yml @@ -1,7 +1,6 @@ ---- classes: - SlewRateLimiter: + frc::SlewRateLimiter: template_params: - Unit typealias: @@ -21,4 +20,4 @@ templates: SlewRateLimiter: qualname: frc::SlewRateLimiter params: - - units::dimensionless::scalar \ No newline at end of file + - units::dimensionless::scalar diff --git a/subprojects/robotpy-wpimath/gen/geometry/CoordinateAxis.yml b/subprojects/robotpy-wpimath/semiwrap/geometry/CoordinateAxis.yml similarity index 81% rename from subprojects/robotpy-wpimath/gen/geometry/CoordinateAxis.yml rename to subprojects/robotpy-wpimath/semiwrap/geometry/CoordinateAxis.yml index eb0bc1044..eecfee653 100644 --- a/subprojects/robotpy-wpimath/gen/geometry/CoordinateAxis.yml +++ b/subprojects/robotpy-wpimath/semiwrap/geometry/CoordinateAxis.yml @@ -1,7 +1,6 @@ ---- classes: - CoordinateAxis: + frc::CoordinateAxis: methods: CoordinateAxis: N: diff --git a/subprojects/robotpy-wpimath/gen/geometry/CoordinateSystem.yml b/subprojects/robotpy-wpimath/semiwrap/geometry/CoordinateSystem.yml similarity index 94% rename from subprojects/robotpy-wpimath/gen/geometry/CoordinateSystem.yml rename to subprojects/robotpy-wpimath/semiwrap/geometry/CoordinateSystem.yml index e3618a7ad..baeb41f52 100644 --- a/subprojects/robotpy-wpimath/gen/geometry/CoordinateSystem.yml +++ b/subprojects/robotpy-wpimath/semiwrap/geometry/CoordinateSystem.yml @@ -1,7 +1,6 @@ ---- classes: - CoordinateSystem: + frc::CoordinateSystem: methods: CoordinateSystem: NWU: diff --git a/subprojects/robotpy-wpimath/gen/geometry/Ellipse2d.yml b/subprojects/robotpy-wpimath/semiwrap/geometry/Ellipse2d.yml similarity index 90% rename from subprojects/robotpy-wpimath/gen/geometry/Ellipse2d.yml rename to subprojects/robotpy-wpimath/semiwrap/geometry/Ellipse2d.yml index c612aef05..8aa8bf674 100644 --- a/subprojects/robotpy-wpimath/gen/geometry/Ellipse2d.yml +++ b/subprojects/robotpy-wpimath/semiwrap/geometry/Ellipse2d.yml @@ -1,11 +1,10 @@ ---- extra_includes: - - rpy/geometryToString.h - - wpystruct.h +- rpy/geometryToString.h +- wpystruct.h classes: - Ellipse2d: + frc::Ellipse2d: force_type_casters: - units::foot_t - units::meter_t @@ -29,7 +28,7 @@ classes: FindNearestPoint: operator==: -inline_code: | +inline_code: |- cls_Ellipse2d .def_static("fromFeet", [](const Pose2d& center, units::foot_t xSemiAxis, units::foot_t ySemiAxis) { return std::make_unique(center, xSemiAxis, ySemiAxis); @@ -45,4 +44,4 @@ inline_code: | .def("__repr__", py::overload_cast(&rpy::toString)); - SetupWPyStruct(cls_Ellipse2d); \ No newline at end of file + SetupWPyStruct(cls_Ellipse2d); diff --git a/subprojects/robotpy-wpimath/gen/geometry/Pose2d.yml b/subprojects/robotpy-wpimath/semiwrap/geometry/Pose2d.yml similarity index 95% rename from subprojects/robotpy-wpimath/gen/geometry/Pose2d.yml rename to subprojects/robotpy-wpimath/semiwrap/geometry/Pose2d.yml index 30d5f32d2..946646720 100644 --- a/subprojects/robotpy-wpimath/gen/geometry/Pose2d.yml +++ b/subprojects/robotpy-wpimath/semiwrap/geometry/Pose2d.yml @@ -1,7 +1,6 @@ ---- extra_includes: - - rpy/geometryToString.h - - wpystruct.h +- rpy/geometryToString.h +- wpystruct.h functions: to_json: @@ -9,8 +8,7 @@ functions: from_json: ignore: true classes: - Pose2d: - shared_ptr: false + frc::Pose2d: force_type_casters: - units::foot_t - units::meter_t diff --git a/subprojects/robotpy-wpimath/gen/geometry/Pose3d.yml b/subprojects/robotpy-wpimath/semiwrap/geometry/Pose3d.yml similarity index 95% rename from subprojects/robotpy-wpimath/gen/geometry/Pose3d.yml rename to subprojects/robotpy-wpimath/semiwrap/geometry/Pose3d.yml index 5b2c0120f..b9d90bd17 100644 --- a/subprojects/robotpy-wpimath/gen/geometry/Pose3d.yml +++ b/subprojects/robotpy-wpimath/semiwrap/geometry/Pose3d.yml @@ -1,7 +1,6 @@ ---- extra_includes: - - rpy/geometryToString.h - - wpystruct.h +- rpy/geometryToString.h +- wpystruct.h functions: to_json: @@ -14,8 +13,7 @@ functions: ignore: true const Eigen::Vector3d&: classes: - Pose3d: - shared_ptr: false + frc::Pose3d: methods: Pose3d: overloads: diff --git a/subprojects/robotpy-wpimath/gen/geometry/Quaternion.yml b/subprojects/robotpy-wpimath/semiwrap/geometry/Quaternion.yml similarity index 91% rename from subprojects/robotpy-wpimath/gen/geometry/Quaternion.yml rename to subprojects/robotpy-wpimath/semiwrap/geometry/Quaternion.yml index a38547804..799842eaa 100644 --- a/subprojects/robotpy-wpimath/gen/geometry/Quaternion.yml +++ b/subprojects/robotpy-wpimath/semiwrap/geometry/Quaternion.yml @@ -1,7 +1,6 @@ ---- extra_includes: - - rpy/geometryToString.h - - wpystruct.h +- rpy/geometryToString.h +- wpystruct.h functions: to_json: @@ -9,8 +8,7 @@ functions: from_json: ignore: true classes: - Quaternion: - shared_ptr: false + frc::Quaternion: methods: Quaternion: overloads: diff --git a/subprojects/robotpy-wpimath/gen/geometry/Rectangle2d.yml b/subprojects/robotpy-wpimath/semiwrap/geometry/Rectangle2d.yml similarity index 90% rename from subprojects/robotpy-wpimath/gen/geometry/Rectangle2d.yml rename to subprojects/robotpy-wpimath/semiwrap/geometry/Rectangle2d.yml index 319767d7b..4a2b9aa5c 100644 --- a/subprojects/robotpy-wpimath/gen/geometry/Rectangle2d.yml +++ b/subprojects/robotpy-wpimath/semiwrap/geometry/Rectangle2d.yml @@ -1,11 +1,10 @@ ---- extra_includes: - - rpy/geometryToString.h - - wpystruct.h +- rpy/geometryToString.h +- wpystruct.h classes: - Rectangle2d: + frc::Rectangle2d: force_type_casters: - units::foot_t - units::meter_t @@ -28,7 +27,7 @@ classes: FindNearestPoint: operator==: -inline_code: | +inline_code: |- cls_Rectangle2d .def_static("fromFeet", [](const Pose2d& center, units::foot_t xWidth, units::foot_t yWidth) { return std::make_unique(center, xWidth, yWidth); @@ -44,4 +43,4 @@ inline_code: | .def("__repr__", py::overload_cast(&rpy::toString)); - SetupWPyStruct(cls_Rectangle2d); \ No newline at end of file + SetupWPyStruct(cls_Rectangle2d); diff --git a/subprojects/robotpy-wpimath/gen/geometry/Rotation2d.yml b/subprojects/robotpy-wpimath/semiwrap/geometry/Rotation2d.yml similarity index 88% rename from subprojects/robotpy-wpimath/gen/geometry/Rotation2d.yml rename to subprojects/robotpy-wpimath/semiwrap/geometry/Rotation2d.yml index 12362c7f7..9be96c2dc 100644 --- a/subprojects/robotpy-wpimath/gen/geometry/Rotation2d.yml +++ b/subprojects/robotpy-wpimath/semiwrap/geometry/Rotation2d.yml @@ -1,7 +1,6 @@ ---- extra_includes: - - rpy/geometryToString.h - - wpystruct.h +- rpy/geometryToString.h +- wpystruct.h functions: to_json: @@ -9,8 +8,7 @@ functions: from_json: ignore: true classes: - Rotation2d: - shared_ptr: false + frc::Rotation2d: methods: Rotation2d: overloads: @@ -21,9 +19,9 @@ classes: :param value: The value of the angle in radians. param_override: value: - x_type: 'units::radian_t' + x_type: units::radian_t template_impls: - - ['units::radian_t'] + - [units::radian_t] double, double: const Eigen::Matrix2d&: rename: fromMatrix diff --git a/subprojects/robotpy-wpimath/gen/geometry/Rotation3d.yml b/subprojects/robotpy-wpimath/semiwrap/geometry/Rotation3d.yml similarity index 95% rename from subprojects/robotpy-wpimath/gen/geometry/Rotation3d.yml rename to subprojects/robotpy-wpimath/semiwrap/geometry/Rotation3d.yml index 99342e225..788f408f3 100644 --- a/subprojects/robotpy-wpimath/gen/geometry/Rotation3d.yml +++ b/subprojects/robotpy-wpimath/semiwrap/geometry/Rotation3d.yml @@ -1,7 +1,6 @@ ---- extra_includes: - - rpy/geometryToString.h - - wpystruct.h +- rpy/geometryToString.h +- wpystruct.h functions: to_json: @@ -9,8 +8,7 @@ functions: from_json: ignore: true classes: - Rotation3d: - shared_ptr: false + frc::Rotation3d: methods: Rotation3d: overloads: diff --git a/subprojects/robotpy-wpimath/gen/geometry/Transform2d.yml b/subprojects/robotpy-wpimath/semiwrap/geometry/Transform2d.yml similarity index 97% rename from subprojects/robotpy-wpimath/gen/geometry/Transform2d.yml rename to subprojects/robotpy-wpimath/semiwrap/geometry/Transform2d.yml index 0f7961dcd..3b2543a07 100644 --- a/subprojects/robotpy-wpimath/gen/geometry/Transform2d.yml +++ b/subprojects/robotpy-wpimath/semiwrap/geometry/Transform2d.yml @@ -1,13 +1,10 @@ ---- - extra_includes: - frc/geometry/Pose2d.h - rpy/geometryToString.h - wpystruct.h classes: - Transform2d: - shared_ptr: false + frc::Transform2d: force_type_casters: - units::foot_t - units::meter_t diff --git a/subprojects/robotpy-wpimath/gen/geometry/Transform3d.yml b/subprojects/robotpy-wpimath/semiwrap/geometry/Transform3d.yml similarity index 94% rename from subprojects/robotpy-wpimath/gen/geometry/Transform3d.yml rename to subprojects/robotpy-wpimath/semiwrap/geometry/Transform3d.yml index 974ba98bd..5c7f60c29 100644 --- a/subprojects/robotpy-wpimath/gen/geometry/Transform3d.yml +++ b/subprojects/robotpy-wpimath/semiwrap/geometry/Transform3d.yml @@ -1,7 +1,6 @@ ---- extra_includes: - - rpy/geometryToString.h - - wpystruct.h +- rpy/geometryToString.h +- wpystruct.h functions: to_json: @@ -9,8 +8,7 @@ functions: from_json: ignore: true classes: - Transform3d: - shared_ptr: false + frc::Transform3d: methods: Transform3d: overloads: diff --git a/subprojects/robotpy-wpimath/gen/geometry/Translation2d.yml b/subprojects/robotpy-wpimath/semiwrap/geometry/Translation2d.yml similarity index 95% rename from subprojects/robotpy-wpimath/gen/geometry/Translation2d.yml rename to subprojects/robotpy-wpimath/semiwrap/geometry/Translation2d.yml index 7a9202fb0..a7631296b 100644 --- a/subprojects/robotpy-wpimath/gen/geometry/Translation2d.yml +++ b/subprojects/robotpy-wpimath/semiwrap/geometry/Translation2d.yml @@ -1,8 +1,7 @@ ---- extra_includes: - - rpy/geometryToString.h - - wpystruct.h - - pybind11/eigen.h +- rpy/geometryToString.h +- wpystruct.h +- pybind11/eigen.h functions: to_json: @@ -10,8 +9,7 @@ functions: from_json: ignore: true classes: - Translation2d: - shared_ptr: false + frc::Translation2d: methods: Translation2d: overloads: diff --git a/subprojects/robotpy-wpimath/gen/geometry/Translation3d.yml b/subprojects/robotpy-wpimath/semiwrap/geometry/Translation3d.yml similarity index 93% rename from subprojects/robotpy-wpimath/gen/geometry/Translation3d.yml rename to subprojects/robotpy-wpimath/semiwrap/geometry/Translation3d.yml index 7f06cd92b..4c4348122 100644 --- a/subprojects/robotpy-wpimath/gen/geometry/Translation3d.yml +++ b/subprojects/robotpy-wpimath/semiwrap/geometry/Translation3d.yml @@ -1,8 +1,7 @@ ---- extra_includes: - - rpy/geometryToString.h - - wpystruct.h - - pybind11/eigen.h +- rpy/geometryToString.h +- wpystruct.h +- pybind11/eigen.h functions: to_json: @@ -10,14 +9,13 @@ functions: from_json: ignore: true classes: - Translation3d: - shared_ptr: false + frc::Translation3d: methods: Translation3d: overloads: '': units::meter_t, units::meter_t, units::meter_t: - units::meter_t, const Rotation3d& : + units::meter_t, const Rotation3d&: const Eigen::Vector3d&: const Translation2d&: Distance: diff --git a/subprojects/robotpy-wpimath/gen/geometry/Twist2d.yml b/subprojects/robotpy-wpimath/semiwrap/geometry/Twist2d.yml similarity index 97% rename from subprojects/robotpy-wpimath/gen/geometry/Twist2d.yml rename to subprojects/robotpy-wpimath/semiwrap/geometry/Twist2d.yml index 00f4e6287..bcbcba0b5 100644 --- a/subprojects/robotpy-wpimath/gen/geometry/Twist2d.yml +++ b/subprojects/robotpy-wpimath/semiwrap/geometry/Twist2d.yml @@ -1,12 +1,9 @@ ---- - extra_includes: - wpystruct.h classes: - Twist2d: + frc::Twist2d: force_no_default_constructor: true - shared_ptr: false attributes: dx: dy: @@ -15,7 +12,6 @@ classes: operator==: operator!=: operator*: - inline_code: | cls_Twist2d diff --git a/subprojects/robotpy-wpimath/gen/geometry/Twist3d.yml b/subprojects/robotpy-wpimath/semiwrap/geometry/Twist3d.yml similarity index 95% rename from subprojects/robotpy-wpimath/gen/geometry/Twist3d.yml rename to subprojects/robotpy-wpimath/semiwrap/geometry/Twist3d.yml index 82c09de17..9a44bf55b 100644 --- a/subprojects/robotpy-wpimath/gen/geometry/Twist3d.yml +++ b/subprojects/robotpy-wpimath/semiwrap/geometry/Twist3d.yml @@ -1,12 +1,9 @@ ---- - extra_includes: - - wpystruct.h +- wpystruct.h classes: - Twist3d: + frc::Twist3d: force_no_default_constructor: true - shared_ptr: false attributes: dx: dy: @@ -19,7 +16,7 @@ classes: operator!=: operator*: -inline_code: | +inline_code: |- cls_Twist3d .def( py::init(cls_Twist3d); \ No newline at end of file + SetupWPyStruct(cls_Twist3d); diff --git a/subprojects/robotpy-wpimath/gen/interpolation/TimeInterpolatableBuffer.yml b/subprojects/robotpy-wpimath/semiwrap/interpolation/TimeInterpolatableBuffer.yml similarity index 97% rename from subprojects/robotpy-wpimath/gen/interpolation/TimeInterpolatableBuffer.yml rename to subprojects/robotpy-wpimath/semiwrap/interpolation/TimeInterpolatableBuffer.yml index f59369fc5..3c88be2f6 100644 --- a/subprojects/robotpy-wpimath/gen/interpolation/TimeInterpolatableBuffer.yml +++ b/subprojects/robotpy-wpimath/semiwrap/interpolation/TimeInterpolatableBuffer.yml @@ -6,7 +6,7 @@ functions: TimeInterpolatableBuffer: ignore: true # constructor specialization classes: - TimeInterpolatableBuffer: + frc::TimeInterpolatableBuffer: template_params: - T methods: diff --git a/subprojects/robotpy-wpimath/gen/kinematics/ChassisSpeeds.yml b/subprojects/robotpy-wpimath/semiwrap/kinematics/ChassisSpeeds.yml similarity index 98% rename from subprojects/robotpy-wpimath/gen/kinematics/ChassisSpeeds.yml rename to subprojects/robotpy-wpimath/semiwrap/kinematics/ChassisSpeeds.yml index d2f6c7396..4d94b3e14 100644 --- a/subprojects/robotpy-wpimath/gen/kinematics/ChassisSpeeds.yml +++ b/subprojects/robotpy-wpimath/semiwrap/kinematics/ChassisSpeeds.yml @@ -1,12 +1,9 @@ ---- - extra_includes: - wpystruct.h classes: - ChassisSpeeds: + frc::ChassisSpeeds: force_no_default_constructor: true - shared_ptr: false attributes: vx: vy: diff --git a/subprojects/robotpy-wpimath/gen/kinematics/DifferentialDriveKinematics.yml b/subprojects/robotpy-wpimath/semiwrap/kinematics/DifferentialDriveKinematics.yml similarity index 93% rename from subprojects/robotpy-wpimath/gen/kinematics/DifferentialDriveKinematics.yml rename to subprojects/robotpy-wpimath/semiwrap/kinematics/DifferentialDriveKinematics.yml index b69bc70f9..59f16951b 100644 --- a/subprojects/robotpy-wpimath/gen/kinematics/DifferentialDriveKinematics.yml +++ b/subprojects/robotpy-wpimath/semiwrap/kinematics/DifferentialDriveKinematics.yml @@ -1,10 +1,9 @@ ---- extra_includes: - wpystruct.h classes: - DifferentialDriveKinematics: + frc::DifferentialDriveKinematics: attributes: trackWidth: methods: diff --git a/subprojects/robotpy-wpimath/gen/kinematics/DifferentialDriveOdometry.yml b/subprojects/robotpy-wpimath/semiwrap/kinematics/DifferentialDriveOdometry.yml similarity index 80% rename from subprojects/robotpy-wpimath/gen/kinematics/DifferentialDriveOdometry.yml rename to subprojects/robotpy-wpimath/semiwrap/kinematics/DifferentialDriveOdometry.yml index 2cdab56df..675a21c45 100644 --- a/subprojects/robotpy-wpimath/gen/kinematics/DifferentialDriveOdometry.yml +++ b/subprojects/robotpy-wpimath/semiwrap/kinematics/DifferentialDriveOdometry.yml @@ -1,7 +1,6 @@ ---- classes: - DifferentialDriveOdometry: + frc::DifferentialDriveOdometry: force_no_trampoline: true methods: DifferentialDriveOdometry: diff --git a/subprojects/robotpy-wpimath/gen/kinematics/DifferentialDriveOdometry3d.yml b/subprojects/robotpy-wpimath/semiwrap/kinematics/DifferentialDriveOdometry3d.yml similarity index 77% rename from subprojects/robotpy-wpimath/gen/kinematics/DifferentialDriveOdometry3d.yml rename to subprojects/robotpy-wpimath/semiwrap/kinematics/DifferentialDriveOdometry3d.yml index 21bad1db7..c8fe9a42a 100644 --- a/subprojects/robotpy-wpimath/gen/kinematics/DifferentialDriveOdometry3d.yml +++ b/subprojects/robotpy-wpimath/semiwrap/kinematics/DifferentialDriveOdometry3d.yml @@ -1,7 +1,6 @@ ---- classes: - DifferentialDriveOdometry3d: + frc::DifferentialDriveOdometry3d: force_no_trampoline: true methods: DifferentialDriveOdometry3d: diff --git a/subprojects/robotpy-wpimath/gen/kinematics/DifferentialDriveWheelPositions.yml b/subprojects/robotpy-wpimath/semiwrap/kinematics/DifferentialDriveWheelPositions.yml similarity index 74% rename from subprojects/robotpy-wpimath/gen/kinematics/DifferentialDriveWheelPositions.yml rename to subprojects/robotpy-wpimath/semiwrap/kinematics/DifferentialDriveWheelPositions.yml index a4977196b..daedf30d2 100644 --- a/subprojects/robotpy-wpimath/gen/kinematics/DifferentialDriveWheelPositions.yml +++ b/subprojects/robotpy-wpimath/semiwrap/kinematics/DifferentialDriveWheelPositions.yml @@ -1,7 +1,6 @@ ---- classes: - DifferentialDriveWheelPositions: + frc::DifferentialDriveWheelPositions: attributes: left: right: diff --git a/subprojects/robotpy-wpimath/gen/kinematics/DifferentialDriveWheelSpeeds.yml b/subprojects/robotpy-wpimath/semiwrap/kinematics/DifferentialDriveWheelSpeeds.yml similarity index 96% rename from subprojects/robotpy-wpimath/gen/kinematics/DifferentialDriveWheelSpeeds.yml rename to subprojects/robotpy-wpimath/semiwrap/kinematics/DifferentialDriveWheelSpeeds.yml index 50f389164..c54c60fef 100644 --- a/subprojects/robotpy-wpimath/gen/kinematics/DifferentialDriveWheelSpeeds.yml +++ b/subprojects/robotpy-wpimath/semiwrap/kinematics/DifferentialDriveWheelSpeeds.yml @@ -1,12 +1,9 @@ ---- - extra_includes: - wpystruct.h classes: - DifferentialDriveWheelSpeeds: + frc::DifferentialDriveWheelSpeeds: force_no_default_constructor: true - shared_ptr: false attributes: left: right: diff --git a/subprojects/robotpy-wpimath/gen/kinematics/Kinematics.yml b/subprojects/robotpy-wpimath/semiwrap/kinematics/Kinematics.yml similarity index 98% rename from subprojects/robotpy-wpimath/gen/kinematics/Kinematics.yml rename to subprojects/robotpy-wpimath/semiwrap/kinematics/Kinematics.yml index fd0e53266..0152e97a1 100644 --- a/subprojects/robotpy-wpimath/gen/kinematics/Kinematics.yml +++ b/subprojects/robotpy-wpimath/semiwrap/kinematics/Kinematics.yml @@ -1,4 +1,3 @@ ---- extra_includes: - frc/kinematics/DifferentialDriveWheelPositions.h @@ -9,7 +8,7 @@ extra_includes: classes: - Kinematics: + frc::Kinematics: force_type_casters: - wpi::array template_params: diff --git a/subprojects/robotpy-wpimath/gen/kinematics/MecanumDriveKinematics.yml b/subprojects/robotpy-wpimath/semiwrap/kinematics/MecanumDriveKinematics.yml similarity index 98% rename from subprojects/robotpy-wpimath/gen/kinematics/MecanumDriveKinematics.yml rename to subprojects/robotpy-wpimath/semiwrap/kinematics/MecanumDriveKinematics.yml index d9d1fea52..e49341726 100644 --- a/subprojects/robotpy-wpimath/gen/kinematics/MecanumDriveKinematics.yml +++ b/subprojects/robotpy-wpimath/semiwrap/kinematics/MecanumDriveKinematics.yml @@ -1,10 +1,9 @@ ---- extra_includes: - wpystruct.h classes: - MecanumDriveKinematics: + frc::MecanumDriveKinematics: methods: MecanumDriveKinematics: ToWheelSpeeds: diff --git a/subprojects/robotpy-wpimath/gen/kinematics/MecanumDriveOdometry.yml b/subprojects/robotpy-wpimath/semiwrap/kinematics/MecanumDriveOdometry.yml similarity index 84% rename from subprojects/robotpy-wpimath/gen/kinematics/MecanumDriveOdometry.yml rename to subprojects/robotpy-wpimath/semiwrap/kinematics/MecanumDriveOdometry.yml index c37100a89..5a15fc419 100644 --- a/subprojects/robotpy-wpimath/gen/kinematics/MecanumDriveOdometry.yml +++ b/subprojects/robotpy-wpimath/semiwrap/kinematics/MecanumDriveOdometry.yml @@ -1,7 +1,6 @@ ---- classes: - MecanumDriveOdometry: + frc::MecanumDriveOdometry: force_no_trampoline: true methods: MecanumDriveOdometry: diff --git a/subprojects/robotpy-wpimath/gen/kinematics/MecanumDriveOdometry3d.yml b/subprojects/robotpy-wpimath/semiwrap/kinematics/MecanumDriveOdometry3d.yml similarity index 72% rename from subprojects/robotpy-wpimath/gen/kinematics/MecanumDriveOdometry3d.yml rename to subprojects/robotpy-wpimath/semiwrap/kinematics/MecanumDriveOdometry3d.yml index 863413c8c..02a4112d8 100644 --- a/subprojects/robotpy-wpimath/gen/kinematics/MecanumDriveOdometry3d.yml +++ b/subprojects/robotpy-wpimath/semiwrap/kinematics/MecanumDriveOdometry3d.yml @@ -1,7 +1,6 @@ ---- classes: - MecanumDriveOdometry3d: + frc::MecanumDriveOdometry3d: force_no_trampoline: true methods: MecanumDriveOdometry3d: diff --git a/subprojects/robotpy-wpimath/gen/kinematics/MecanumDriveWheelPositions.yml b/subprojects/robotpy-wpimath/semiwrap/kinematics/MecanumDriveWheelPositions.yml similarity index 82% rename from subprojects/robotpy-wpimath/gen/kinematics/MecanumDriveWheelPositions.yml rename to subprojects/robotpy-wpimath/semiwrap/kinematics/MecanumDriveWheelPositions.yml index 57da6b987..411b06870 100644 --- a/subprojects/robotpy-wpimath/gen/kinematics/MecanumDriveWheelPositions.yml +++ b/subprojects/robotpy-wpimath/semiwrap/kinematics/MecanumDriveWheelPositions.yml @@ -1,7 +1,6 @@ ---- classes: - MecanumDriveWheelPositions: + frc::MecanumDriveWheelPositions: attributes: frontLeft: frontRight: diff --git a/subprojects/robotpy-wpimath/gen/kinematics/MecanumDriveWheelSpeeds.yml b/subprojects/robotpy-wpimath/semiwrap/kinematics/MecanumDriveWheelSpeeds.yml similarity index 98% rename from subprojects/robotpy-wpimath/gen/kinematics/MecanumDriveWheelSpeeds.yml rename to subprojects/robotpy-wpimath/semiwrap/kinematics/MecanumDriveWheelSpeeds.yml index 3e62b8075..6213fcc1b 100644 --- a/subprojects/robotpy-wpimath/gen/kinematics/MecanumDriveWheelSpeeds.yml +++ b/subprojects/robotpy-wpimath/semiwrap/kinematics/MecanumDriveWheelSpeeds.yml @@ -1,12 +1,9 @@ ---- - extra_includes: - wpystruct.h classes: - MecanumDriveWheelSpeeds: + frc::MecanumDriveWheelSpeeds: force_no_default_constructor: true - shared_ptr: false attributes: frontLeft: frontRight: diff --git a/subprojects/robotpy-wpimath/gen/kinematics/Odometry.yml b/subprojects/robotpy-wpimath/semiwrap/kinematics/Odometry.yml similarity index 98% rename from subprojects/robotpy-wpimath/gen/kinematics/Odometry.yml rename to subprojects/robotpy-wpimath/semiwrap/kinematics/Odometry.yml index c2ea93c27..eb35370d9 100644 --- a/subprojects/robotpy-wpimath/gen/kinematics/Odometry.yml +++ b/subprojects/robotpy-wpimath/semiwrap/kinematics/Odometry.yml @@ -1,4 +1,3 @@ ---- extra_includes: - frc/kinematics/DifferentialDriveWheelPositions.h @@ -8,7 +7,7 @@ extra_includes: - frc/kinematics/SwerveDriveKinematics.h classes: - Odometry: + frc::Odometry: template_params: - WheelSpeeds - WheelPositions diff --git a/subprojects/robotpy-wpimath/gen/kinematics/Odometry3d.yml b/subprojects/robotpy-wpimath/semiwrap/kinematics/Odometry3d.yml similarity index 98% rename from subprojects/robotpy-wpimath/gen/kinematics/Odometry3d.yml rename to subprojects/robotpy-wpimath/semiwrap/kinematics/Odometry3d.yml index 9989815dd..83d71ec6d 100644 --- a/subprojects/robotpy-wpimath/gen/kinematics/Odometry3d.yml +++ b/subprojects/robotpy-wpimath/semiwrap/kinematics/Odometry3d.yml @@ -1,4 +1,3 @@ ---- extra_includes: - frc/kinematics/DifferentialDriveWheelPositions.h @@ -8,7 +7,7 @@ extra_includes: - frc/kinematics/SwerveDriveKinematics.h classes: - Odometry3d: + frc::Odometry3d: template_params: - WheelSpeeds - WheelPositions diff --git a/subprojects/robotpy-wpimath/gen/kinematics/SwerveDriveKinematics.yml b/subprojects/robotpy-wpimath/semiwrap/kinematics/SwerveDriveKinematics.yml similarity index 98% rename from subprojects/robotpy-wpimath/gen/kinematics/SwerveDriveKinematics.yml rename to subprojects/robotpy-wpimath/semiwrap/kinematics/SwerveDriveKinematics.yml index 5002b3d9c..f3a609e7e 100644 --- a/subprojects/robotpy-wpimath/gen/kinematics/SwerveDriveKinematics.yml +++ b/subprojects/robotpy-wpimath/semiwrap/kinematics/SwerveDriveKinematics.yml @@ -1,7 +1,6 @@ ---- classes: - SwerveDriveKinematics: + frc::SwerveDriveKinematics: force_type_casters: - wpi::array template_params: @@ -15,7 +14,7 @@ classes: ignore: true const wpi::array&: ignore: true - + ResetHeadings: overloads: ModuleHeadings&&...: @@ -69,8 +68,7 @@ classes: } ? wpi::array*, ChassisSpeeds, units::meters_per_second_t, units::meters_per_second_t, units::radians_per_second_t - : - cpp_code: | + : cpp_code: | [](wpi::array moduleStates, ChassisSpeeds currentChassisSpeed, units::meters_per_second_t attainableMaxModuleSpeed, @@ -93,7 +91,7 @@ classes: } else if constexpr (NumModules == 6) { cls_SwerveDriveKinematics.def(py::init()); } - + templates: SwerveDrive2Kinematics: diff --git a/subprojects/robotpy-wpimath/gen/kinematics/SwerveDriveOdometry.yml b/subprojects/robotpy-wpimath/semiwrap/kinematics/SwerveDriveOdometry.yml similarity index 94% rename from subprojects/robotpy-wpimath/gen/kinematics/SwerveDriveOdometry.yml rename to subprojects/robotpy-wpimath/semiwrap/kinematics/SwerveDriveOdometry.yml index c22a25890..f6cdc1229 100644 --- a/subprojects/robotpy-wpimath/gen/kinematics/SwerveDriveOdometry.yml +++ b/subprojects/robotpy-wpimath/semiwrap/kinematics/SwerveDriveOdometry.yml @@ -1,7 +1,6 @@ ---- classes: - SwerveDriveOdometry: + frc::SwerveDriveOdometry: force_no_trampoline: true template_params: - size_t NumModules diff --git a/subprojects/robotpy-wpimath/gen/kinematics/SwerveDriveOdometry3d.yml b/subprojects/robotpy-wpimath/semiwrap/kinematics/SwerveDriveOdometry3d.yml similarity index 92% rename from subprojects/robotpy-wpimath/gen/kinematics/SwerveDriveOdometry3d.yml rename to subprojects/robotpy-wpimath/semiwrap/kinematics/SwerveDriveOdometry3d.yml index cd6ca4796..7fb952ee0 100644 --- a/subprojects/robotpy-wpimath/gen/kinematics/SwerveDriveOdometry3d.yml +++ b/subprojects/robotpy-wpimath/semiwrap/kinematics/SwerveDriveOdometry3d.yml @@ -1,7 +1,6 @@ ---- classes: - SwerveDriveOdometry3d: + frc::SwerveDriveOdometry3d: force_no_trampoline: true template_params: - size_t NumModules @@ -24,4 +23,4 @@ templates: SwerveDrive6Odometry3d: qualname: frc::SwerveDriveOdometry3d params: - - 6 \ No newline at end of file + - 6 diff --git a/subprojects/robotpy-wpimath/gen/kinematics/SwerveModulePosition.yml b/subprojects/robotpy-wpimath/semiwrap/kinematics/SwerveModulePosition.yml similarity index 97% rename from subprojects/robotpy-wpimath/gen/kinematics/SwerveModulePosition.yml rename to subprojects/robotpy-wpimath/semiwrap/kinematics/SwerveModulePosition.yml index f613d8402..ea00ad96d 100644 --- a/subprojects/robotpy-wpimath/gen/kinematics/SwerveModulePosition.yml +++ b/subprojects/robotpy-wpimath/semiwrap/kinematics/SwerveModulePosition.yml @@ -1,10 +1,9 @@ ---- extra_includes: - wpystruct.h classes: - SwerveModulePosition: + frc::SwerveModulePosition: force_no_default_constructor: true attributes: distance: diff --git a/subprojects/robotpy-wpimath/gen/kinematics/SwerveModuleState.yml b/subprojects/robotpy-wpimath/semiwrap/kinematics/SwerveModuleState.yml similarity index 95% rename from subprojects/robotpy-wpimath/gen/kinematics/SwerveModuleState.yml rename to subprojects/robotpy-wpimath/semiwrap/kinematics/SwerveModuleState.yml index 4c91a3376..9ba68ee96 100644 --- a/subprojects/robotpy-wpimath/gen/kinematics/SwerveModuleState.yml +++ b/subprojects/robotpy-wpimath/semiwrap/kinematics/SwerveModuleState.yml @@ -1,12 +1,9 @@ ---- - extra_includes: - wpystruct.h classes: - SwerveModuleState: + frc::SwerveModuleState: force_no_default_constructor: true - shared_ptr: false attributes: speed: angle: diff --git a/subprojects/robotpy-wpimath/gen/spline/CubicHermiteSpline.yml b/subprojects/robotpy-wpimath/semiwrap/spline/CubicHermiteSpline.yml similarity index 89% rename from subprojects/robotpy-wpimath/gen/spline/CubicHermiteSpline.yml rename to subprojects/robotpy-wpimath/semiwrap/spline/CubicHermiteSpline.yml index 93ef6d762..360d7f207 100644 --- a/subprojects/robotpy-wpimath/gen/spline/CubicHermiteSpline.yml +++ b/subprojects/robotpy-wpimath/semiwrap/spline/CubicHermiteSpline.yml @@ -1,7 +1,6 @@ ---- classes: - CubicHermiteSpline: + frc::CubicHermiteSpline: force_no_trampoline: true methods: CubicHermiteSpline: diff --git a/subprojects/robotpy-wpimath/gen/spline/QuinticHermiteSpline.yml b/subprojects/robotpy-wpimath/semiwrap/spline/QuinticHermiteSpline.yml similarity index 86% rename from subprojects/robotpy-wpimath/gen/spline/QuinticHermiteSpline.yml rename to subprojects/robotpy-wpimath/semiwrap/spline/QuinticHermiteSpline.yml index d5f42a5b8..f9552c806 100644 --- a/subprojects/robotpy-wpimath/gen/spline/QuinticHermiteSpline.yml +++ b/subprojects/robotpy-wpimath/semiwrap/spline/QuinticHermiteSpline.yml @@ -1,7 +1,6 @@ ---- classes: - QuinticHermiteSpline: + frc::QuinticHermiteSpline: force_no_trampoline: true methods: QuinticHermiteSpline: diff --git a/subprojects/robotpy-wpimath/gen/spline/Spline.yml b/subprojects/robotpy-wpimath/semiwrap/spline/Spline.yml similarity index 95% rename from subprojects/robotpy-wpimath/gen/spline/Spline.yml rename to subprojects/robotpy-wpimath/semiwrap/spline/Spline.yml index 6ec968718..763e3ea96 100644 --- a/subprojects/robotpy-wpimath/gen/spline/Spline.yml +++ b/subprojects/robotpy-wpimath/semiwrap/spline/Spline.yml @@ -1,10 +1,9 @@ ---- extra_includes: - pybind11/stl.h classes: - Spline: + frc::Spline: is_polymorphic: true force_type_casters: - units::curvature_t @@ -33,7 +32,7 @@ classes: py::arg("x"), py::arg("y") ); - Spline::ControlVector: + frc::Spline::ControlVector: force_no_default_constructor: true attributes: x: diff --git a/subprojects/robotpy-wpimath/gen/spline/SplineHelper.yml b/subprojects/robotpy-wpimath/semiwrap/spline/SplineHelper.yml similarity index 82% rename from subprojects/robotpy-wpimath/gen/spline/SplineHelper.yml rename to subprojects/robotpy-wpimath/semiwrap/spline/SplineHelper.yml index 6e1fed83f..495defeae 100644 --- a/subprojects/robotpy-wpimath/gen/spline/SplineHelper.yml +++ b/subprojects/robotpy-wpimath/semiwrap/spline/SplineHelper.yml @@ -1,8 +1,5 @@ ---- - classes: - SplineHelper: - shared_ptr: false + frc::SplineHelper: methods: CubicControlVectorsFromWaypoints: QuinticControlVectorsFromWaypoints: @@ -10,4 +7,3 @@ classes: CubicSplinesFromControlVectors: QuinticSplinesFromControlVectors: OptimizeCurvature: - diff --git a/subprojects/robotpy-wpimath/gen/spline/SplineParameterizer.yml b/subprojects/robotpy-wpimath/semiwrap/spline/SplineParameterizer.yml similarity index 56% rename from subprojects/robotpy-wpimath/gen/spline/SplineParameterizer.yml rename to subprojects/robotpy-wpimath/semiwrap/spline/SplineParameterizer.yml index 62e8bda2c..a4971fa5b 100644 --- a/subprojects/robotpy-wpimath/gen/spline/SplineParameterizer.yml +++ b/subprojects/robotpy-wpimath/semiwrap/spline/SplineParameterizer.yml @@ -1,16 +1,13 @@ ---- - classes: - SplineParameterizer: - shared_ptr: false + frc::SplineParameterizer: force_no_default_constructor: true force_type_casters: - units::curvature_t methods: Parameterize: template_impls: - - ["3"] - - ["5"] + - ['3'] + - ['5'] - SplineParameterizer::MalformedSplineException: + frc::SplineParameterizer::MalformedSplineException: ignore: true diff --git a/subprojects/robotpy-wpimath/setup.py b/subprojects/robotpy-wpimath/setup.py deleted file mode 100644 index 3542d0c9a..000000000 --- a/subprojects/robotpy-wpimath/setup.py +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env python3 - -from robotpy_build.setup import setup - -setup() diff --git a/subprojects/robotpy-wpimath/wpimath/__init__.py b/subprojects/robotpy-wpimath/wpimath/__init__.py index 6f2b1878a..f85ba7db0 100644 --- a/subprojects/robotpy-wpimath/wpimath/__init__.py +++ b/subprojects/robotpy-wpimath/wpimath/__init__.py @@ -1,27 +1,9 @@ -from . import _init_wpimath # noqa: F401 +from . import _init__wpimath # noqa: F401 -# autogenerated by 'robotpy-build create-imports wpimath wpimath._wpimath' -from ._wpimath import ( - angleModulus, - applyDeadband, - floorDiv, - floorMod, - inputModulus, - objectToRobotPose, -) - -__all__ = [ - "angleModulus", - "applyDeadband", - "floorDiv", - "floorMod", - "inputModulus", - "objectToRobotPose", -] - -# What +# Needed for stubgen +from . import geometry -# autogenerated by 'robotpy-build create-imports wpimath wpimath._wpimath' +# autogenerated by 'semiwrap create-imports wpimath wpimath._wpimath' from ._wpimath import ( angleModulus, applyDeadband, @@ -29,6 +11,7 @@ floorMod, inputModulus, objectToRobotPose, + slewRateLimit, ) __all__ = [ @@ -38,4 +21,5 @@ "floorMod", "inputModulus", "objectToRobotPose", + "slewRateLimit", ] diff --git a/subprojects/robotpy-wpimath/wpimath/_controls/__init__.py b/subprojects/robotpy-wpimath/wpimath/_controls/__init__.py index 21917ea3f..d3c258e60 100644 --- a/subprojects/robotpy-wpimath/wpimath/_controls/__init__.py +++ b/subprojects/robotpy-wpimath/wpimath/_controls/__init__.py @@ -1 +1 @@ -from . import _init_controls +from . import _init__controls diff --git a/subprojects/robotpy-wpimath/wpimath/_controls/controls.cpp b/subprojects/robotpy-wpimath/wpimath/_controls/controls.cpp index 956ee7fab..1c5864fe0 100644 --- a/subprojects/robotpy-wpimath/wpimath/_controls/controls.cpp +++ b/subprojects/robotpy-wpimath/wpimath/_controls/controls.cpp @@ -1,7 +1,7 @@ -#include "rpygen_wrapper.hpp" +#include "semiwrap_init.wpimath._controls._controls.hpp" -RPYBUILD_PYBIND11_MODULE(m) +SEMIWRAP_PYBIND11_MODULE(m) { initWrapper(m); } diff --git a/subprojects/robotpy-wpimath/wpimath/_impl/src/PyTrajectoryConstraint.h b/subprojects/robotpy-wpimath/wpimath/_impl/src/PyTrajectoryConstraint.h index 70f7b0705..8d91ed04c 100644 --- a/subprojects/robotpy-wpimath/wpimath/_impl/src/PyTrajectoryConstraint.h +++ b/subprojects/robotpy-wpimath/wpimath/_impl/src/PyTrajectoryConstraint.h @@ -1,7 +1,7 @@ #pragma once #include -#include +#include namespace frc { diff --git a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/SparseCore b/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/SparseCore deleted file mode 100644 index bf8c27e13..000000000 --- a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/SparseCore +++ /dev/null @@ -1,69 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_SPARSECORE_MODULE_H -#define EIGEN_SPARSECORE_MODULE_H - -#include "../../../include/Eigen/Core" - -#include "../../../include/Eigen/src/Core/util/DisableStupidWarnings.h" - -#include -#include -#include -#include -#include - -/** - * \defgroup SparseCore_Module SparseCore module - * - * This module provides a sparse matrix representation, and basic associated matrix manipulations - * and operations. - * - * See the \ref TutorialSparse "Sparse tutorial" - * - * \code - * #include - * \endcode - * - * This module depends on: Core. - */ - -#include "src/SparseCore/SparseUtil.h" -#include "src/SparseCore/SparseMatrixBase.h" -#include "src/SparseCore/SparseAssign.h" -#include "src/SparseCore/CompressedStorage.h" -#include "src/SparseCore/AmbiVector.h" -#include "src/SparseCore/SparseCompressedBase.h" -#include "src/SparseCore/SparseMatrix.h" -#include "src/SparseCore/SparseMap.h" -#include "src/SparseCore/MappedSparseMatrix.h" -#include "src/SparseCore/SparseVector.h" -#include "src/SparseCore/SparseRef.h" -#include "src/SparseCore/SparseCwiseUnaryOp.h" -#include "src/SparseCore/SparseCwiseBinaryOp.h" -#include "src/SparseCore/SparseTranspose.h" -#include "src/SparseCore/SparseBlock.h" -#include "src/SparseCore/SparseDot.h" -#include "src/SparseCore/SparseRedux.h" -#include "src/SparseCore/SparseView.h" -#include "src/SparseCore/SparseDiagonalProduct.h" -#include "src/SparseCore/ConservativeSparseSparseProduct.h" -#include "src/SparseCore/SparseSparseProductWithPruning.h" -#include "src/SparseCore/SparseProduct.h" -#include "src/SparseCore/SparseDenseProduct.h" -#include "src/SparseCore/SparseSelfAdjointView.h" -#include "src/SparseCore/SparseTriangularView.h" -#include "src/SparseCore/TriangularSolver.h" -#include "src/SparseCore/SparsePermutation.h" -#include "src/SparseCore/SparseFuzzy.h" -#include "src/SparseCore/SparseSolverBase.h" - -#include "../../../include/Eigen/src/Core/util/ReenableStupidWarnings.h" - -#endif // EIGEN_SPARSECORE_MODULE_H - diff --git a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/AmbiVector.h b/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/AmbiVector.h deleted file mode 100644 index 2cb7747cc..000000000 --- a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/AmbiVector.h +++ /dev/null @@ -1,378 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_AMBIVECTOR_H -#define EIGEN_AMBIVECTOR_H - -namespace Eigen { - -namespace internal { - -/** \internal - * Hybrid sparse/dense vector class designed for intensive read-write operations. - * - * See BasicSparseLLT and SparseProduct for usage examples. - */ -template -class AmbiVector -{ - public: - typedef _Scalar Scalar; - typedef _StorageIndex StorageIndex; - typedef typename NumTraits::Real RealScalar; - - explicit AmbiVector(Index size) - : m_buffer(0), m_zero(0), m_size(0), m_end(0), m_allocatedSize(0), m_allocatedElements(0), m_mode(-1) - { - resize(size); - } - - void init(double estimatedDensity); - void init(int mode); - - Index nonZeros() const; - - /** Specifies a sub-vector to work on */ - void setBounds(Index start, Index end) { m_start = convert_index(start); m_end = convert_index(end); } - - void setZero(); - - void restart(); - Scalar& coeffRef(Index i); - Scalar& coeff(Index i); - - class Iterator; - - ~AmbiVector() { delete[] m_buffer; } - - void resize(Index size) - { - if (m_allocatedSize < size) - reallocate(size); - m_size = convert_index(size); - } - - StorageIndex size() const { return m_size; } - - protected: - StorageIndex convert_index(Index idx) - { - return internal::convert_index(idx); - } - - void reallocate(Index size) - { - // if the size of the matrix is not too large, let's allocate a bit more than needed such - // that we can handle dense vector even in sparse mode. - delete[] m_buffer; - if (size<1000) - { - Index allocSize = (size * sizeof(ListEl) + sizeof(Scalar) - 1)/sizeof(Scalar); - m_allocatedElements = convert_index((allocSize*sizeof(Scalar))/sizeof(ListEl)); - m_buffer = new Scalar[allocSize]; - } - else - { - m_allocatedElements = convert_index((size*sizeof(Scalar))/sizeof(ListEl)); - m_buffer = new Scalar[size]; - } - m_size = convert_index(size); - m_start = 0; - m_end = m_size; - } - - void reallocateSparse() - { - Index copyElements = m_allocatedElements; - m_allocatedElements = (std::min)(StorageIndex(m_allocatedElements*1.5),m_size); - Index allocSize = m_allocatedElements * sizeof(ListEl); - allocSize = (allocSize + sizeof(Scalar) - 1)/sizeof(Scalar); - Scalar* newBuffer = new Scalar[allocSize]; - std::memcpy(newBuffer, m_buffer, copyElements * sizeof(ListEl)); - delete[] m_buffer; - m_buffer = newBuffer; - } - - protected: - // element type of the linked list - struct ListEl - { - StorageIndex next; - StorageIndex index; - Scalar value; - }; - - // used to store data in both mode - Scalar* m_buffer; - Scalar m_zero; - StorageIndex m_size; - StorageIndex m_start; - StorageIndex m_end; - StorageIndex m_allocatedSize; - StorageIndex m_allocatedElements; - StorageIndex m_mode; - - // linked list mode - StorageIndex m_llStart; - StorageIndex m_llCurrent; - StorageIndex m_llSize; -}; - -/** \returns the number of non zeros in the current sub vector */ -template -Index AmbiVector<_Scalar,_StorageIndex>::nonZeros() const -{ - if (m_mode==IsSparse) - return m_llSize; - else - return m_end - m_start; -} - -template -void AmbiVector<_Scalar,_StorageIndex>::init(double estimatedDensity) -{ - if (estimatedDensity>0.1) - init(IsDense); - else - init(IsSparse); -} - -template -void AmbiVector<_Scalar,_StorageIndex>::init(int mode) -{ - m_mode = mode; - // This is only necessary in sparse mode, but we set these unconditionally to avoid some maybe-uninitialized warnings - // if (m_mode==IsSparse) - { - m_llSize = 0; - m_llStart = -1; - } -} - -/** Must be called whenever we might perform a write access - * with an index smaller than the previous one. - * - * Don't worry, this function is extremely cheap. - */ -template -void AmbiVector<_Scalar,_StorageIndex>::restart() -{ - m_llCurrent = m_llStart; -} - -/** Set all coefficients of current subvector to zero */ -template -void AmbiVector<_Scalar,_StorageIndex>::setZero() -{ - if (m_mode==IsDense) - { - for (Index i=m_start; i -_Scalar& AmbiVector<_Scalar,_StorageIndex>::coeffRef(Index i) -{ - if (m_mode==IsDense) - return m_buffer[i]; - else - { - ListEl* EIGEN_RESTRICT llElements = reinterpret_cast(m_buffer); - // TODO factorize the following code to reduce code generation - eigen_assert(m_mode==IsSparse); - if (m_llSize==0) - { - // this is the first element - m_llStart = 0; - m_llCurrent = 0; - ++m_llSize; - llElements[0].value = Scalar(0); - llElements[0].index = convert_index(i); - llElements[0].next = -1; - return llElements[0].value; - } - else if (i=llElements[m_llCurrent].index && "you must call restart() before inserting an element with lower or equal index"); - while (nextel >= 0 && llElements[nextel].index<=i) - { - m_llCurrent = nextel; - nextel = llElements[nextel].next; - } - - if (llElements[m_llCurrent].index==i) - { - // the coefficient already exists and we found it ! - return llElements[m_llCurrent].value; - } - else - { - if (m_llSize>=m_allocatedElements) - { - reallocateSparse(); - llElements = reinterpret_cast(m_buffer); - } - eigen_internal_assert(m_llSize -_Scalar& AmbiVector<_Scalar,_StorageIndex>::coeff(Index i) -{ - if (m_mode==IsDense) - return m_buffer[i]; - else - { - ListEl* EIGEN_RESTRICT llElements = reinterpret_cast(m_buffer); - eigen_assert(m_mode==IsSparse); - if ((m_llSize==0) || (i= 0 && llElements[elid].index -class AmbiVector<_Scalar,_StorageIndex>::Iterator -{ - public: - typedef _Scalar Scalar; - typedef typename NumTraits::Real RealScalar; - - /** Default constructor - * \param vec the vector on which we iterate - * \param epsilon the minimal value used to prune zero coefficients. - * In practice, all coefficients having a magnitude smaller than \a epsilon - * are skipped. - */ - explicit Iterator(const AmbiVector& vec, const RealScalar& epsilon = 0) - : m_vector(vec) - { - using std::abs; - m_epsilon = epsilon; - m_isDense = m_vector.m_mode==IsDense; - if (m_isDense) - { - m_currentEl = 0; // this is to avoid a compilation warning - m_cachedValue = 0; // this is to avoid a compilation warning - m_cachedIndex = m_vector.m_start-1; - ++(*this); - } - else - { - ListEl* EIGEN_RESTRICT llElements = reinterpret_cast(m_vector.m_buffer); - m_currentEl = m_vector.m_llStart; - while (m_currentEl>=0 && abs(llElements[m_currentEl].value)<=m_epsilon) - m_currentEl = llElements[m_currentEl].next; - if (m_currentEl<0) - { - m_cachedValue = 0; // this is to avoid a compilation warning - m_cachedIndex = -1; - } - else - { - m_cachedIndex = llElements[m_currentEl].index; - m_cachedValue = llElements[m_currentEl].value; - } - } - } - - StorageIndex index() const { return m_cachedIndex; } - Scalar value() const { return m_cachedValue; } - - operator bool() const { return m_cachedIndex>=0; } - - Iterator& operator++() - { - using std::abs; - if (m_isDense) - { - do { - ++m_cachedIndex; - } while (m_cachedIndex(m_vector.m_buffer); - do { - m_currentEl = llElements[m_currentEl].next; - } while (m_currentEl>=0 && abs(llElements[m_currentEl].value)<=m_epsilon); - if (m_currentEl<0) - { - m_cachedIndex = -1; - } - else - { - m_cachedIndex = llElements[m_currentEl].index; - m_cachedValue = llElements[m_currentEl].value; - } - } - return *this; - } - - protected: - const AmbiVector& m_vector; // the target vector - StorageIndex m_currentEl; // the current element in sparse/linked-list mode - RealScalar m_epsilon; // epsilon used to prune zero coefficients - StorageIndex m_cachedIndex; // current coordinate - Scalar m_cachedValue; // current value - bool m_isDense; // mode of the vector -}; - -} // end namespace internal - -} // end namespace Eigen - -#endif // EIGEN_AMBIVECTOR_H diff --git a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/CompressedStorage.h b/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/CompressedStorage.h deleted file mode 100644 index acd986fab..000000000 --- a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/CompressedStorage.h +++ /dev/null @@ -1,274 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008-2014 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_COMPRESSED_STORAGE_H -#define EIGEN_COMPRESSED_STORAGE_H - -namespace Eigen { - -namespace internal { - -/** \internal - * Stores a sparse set of values as a list of values and a list of indices. - * - */ -template -class CompressedStorage -{ - public: - - typedef _Scalar Scalar; - typedef _StorageIndex StorageIndex; - - protected: - - typedef typename NumTraits::Real RealScalar; - - public: - - CompressedStorage() - : m_values(0), m_indices(0), m_size(0), m_allocatedSize(0) - {} - - explicit CompressedStorage(Index size) - : m_values(0), m_indices(0), m_size(0), m_allocatedSize(0) - { - resize(size); - } - - CompressedStorage(const CompressedStorage& other) - : m_values(0), m_indices(0), m_size(0), m_allocatedSize(0) - { - *this = other; - } - - CompressedStorage& operator=(const CompressedStorage& other) - { - resize(other.size()); - if(other.size()>0) - { - internal::smart_copy(other.m_values, other.m_values + m_size, m_values); - internal::smart_copy(other.m_indices, other.m_indices + m_size, m_indices); - } - return *this; - } - - void swap(CompressedStorage& other) - { - std::swap(m_values, other.m_values); - std::swap(m_indices, other.m_indices); - std::swap(m_size, other.m_size); - std::swap(m_allocatedSize, other.m_allocatedSize); - } - - ~CompressedStorage() - { - delete[] m_values; - delete[] m_indices; - } - - void reserve(Index size) - { - Index newAllocatedSize = m_size + size; - if (newAllocatedSize > m_allocatedSize) - reallocate(newAllocatedSize); - } - - void squeeze() - { - if (m_allocatedSize>m_size) - reallocate(m_size); - } - - void resize(Index size, double reserveSizeFactor = 0) - { - if (m_allocatedSize)(NumTraits::highest(), size + Index(reserveSizeFactor*double(size))); - if(realloc_size(i); - } - - inline Index size() const { return m_size; } - inline Index allocatedSize() const { return m_allocatedSize; } - inline void clear() { m_size = 0; } - - const Scalar* valuePtr() const { return m_values; } - Scalar* valuePtr() { return m_values; } - const StorageIndex* indexPtr() const { return m_indices; } - StorageIndex* indexPtr() { return m_indices; } - - inline Scalar& value(Index i) { eigen_internal_assert(m_values!=0); return m_values[i]; } - inline const Scalar& value(Index i) const { eigen_internal_assert(m_values!=0); return m_values[i]; } - - inline StorageIndex& index(Index i) { eigen_internal_assert(m_indices!=0); return m_indices[i]; } - inline const StorageIndex& index(Index i) const { eigen_internal_assert(m_indices!=0); return m_indices[i]; } - - /** \returns the largest \c k such that for all \c j in [0,k) index[\c j]\<\a key */ - inline Index searchLowerIndex(Index key) const - { - return searchLowerIndex(0, m_size, key); - } - - /** \returns the largest \c k in [start,end) such that for all \c j in [start,k) index[\c j]\<\a key */ - inline Index searchLowerIndex(Index start, Index end, Index key) const - { - while(end>start) - { - Index mid = (end+start)>>1; - if (m_indices[mid]=end) - return defaultValue; - else if (end>start && key==m_indices[end-1]) - return m_values[end-1]; - // ^^ optimization: let's first check if it is the last coefficient - // (very common in high level algorithms) - const Index id = searchLowerIndex(start,end-1,key); - return ((id=m_size || m_indices[id]!=key) - { - if (m_allocatedSize newValues(m_allocatedSize); - internal::scoped_array newIndices(m_allocatedSize); - - // copy first chunk - internal::smart_copy(m_values, m_values +id, newValues.ptr()); - internal::smart_copy(m_indices, m_indices+id, newIndices.ptr()); - - // copy the rest - if(m_size>id) - { - internal::smart_copy(m_values +id, m_values +m_size, newValues.ptr() +id+1); - internal::smart_copy(m_indices+id, m_indices+m_size, newIndices.ptr()+id+1); - } - std::swap(m_values,newValues.ptr()); - std::swap(m_indices,newIndices.ptr()); - } - else if(m_size>id) - { - internal::smart_memmove(m_values +id, m_values +m_size, m_values +id+1); - internal::smart_memmove(m_indices+id, m_indices+m_size, m_indices+id+1); - } - m_size++; - m_indices[id] = internal::convert_index(key); - m_values[id] = defaultValue; - } - return m_values[id]; - } - - void moveChunk(Index from, Index to, Index chunkSize) - { - eigen_internal_assert(to+chunkSize <= m_size); - if(to>from && from+chunkSize>to) - { - // move backward - internal::smart_memmove(m_values+from, m_values+from+chunkSize, m_values+to); - internal::smart_memmove(m_indices+from, m_indices+from+chunkSize, m_indices+to); - } - else - { - internal::smart_copy(m_values+from, m_values+from+chunkSize, m_values+to); - internal::smart_copy(m_indices+from, m_indices+from+chunkSize, m_indices+to); - } - } - - void prune(const Scalar& reference, const RealScalar& epsilon = NumTraits::dummy_precision()) - { - Index k = 0; - Index n = size(); - for (Index i=0; i newValues(size); - internal::scoped_array newIndices(size); - Index copySize = (std::min)(size, m_size); - if (copySize>0) { - internal::smart_copy(m_values, m_values+copySize, newValues.ptr()); - internal::smart_copy(m_indices, m_indices+copySize, newIndices.ptr()); - } - std::swap(m_values,newValues.ptr()); - std::swap(m_indices,newIndices.ptr()); - m_allocatedSize = size; - } - - protected: - Scalar* m_values; - StorageIndex* m_indices; - Index m_size; - Index m_allocatedSize; - -}; - -} // end namespace internal - -} // end namespace Eigen - -#endif // EIGEN_COMPRESSED_STORAGE_H diff --git a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h b/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h deleted file mode 100644 index 948650253..000000000 --- a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h +++ /dev/null @@ -1,352 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008-2015 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_CONSERVATIVESPARSESPARSEPRODUCT_H -#define EIGEN_CONSERVATIVESPARSESPARSEPRODUCT_H - -namespace Eigen { - -namespace internal { - -template -static void conservative_sparse_sparse_product_impl(const Lhs& lhs, const Rhs& rhs, ResultType& res, bool sortedInsertion = false) -{ - typedef typename remove_all::type::Scalar LhsScalar; - typedef typename remove_all::type::Scalar RhsScalar; - typedef typename remove_all::type::Scalar ResScalar; - - // make sure to call innerSize/outerSize since we fake the storage order. - Index rows = lhs.innerSize(); - Index cols = rhs.outerSize(); - eigen_assert(lhs.outerSize() == rhs.innerSize()); - - ei_declare_aligned_stack_constructed_variable(bool, mask, rows, 0); - ei_declare_aligned_stack_constructed_variable(ResScalar, values, rows, 0); - ei_declare_aligned_stack_constructed_variable(Index, indices, rows, 0); - - std::memset(mask,0,sizeof(bool)*rows); - - evaluator lhsEval(lhs); - evaluator rhsEval(rhs); - - // estimate the number of non zero entries - // given a rhs column containing Y non zeros, we assume that the respective Y columns - // of the lhs differs in average of one non zeros, thus the number of non zeros for - // the product of a rhs column with the lhs is X+Y where X is the average number of non zero - // per column of the lhs. - // Therefore, we have nnz(lhs*rhs) = nnz(lhs) + nnz(rhs) - Index estimated_nnz_prod = lhsEval.nonZerosEstimate() + rhsEval.nonZerosEstimate(); - - res.setZero(); - res.reserve(Index(estimated_nnz_prod)); - // we compute each column of the result, one after the other - for (Index j=0; j::InnerIterator rhsIt(rhsEval, j); rhsIt; ++rhsIt) - { - RhsScalar y = rhsIt.value(); - Index k = rhsIt.index(); - for (typename evaluator::InnerIterator lhsIt(lhsEval, k); lhsIt; ++lhsIt) - { - Index i = lhsIt.index(); - LhsScalar x = lhsIt.value(); - if(!mask[i]) - { - mask[i] = true; - values[i] = x * y; - indices[nnz] = i; - ++nnz; - } - else - values[i] += x * y; - } - } - if(!sortedInsertion) - { - // unordered insertion - for(Index k=0; k use a quick sort - // otherwise => loop through the entire vector - // In order to avoid to perform an expensive log2 when the - // result is clearly very sparse we use a linear bound up to 200. - if((nnz<200 && nnz1) std::sort(indices,indices+nnz); - for(Index k=0; k::Flags&RowMajorBit) ? RowMajor : ColMajor, - int RhsStorageOrder = (traits::Flags&RowMajorBit) ? RowMajor : ColMajor, - int ResStorageOrder = (traits::Flags&RowMajorBit) ? RowMajor : ColMajor> -struct conservative_sparse_sparse_product_selector; - -template -struct conservative_sparse_sparse_product_selector -{ - typedef typename remove_all::type LhsCleaned; - typedef typename LhsCleaned::Scalar Scalar; - - static void run(const Lhs& lhs, const Rhs& rhs, ResultType& res) - { - typedef SparseMatrix RowMajorMatrix; - typedef SparseMatrix ColMajorMatrixAux; - typedef typename sparse_eval::type ColMajorMatrix; - - // If the result is tall and thin (in the extreme case a column vector) - // then it is faster to sort the coefficients inplace instead of transposing twice. - // FIXME, the following heuristic is probably not very good. - if(lhs.rows()>rhs.cols()) - { - ColMajorMatrix resCol(lhs.rows(),rhs.cols()); - // perform sorted insertion - internal::conservative_sparse_sparse_product_impl(lhs, rhs, resCol, true); - res = resCol.markAsRValue(); - } - else - { - ColMajorMatrixAux resCol(lhs.rows(),rhs.cols()); - // resort to transpose to sort the entries - internal::conservative_sparse_sparse_product_impl(lhs, rhs, resCol, false); - RowMajorMatrix resRow(resCol); - res = resRow.markAsRValue(); - } - } -}; - -template -struct conservative_sparse_sparse_product_selector -{ - static void run(const Lhs& lhs, const Rhs& rhs, ResultType& res) - { - typedef SparseMatrix RowMajorRhs; - typedef SparseMatrix RowMajorRes; - RowMajorRhs rhsRow = rhs; - RowMajorRes resRow(lhs.rows(), rhs.cols()); - internal::conservative_sparse_sparse_product_impl(rhsRow, lhs, resRow); - res = resRow; - } -}; - -template -struct conservative_sparse_sparse_product_selector -{ - static void run(const Lhs& lhs, const Rhs& rhs, ResultType& res) - { - typedef SparseMatrix RowMajorLhs; - typedef SparseMatrix RowMajorRes; - RowMajorLhs lhsRow = lhs; - RowMajorRes resRow(lhs.rows(), rhs.cols()); - internal::conservative_sparse_sparse_product_impl(rhs, lhsRow, resRow); - res = resRow; - } -}; - -template -struct conservative_sparse_sparse_product_selector -{ - static void run(const Lhs& lhs, const Rhs& rhs, ResultType& res) - { - typedef SparseMatrix RowMajorMatrix; - RowMajorMatrix resRow(lhs.rows(), rhs.cols()); - internal::conservative_sparse_sparse_product_impl(rhs, lhs, resRow); - res = resRow; - } -}; - - -template -struct conservative_sparse_sparse_product_selector -{ - typedef typename traits::type>::Scalar Scalar; - - static void run(const Lhs& lhs, const Rhs& rhs, ResultType& res) - { - typedef SparseMatrix ColMajorMatrix; - ColMajorMatrix resCol(lhs.rows(), rhs.cols()); - internal::conservative_sparse_sparse_product_impl(lhs, rhs, resCol); - res = resCol; - } -}; - -template -struct conservative_sparse_sparse_product_selector -{ - static void run(const Lhs& lhs, const Rhs& rhs, ResultType& res) - { - typedef SparseMatrix ColMajorLhs; - typedef SparseMatrix ColMajorRes; - ColMajorLhs lhsCol = lhs; - ColMajorRes resCol(lhs.rows(), rhs.cols()); - internal::conservative_sparse_sparse_product_impl(lhsCol, rhs, resCol); - res = resCol; - } -}; - -template -struct conservative_sparse_sparse_product_selector -{ - static void run(const Lhs& lhs, const Rhs& rhs, ResultType& res) - { - typedef SparseMatrix ColMajorRhs; - typedef SparseMatrix ColMajorRes; - ColMajorRhs rhsCol = rhs; - ColMajorRes resCol(lhs.rows(), rhs.cols()); - internal::conservative_sparse_sparse_product_impl(lhs, rhsCol, resCol); - res = resCol; - } -}; - -template -struct conservative_sparse_sparse_product_selector -{ - static void run(const Lhs& lhs, const Rhs& rhs, ResultType& res) - { - typedef SparseMatrix RowMajorMatrix; - typedef SparseMatrix ColMajorMatrix; - RowMajorMatrix resRow(lhs.rows(),rhs.cols()); - internal::conservative_sparse_sparse_product_impl(rhs, lhs, resRow); - // sort the non zeros: - ColMajorMatrix resCol(resRow); - res = resCol; - } -}; - -} // end namespace internal - - -namespace internal { - -template -static void sparse_sparse_to_dense_product_impl(const Lhs& lhs, const Rhs& rhs, ResultType& res) -{ - typedef typename remove_all::type::Scalar LhsScalar; - typedef typename remove_all::type::Scalar RhsScalar; - Index cols = rhs.outerSize(); - eigen_assert(lhs.outerSize() == rhs.innerSize()); - - evaluator lhsEval(lhs); - evaluator rhsEval(rhs); - - for (Index j=0; j::InnerIterator rhsIt(rhsEval, j); rhsIt; ++rhsIt) - { - RhsScalar y = rhsIt.value(); - Index k = rhsIt.index(); - for (typename evaluator::InnerIterator lhsIt(lhsEval, k); lhsIt; ++lhsIt) - { - Index i = lhsIt.index(); - LhsScalar x = lhsIt.value(); - res.coeffRef(i,j) += x * y; - } - } - } -} - - -} // end namespace internal - -namespace internal { - -template::Flags&RowMajorBit) ? RowMajor : ColMajor, - int RhsStorageOrder = (traits::Flags&RowMajorBit) ? RowMajor : ColMajor> -struct sparse_sparse_to_dense_product_selector; - -template -struct sparse_sparse_to_dense_product_selector -{ - static void run(const Lhs& lhs, const Rhs& rhs, ResultType& res) - { - internal::sparse_sparse_to_dense_product_impl(lhs, rhs, res); - } -}; - -template -struct sparse_sparse_to_dense_product_selector -{ - static void run(const Lhs& lhs, const Rhs& rhs, ResultType& res) - { - typedef SparseMatrix ColMajorLhs; - ColMajorLhs lhsCol(lhs); - internal::sparse_sparse_to_dense_product_impl(lhsCol, rhs, res); - } -}; - -template -struct sparse_sparse_to_dense_product_selector -{ - static void run(const Lhs& lhs, const Rhs& rhs, ResultType& res) - { - typedef SparseMatrix ColMajorRhs; - ColMajorRhs rhsCol(rhs); - internal::sparse_sparse_to_dense_product_impl(lhs, rhsCol, res); - } -}; - -template -struct sparse_sparse_to_dense_product_selector -{ - static void run(const Lhs& lhs, const Rhs& rhs, ResultType& res) - { - Transpose trRes(res); - internal::sparse_sparse_to_dense_product_impl >(rhs, lhs, trRes); - } -}; - - -} // end namespace internal - -} // end namespace Eigen - -#endif // EIGEN_CONSERVATIVESPARSESPARSEPRODUCT_H diff --git a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/MappedSparseMatrix.h b/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/MappedSparseMatrix.h deleted file mode 100644 index 67718c85b..000000000 --- a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/MappedSparseMatrix.h +++ /dev/null @@ -1,67 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008-2014 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_MAPPED_SPARSEMATRIX_H -#define EIGEN_MAPPED_SPARSEMATRIX_H - -namespace Eigen { - -/** \deprecated Use Map > - * \class MappedSparseMatrix - * - * \brief Sparse matrix - * - * \param _Scalar the scalar type, i.e. the type of the coefficients - * - * See http://www.netlib.org/linalg/html_templates/node91.html for details on the storage scheme. - * - */ -namespace internal { -template -struct traits > : traits > -{}; -} // end namespace internal - -template -class MappedSparseMatrix - : public Map > -{ - typedef Map > Base; - - public: - - typedef typename Base::StorageIndex StorageIndex; - typedef typename Base::Scalar Scalar; - - inline MappedSparseMatrix(Index rows, Index cols, Index nnz, StorageIndex* outerIndexPtr, StorageIndex* innerIndexPtr, Scalar* valuePtr, StorageIndex* innerNonZeroPtr = 0) - : Base(rows, cols, nnz, outerIndexPtr, innerIndexPtr, valuePtr, innerNonZeroPtr) - {} - - /** Empty destructor */ - inline ~MappedSparseMatrix() {} -}; - -namespace internal { - -template -struct evaluator > - : evaluator > > -{ - typedef MappedSparseMatrix<_Scalar,_Options,_StorageIndex> XprType; - typedef evaluator > Base; - - evaluator() : Base() {} - explicit evaluator(const XprType &mat) : Base(mat) {} -}; - -} - -} // end namespace Eigen - -#endif // EIGEN_MAPPED_SPARSEMATRIX_H diff --git a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseAssign.h b/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseAssign.h deleted file mode 100644 index 905485c88..000000000 --- a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseAssign.h +++ /dev/null @@ -1,270 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008-2014 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_SPARSEASSIGN_H -#define EIGEN_SPARSEASSIGN_H - -namespace Eigen { - -template -template -Derived& SparseMatrixBase::operator=(const EigenBase &other) -{ - internal::call_assignment_no_alias(derived(), other.derived()); - return derived(); -} - -template -template -Derived& SparseMatrixBase::operator=(const ReturnByValue& other) -{ - // TODO use the evaluator mechanism - other.evalTo(derived()); - return derived(); -} - -template -template -inline Derived& SparseMatrixBase::operator=(const SparseMatrixBase& other) -{ - // by default sparse evaluation do not alias, so we can safely bypass the generic call_assignment routine - internal::Assignment > - ::run(derived(), other.derived(), internal::assign_op()); - return derived(); -} - -template -inline Derived& SparseMatrixBase::operator=(const Derived& other) -{ - internal::call_assignment_no_alias(derived(), other.derived()); - return derived(); -} - -namespace internal { - -template<> -struct storage_kind_to_evaluator_kind { - typedef IteratorBased Kind; -}; - -template<> -struct storage_kind_to_shape { - typedef SparseShape Shape; -}; - -struct Sparse2Sparse {}; -struct Sparse2Dense {}; - -template<> struct AssignmentKind { typedef Sparse2Sparse Kind; }; -template<> struct AssignmentKind { typedef Sparse2Sparse Kind; }; -template<> struct AssignmentKind { typedef Sparse2Dense Kind; }; -template<> struct AssignmentKind { typedef Sparse2Dense Kind; }; - - -template -void assign_sparse_to_sparse(DstXprType &dst, const SrcXprType &src) -{ - typedef typename DstXprType::Scalar Scalar; - typedef internal::evaluator DstEvaluatorType; - typedef internal::evaluator SrcEvaluatorType; - - SrcEvaluatorType srcEvaluator(src); - - const bool transpose = (DstEvaluatorType::Flags & RowMajorBit) != (SrcEvaluatorType::Flags & RowMajorBit); - const Index outerEvaluationSize = (SrcEvaluatorType::Flags&RowMajorBit) ? src.rows() : src.cols(); - if ((!transpose) && src.isRValue()) - { - // eval without temporary - dst.resize(src.rows(), src.cols()); - dst.setZero(); - dst.reserve((std::min)(src.rows()*src.cols(), (std::max)(src.rows(),src.cols())*2)); - for (Index j=0; j::SupportedAccessPatterns & OuterRandomAccessPattern)==OuterRandomAccessPattern) || - (!((DstEvaluatorType::Flags & RowMajorBit) != (SrcEvaluatorType::Flags & RowMajorBit)))) && - "the transpose operation is supposed to be handled in SparseMatrix::operator="); - - enum { Flip = (DstEvaluatorType::Flags & RowMajorBit) != (SrcEvaluatorType::Flags & RowMajorBit) }; - - - DstXprType temp(src.rows(), src.cols()); - - temp.reserve((std::min)(src.rows()*src.cols(), (std::max)(src.rows(),src.cols())*2)); - for (Index j=0; j -struct Assignment -{ - static void run(DstXprType &dst, const SrcXprType &src, const internal::assign_op &/*func*/) - { - assign_sparse_to_sparse(dst.derived(), src.derived()); - } -}; - -// Generic Sparse to Dense assignment -template< typename DstXprType, typename SrcXprType, typename Functor, typename Weak> -struct Assignment -{ - static void run(DstXprType &dst, const SrcXprType &src, const Functor &func) - { - if(internal::is_same >::value) - dst.setZero(); - - internal::evaluator srcEval(src); - resize_if_allowed(dst, src, func); - internal::evaluator dstEval(dst); - - const Index outerEvaluationSize = (internal::evaluator::Flags&RowMajorBit) ? src.rows() : src.cols(); - for (Index j=0; j::InnerIterator i(srcEval,j); i; ++i) - func.assignCoeff(dstEval.coeffRef(i.row(),i.col()), i.value()); - } -}; - -// Specialization for dense ?= dense +/- sparse and dense ?= sparse +/- dense -template -struct assignment_from_dense_op_sparse -{ - template - static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - void run(DstXprType &dst, const SrcXprType &src, const InitialFunc& /*func*/) - { - #ifdef EIGEN_SPARSE_ASSIGNMENT_FROM_DENSE_OP_SPARSE_PLUGIN - EIGEN_SPARSE_ASSIGNMENT_FROM_DENSE_OP_SPARSE_PLUGIN - #endif - - call_assignment_no_alias(dst, src.lhs(), Func1()); - call_assignment_no_alias(dst, src.rhs(), Func2()); - } - - // Specialization for dense1 = sparse + dense2; -> dense1 = dense2; dense1 += sparse; - template - static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - typename internal::enable_if::Shape,DenseShape>::value>::type - run(DstXprType &dst, const CwiseBinaryOp, const Lhs, const Rhs> &src, - const internal::assign_op& /*func*/) - { - #ifdef EIGEN_SPARSE_ASSIGNMENT_FROM_SPARSE_ADD_DENSE_PLUGIN - EIGEN_SPARSE_ASSIGNMENT_FROM_SPARSE_ADD_DENSE_PLUGIN - #endif - - // Apply the dense matrix first, then the sparse one. - call_assignment_no_alias(dst, src.rhs(), Func1()); - call_assignment_no_alias(dst, src.lhs(), Func2()); - } - - // Specialization for dense1 = sparse - dense2; -> dense1 = -dense2; dense1 += sparse; - template - static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE - typename internal::enable_if::Shape,DenseShape>::value>::type - run(DstXprType &dst, const CwiseBinaryOp, const Lhs, const Rhs> &src, - const internal::assign_op& /*func*/) - { - #ifdef EIGEN_SPARSE_ASSIGNMENT_FROM_SPARSE_SUB_DENSE_PLUGIN - EIGEN_SPARSE_ASSIGNMENT_FROM_SPARSE_SUB_DENSE_PLUGIN - #endif - - // Apply the dense matrix first, then the sparse one. - call_assignment_no_alias(dst, -src.rhs(), Func1()); - call_assignment_no_alias(dst, src.lhs(), add_assign_op()); - } -}; - -#define EIGEN_CATCH_ASSIGN_DENSE_OP_SPARSE(ASSIGN_OP,BINOP,ASSIGN_OP2) \ - template< typename DstXprType, typename Lhs, typename Rhs, typename Scalar> \ - struct Assignment, const Lhs, const Rhs>, internal::ASSIGN_OP, \ - Sparse2Dense, \ - typename internal::enable_if< internal::is_same::Shape,DenseShape>::value \ - || internal::is_same::Shape,DenseShape>::value>::type> \ - : assignment_from_dense_op_sparse, internal::ASSIGN_OP2 > \ - {} - -EIGEN_CATCH_ASSIGN_DENSE_OP_SPARSE(assign_op, scalar_sum_op,add_assign_op); -EIGEN_CATCH_ASSIGN_DENSE_OP_SPARSE(add_assign_op,scalar_sum_op,add_assign_op); -EIGEN_CATCH_ASSIGN_DENSE_OP_SPARSE(sub_assign_op,scalar_sum_op,sub_assign_op); - -EIGEN_CATCH_ASSIGN_DENSE_OP_SPARSE(assign_op, scalar_difference_op,sub_assign_op); -EIGEN_CATCH_ASSIGN_DENSE_OP_SPARSE(add_assign_op,scalar_difference_op,sub_assign_op); -EIGEN_CATCH_ASSIGN_DENSE_OP_SPARSE(sub_assign_op,scalar_difference_op,add_assign_op); - - -// Specialization for "dst = dec.solve(rhs)" -// NOTE we need to specialize it for Sparse2Sparse to avoid ambiguous specialization error -template -struct Assignment, internal::assign_op, Sparse2Sparse> -{ - typedef Solve SrcXprType; - static void run(DstXprType &dst, const SrcXprType &src, const internal::assign_op &) - { - Index dstRows = src.rows(); - Index dstCols = src.cols(); - if((dst.rows()!=dstRows) || (dst.cols()!=dstCols)) - dst.resize(dstRows, dstCols); - - src.dec()._solve_impl(src.rhs(), dst); - } -}; - -struct Diagonal2Sparse {}; - -template<> struct AssignmentKind { typedef Diagonal2Sparse Kind; }; - -template< typename DstXprType, typename SrcXprType, typename Functor> -struct Assignment -{ - typedef typename DstXprType::StorageIndex StorageIndex; - typedef typename DstXprType::Scalar Scalar; - - template - static void run(SparseMatrix &dst, const SrcXprType &src, const AssignFunc &func) - { dst.assignDiagonal(src.diagonal(), func); } - - template - static void run(SparseMatrixBase &dst, const SrcXprType &src, const internal::assign_op &/*func*/) - { dst.derived().diagonal() = src.diagonal(); } - - template - static void run(SparseMatrixBase &dst, const SrcXprType &src, const internal::add_assign_op &/*func*/) - { dst.derived().diagonal() += src.diagonal(); } - - template - static void run(SparseMatrixBase &dst, const SrcXprType &src, const internal::sub_assign_op &/*func*/) - { dst.derived().diagonal() -= src.diagonal(); } -}; -} // end namespace internal - -} // end namespace Eigen - -#endif // EIGEN_SPARSEASSIGN_H diff --git a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseBlock.h b/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseBlock.h deleted file mode 100644 index 5b4f6cc9f..000000000 --- a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseBlock.h +++ /dev/null @@ -1,571 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008-2014 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_SPARSE_BLOCK_H -#define EIGEN_SPARSE_BLOCK_H - -namespace Eigen { - -// Subset of columns or rows -template -class BlockImpl - : public SparseMatrixBase > -{ - typedef typename internal::remove_all::type _MatrixTypeNested; - typedef Block BlockType; -public: - enum { IsRowMajor = internal::traits::IsRowMajor }; -protected: - enum { OuterSize = IsRowMajor ? BlockRows : BlockCols }; - typedef SparseMatrixBase Base; - using Base::convert_index; -public: - EIGEN_SPARSE_PUBLIC_INTERFACE(BlockType) - - inline BlockImpl(XprType& xpr, Index i) - : m_matrix(xpr), m_outerStart(convert_index(i)), m_outerSize(OuterSize) - {} - - inline BlockImpl(XprType& xpr, Index startRow, Index startCol, Index blockRows, Index blockCols) - : m_matrix(xpr), m_outerStart(convert_index(IsRowMajor ? startRow : startCol)), m_outerSize(convert_index(IsRowMajor ? blockRows : blockCols)) - {} - - EIGEN_STRONG_INLINE Index rows() const { return IsRowMajor ? m_outerSize.value() : m_matrix.rows(); } - EIGEN_STRONG_INLINE Index cols() const { return IsRowMajor ? m_matrix.cols() : m_outerSize.value(); } - - Index nonZeros() const - { - typedef internal::evaluator EvaluatorType; - EvaluatorType matEval(m_matrix); - Index nnz = 0; - Index end = m_outerStart + m_outerSize.value(); - for(Index j=m_outerStart; j::non_const_type m_matrix; - Index m_outerStart; - const internal::variable_if_dynamic m_outerSize; - - protected: - // Disable assignment with clear error message. - // Note that simply removing operator= yields compilation errors with ICC+MSVC - template - BlockImpl& operator=(const T&) - { - EIGEN_STATIC_ASSERT(sizeof(T)==0, THIS_SPARSE_BLOCK_SUBEXPRESSION_IS_READ_ONLY); - return *this; - } -}; - - -/*************************************************************************** -* specialization for SparseMatrix -***************************************************************************/ - -namespace internal { - -template -class sparse_matrix_block_impl - : public SparseCompressedBase > -{ - typedef typename internal::remove_all::type _MatrixTypeNested; - typedef Block BlockType; - typedef SparseCompressedBase > Base; - using Base::convert_index; -public: - enum { IsRowMajor = internal::traits::IsRowMajor }; - EIGEN_SPARSE_PUBLIC_INTERFACE(BlockType) -protected: - typedef typename Base::IndexVector IndexVector; - enum { OuterSize = IsRowMajor ? BlockRows : BlockCols }; -public: - - inline sparse_matrix_block_impl(SparseMatrixType& xpr, Index i) - : m_matrix(xpr), m_outerStart(convert_index(i)), m_outerSize(OuterSize) - {} - - inline sparse_matrix_block_impl(SparseMatrixType& xpr, Index startRow, Index startCol, Index blockRows, Index blockCols) - : m_matrix(xpr), m_outerStart(convert_index(IsRowMajor ? startRow : startCol)), m_outerSize(convert_index(IsRowMajor ? blockRows : blockCols)) - {} - - template - inline BlockType& operator=(const SparseMatrixBase& other) - { - typedef typename internal::remove_all::type _NestedMatrixType; - _NestedMatrixType& matrix = m_matrix; - // This assignment is slow if this vector set is not empty - // and/or it is not at the end of the nonzeros of the underlying matrix. - - // 1 - eval to a temporary to avoid transposition and/or aliasing issues - Ref > tmp(other.derived()); - eigen_internal_assert(tmp.outerSize()==m_outerSize.value()); - - // 2 - let's check whether there is enough allocated memory - Index nnz = tmp.nonZeros(); - Index start = m_outerStart==0 ? 0 : m_matrix.outerIndexPtr()[m_outerStart]; // starting position of the current block - Index end = m_matrix.outerIndexPtr()[m_outerStart+m_outerSize.value()]; // ending position of the current block - Index block_size = end - start; // available room in the current block - Index tail_size = m_matrix.outerIndexPtr()[m_matrix.outerSize()] - end; - - Index free_size = m_matrix.isCompressed() - ? Index(matrix.data().allocatedSize()) + block_size - : block_size; - - Index tmp_start = tmp.outerIndexPtr()[0]; - - bool update_trailing_pointers = false; - if(nnz>free_size) - { - // realloc manually to reduce copies - typename SparseMatrixType::Storage newdata(m_matrix.data().allocatedSize() - block_size + nnz); - - internal::smart_copy(m_matrix.valuePtr(), m_matrix.valuePtr() + start, newdata.valuePtr()); - internal::smart_copy(m_matrix.innerIndexPtr(), m_matrix.innerIndexPtr() + start, newdata.indexPtr()); - - internal::smart_copy(tmp.valuePtr() + tmp_start, tmp.valuePtr() + tmp_start + nnz, newdata.valuePtr() + start); - internal::smart_copy(tmp.innerIndexPtr() + tmp_start, tmp.innerIndexPtr() + tmp_start + nnz, newdata.indexPtr() + start); - - internal::smart_copy(matrix.valuePtr()+end, matrix.valuePtr()+end + tail_size, newdata.valuePtr()+start+nnz); - internal::smart_copy(matrix.innerIndexPtr()+end, matrix.innerIndexPtr()+end + tail_size, newdata.indexPtr()+start+nnz); - - newdata.resize(m_matrix.outerIndexPtr()[m_matrix.outerSize()] - block_size + nnz); - - matrix.data().swap(newdata); - - update_trailing_pointers = true; - } - else - { - if(m_matrix.isCompressed() && nnz!=block_size) - { - // no need to realloc, simply copy the tail at its respective position and insert tmp - matrix.data().resize(start + nnz + tail_size); - - internal::smart_memmove(matrix.valuePtr()+end, matrix.valuePtr() + end+tail_size, matrix.valuePtr() + start+nnz); - internal::smart_memmove(matrix.innerIndexPtr()+end, matrix.innerIndexPtr() + end+tail_size, matrix.innerIndexPtr() + start+nnz); - - update_trailing_pointers = true; - } - - internal::smart_copy(tmp.valuePtr() + tmp_start, tmp.valuePtr() + tmp_start + nnz, matrix.valuePtr() + start); - internal::smart_copy(tmp.innerIndexPtr() + tmp_start, tmp.innerIndexPtr() + tmp_start + nnz, matrix.innerIndexPtr() + start); - } - - // update outer index pointers and innerNonZeros - if(IsVectorAtCompileTime) - { - if(!m_matrix.isCompressed()) - matrix.innerNonZeroPtr()[m_outerStart] = StorageIndex(nnz); - matrix.outerIndexPtr()[m_outerStart] = StorageIndex(start); - } - else - { - StorageIndex p = StorageIndex(start); - for(Index k=0; k(tmp.innerVector(k).nonZeros()); - if(!m_matrix.isCompressed()) - matrix.innerNonZeroPtr()[m_outerStart+k] = nnz_k; - matrix.outerIndexPtr()[m_outerStart+k] = p; - p += nnz_k; - } - } - - if(update_trailing_pointers) - { - StorageIndex offset = internal::convert_index(nnz - block_size); - for(Index k = m_outerStart + m_outerSize.value(); k<=matrix.outerSize(); ++k) - { - matrix.outerIndexPtr()[k] += offset; - } - } - - return derived(); - } - - inline BlockType& operator=(const BlockType& other) - { - return operator=(other); - } - - inline const Scalar* valuePtr() const - { return m_matrix.valuePtr(); } - inline Scalar* valuePtr() - { return m_matrix.valuePtr(); } - - inline const StorageIndex* innerIndexPtr() const - { return m_matrix.innerIndexPtr(); } - inline StorageIndex* innerIndexPtr() - { return m_matrix.innerIndexPtr(); } - - inline const StorageIndex* outerIndexPtr() const - { return m_matrix.outerIndexPtr() + m_outerStart; } - inline StorageIndex* outerIndexPtr() - { return m_matrix.outerIndexPtr() + m_outerStart; } - - inline const StorageIndex* innerNonZeroPtr() const - { return isCompressed() ? 0 : (m_matrix.innerNonZeroPtr()+m_outerStart); } - inline StorageIndex* innerNonZeroPtr() - { return isCompressed() ? 0 : (m_matrix.innerNonZeroPtr()+m_outerStart); } - - bool isCompressed() const { return m_matrix.innerNonZeroPtr()==0; } - - inline Scalar& coeffRef(Index row, Index col) - { - return m_matrix.coeffRef(row + (IsRowMajor ? m_outerStart : 0), col + (IsRowMajor ? 0 : m_outerStart)); - } - - inline const Scalar coeff(Index row, Index col) const - { - return m_matrix.coeff(row + (IsRowMajor ? m_outerStart : 0), col + (IsRowMajor ? 0 : m_outerStart)); - } - - inline const Scalar coeff(Index index) const - { - return m_matrix.coeff(IsRowMajor ? m_outerStart : index, IsRowMajor ? index : m_outerStart); - } - - const Scalar& lastCoeff() const - { - EIGEN_STATIC_ASSERT_VECTOR_ONLY(sparse_matrix_block_impl); - eigen_assert(Base::nonZeros()>0); - if(m_matrix.isCompressed()) - return m_matrix.valuePtr()[m_matrix.outerIndexPtr()[m_outerStart+1]-1]; - else - return m_matrix.valuePtr()[m_matrix.outerIndexPtr()[m_outerStart]+m_matrix.innerNonZeroPtr()[m_outerStart]-1]; - } - - EIGEN_STRONG_INLINE Index rows() const { return IsRowMajor ? m_outerSize.value() : m_matrix.rows(); } - EIGEN_STRONG_INLINE Index cols() const { return IsRowMajor ? m_matrix.cols() : m_outerSize.value(); } - - inline const SparseMatrixType& nestedExpression() const { return m_matrix; } - inline SparseMatrixType& nestedExpression() { return m_matrix; } - Index startRow() const { return IsRowMajor ? m_outerStart : 0; } - Index startCol() const { return IsRowMajor ? 0 : m_outerStart; } - Index blockRows() const { return IsRowMajor ? m_outerSize.value() : m_matrix.rows(); } - Index blockCols() const { return IsRowMajor ? m_matrix.cols() : m_outerSize.value(); } - - protected: - - typename internal::ref_selector::non_const_type m_matrix; - Index m_outerStart; - const internal::variable_if_dynamic m_outerSize; - -}; - -} // namespace internal - -template -class BlockImpl,BlockRows,BlockCols,true,Sparse> - : public internal::sparse_matrix_block_impl,BlockRows,BlockCols> -{ -public: - typedef _StorageIndex StorageIndex; - typedef SparseMatrix<_Scalar, _Options, _StorageIndex> SparseMatrixType; - typedef internal::sparse_matrix_block_impl Base; - inline BlockImpl(SparseMatrixType& xpr, Index i) - : Base(xpr, i) - {} - - inline BlockImpl(SparseMatrixType& xpr, Index startRow, Index startCol, Index blockRows, Index blockCols) - : Base(xpr, startRow, startCol, blockRows, blockCols) - {} - - using Base::operator=; -}; - -template -class BlockImpl,BlockRows,BlockCols,true,Sparse> - : public internal::sparse_matrix_block_impl,BlockRows,BlockCols> -{ -public: - typedef _StorageIndex StorageIndex; - typedef const SparseMatrix<_Scalar, _Options, _StorageIndex> SparseMatrixType; - typedef internal::sparse_matrix_block_impl Base; - inline BlockImpl(SparseMatrixType& xpr, Index i) - : Base(xpr, i) - {} - - inline BlockImpl(SparseMatrixType& xpr, Index startRow, Index startCol, Index blockRows, Index blockCols) - : Base(xpr, startRow, startCol, blockRows, blockCols) - {} - - using Base::operator=; -private: - template BlockImpl(const SparseMatrixBase& xpr, Index i); - template BlockImpl(const SparseMatrixBase& xpr); -}; - -//---------- - -/** Generic implementation of sparse Block expression. - * Real-only. - */ -template -class BlockImpl - : public SparseMatrixBase >, internal::no_assignment_operator -{ - typedef Block BlockType; - typedef SparseMatrixBase Base; - using Base::convert_index; -public: - enum { IsRowMajor = internal::traits::IsRowMajor }; - EIGEN_SPARSE_PUBLIC_INTERFACE(BlockType) - - typedef typename internal::remove_all::type _MatrixTypeNested; - - /** Column or Row constructor - */ - inline BlockImpl(XprType& xpr, Index i) - : m_matrix(xpr), - m_startRow( (BlockRows==1) && (BlockCols==XprType::ColsAtCompileTime) ? convert_index(i) : 0), - m_startCol( (BlockRows==XprType::RowsAtCompileTime) && (BlockCols==1) ? convert_index(i) : 0), - m_blockRows(BlockRows==1 ? 1 : xpr.rows()), - m_blockCols(BlockCols==1 ? 1 : xpr.cols()) - {} - - /** Dynamic-size constructor - */ - inline BlockImpl(XprType& xpr, Index startRow, Index startCol, Index blockRows, Index blockCols) - : m_matrix(xpr), m_startRow(convert_index(startRow)), m_startCol(convert_index(startCol)), m_blockRows(convert_index(blockRows)), m_blockCols(convert_index(blockCols)) - {} - - inline Index rows() const { return m_blockRows.value(); } - inline Index cols() const { return m_blockCols.value(); } - - inline Scalar& coeffRef(Index row, Index col) - { - return m_matrix.coeffRef(row + m_startRow.value(), col + m_startCol.value()); - } - - inline const Scalar coeff(Index row, Index col) const - { - return m_matrix.coeff(row + m_startRow.value(), col + m_startCol.value()); - } - - inline Scalar& coeffRef(Index index) - { - return m_matrix.coeffRef(m_startRow.value() + (RowsAtCompileTime == 1 ? 0 : index), - m_startCol.value() + (RowsAtCompileTime == 1 ? index : 0)); - } - - inline const Scalar coeff(Index index) const - { - return m_matrix.coeff(m_startRow.value() + (RowsAtCompileTime == 1 ? 0 : index), - m_startCol.value() + (RowsAtCompileTime == 1 ? index : 0)); - } - - inline const XprType& nestedExpression() const { return m_matrix; } - inline XprType& nestedExpression() { return m_matrix; } - Index startRow() const { return m_startRow.value(); } - Index startCol() const { return m_startCol.value(); } - Index blockRows() const { return m_blockRows.value(); } - Index blockCols() const { return m_blockCols.value(); } - - protected: -// friend class internal::GenericSparseBlockInnerIteratorImpl; - friend struct internal::unary_evaluator, internal::IteratorBased, Scalar >; - - Index nonZeros() const { return Dynamic; } - - typename internal::ref_selector::non_const_type m_matrix; - const internal::variable_if_dynamic m_startRow; - const internal::variable_if_dynamic m_startCol; - const internal::variable_if_dynamic m_blockRows; - const internal::variable_if_dynamic m_blockCols; - - protected: - // Disable assignment with clear error message. - // Note that simply removing operator= yields compilation errors with ICC+MSVC - template - BlockImpl& operator=(const T&) - { - EIGEN_STATIC_ASSERT(sizeof(T)==0, THIS_SPARSE_BLOCK_SUBEXPRESSION_IS_READ_ONLY); - return *this; - } - -}; - -namespace internal { - -template -struct unary_evaluator, IteratorBased > - : public evaluator_base > -{ - class InnerVectorInnerIterator; - class OuterVectorInnerIterator; - public: - typedef Block XprType; - typedef typename XprType::StorageIndex StorageIndex; - typedef typename XprType::Scalar Scalar; - - enum { - IsRowMajor = XprType::IsRowMajor, - - OuterVector = (BlockCols==1 && ArgType::IsRowMajor) - | // FIXME | instead of || to please GCC 4.4.0 stupid warning "suggest parentheses around &&". - // revert to || as soon as not needed anymore. - (BlockRows==1 && !ArgType::IsRowMajor), - - CoeffReadCost = evaluator::CoeffReadCost, - Flags = XprType::Flags - }; - - typedef typename internal::conditional::type InnerIterator; - - explicit unary_evaluator(const XprType& op) - : m_argImpl(op.nestedExpression()), m_block(op) - {} - - inline Index nonZerosEstimate() const { - const Index nnz = m_block.nonZeros(); - if(nnz < 0) { - // Scale the non-zero estimate for the underlying expression linearly with block size. - // Return zero if the underlying block is empty. - const Index nested_sz = m_block.nestedExpression().size(); - return nested_sz == 0 ? 0 : m_argImpl.nonZerosEstimate() * m_block.size() / nested_sz; - } - return nnz; - } - - protected: - typedef typename evaluator::InnerIterator EvalIterator; - - evaluator m_argImpl; - const XprType &m_block; -}; - -template -class unary_evaluator, IteratorBased>::InnerVectorInnerIterator - : public EvalIterator -{ - // NOTE MSVC fails to compile if we don't explicitely "import" IsRowMajor from unary_evaluator - // because the base class EvalIterator has a private IsRowMajor enum too. (bug #1786) - // NOTE We cannot call it IsRowMajor because it would shadow unary_evaluator::IsRowMajor - enum { XprIsRowMajor = unary_evaluator::IsRowMajor }; - const XprType& m_block; - Index m_end; -public: - - EIGEN_STRONG_INLINE InnerVectorInnerIterator(const unary_evaluator& aEval, Index outer) - : EvalIterator(aEval.m_argImpl, outer + (XprIsRowMajor ? aEval.m_block.startRow() : aEval.m_block.startCol())), - m_block(aEval.m_block), - m_end(XprIsRowMajor ? aEval.m_block.startCol()+aEval.m_block.blockCols() : aEval.m_block.startRow()+aEval.m_block.blockRows()) - { - while( (EvalIterator::operator bool()) && (EvalIterator::index() < (XprIsRowMajor ? m_block.startCol() : m_block.startRow())) ) - EvalIterator::operator++(); - } - - inline StorageIndex index() const { return EvalIterator::index() - convert_index(XprIsRowMajor ? m_block.startCol() : m_block.startRow()); } - inline Index outer() const { return EvalIterator::outer() - (XprIsRowMajor ? m_block.startRow() : m_block.startCol()); } - inline Index row() const { return EvalIterator::row() - m_block.startRow(); } - inline Index col() const { return EvalIterator::col() - m_block.startCol(); } - - inline operator bool() const { return EvalIterator::operator bool() && EvalIterator::index() < m_end; } -}; - -template -class unary_evaluator, IteratorBased>::OuterVectorInnerIterator -{ - // NOTE see above - enum { XprIsRowMajor = unary_evaluator::IsRowMajor }; - const unary_evaluator& m_eval; - Index m_outerPos; - const Index m_innerIndex; - Index m_end; - EvalIterator m_it; -public: - - EIGEN_STRONG_INLINE OuterVectorInnerIterator(const unary_evaluator& aEval, Index outer) - : m_eval(aEval), - m_outerPos( (XprIsRowMajor ? aEval.m_block.startCol() : aEval.m_block.startRow()) ), - m_innerIndex(XprIsRowMajor ? aEval.m_block.startRow() : aEval.m_block.startCol()), - m_end(XprIsRowMajor ? aEval.m_block.startCol()+aEval.m_block.blockCols() : aEval.m_block.startRow()+aEval.m_block.blockRows()), - m_it(m_eval.m_argImpl, m_outerPos) - { - EIGEN_UNUSED_VARIABLE(outer); - eigen_assert(outer==0); - - while(m_it && m_it.index() < m_innerIndex) ++m_it; - if((!m_it) || (m_it.index()!=m_innerIndex)) - ++(*this); - } - - inline StorageIndex index() const { return convert_index(m_outerPos - (XprIsRowMajor ? m_eval.m_block.startCol() : m_eval.m_block.startRow())); } - inline Index outer() const { return 0; } - inline Index row() const { return XprIsRowMajor ? 0 : index(); } - inline Index col() const { return XprIsRowMajor ? index() : 0; } - - inline Scalar value() const { return m_it.value(); } - inline Scalar& valueRef() { return m_it.valueRef(); } - - inline OuterVectorInnerIterator& operator++() - { - // search next non-zero entry - while(++m_outerPos -struct unary_evaluator,BlockRows,BlockCols,true>, IteratorBased> - : evaluator,BlockRows,BlockCols,true> > > -{ - typedef Block,BlockRows,BlockCols,true> XprType; - typedef evaluator > Base; - explicit unary_evaluator(const XprType &xpr) : Base(xpr) {} -}; - -template -struct unary_evaluator,BlockRows,BlockCols,true>, IteratorBased> - : evaluator,BlockRows,BlockCols,true> > > -{ - typedef Block,BlockRows,BlockCols,true> XprType; - typedef evaluator > Base; - explicit unary_evaluator(const XprType &xpr) : Base(xpr) {} -}; - -} // end namespace internal - - -} // end namespace Eigen - -#endif // EIGEN_SPARSE_BLOCK_H diff --git a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseColEtree.h b/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseColEtree.h deleted file mode 100644 index ebe02d1ab..000000000 --- a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseColEtree.h +++ /dev/null @@ -1,206 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2012 Désiré Nuentsa-Wakam -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - - -/* - - * NOTE: This file is the modified version of sp_coletree.c file in SuperLU - - * -- SuperLU routine (version 3.1) -- - * Univ. of California Berkeley, Xerox Palo Alto Research Center, - * and Lawrence Berkeley National Lab. - * August 1, 2008 - * - * Copyright (c) 1994 by Xerox Corporation. All rights reserved. - * - * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY - * EXPRESSED OR IMPLIED. ANY USE IS AT YOUR OWN RISK. - * - * Permission is hereby granted to use or copy this program for any - * purpose, provided the above notices are retained on all copies. - * Permission to modify the code and to distribute modified code is - * granted, provided the above notices are retained, and a notice that - * the code was modified is included with the above copyright notice. - */ -#ifndef SPARSE_COLETREE_H -#define SPARSE_COLETREE_H - -namespace Eigen { - -namespace internal { - -/** Find the root of the tree/set containing the vertex i : Use Path halving */ -template -Index etree_find (Index i, IndexVector& pp) -{ - Index p = pp(i); // Parent - Index gp = pp(p); // Grand parent - while (gp != p) - { - pp(i) = gp; // Parent pointer on find path is changed to former grand parent - i = gp; - p = pp(i); - gp = pp(p); - } - return p; -} - -/** Compute the column elimination tree of a sparse matrix - * \param mat The matrix in column-major format. - * \param parent The elimination tree - * \param firstRowElt The column index of the first element in each row - * \param perm The permutation to apply to the column of \b mat - */ -template -int coletree(const MatrixType& mat, IndexVector& parent, IndexVector& firstRowElt, typename MatrixType::StorageIndex *perm=0) -{ - typedef typename MatrixType::StorageIndex StorageIndex; - StorageIndex nc = convert_index(mat.cols()); // Number of columns - StorageIndex m = convert_index(mat.rows()); - StorageIndex diagSize = (std::min)(nc,m); - IndexVector root(nc); // root of subtree of etree - root.setZero(); - IndexVector pp(nc); // disjoint sets - pp.setZero(); // Initialize disjoint sets - parent.resize(mat.cols()); - //Compute first nonzero column in each row - firstRowElt.resize(m); - firstRowElt.setConstant(nc); - firstRowElt.segment(0, diagSize).setLinSpaced(diagSize, 0, diagSize-1); - bool found_diag; - for (StorageIndex col = 0; col < nc; col++) - { - StorageIndex pcol = col; - if(perm) pcol = perm[col]; - for (typename MatrixType::InnerIterator it(mat, pcol); it; ++it) - { - Index row = it.row(); - firstRowElt(row) = (std::min)(firstRowElt(row), col); - } - } - /* Compute etree by Liu's algorithm for symmetric matrices, - except use (firstRowElt[r],c) in place of an edge (r,c) of A. - Thus each row clique in A'*A is replaced by a star - centered at its first vertex, which has the same fill. */ - StorageIndex rset, cset, rroot; - for (StorageIndex col = 0; col < nc; col++) - { - found_diag = col>=m; - pp(col) = col; - cset = col; - root(cset) = col; - parent(col) = nc; - /* The diagonal element is treated here even if it does not exist in the matrix - * hence the loop is executed once more */ - StorageIndex pcol = col; - if(perm) pcol = perm[col]; - for (typename MatrixType::InnerIterator it(mat, pcol); it||!found_diag; ++it) - { // A sequence of interleaved find and union is performed - Index i = col; - if(it) i = it.index(); - if (i == col) found_diag = true; - - StorageIndex row = firstRowElt(i); - if (row >= col) continue; - rset = internal::etree_find(row, pp); // Find the name of the set containing row - rroot = root(rset); - if (rroot != col) - { - parent(rroot) = col; - pp(cset) = rset; - cset = rset; - root(cset) = col; - } - } - } - return 0; -} - -/** - * Depth-first search from vertex n. No recursion. - * This routine was contributed by Cédric Doucet, CEDRAT Group, Meylan, France. -*/ -template -void nr_etdfs (typename IndexVector::Scalar n, IndexVector& parent, IndexVector& first_kid, IndexVector& next_kid, IndexVector& post, typename IndexVector::Scalar postnum) -{ - typedef typename IndexVector::Scalar StorageIndex; - StorageIndex current = n, first, next; - while (postnum != n) - { - // No kid for the current node - first = first_kid(current); - - // no kid for the current node - if (first == -1) - { - // Numbering this node because it has no kid - post(current) = postnum++; - - // looking for the next kid - next = next_kid(current); - while (next == -1) - { - // No more kids : back to the parent node - current = parent(current); - // numbering the parent node - post(current) = postnum++; - - // Get the next kid - next = next_kid(current); - } - // stopping criterion - if (postnum == n+1) return; - - // Updating current node - current = next; - } - else - { - current = first; - } - } -} - - -/** - * \brief Post order a tree - * \param n the number of nodes - * \param parent Input tree - * \param post postordered tree - */ -template -void treePostorder(typename IndexVector::Scalar n, IndexVector& parent, IndexVector& post) -{ - typedef typename IndexVector::Scalar StorageIndex; - IndexVector first_kid, next_kid; // Linked list of children - StorageIndex postnum; - // Allocate storage for working arrays and results - first_kid.resize(n+1); - next_kid.setZero(n+1); - post.setZero(n+1); - - // Set up structure describing children - first_kid.setConstant(-1); - for (StorageIndex v = n-1; v >= 0; v--) - { - StorageIndex dad = parent(v); - next_kid(v) = first_kid(dad); - first_kid(dad) = v; - } - - // Depth-first search from dummy root vertex #n - postnum = 0; - internal::nr_etdfs(n, parent, first_kid, next_kid, post, postnum); -} - -} // end namespace internal - -} // end namespace Eigen - -#endif // SPARSE_COLETREE_H diff --git a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseCompressedBase.h b/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseCompressedBase.h deleted file mode 100644 index 6a2c7a8ce..000000000 --- a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseCompressedBase.h +++ /dev/null @@ -1,370 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2015 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_SPARSE_COMPRESSED_BASE_H -#define EIGEN_SPARSE_COMPRESSED_BASE_H - -namespace Eigen { - -template class SparseCompressedBase; - -namespace internal { - -template -struct traits > : traits -{}; - -} // end namespace internal - -/** \ingroup SparseCore_Module - * \class SparseCompressedBase - * \brief Common base class for sparse [compressed]-{row|column}-storage format. - * - * This class defines the common interface for all derived classes implementing the compressed sparse storage format, such as: - * - SparseMatrix - * - Ref - * - Map - * - */ -template -class SparseCompressedBase - : public SparseMatrixBase -{ - public: - typedef SparseMatrixBase Base; - EIGEN_SPARSE_PUBLIC_INTERFACE(SparseCompressedBase) - using Base::operator=; - using Base::IsRowMajor; - - class InnerIterator; - class ReverseInnerIterator; - - protected: - typedef typename Base::IndexVector IndexVector; - Eigen::Map innerNonZeros() { return Eigen::Map(innerNonZeroPtr(), isCompressed()?0:derived().outerSize()); } - const Eigen::Map innerNonZeros() const { return Eigen::Map(innerNonZeroPtr(), isCompressed()?0:derived().outerSize()); } - - public: - - /** \returns the number of non zero coefficients */ - inline Index nonZeros() const - { - if(Derived::IsVectorAtCompileTime && outerIndexPtr()==0) - return derived().nonZeros(); - else if(isCompressed()) - return outerIndexPtr()[derived().outerSize()]-outerIndexPtr()[0]; - else if(derived().outerSize()==0) - return 0; - else - return innerNonZeros().sum(); - } - - /** \returns a const pointer to the array of values. - * This function is aimed at interoperability with other libraries. - * \sa innerIndexPtr(), outerIndexPtr() */ - inline const Scalar* valuePtr() const { return derived().valuePtr(); } - /** \returns a non-const pointer to the array of values. - * This function is aimed at interoperability with other libraries. - * \sa innerIndexPtr(), outerIndexPtr() */ - inline Scalar* valuePtr() { return derived().valuePtr(); } - - /** \returns a const pointer to the array of inner indices. - * This function is aimed at interoperability with other libraries. - * \sa valuePtr(), outerIndexPtr() */ - inline const StorageIndex* innerIndexPtr() const { return derived().innerIndexPtr(); } - /** \returns a non-const pointer to the array of inner indices. - * This function is aimed at interoperability with other libraries. - * \sa valuePtr(), outerIndexPtr() */ - inline StorageIndex* innerIndexPtr() { return derived().innerIndexPtr(); } - - /** \returns a const pointer to the array of the starting positions of the inner vectors. - * This function is aimed at interoperability with other libraries. - * \warning it returns the null pointer 0 for SparseVector - * \sa valuePtr(), innerIndexPtr() */ - inline const StorageIndex* outerIndexPtr() const { return derived().outerIndexPtr(); } - /** \returns a non-const pointer to the array of the starting positions of the inner vectors. - * This function is aimed at interoperability with other libraries. - * \warning it returns the null pointer 0 for SparseVector - * \sa valuePtr(), innerIndexPtr() */ - inline StorageIndex* outerIndexPtr() { return derived().outerIndexPtr(); } - - /** \returns a const pointer to the array of the number of non zeros of the inner vectors. - * This function is aimed at interoperability with other libraries. - * \warning it returns the null pointer 0 in compressed mode */ - inline const StorageIndex* innerNonZeroPtr() const { return derived().innerNonZeroPtr(); } - /** \returns a non-const pointer to the array of the number of non zeros of the inner vectors. - * This function is aimed at interoperability with other libraries. - * \warning it returns the null pointer 0 in compressed mode */ - inline StorageIndex* innerNonZeroPtr() { return derived().innerNonZeroPtr(); } - - /** \returns whether \c *this is in compressed form. */ - inline bool isCompressed() const { return innerNonZeroPtr()==0; } - - /** \returns a read-only view of the stored coefficients as a 1D array expression. - * - * \warning this method is for \b compressed \b storage \b only, and it will trigger an assertion otherwise. - * - * \sa valuePtr(), isCompressed() */ - const Map > coeffs() const { eigen_assert(isCompressed()); return Array::Map(valuePtr(),nonZeros()); } - - /** \returns a read-write view of the stored coefficients as a 1D array expression - * - * \warning this method is for \b compressed \b storage \b only, and it will trigger an assertion otherwise. - * - * Here is an example: - * \include SparseMatrix_coeffs.cpp - * and the output is: - * \include SparseMatrix_coeffs.out - * - * \sa valuePtr(), isCompressed() */ - Map > coeffs() { eigen_assert(isCompressed()); return Array::Map(valuePtr(),nonZeros()); } - - protected: - /** Default constructor. Do nothing. */ - SparseCompressedBase() {} - - /** \internal return the index of the coeff at (row,col) or just before if it does not exist. - * This is an analogue of std::lower_bound. - */ - internal::LowerBoundIndex lower_bound(Index row, Index col) const - { - eigen_internal_assert(row>=0 && rowrows() && col>=0 && colcols()); - - const Index outer = Derived::IsRowMajor ? row : col; - const Index inner = Derived::IsRowMajor ? col : row; - - Index start = this->outerIndexPtr()[outer]; - Index end = this->isCompressed() ? this->outerIndexPtr()[outer+1] : this->outerIndexPtr()[outer] + this->innerNonZeroPtr()[outer]; - eigen_assert(end>=start && "you are using a non finalized sparse matrix or written coefficient does not exist"); - internal::LowerBoundIndex p; - p.value = std::lower_bound(this->innerIndexPtr()+start, this->innerIndexPtr()+end,inner) - this->innerIndexPtr(); - p.found = (p.valueinnerIndexPtr()[p.value]==inner); - return p; - } - - friend struct internal::evaluator >; - - private: - template explicit SparseCompressedBase(const SparseCompressedBase&); -}; - -template -class SparseCompressedBase::InnerIterator -{ - public: - InnerIterator() - : m_values(0), m_indices(0), m_outer(0), m_id(0), m_end(0) - {} - - InnerIterator(const InnerIterator& other) - : m_values(other.m_values), m_indices(other.m_indices), m_outer(other.m_outer), m_id(other.m_id), m_end(other.m_end) - {} - - InnerIterator& operator=(const InnerIterator& other) - { - m_values = other.m_values; - m_indices = other.m_indices; - const_cast(m_outer).setValue(other.m_outer.value()); - m_id = other.m_id; - m_end = other.m_end; - return *this; - } - - InnerIterator(const SparseCompressedBase& mat, Index outer) - : m_values(mat.valuePtr()), m_indices(mat.innerIndexPtr()), m_outer(outer) - { - if(Derived::IsVectorAtCompileTime && mat.outerIndexPtr()==0) - { - m_id = 0; - m_end = mat.nonZeros(); - } - else - { - m_id = mat.outerIndexPtr()[outer]; - if(mat.isCompressed()) - m_end = mat.outerIndexPtr()[outer+1]; - else - m_end = m_id + mat.innerNonZeroPtr()[outer]; - } - } - - explicit InnerIterator(const SparseCompressedBase& mat) - : m_values(mat.valuePtr()), m_indices(mat.innerIndexPtr()), m_outer(0), m_id(0), m_end(mat.nonZeros()) - { - EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived); - } - - explicit InnerIterator(const internal::CompressedStorage& data) - : m_values(data.valuePtr()), m_indices(data.indexPtr()), m_outer(0), m_id(0), m_end(data.size()) - { - EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived); - } - - inline InnerIterator& operator++() { m_id++; return *this; } - inline InnerIterator& operator+=(Index i) { m_id += i ; return *this; } - - inline InnerIterator operator+(Index i) - { - InnerIterator result = *this; - result += i; - return result; - } - - inline const Scalar& value() const { return m_values[m_id]; } - inline Scalar& valueRef() { return const_cast(m_values[m_id]); } - - inline StorageIndex index() const { return m_indices[m_id]; } - inline Index outer() const { return m_outer.value(); } - inline Index row() const { return IsRowMajor ? m_outer.value() : index(); } - inline Index col() const { return IsRowMajor ? index() : m_outer.value(); } - - inline operator bool() const { return (m_id < m_end); } - - protected: - const Scalar* m_values; - const StorageIndex* m_indices; - typedef internal::variable_if_dynamic OuterType; - const OuterType m_outer; - Index m_id; - Index m_end; - private: - // If you get here, then you're not using the right InnerIterator type, e.g.: - // SparseMatrix A; - // SparseMatrix::InnerIterator it(A,0); - template InnerIterator(const SparseMatrixBase&, Index outer); -}; - -template -class SparseCompressedBase::ReverseInnerIterator -{ - public: - ReverseInnerIterator(const SparseCompressedBase& mat, Index outer) - : m_values(mat.valuePtr()), m_indices(mat.innerIndexPtr()), m_outer(outer) - { - if(Derived::IsVectorAtCompileTime && mat.outerIndexPtr()==0) - { - m_start = 0; - m_id = mat.nonZeros(); - } - else - { - m_start = mat.outerIndexPtr()[outer]; - if(mat.isCompressed()) - m_id = mat.outerIndexPtr()[outer+1]; - else - m_id = m_start + mat.innerNonZeroPtr()[outer]; - } - } - - explicit ReverseInnerIterator(const SparseCompressedBase& mat) - : m_values(mat.valuePtr()), m_indices(mat.innerIndexPtr()), m_outer(0), m_start(0), m_id(mat.nonZeros()) - { - EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived); - } - - explicit ReverseInnerIterator(const internal::CompressedStorage& data) - : m_values(data.valuePtr()), m_indices(data.indexPtr()), m_outer(0), m_start(0), m_id(data.size()) - { - EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived); - } - - inline ReverseInnerIterator& operator--() { --m_id; return *this; } - inline ReverseInnerIterator& operator-=(Index i) { m_id -= i; return *this; } - - inline ReverseInnerIterator operator-(Index i) - { - ReverseInnerIterator result = *this; - result -= i; - return result; - } - - inline const Scalar& value() const { return m_values[m_id-1]; } - inline Scalar& valueRef() { return const_cast(m_values[m_id-1]); } - - inline StorageIndex index() const { return m_indices[m_id-1]; } - inline Index outer() const { return m_outer.value(); } - inline Index row() const { return IsRowMajor ? m_outer.value() : index(); } - inline Index col() const { return IsRowMajor ? index() : m_outer.value(); } - - inline operator bool() const { return (m_id > m_start); } - - protected: - const Scalar* m_values; - const StorageIndex* m_indices; - typedef internal::variable_if_dynamic OuterType; - const OuterType m_outer; - Index m_start; - Index m_id; -}; - -namespace internal { - -template -struct evaluator > - : evaluator_base -{ - typedef typename Derived::Scalar Scalar; - typedef typename Derived::InnerIterator InnerIterator; - - enum { - CoeffReadCost = NumTraits::ReadCost, - Flags = Derived::Flags - }; - - evaluator() : m_matrix(0), m_zero(0) - { - EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); - } - explicit evaluator(const Derived &mat) : m_matrix(&mat), m_zero(0) - { - EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); - } - - inline Index nonZerosEstimate() const { - return m_matrix->nonZeros(); - } - - operator Derived&() { return m_matrix->const_cast_derived(); } - operator const Derived&() const { return *m_matrix; } - - typedef typename DenseCoeffsBase::CoeffReturnType CoeffReturnType; - const Scalar& coeff(Index row, Index col) const - { - Index p = find(row,col); - - if(p==Dynamic) - return m_zero; - else - return m_matrix->const_cast_derived().valuePtr()[p]; - } - - Scalar& coeffRef(Index row, Index col) - { - Index p = find(row,col); - eigen_assert(p!=Dynamic && "written coefficient does not exist"); - return m_matrix->const_cast_derived().valuePtr()[p]; - } - -protected: - - Index find(Index row, Index col) const - { - internal::LowerBoundIndex p = m_matrix->lower_bound(row,col); - return p.found ? p.value : Dynamic; - } - - const Derived *m_matrix; - const Scalar m_zero; -}; - -} - -} // end namespace Eigen - -#endif // EIGEN_SPARSE_COMPRESSED_BASE_H diff --git a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseCwiseBinaryOp.h b/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseCwiseBinaryOp.h deleted file mode 100644 index 9b0d3f98d..000000000 --- a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +++ /dev/null @@ -1,722 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008-2014 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_SPARSE_CWISE_BINARY_OP_H -#define EIGEN_SPARSE_CWISE_BINARY_OP_H - -namespace Eigen { - -// Here we have to handle 3 cases: -// 1 - sparse op dense -// 2 - dense op sparse -// 3 - sparse op sparse -// We also need to implement a 4th iterator for: -// 4 - dense op dense -// Finally, we also need to distinguish between the product and other operations : -// configuration returned mode -// 1 - sparse op dense product sparse -// generic dense -// 2 - dense op sparse product sparse -// generic dense -// 3 - sparse op sparse product sparse -// generic sparse -// 4 - dense op dense product dense -// generic dense -// -// TODO to ease compiler job, we could specialize product/quotient with a scalar -// and fallback to cwise-unary evaluator using bind1st_op and bind2nd_op. - -template -class CwiseBinaryOpImpl - : public SparseMatrixBase > -{ - public: - typedef CwiseBinaryOp Derived; - typedef SparseMatrixBase Base; - EIGEN_SPARSE_PUBLIC_INTERFACE(Derived) - CwiseBinaryOpImpl() - { - EIGEN_STATIC_ASSERT(( - (!internal::is_same::StorageKind, - typename internal::traits::StorageKind>::value) - || ((internal::evaluator::Flags&RowMajorBit) == (internal::evaluator::Flags&RowMajorBit))), - THE_STORAGE_ORDER_OF_BOTH_SIDES_MUST_MATCH); - } -}; - -namespace internal { - - -// Generic "sparse OP sparse" -template struct binary_sparse_evaluator; - -template -struct binary_evaluator, IteratorBased, IteratorBased> - : evaluator_base > -{ -protected: - typedef typename evaluator::InnerIterator LhsIterator; - typedef typename evaluator::InnerIterator RhsIterator; - typedef CwiseBinaryOp XprType; - typedef typename traits::Scalar Scalar; - typedef typename XprType::StorageIndex StorageIndex; -public: - - class InnerIterator - { - public: - - EIGEN_STRONG_INLINE InnerIterator(const binary_evaluator& aEval, Index outer) - : m_lhsIter(aEval.m_lhsImpl,outer), m_rhsIter(aEval.m_rhsImpl,outer), m_functor(aEval.m_functor) - { - this->operator++(); - } - - EIGEN_STRONG_INLINE InnerIterator& operator++() - { - if (m_lhsIter && m_rhsIter && (m_lhsIter.index() == m_rhsIter.index())) - { - m_id = m_lhsIter.index(); - m_value = m_functor(m_lhsIter.value(), m_rhsIter.value()); - ++m_lhsIter; - ++m_rhsIter; - } - else if (m_lhsIter && (!m_rhsIter || (m_lhsIter.index() < m_rhsIter.index()))) - { - m_id = m_lhsIter.index(); - m_value = m_functor(m_lhsIter.value(), Scalar(0)); - ++m_lhsIter; - } - else if (m_rhsIter && (!m_lhsIter || (m_lhsIter.index() > m_rhsIter.index()))) - { - m_id = m_rhsIter.index(); - m_value = m_functor(Scalar(0), m_rhsIter.value()); - ++m_rhsIter; - } - else - { - m_value = Scalar(0); // this is to avoid a compilation warning - m_id = -1; - } - return *this; - } - - EIGEN_STRONG_INLINE Scalar value() const { return m_value; } - - EIGEN_STRONG_INLINE StorageIndex index() const { return m_id; } - EIGEN_STRONG_INLINE Index outer() const { return m_lhsIter.outer(); } - EIGEN_STRONG_INLINE Index row() const { return Lhs::IsRowMajor ? m_lhsIter.row() : index(); } - EIGEN_STRONG_INLINE Index col() const { return Lhs::IsRowMajor ? index() : m_lhsIter.col(); } - - EIGEN_STRONG_INLINE operator bool() const { return m_id>=0; } - - protected: - LhsIterator m_lhsIter; - RhsIterator m_rhsIter; - const BinaryOp& m_functor; - Scalar m_value; - StorageIndex m_id; - }; - - - enum { - CoeffReadCost = int(evaluator::CoeffReadCost) + int(evaluator::CoeffReadCost) + int(functor_traits::Cost), - Flags = XprType::Flags - }; - - explicit binary_evaluator(const XprType& xpr) - : m_functor(xpr.functor()), - m_lhsImpl(xpr.lhs()), - m_rhsImpl(xpr.rhs()) - { - EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits::Cost); - EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); - } - - inline Index nonZerosEstimate() const { - return m_lhsImpl.nonZerosEstimate() + m_rhsImpl.nonZerosEstimate(); - } - -protected: - const BinaryOp m_functor; - evaluator m_lhsImpl; - evaluator m_rhsImpl; -}; - -// dense op sparse -template -struct binary_evaluator, IndexBased, IteratorBased> - : evaluator_base > -{ -protected: - typedef typename evaluator::InnerIterator RhsIterator; - typedef CwiseBinaryOp XprType; - typedef typename traits::Scalar Scalar; - typedef typename XprType::StorageIndex StorageIndex; -public: - - class InnerIterator - { - enum { IsRowMajor = (int(Rhs::Flags)&RowMajorBit)==RowMajorBit }; - public: - - EIGEN_STRONG_INLINE InnerIterator(const binary_evaluator& aEval, Index outer) - : m_lhsEval(aEval.m_lhsImpl), m_rhsIter(aEval.m_rhsImpl,outer), m_functor(aEval.m_functor), m_value(0), m_id(-1), m_innerSize(aEval.m_expr.rhs().innerSize()) - { - this->operator++(); - } - - EIGEN_STRONG_INLINE InnerIterator& operator++() - { - ++m_id; - if(m_id &m_lhsEval; - RhsIterator m_rhsIter; - const BinaryOp& m_functor; - Scalar m_value; - StorageIndex m_id; - StorageIndex m_innerSize; - }; - - - enum { - CoeffReadCost = int(evaluator::CoeffReadCost) + int(evaluator::CoeffReadCost) + int(functor_traits::Cost), - Flags = XprType::Flags - }; - - explicit binary_evaluator(const XprType& xpr) - : m_functor(xpr.functor()), - m_lhsImpl(xpr.lhs()), - m_rhsImpl(xpr.rhs()), - m_expr(xpr) - { - EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits::Cost); - EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); - } - - inline Index nonZerosEstimate() const { - return m_expr.size(); - } - -protected: - const BinaryOp m_functor; - evaluator m_lhsImpl; - evaluator m_rhsImpl; - const XprType &m_expr; -}; - -// sparse op dense -template -struct binary_evaluator, IteratorBased, IndexBased> - : evaluator_base > -{ -protected: - typedef typename evaluator::InnerIterator LhsIterator; - typedef CwiseBinaryOp XprType; - typedef typename traits::Scalar Scalar; - typedef typename XprType::StorageIndex StorageIndex; -public: - - class InnerIterator - { - enum { IsRowMajor = (int(Lhs::Flags)&RowMajorBit)==RowMajorBit }; - public: - - EIGEN_STRONG_INLINE InnerIterator(const binary_evaluator& aEval, Index outer) - : m_lhsIter(aEval.m_lhsImpl,outer), m_rhsEval(aEval.m_rhsImpl), m_functor(aEval.m_functor), m_value(0), m_id(-1), m_innerSize(aEval.m_expr.lhs().innerSize()) - { - this->operator++(); - } - - EIGEN_STRONG_INLINE InnerIterator& operator++() - { - ++m_id; - if(m_id &m_rhsEval; - const BinaryOp& m_functor; - Scalar m_value; - StorageIndex m_id; - StorageIndex m_innerSize; - }; - - - enum { - CoeffReadCost = int(evaluator::CoeffReadCost) + int(evaluator::CoeffReadCost) + int(functor_traits::Cost), - Flags = XprType::Flags - }; - - explicit binary_evaluator(const XprType& xpr) - : m_functor(xpr.functor()), - m_lhsImpl(xpr.lhs()), - m_rhsImpl(xpr.rhs()), - m_expr(xpr) - { - EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits::Cost); - EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); - } - - inline Index nonZerosEstimate() const { - return m_expr.size(); - } - -protected: - const BinaryOp m_functor; - evaluator m_lhsImpl; - evaluator m_rhsImpl; - const XprType &m_expr; -}; - -template::Kind, - typename RhsKind = typename evaluator_traits::Kind, - typename LhsScalar = typename traits::Scalar, - typename RhsScalar = typename traits::Scalar> struct sparse_conjunction_evaluator; - -// "sparse .* sparse" -template -struct binary_evaluator, Lhs, Rhs>, IteratorBased, IteratorBased> - : sparse_conjunction_evaluator, Lhs, Rhs> > -{ - typedef CwiseBinaryOp, Lhs, Rhs> XprType; - typedef sparse_conjunction_evaluator Base; - explicit binary_evaluator(const XprType& xpr) : Base(xpr) {} -}; -// "dense .* sparse" -template -struct binary_evaluator, Lhs, Rhs>, IndexBased, IteratorBased> - : sparse_conjunction_evaluator, Lhs, Rhs> > -{ - typedef CwiseBinaryOp, Lhs, Rhs> XprType; - typedef sparse_conjunction_evaluator Base; - explicit binary_evaluator(const XprType& xpr) : Base(xpr) {} -}; -// "sparse .* dense" -template -struct binary_evaluator, Lhs, Rhs>, IteratorBased, IndexBased> - : sparse_conjunction_evaluator, Lhs, Rhs> > -{ - typedef CwiseBinaryOp, Lhs, Rhs> XprType; - typedef sparse_conjunction_evaluator Base; - explicit binary_evaluator(const XprType& xpr) : Base(xpr) {} -}; - -// "sparse ./ dense" -template -struct binary_evaluator, Lhs, Rhs>, IteratorBased, IndexBased> - : sparse_conjunction_evaluator, Lhs, Rhs> > -{ - typedef CwiseBinaryOp, Lhs, Rhs> XprType; - typedef sparse_conjunction_evaluator Base; - explicit binary_evaluator(const XprType& xpr) : Base(xpr) {} -}; - -// "sparse && sparse" -template -struct binary_evaluator, IteratorBased, IteratorBased> - : sparse_conjunction_evaluator > -{ - typedef CwiseBinaryOp XprType; - typedef sparse_conjunction_evaluator Base; - explicit binary_evaluator(const XprType& xpr) : Base(xpr) {} -}; -// "dense && sparse" -template -struct binary_evaluator, IndexBased, IteratorBased> - : sparse_conjunction_evaluator > -{ - typedef CwiseBinaryOp XprType; - typedef sparse_conjunction_evaluator Base; - explicit binary_evaluator(const XprType& xpr) : Base(xpr) {} -}; -// "sparse && dense" -template -struct binary_evaluator, IteratorBased, IndexBased> - : sparse_conjunction_evaluator > -{ - typedef CwiseBinaryOp XprType; - typedef sparse_conjunction_evaluator Base; - explicit binary_evaluator(const XprType& xpr) : Base(xpr) {} -}; - -// "sparse ^ sparse" -template -struct sparse_conjunction_evaluator - : evaluator_base -{ -protected: - typedef typename XprType::Functor BinaryOp; - typedef typename XprType::Lhs LhsArg; - typedef typename XprType::Rhs RhsArg; - typedef typename evaluator::InnerIterator LhsIterator; - typedef typename evaluator::InnerIterator RhsIterator; - typedef typename XprType::StorageIndex StorageIndex; - typedef typename traits::Scalar Scalar; -public: - - class InnerIterator - { - public: - - EIGEN_STRONG_INLINE InnerIterator(const sparse_conjunction_evaluator& aEval, Index outer) - : m_lhsIter(aEval.m_lhsImpl,outer), m_rhsIter(aEval.m_rhsImpl,outer), m_functor(aEval.m_functor) - { - while (m_lhsIter && m_rhsIter && (m_lhsIter.index() != m_rhsIter.index())) - { - if (m_lhsIter.index() < m_rhsIter.index()) - ++m_lhsIter; - else - ++m_rhsIter; - } - } - - EIGEN_STRONG_INLINE InnerIterator& operator++() - { - ++m_lhsIter; - ++m_rhsIter; - while (m_lhsIter && m_rhsIter && (m_lhsIter.index() != m_rhsIter.index())) - { - if (m_lhsIter.index() < m_rhsIter.index()) - ++m_lhsIter; - else - ++m_rhsIter; - } - return *this; - } - - EIGEN_STRONG_INLINE Scalar value() const { return m_functor(m_lhsIter.value(), m_rhsIter.value()); } - - EIGEN_STRONG_INLINE StorageIndex index() const { return m_lhsIter.index(); } - EIGEN_STRONG_INLINE Index outer() const { return m_lhsIter.outer(); } - EIGEN_STRONG_INLINE Index row() const { return m_lhsIter.row(); } - EIGEN_STRONG_INLINE Index col() const { return m_lhsIter.col(); } - - EIGEN_STRONG_INLINE operator bool() const { return (m_lhsIter && m_rhsIter); } - - protected: - LhsIterator m_lhsIter; - RhsIterator m_rhsIter; - const BinaryOp& m_functor; - }; - - - enum { - CoeffReadCost = int(evaluator::CoeffReadCost) + int(evaluator::CoeffReadCost) + int(functor_traits::Cost), - Flags = XprType::Flags - }; - - explicit sparse_conjunction_evaluator(const XprType& xpr) - : m_functor(xpr.functor()), - m_lhsImpl(xpr.lhs()), - m_rhsImpl(xpr.rhs()) - { - EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits::Cost); - EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); - } - - inline Index nonZerosEstimate() const { - return (std::min)(m_lhsImpl.nonZerosEstimate(), m_rhsImpl.nonZerosEstimate()); - } - -protected: - const BinaryOp m_functor; - evaluator m_lhsImpl; - evaluator m_rhsImpl; -}; - -// "dense ^ sparse" -template -struct sparse_conjunction_evaluator - : evaluator_base -{ -protected: - typedef typename XprType::Functor BinaryOp; - typedef typename XprType::Lhs LhsArg; - typedef typename XprType::Rhs RhsArg; - typedef evaluator LhsEvaluator; - typedef typename evaluator::InnerIterator RhsIterator; - typedef typename XprType::StorageIndex StorageIndex; - typedef typename traits::Scalar Scalar; -public: - - class InnerIterator - { - enum { IsRowMajor = (int(RhsArg::Flags)&RowMajorBit)==RowMajorBit }; - - public: - - EIGEN_STRONG_INLINE InnerIterator(const sparse_conjunction_evaluator& aEval, Index outer) - : m_lhsEval(aEval.m_lhsImpl), m_rhsIter(aEval.m_rhsImpl,outer), m_functor(aEval.m_functor), m_outer(outer) - {} - - EIGEN_STRONG_INLINE InnerIterator& operator++() - { - ++m_rhsIter; - return *this; - } - - EIGEN_STRONG_INLINE Scalar value() const - { return m_functor(m_lhsEval.coeff(IsRowMajor?m_outer:m_rhsIter.index(),IsRowMajor?m_rhsIter.index():m_outer), m_rhsIter.value()); } - - EIGEN_STRONG_INLINE StorageIndex index() const { return m_rhsIter.index(); } - EIGEN_STRONG_INLINE Index outer() const { return m_rhsIter.outer(); } - EIGEN_STRONG_INLINE Index row() const { return m_rhsIter.row(); } - EIGEN_STRONG_INLINE Index col() const { return m_rhsIter.col(); } - - EIGEN_STRONG_INLINE operator bool() const { return m_rhsIter; } - - protected: - const LhsEvaluator &m_lhsEval; - RhsIterator m_rhsIter; - const BinaryOp& m_functor; - const Index m_outer; - }; - - - enum { - CoeffReadCost = int(evaluator::CoeffReadCost) + int(evaluator::CoeffReadCost) + int(functor_traits::Cost), - Flags = XprType::Flags - }; - - explicit sparse_conjunction_evaluator(const XprType& xpr) - : m_functor(xpr.functor()), - m_lhsImpl(xpr.lhs()), - m_rhsImpl(xpr.rhs()) - { - EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits::Cost); - EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); - } - - inline Index nonZerosEstimate() const { - return m_rhsImpl.nonZerosEstimate(); - } - -protected: - const BinaryOp m_functor; - evaluator m_lhsImpl; - evaluator m_rhsImpl; -}; - -// "sparse ^ dense" -template -struct sparse_conjunction_evaluator - : evaluator_base -{ -protected: - typedef typename XprType::Functor BinaryOp; - typedef typename XprType::Lhs LhsArg; - typedef typename XprType::Rhs RhsArg; - typedef typename evaluator::InnerIterator LhsIterator; - typedef evaluator RhsEvaluator; - typedef typename XprType::StorageIndex StorageIndex; - typedef typename traits::Scalar Scalar; -public: - - class InnerIterator - { - enum { IsRowMajor = (int(LhsArg::Flags)&RowMajorBit)==RowMajorBit }; - - public: - - EIGEN_STRONG_INLINE InnerIterator(const sparse_conjunction_evaluator& aEval, Index outer) - : m_lhsIter(aEval.m_lhsImpl,outer), m_rhsEval(aEval.m_rhsImpl), m_functor(aEval.m_functor), m_outer(outer) - {} - - EIGEN_STRONG_INLINE InnerIterator& operator++() - { - ++m_lhsIter; - return *this; - } - - EIGEN_STRONG_INLINE Scalar value() const - { return m_functor(m_lhsIter.value(), - m_rhsEval.coeff(IsRowMajor?m_outer:m_lhsIter.index(),IsRowMajor?m_lhsIter.index():m_outer)); } - - EIGEN_STRONG_INLINE StorageIndex index() const { return m_lhsIter.index(); } - EIGEN_STRONG_INLINE Index outer() const { return m_lhsIter.outer(); } - EIGEN_STRONG_INLINE Index row() const { return m_lhsIter.row(); } - EIGEN_STRONG_INLINE Index col() const { return m_lhsIter.col(); } - - EIGEN_STRONG_INLINE operator bool() const { return m_lhsIter; } - - protected: - LhsIterator m_lhsIter; - const evaluator &m_rhsEval; - const BinaryOp& m_functor; - const Index m_outer; - }; - - - enum { - CoeffReadCost = int(evaluator::CoeffReadCost) + int(evaluator::CoeffReadCost) + int(functor_traits::Cost), - Flags = XprType::Flags - }; - - explicit sparse_conjunction_evaluator(const XprType& xpr) - : m_functor(xpr.functor()), - m_lhsImpl(xpr.lhs()), - m_rhsImpl(xpr.rhs()) - { - EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits::Cost); - EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); - } - - inline Index nonZerosEstimate() const { - return m_lhsImpl.nonZerosEstimate(); - } - -protected: - const BinaryOp m_functor; - evaluator m_lhsImpl; - evaluator m_rhsImpl; -}; - -} - -/*************************************************************************** -* Implementation of SparseMatrixBase and SparseCwise functions/operators -***************************************************************************/ - -template -template -Derived& SparseMatrixBase::operator+=(const EigenBase &other) -{ - call_assignment(derived(), other.derived(), internal::add_assign_op()); - return derived(); -} - -template -template -Derived& SparseMatrixBase::operator-=(const EigenBase &other) -{ - call_assignment(derived(), other.derived(), internal::assign_op()); - return derived(); -} - -template -template -EIGEN_STRONG_INLINE Derived & -SparseMatrixBase::operator-=(const SparseMatrixBase &other) -{ - return derived() = derived() - other.derived(); -} - -template -template -EIGEN_STRONG_INLINE Derived & -SparseMatrixBase::operator+=(const SparseMatrixBase& other) -{ - return derived() = derived() + other.derived(); -} - -template -template -Derived& SparseMatrixBase::operator+=(const DiagonalBase& other) -{ - call_assignment_no_alias(derived(), other.derived(), internal::add_assign_op()); - return derived(); -} - -template -template -Derived& SparseMatrixBase::operator-=(const DiagonalBase& other) -{ - call_assignment_no_alias(derived(), other.derived(), internal::sub_assign_op()); - return derived(); -} - -template -template -EIGEN_STRONG_INLINE const typename SparseMatrixBase::template CwiseProductDenseReturnType::Type -SparseMatrixBase::cwiseProduct(const MatrixBase &other) const -{ - return typename CwiseProductDenseReturnType::Type(derived(), other.derived()); -} - -template -EIGEN_STRONG_INLINE const CwiseBinaryOp, const DenseDerived, const SparseDerived> -operator+(const MatrixBase &a, const SparseMatrixBase &b) -{ - return CwiseBinaryOp, const DenseDerived, const SparseDerived>(a.derived(), b.derived()); -} - -template -EIGEN_STRONG_INLINE const CwiseBinaryOp, const SparseDerived, const DenseDerived> -operator+(const SparseMatrixBase &a, const MatrixBase &b) -{ - return CwiseBinaryOp, const SparseDerived, const DenseDerived>(a.derived(), b.derived()); -} - -template -EIGEN_STRONG_INLINE const CwiseBinaryOp, const DenseDerived, const SparseDerived> -operator-(const MatrixBase &a, const SparseMatrixBase &b) -{ - return CwiseBinaryOp, const DenseDerived, const SparseDerived>(a.derived(), b.derived()); -} - -template -EIGEN_STRONG_INLINE const CwiseBinaryOp, const SparseDerived, const DenseDerived> -operator-(const SparseMatrixBase &a, const MatrixBase &b) -{ - return CwiseBinaryOp, const SparseDerived, const DenseDerived>(a.derived(), b.derived()); -} - -} // end namespace Eigen - -#endif // EIGEN_SPARSE_CWISE_BINARY_OP_H diff --git a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseCwiseUnaryOp.h b/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseCwiseUnaryOp.h deleted file mode 100644 index 32dac0f78..000000000 --- a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseCwiseUnaryOp.h +++ /dev/null @@ -1,150 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008-2015 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_SPARSE_CWISE_UNARY_OP_H -#define EIGEN_SPARSE_CWISE_UNARY_OP_H - -namespace Eigen { - -namespace internal { - -template -struct unary_evaluator, IteratorBased> - : public evaluator_base > -{ - public: - typedef CwiseUnaryOp XprType; - - class InnerIterator; - - enum { - CoeffReadCost = int(evaluator::CoeffReadCost) + int(functor_traits::Cost), - Flags = XprType::Flags - }; - - explicit unary_evaluator(const XprType& op) : m_functor(op.functor()), m_argImpl(op.nestedExpression()) - { - EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits::Cost); - EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); - } - - inline Index nonZerosEstimate() const { - return m_argImpl.nonZerosEstimate(); - } - - protected: - typedef typename evaluator::InnerIterator EvalIterator; - - const UnaryOp m_functor; - evaluator m_argImpl; -}; - -template -class unary_evaluator, IteratorBased>::InnerIterator - : public unary_evaluator, IteratorBased>::EvalIterator -{ - protected: - typedef typename XprType::Scalar Scalar; - typedef typename unary_evaluator, IteratorBased>::EvalIterator Base; - public: - - EIGEN_STRONG_INLINE InnerIterator(const unary_evaluator& unaryOp, Index outer) - : Base(unaryOp.m_argImpl,outer), m_functor(unaryOp.m_functor) - {} - - EIGEN_STRONG_INLINE InnerIterator& operator++() - { Base::operator++(); return *this; } - - EIGEN_STRONG_INLINE Scalar value() const { return m_functor(Base::value()); } - - protected: - const UnaryOp m_functor; - private: - Scalar& valueRef(); -}; - -template -struct unary_evaluator, IteratorBased> - : public evaluator_base > -{ - public: - typedef CwiseUnaryView XprType; - - class InnerIterator; - - enum { - CoeffReadCost = int(evaluator::CoeffReadCost) + int(functor_traits::Cost), - Flags = XprType::Flags - }; - - explicit unary_evaluator(const XprType& op) : m_functor(op.functor()), m_argImpl(op.nestedExpression()) - { - EIGEN_INTERNAL_CHECK_COST_VALUE(functor_traits::Cost); - EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); - } - - protected: - typedef typename evaluator::InnerIterator EvalIterator; - - const ViewOp m_functor; - evaluator m_argImpl; -}; - -template -class unary_evaluator, IteratorBased>::InnerIterator - : public unary_evaluator, IteratorBased>::EvalIterator -{ - protected: - typedef typename XprType::Scalar Scalar; - typedef typename unary_evaluator, IteratorBased>::EvalIterator Base; - public: - - EIGEN_STRONG_INLINE InnerIterator(const unary_evaluator& unaryOp, Index outer) - : Base(unaryOp.m_argImpl,outer), m_functor(unaryOp.m_functor) - {} - - EIGEN_STRONG_INLINE InnerIterator& operator++() - { Base::operator++(); return *this; } - - EIGEN_STRONG_INLINE Scalar value() const { return m_functor(Base::value()); } - EIGEN_STRONG_INLINE Scalar& valueRef() { return m_functor(Base::valueRef()); } - - protected: - const ViewOp m_functor; -}; - -} // end namespace internal - -template -EIGEN_STRONG_INLINE Derived& -SparseMatrixBase::operator*=(const Scalar& other) -{ - typedef typename internal::evaluator::InnerIterator EvalIterator; - internal::evaluator thisEval(derived()); - for (Index j=0; j -EIGEN_STRONG_INLINE Derived& -SparseMatrixBase::operator/=(const Scalar& other) -{ - typedef typename internal::evaluator::InnerIterator EvalIterator; - internal::evaluator thisEval(derived()); - for (Index j=0; j -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_SPARSEDENSEPRODUCT_H -#define EIGEN_SPARSEDENSEPRODUCT_H - -namespace Eigen { - -namespace internal { - -template <> struct product_promote_storage_type { typedef Sparse ret; }; -template <> struct product_promote_storage_type { typedef Sparse ret; }; - -template -struct sparse_time_dense_product_impl; - -template -struct sparse_time_dense_product_impl -{ - typedef typename internal::remove_all::type Lhs; - typedef typename internal::remove_all::type Rhs; - typedef typename internal::remove_all::type Res; - typedef typename evaluator::InnerIterator LhsInnerIterator; - typedef evaluator LhsEval; - static void run(const SparseLhsType& lhs, const DenseRhsType& rhs, DenseResType& res, const typename Res::Scalar& alpha) - { - LhsEval lhsEval(lhs); - - Index n = lhs.outerSize(); -#ifdef EIGEN_HAS_OPENMP - Eigen::initParallel(); - Index threads = Eigen::nbThreads(); -#endif - - for(Index c=0; c1 && lhsEval.nonZerosEstimate() > 20000) - { - #pragma omp parallel for schedule(dynamic,(n+threads*4-1)/(threads*4)) num_threads(threads) - for(Index i=0; i let's disable it for now as it is conflicting with generic scalar*matrix and matrix*scalar operators -// template -// struct ScalarBinaryOpTraits > -// { -// enum { -// Defined = 1 -// }; -// typedef typename CwiseUnaryOp, T2>::PlainObject ReturnType; -// }; - -template -struct sparse_time_dense_product_impl -{ - typedef typename internal::remove_all::type Lhs; - typedef typename internal::remove_all::type Rhs; - typedef typename internal::remove_all::type Res; - typedef evaluator LhsEval; - typedef typename LhsEval::InnerIterator LhsInnerIterator; - static void run(const SparseLhsType& lhs, const DenseRhsType& rhs, DenseResType& res, const AlphaType& alpha) - { - LhsEval lhsEval(lhs); - for(Index c=0; c::ReturnType rhs_j(alpha * rhs.coeff(j,c)); - for(LhsInnerIterator it(lhsEval,j); it ;++it) - res.coeffRef(it.index(),c) += it.value() * rhs_j; - } - } - } -}; - -template -struct sparse_time_dense_product_impl -{ - typedef typename internal::remove_all::type Lhs; - typedef typename internal::remove_all::type Rhs; - typedef typename internal::remove_all::type Res; - typedef evaluator LhsEval; - typedef typename LhsEval::InnerIterator LhsInnerIterator; - static void run(const SparseLhsType& lhs, const DenseRhsType& rhs, DenseResType& res, const typename Res::Scalar& alpha) - { - Index n = lhs.rows(); - LhsEval lhsEval(lhs); - -#ifdef EIGEN_HAS_OPENMP - Eigen::initParallel(); - Index threads = Eigen::nbThreads(); - // This 20000 threshold has been found experimentally on 2D and 3D Poisson problems. - // It basically represents the minimal amount of work to be done to be worth it. - if(threads>1 && lhsEval.nonZerosEstimate()*rhs.cols() > 20000) - { - #pragma omp parallel for schedule(dynamic,(n+threads*4-1)/(threads*4)) num_threads(threads) - for(Index i=0; i -struct sparse_time_dense_product_impl -{ - typedef typename internal::remove_all::type Lhs; - typedef typename internal::remove_all::type Rhs; - typedef typename internal::remove_all::type Res; - typedef typename evaluator::InnerIterator LhsInnerIterator; - static void run(const SparseLhsType& lhs, const DenseRhsType& rhs, DenseResType& res, const typename Res::Scalar& alpha) - { - evaluator lhsEval(lhs); - for(Index j=0; j -inline void sparse_time_dense_product(const SparseLhsType& lhs, const DenseRhsType& rhs, DenseResType& res, const AlphaType& alpha) -{ - sparse_time_dense_product_impl::run(lhs, rhs, res, alpha); -} - -} // end namespace internal - -namespace internal { - -template -struct generic_product_impl - : generic_product_impl_base > -{ - typedef typename Product::Scalar Scalar; - - template - static void scaleAndAddTo(Dest& dst, const Lhs& lhs, const Rhs& rhs, const Scalar& alpha) - { - typedef typename nested_eval::type LhsNested; - typedef typename nested_eval::type RhsNested; - LhsNested lhsNested(lhs); - RhsNested rhsNested(rhs); - internal::sparse_time_dense_product(lhsNested, rhsNested, dst, alpha); - } -}; - -template -struct generic_product_impl - : generic_product_impl -{}; - -template -struct generic_product_impl - : generic_product_impl_base > -{ - typedef typename Product::Scalar Scalar; - - template - static void scaleAndAddTo(Dst& dst, const Lhs& lhs, const Rhs& rhs, const Scalar& alpha) - { - typedef typename nested_eval::type LhsNested; - typedef typename nested_eval::type RhsNested; - LhsNested lhsNested(lhs); - RhsNested rhsNested(rhs); - - // transpose everything - Transpose dstT(dst); - internal::sparse_time_dense_product(rhsNested.transpose(), lhsNested.transpose(), dstT, alpha); - } -}; - -template -struct generic_product_impl - : generic_product_impl -{}; - -template -struct sparse_dense_outer_product_evaluator -{ -protected: - typedef typename conditional::type Lhs1; - typedef typename conditional::type ActualRhs; - typedef Product ProdXprType; - - // if the actual left-hand side is a dense vector, - // then build a sparse-view so that we can seamlessly iterate over it. - typedef typename conditional::StorageKind,Sparse>::value, - Lhs1, SparseView >::type ActualLhs; - typedef typename conditional::StorageKind,Sparse>::value, - Lhs1 const&, SparseView >::type LhsArg; - - typedef evaluator LhsEval; - typedef evaluator RhsEval; - typedef typename evaluator::InnerIterator LhsIterator; - typedef typename ProdXprType::Scalar Scalar; - -public: - enum { - Flags = NeedToTranspose ? RowMajorBit : 0, - CoeffReadCost = HugeCost - }; - - class InnerIterator : public LhsIterator - { - public: - InnerIterator(const sparse_dense_outer_product_evaluator &xprEval, Index outer) - : LhsIterator(xprEval.m_lhsXprImpl, 0), - m_outer(outer), - m_empty(false), - m_factor(get(xprEval.m_rhsXprImpl, outer, typename internal::traits::StorageKind() )) - {} - - EIGEN_STRONG_INLINE Index outer() const { return m_outer; } - EIGEN_STRONG_INLINE Index row() const { return NeedToTranspose ? m_outer : LhsIterator::index(); } - EIGEN_STRONG_INLINE Index col() const { return NeedToTranspose ? LhsIterator::index() : m_outer; } - - EIGEN_STRONG_INLINE Scalar value() const { return LhsIterator::value() * m_factor; } - EIGEN_STRONG_INLINE operator bool() const { return LhsIterator::operator bool() && (!m_empty); } - - protected: - Scalar get(const RhsEval &rhs, Index outer, Dense = Dense()) const - { - return rhs.coeff(outer); - } - - Scalar get(const RhsEval &rhs, Index outer, Sparse = Sparse()) - { - typename RhsEval::InnerIterator it(rhs, outer); - if (it && it.index()==0 && it.value()!=Scalar(0)) - return it.value(); - m_empty = true; - return Scalar(0); - } - - Index m_outer; - bool m_empty; - Scalar m_factor; - }; - - sparse_dense_outer_product_evaluator(const Lhs1 &lhs, const ActualRhs &rhs) - : m_lhs(lhs), m_lhsXprImpl(m_lhs), m_rhsXprImpl(rhs) - { - EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); - } - - // transpose case - sparse_dense_outer_product_evaluator(const ActualRhs &rhs, const Lhs1 &lhs) - : m_lhs(lhs), m_lhsXprImpl(m_lhs), m_rhsXprImpl(rhs) - { - EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); - } - -protected: - const LhsArg m_lhs; - evaluator m_lhsXprImpl; - evaluator m_rhsXprImpl; -}; - -// sparse * dense outer product -template -struct product_evaluator, OuterProduct, SparseShape, DenseShape> - : sparse_dense_outer_product_evaluator -{ - typedef sparse_dense_outer_product_evaluator Base; - - typedef Product XprType; - typedef typename XprType::PlainObject PlainObject; - - explicit product_evaluator(const XprType& xpr) - : Base(xpr.lhs(), xpr.rhs()) - {} - -}; - -template -struct product_evaluator, OuterProduct, DenseShape, SparseShape> - : sparse_dense_outer_product_evaluator -{ - typedef sparse_dense_outer_product_evaluator Base; - - typedef Product XprType; - typedef typename XprType::PlainObject PlainObject; - - explicit product_evaluator(const XprType& xpr) - : Base(xpr.lhs(), xpr.rhs()) - {} - -}; - -} // end namespace internal - -} // end namespace Eigen - -#endif // EIGEN_SPARSEDENSEPRODUCT_H diff --git a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseDiagonalProduct.h b/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseDiagonalProduct.h deleted file mode 100644 index 941c03be3..000000000 --- a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseDiagonalProduct.h +++ /dev/null @@ -1,138 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2009-2015 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_SPARSE_DIAGONAL_PRODUCT_H -#define EIGEN_SPARSE_DIAGONAL_PRODUCT_H - -namespace Eigen { - -// The product of a diagonal matrix with a sparse matrix can be easily -// implemented using expression template. -// We have two consider very different cases: -// 1 - diag * row-major sparse -// => each inner vector <=> scalar * sparse vector product -// => so we can reuse CwiseUnaryOp::InnerIterator -// 2 - diag * col-major sparse -// => each inner vector <=> densevector * sparse vector cwise product -// => again, we can reuse specialization of CwiseBinaryOp::InnerIterator -// for that particular case -// The two other cases are symmetric. - -namespace internal { - -enum { - SDP_AsScalarProduct, - SDP_AsCwiseProduct -}; - -template -struct sparse_diagonal_product_evaluator; - -template -struct product_evaluator, ProductTag, DiagonalShape, SparseShape> - : public sparse_diagonal_product_evaluator -{ - typedef Product XprType; - enum { CoeffReadCost = HugeCost, Flags = Rhs::Flags&RowMajorBit, Alignment = 0 }; // FIXME CoeffReadCost & Flags - - typedef sparse_diagonal_product_evaluator Base; - explicit product_evaluator(const XprType& xpr) : Base(xpr.rhs(), xpr.lhs().diagonal()) {} -}; - -template -struct product_evaluator, ProductTag, SparseShape, DiagonalShape> - : public sparse_diagonal_product_evaluator, Lhs::Flags&RowMajorBit?SDP_AsCwiseProduct:SDP_AsScalarProduct> -{ - typedef Product XprType; - enum { CoeffReadCost = HugeCost, Flags = Lhs::Flags&RowMajorBit, Alignment = 0 }; // FIXME CoeffReadCost & Flags - - typedef sparse_diagonal_product_evaluator, Lhs::Flags&RowMajorBit?SDP_AsCwiseProduct:SDP_AsScalarProduct> Base; - explicit product_evaluator(const XprType& xpr) : Base(xpr.lhs(), xpr.rhs().diagonal().transpose()) {} -}; - -template -struct sparse_diagonal_product_evaluator -{ -protected: - typedef typename evaluator::InnerIterator SparseXprInnerIterator; - typedef typename SparseXprType::Scalar Scalar; - -public: - class InnerIterator : public SparseXprInnerIterator - { - public: - InnerIterator(const sparse_diagonal_product_evaluator &xprEval, Index outer) - : SparseXprInnerIterator(xprEval.m_sparseXprImpl, outer), - m_coeff(xprEval.m_diagCoeffImpl.coeff(outer)) - {} - - EIGEN_STRONG_INLINE Scalar value() const { return m_coeff * SparseXprInnerIterator::value(); } - protected: - typename DiagonalCoeffType::Scalar m_coeff; - }; - - sparse_diagonal_product_evaluator(const SparseXprType &sparseXpr, const DiagonalCoeffType &diagCoeff) - : m_sparseXprImpl(sparseXpr), m_diagCoeffImpl(diagCoeff) - {} - - Index nonZerosEstimate() const { return m_sparseXprImpl.nonZerosEstimate(); } - -protected: - evaluator m_sparseXprImpl; - evaluator m_diagCoeffImpl; -}; - - -template -struct sparse_diagonal_product_evaluator -{ - typedef typename SparseXprType::Scalar Scalar; - typedef typename SparseXprType::StorageIndex StorageIndex; - - typedef typename nested_eval::type DiagCoeffNested; - - class InnerIterator - { - typedef typename evaluator::InnerIterator SparseXprIter; - public: - InnerIterator(const sparse_diagonal_product_evaluator &xprEval, Index outer) - : m_sparseIter(xprEval.m_sparseXprEval, outer), m_diagCoeffNested(xprEval.m_diagCoeffNested) - {} - - inline Scalar value() const { return m_sparseIter.value() * m_diagCoeffNested.coeff(index()); } - inline StorageIndex index() const { return m_sparseIter.index(); } - inline Index outer() const { return m_sparseIter.outer(); } - inline Index col() const { return SparseXprType::IsRowMajor ? m_sparseIter.index() : m_sparseIter.outer(); } - inline Index row() const { return SparseXprType::IsRowMajor ? m_sparseIter.outer() : m_sparseIter.index(); } - - EIGEN_STRONG_INLINE InnerIterator& operator++() { ++m_sparseIter; return *this; } - inline operator bool() const { return m_sparseIter; } - - protected: - SparseXprIter m_sparseIter; - DiagCoeffNested m_diagCoeffNested; - }; - - sparse_diagonal_product_evaluator(const SparseXprType &sparseXpr, const DiagCoeffType &diagCoeff) - : m_sparseXprEval(sparseXpr), m_diagCoeffNested(diagCoeff) - {} - - Index nonZerosEstimate() const { return m_sparseXprEval.nonZerosEstimate(); } - -protected: - evaluator m_sparseXprEval; - DiagCoeffNested m_diagCoeffNested; -}; - -} // end namespace internal - -} // end namespace Eigen - -#endif // EIGEN_SPARSE_DIAGONAL_PRODUCT_H diff --git a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseDot.h b/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseDot.h deleted file mode 100644 index 38bc4aa9e..000000000 --- a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseDot.h +++ /dev/null @@ -1,98 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_SPARSE_DOT_H -#define EIGEN_SPARSE_DOT_H - -namespace Eigen { - -template -template -typename internal::traits::Scalar -SparseMatrixBase::dot(const MatrixBase& other) const -{ - EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) - EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived) - EIGEN_STATIC_ASSERT_SAME_VECTOR_SIZE(Derived,OtherDerived) - EIGEN_STATIC_ASSERT((internal::is_same::value), - YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY) - - eigen_assert(size() == other.size()); - eigen_assert(other.size()>0 && "you are using a non initialized vector"); - - internal::evaluator thisEval(derived()); - typename internal::evaluator::InnerIterator i(thisEval, 0); - Scalar res(0); - while (i) - { - res += numext::conj(i.value()) * other.coeff(i.index()); - ++i; - } - return res; -} - -template -template -typename internal::traits::Scalar -SparseMatrixBase::dot(const SparseMatrixBase& other) const -{ - EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) - EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived) - EIGEN_STATIC_ASSERT_SAME_VECTOR_SIZE(Derived,OtherDerived) - EIGEN_STATIC_ASSERT((internal::is_same::value), - YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY) - - eigen_assert(size() == other.size()); - - internal::evaluator thisEval(derived()); - typename internal::evaluator::InnerIterator i(thisEval, 0); - - internal::evaluator otherEval(other.derived()); - typename internal::evaluator::InnerIterator j(otherEval, 0); - - Scalar res(0); - while (i && j) - { - if (i.index()==j.index()) - { - res += numext::conj(i.value()) * j.value(); - ++i; ++j; - } - else if (i.index() -inline typename NumTraits::Scalar>::Real -SparseMatrixBase::squaredNorm() const -{ - return numext::real((*this).cwiseAbs2().sum()); -} - -template -inline typename NumTraits::Scalar>::Real -SparseMatrixBase::norm() const -{ - using std::sqrt; - return sqrt(squaredNorm()); -} - -template -inline typename NumTraits::Scalar>::Real -SparseMatrixBase::blueNorm() const -{ - return internal::blueNorm_impl(*this); -} -} // end namespace Eigen - -#endif // EIGEN_SPARSE_DOT_H diff --git a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseFuzzy.h b/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseFuzzy.h deleted file mode 100644 index 7d47eb94d..000000000 --- a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseFuzzy.h +++ /dev/null @@ -1,29 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008-2014 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_SPARSE_FUZZY_H -#define EIGEN_SPARSE_FUZZY_H - -namespace Eigen { - -template -template -bool SparseMatrixBase::isApprox(const SparseMatrixBase& other, const RealScalar &prec) const -{ - const typename internal::nested_eval::type actualA(derived()); - typename internal::conditional::type, - const PlainObject>::type actualB(other.derived()); - - return (actualA - actualB).squaredNorm() <= prec * prec * numext::mini(actualA.squaredNorm(), actualB.squaredNorm()); -} - -} // end namespace Eigen - -#endif // EIGEN_SPARSE_FUZZY_H diff --git a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseMap.h b/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseMap.h deleted file mode 100644 index f99be3379..000000000 --- a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseMap.h +++ /dev/null @@ -1,305 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2015 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_SPARSE_MAP_H -#define EIGEN_SPARSE_MAP_H - -namespace Eigen { - -namespace internal { - -template -struct traits, Options, StrideType> > - : public traits > -{ - typedef SparseMatrix PlainObjectType; - typedef traits TraitsBase; - enum { - Flags = TraitsBase::Flags & (~NestByRefBit) - }; -}; - -template -struct traits, Options, StrideType> > - : public traits > -{ - typedef SparseMatrix PlainObjectType; - typedef traits TraitsBase; - enum { - Flags = TraitsBase::Flags & (~ (NestByRefBit | LvalueBit)) - }; -}; - -} // end namespace internal - -template::has_write_access ? WriteAccessors : ReadOnlyAccessors -> class SparseMapBase; - -/** \ingroup SparseCore_Module - * class SparseMapBase - * \brief Common base class for Map and Ref instance of sparse matrix and vector. - */ -template -class SparseMapBase - : public SparseCompressedBase -{ - public: - typedef SparseCompressedBase Base; - typedef typename Base::Scalar Scalar; - typedef typename Base::StorageIndex StorageIndex; - enum { IsRowMajor = Base::IsRowMajor }; - using Base::operator=; - protected: - - typedef typename internal::conditional< - bool(internal::is_lvalue::value), - Scalar *, const Scalar *>::type ScalarPointer; - typedef typename internal::conditional< - bool(internal::is_lvalue::value), - StorageIndex *, const StorageIndex *>::type IndexPointer; - - Index m_outerSize; - Index m_innerSize; - Array m_zero_nnz; - IndexPointer m_outerIndex; - IndexPointer m_innerIndices; - ScalarPointer m_values; - IndexPointer m_innerNonZeros; - - public: - - /** \copydoc SparseMatrixBase::rows() */ - inline Index rows() const { return IsRowMajor ? m_outerSize : m_innerSize; } - /** \copydoc SparseMatrixBase::cols() */ - inline Index cols() const { return IsRowMajor ? m_innerSize : m_outerSize; } - /** \copydoc SparseMatrixBase::innerSize() */ - inline Index innerSize() const { return m_innerSize; } - /** \copydoc SparseMatrixBase::outerSize() */ - inline Index outerSize() const { return m_outerSize; } - /** \copydoc SparseCompressedBase::nonZeros */ - inline Index nonZeros() const { return m_zero_nnz[1]; } - - /** \copydoc SparseCompressedBase::isCompressed */ - bool isCompressed() const { return m_innerNonZeros==0; } - - //---------------------------------------- - // direct access interface - /** \copydoc SparseMatrix::valuePtr */ - inline const Scalar* valuePtr() const { return m_values; } - /** \copydoc SparseMatrix::innerIndexPtr */ - inline const StorageIndex* innerIndexPtr() const { return m_innerIndices; } - /** \copydoc SparseMatrix::outerIndexPtr */ - inline const StorageIndex* outerIndexPtr() const { return m_outerIndex; } - /** \copydoc SparseMatrix::innerNonZeroPtr */ - inline const StorageIndex* innerNonZeroPtr() const { return m_innerNonZeros; } - //---------------------------------------- - - /** \copydoc SparseMatrix::coeff */ - inline Scalar coeff(Index row, Index col) const - { - const Index outer = IsRowMajor ? row : col; - const Index inner = IsRowMajor ? col : row; - - Index start = m_outerIndex[outer]; - Index end = isCompressed() ? m_outerIndex[outer+1] : start + m_innerNonZeros[outer]; - if (start==end) - return Scalar(0); - else if (end>0 && inner==m_innerIndices[end-1]) - return m_values[end-1]; - // ^^ optimization: let's first check if it is the last coefficient - // (very common in high level algorithms) - - const StorageIndex* r = std::lower_bound(&m_innerIndices[start],&m_innerIndices[end-1],inner); - const Index id = r-&m_innerIndices[0]; - return ((*r==inner) && (id(nnz)), m_outerIndex(outerIndexPtr), - m_innerIndices(innerIndexPtr), m_values(valuePtr), m_innerNonZeros(innerNonZerosPtr) - {} - - // for vectors - inline SparseMapBase(Index size, Index nnz, IndexPointer innerIndexPtr, ScalarPointer valuePtr) - : m_outerSize(1), m_innerSize(size), m_zero_nnz(0,internal::convert_index(nnz)), m_outerIndex(m_zero_nnz.data()), - m_innerIndices(innerIndexPtr), m_values(valuePtr), m_innerNonZeros(0) - {} - - /** Empty destructor */ - inline ~SparseMapBase() {} - - protected: - inline SparseMapBase() {} -}; - -/** \ingroup SparseCore_Module - * class SparseMapBase - * \brief Common base class for writable Map and Ref instance of sparse matrix and vector. - */ -template -class SparseMapBase - : public SparseMapBase -{ - typedef MapBase ReadOnlyMapBase; - - public: - typedef SparseMapBase Base; - typedef typename Base::Scalar Scalar; - typedef typename Base::StorageIndex StorageIndex; - enum { IsRowMajor = Base::IsRowMajor }; - - using Base::operator=; - - public: - - //---------------------------------------- - // direct access interface - using Base::valuePtr; - using Base::innerIndexPtr; - using Base::outerIndexPtr; - using Base::innerNonZeroPtr; - /** \copydoc SparseMatrix::valuePtr */ - inline Scalar* valuePtr() { return Base::m_values; } - /** \copydoc SparseMatrix::innerIndexPtr */ - inline StorageIndex* innerIndexPtr() { return Base::m_innerIndices; } - /** \copydoc SparseMatrix::outerIndexPtr */ - inline StorageIndex* outerIndexPtr() { return Base::m_outerIndex; } - /** \copydoc SparseMatrix::innerNonZeroPtr */ - inline StorageIndex* innerNonZeroPtr() { return Base::m_innerNonZeros; } - //---------------------------------------- - - /** \copydoc SparseMatrix::coeffRef */ - inline Scalar& coeffRef(Index row, Index col) - { - const Index outer = IsRowMajor ? row : col; - const Index inner = IsRowMajor ? col : row; - - Index start = Base::m_outerIndex[outer]; - Index end = Base::isCompressed() ? Base::m_outerIndex[outer+1] : start + Base::m_innerNonZeros[outer]; - eigen_assert(end>=start && "you probably called coeffRef on a non finalized matrix"); - eigen_assert(end>start && "coeffRef cannot be called on a zero coefficient"); - StorageIndex* r = std::lower_bound(&Base::m_innerIndices[start],&Base::m_innerIndices[end],inner); - const Index id = r - &Base::m_innerIndices[0]; - eigen_assert((*r==inner) && (id(Base::m_values)[id]; - } - - inline SparseMapBase(Index rows, Index cols, Index nnz, StorageIndex* outerIndexPtr, StorageIndex* innerIndexPtr, - Scalar* valuePtr, StorageIndex* innerNonZerosPtr = 0) - : Base(rows, cols, nnz, outerIndexPtr, innerIndexPtr, valuePtr, innerNonZerosPtr) - {} - - // for vectors - inline SparseMapBase(Index size, Index nnz, StorageIndex* innerIndexPtr, Scalar* valuePtr) - : Base(size, nnz, innerIndexPtr, valuePtr) - {} - - /** Empty destructor */ - inline ~SparseMapBase() {} - - protected: - inline SparseMapBase() {} -}; - -/** \ingroup SparseCore_Module - * - * \brief Specialization of class Map for SparseMatrix-like storage. - * - * \tparam SparseMatrixType the equivalent sparse matrix type of the referenced data, it must be a template instance of class SparseMatrix. - * - * \sa class Map, class SparseMatrix, class Ref - */ -#ifndef EIGEN_PARSED_BY_DOXYGEN -template -class Map, Options, StrideType> - : public SparseMapBase, Options, StrideType> > -#else -template -class Map - : public SparseMapBase -#endif -{ - public: - typedef SparseMapBase Base; - EIGEN_SPARSE_PUBLIC_INTERFACE(Map) - enum { IsRowMajor = Base::IsRowMajor }; - - public: - - /** Constructs a read-write Map to a sparse matrix of size \a rows x \a cols, containing \a nnz non-zero coefficients, - * stored as a sparse format as defined by the pointers \a outerIndexPtr, \a innerIndexPtr, and \a valuePtr. - * If the optional parameter \a innerNonZerosPtr is the null pointer, then a standard compressed format is assumed. - * - * This constructor is available only if \c SparseMatrixType is non-const. - * - * More details on the expected storage schemes are given in the \ref TutorialSparse "manual pages". - */ - inline Map(Index rows, Index cols, Index nnz, StorageIndex* outerIndexPtr, - StorageIndex* innerIndexPtr, Scalar* valuePtr, StorageIndex* innerNonZerosPtr = 0) - : Base(rows, cols, nnz, outerIndexPtr, innerIndexPtr, valuePtr, innerNonZerosPtr) - {} -#ifndef EIGEN_PARSED_BY_DOXYGEN - /** Empty destructor */ - inline ~Map() {} -}; - -template -class Map, Options, StrideType> - : public SparseMapBase, Options, StrideType> > -{ - public: - typedef SparseMapBase Base; - EIGEN_SPARSE_PUBLIC_INTERFACE(Map) - enum { IsRowMajor = Base::IsRowMajor }; - - public: -#endif - /** This is the const version of the above constructor. - * - * This constructor is available only if \c SparseMatrixType is const, e.g.: - * \code Map > \endcode - */ - inline Map(Index rows, Index cols, Index nnz, const StorageIndex* outerIndexPtr, - const StorageIndex* innerIndexPtr, const Scalar* valuePtr, const StorageIndex* innerNonZerosPtr = 0) - : Base(rows, cols, nnz, outerIndexPtr, innerIndexPtr, valuePtr, innerNonZerosPtr) - {} - - /** Empty destructor */ - inline ~Map() {} -}; - -namespace internal { - -template -struct evaluator, Options, StrideType> > - : evaluator, Options, StrideType> > > -{ - typedef evaluator, Options, StrideType> > > Base; - typedef Map, Options, StrideType> XprType; - evaluator() : Base() {} - explicit evaluator(const XprType &mat) : Base(mat) {} -}; - -template -struct evaluator, Options, StrideType> > - : evaluator, Options, StrideType> > > -{ - typedef evaluator, Options, StrideType> > > Base; - typedef Map, Options, StrideType> XprType; - evaluator() : Base() {} - explicit evaluator(const XprType &mat) : Base(mat) {} -}; - -} - -} // end namespace Eigen - -#endif // EIGEN_SPARSE_MAP_H diff --git a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseMatrix.h b/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseMatrix.h deleted file mode 100644 index 616b4a0c2..000000000 --- a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseMatrix.h +++ /dev/null @@ -1,1518 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008-2014 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_SPARSEMATRIX_H -#define EIGEN_SPARSEMATRIX_H - -namespace Eigen { - -/** \ingroup SparseCore_Module - * - * \class SparseMatrix - * - * \brief A versatible sparse matrix representation - * - * This class implements a more versatile variants of the common \em compressed row/column storage format. - * Each colmun's (resp. row) non zeros are stored as a pair of value with associated row (resp. colmiun) index. - * All the non zeros are stored in a single large buffer. Unlike the \em compressed format, there might be extra - * space in between the nonzeros of two successive colmuns (resp. rows) such that insertion of new non-zero - * can be done with limited memory reallocation and copies. - * - * A call to the function makeCompressed() turns the matrix into the standard \em compressed format - * compatible with many library. - * - * More details on this storage sceheme are given in the \ref TutorialSparse "manual pages". - * - * \tparam _Scalar the scalar type, i.e. the type of the coefficients - * \tparam _Options Union of bit flags controlling the storage scheme. Currently the only possibility - * is ColMajor or RowMajor. The default is 0 which means column-major. - * \tparam _StorageIndex the type of the indices. It has to be a \b signed type (e.g., short, int, std::ptrdiff_t). Default is \c int. - * - * \warning In %Eigen 3.2, the undocumented type \c SparseMatrix::Index was improperly defined as the storage index type (e.g., int), - * whereas it is now (starting from %Eigen 3.3) deprecated and always defined as Eigen::Index. - * Codes making use of \c SparseMatrix::Index, might thus likely have to be changed to use \c SparseMatrix::StorageIndex instead. - * - * This class can be extended with the help of the plugin mechanism described on the page - * \ref TopicCustomizing_Plugins by defining the preprocessor symbol \c EIGEN_SPARSEMATRIX_PLUGIN. - */ - -namespace internal { -template -struct traits > -{ - typedef _Scalar Scalar; - typedef _StorageIndex StorageIndex; - typedef Sparse StorageKind; - typedef MatrixXpr XprKind; - enum { - RowsAtCompileTime = Dynamic, - ColsAtCompileTime = Dynamic, - MaxRowsAtCompileTime = Dynamic, - MaxColsAtCompileTime = Dynamic, - Flags = _Options | NestByRefBit | LvalueBit | CompressedAccessBit, - SupportedAccessPatterns = InnerRandomAccessPattern - }; -}; - -template -struct traits, DiagIndex> > -{ - typedef SparseMatrix<_Scalar, _Options, _StorageIndex> MatrixType; - typedef typename ref_selector::type MatrixTypeNested; - typedef typename remove_reference::type _MatrixTypeNested; - - typedef _Scalar Scalar; - typedef Dense StorageKind; - typedef _StorageIndex StorageIndex; - typedef MatrixXpr XprKind; - - enum { - RowsAtCompileTime = Dynamic, - ColsAtCompileTime = 1, - MaxRowsAtCompileTime = Dynamic, - MaxColsAtCompileTime = 1, - Flags = LvalueBit - }; -}; - -template -struct traits, DiagIndex> > - : public traits, DiagIndex> > -{ - enum { - Flags = 0 - }; -}; - -} // end namespace internal - -template -class SparseMatrix - : public SparseCompressedBase > -{ - typedef SparseCompressedBase Base; - using Base::convert_index; - friend class SparseVector<_Scalar,0,_StorageIndex>; - template - friend struct internal::Assignment; - public: - using Base::isCompressed; - using Base::nonZeros; - EIGEN_SPARSE_PUBLIC_INTERFACE(SparseMatrix) - using Base::operator+=; - using Base::operator-=; - - typedef MappedSparseMatrix Map; - typedef Diagonal DiagonalReturnType; - typedef Diagonal ConstDiagonalReturnType; - typedef typename Base::InnerIterator InnerIterator; - typedef typename Base::ReverseInnerIterator ReverseInnerIterator; - - - using Base::IsRowMajor; - typedef internal::CompressedStorage Storage; - enum { - Options = _Options - }; - - typedef typename Base::IndexVector IndexVector; - typedef typename Base::ScalarVector ScalarVector; - protected: - typedef SparseMatrix TransposedSparseMatrix; - - Index m_outerSize; - Index m_innerSize; - StorageIndex* m_outerIndex; - StorageIndex* m_innerNonZeros; // optional, if null then the data is compressed - Storage m_data; - - public: - - /** \returns the number of rows of the matrix */ - inline Index rows() const { return IsRowMajor ? m_outerSize : m_innerSize; } - /** \returns the number of columns of the matrix */ - inline Index cols() const { return IsRowMajor ? m_innerSize : m_outerSize; } - - /** \returns the number of rows (resp. columns) of the matrix if the storage order column major (resp. row major) */ - inline Index innerSize() const { return m_innerSize; } - /** \returns the number of columns (resp. rows) of the matrix if the storage order column major (resp. row major) */ - inline Index outerSize() const { return m_outerSize; } - - /** \returns a const pointer to the array of values. - * This function is aimed at interoperability with other libraries. - * \sa innerIndexPtr(), outerIndexPtr() */ - inline const Scalar* valuePtr() const { return m_data.valuePtr(); } - /** \returns a non-const pointer to the array of values. - * This function is aimed at interoperability with other libraries. - * \sa innerIndexPtr(), outerIndexPtr() */ - inline Scalar* valuePtr() { return m_data.valuePtr(); } - - /** \returns a const pointer to the array of inner indices. - * This function is aimed at interoperability with other libraries. - * \sa valuePtr(), outerIndexPtr() */ - inline const StorageIndex* innerIndexPtr() const { return m_data.indexPtr(); } - /** \returns a non-const pointer to the array of inner indices. - * This function is aimed at interoperability with other libraries. - * \sa valuePtr(), outerIndexPtr() */ - inline StorageIndex* innerIndexPtr() { return m_data.indexPtr(); } - - /** \returns a const pointer to the array of the starting positions of the inner vectors. - * This function is aimed at interoperability with other libraries. - * \sa valuePtr(), innerIndexPtr() */ - inline const StorageIndex* outerIndexPtr() const { return m_outerIndex; } - /** \returns a non-const pointer to the array of the starting positions of the inner vectors. - * This function is aimed at interoperability with other libraries. - * \sa valuePtr(), innerIndexPtr() */ - inline StorageIndex* outerIndexPtr() { return m_outerIndex; } - - /** \returns a const pointer to the array of the number of non zeros of the inner vectors. - * This function is aimed at interoperability with other libraries. - * \warning it returns the null pointer 0 in compressed mode */ - inline const StorageIndex* innerNonZeroPtr() const { return m_innerNonZeros; } - /** \returns a non-const pointer to the array of the number of non zeros of the inner vectors. - * This function is aimed at interoperability with other libraries. - * \warning it returns the null pointer 0 in compressed mode */ - inline StorageIndex* innerNonZeroPtr() { return m_innerNonZeros; } - - /** \internal */ - inline Storage& data() { return m_data; } - /** \internal */ - inline const Storage& data() const { return m_data; } - - /** \returns the value of the matrix at position \a i, \a j - * This function returns Scalar(0) if the element is an explicit \em zero */ - inline Scalar coeff(Index row, Index col) const - { - eigen_assert(row>=0 && row=0 && col=0 && row=0 && col=start && "you probably called coeffRef on a non finalized matrix"); - if(end<=start) - return insert(row,col); - const Index p = m_data.searchLowerIndex(start,end-1,StorageIndex(inner)); - if((pinnerSize() non zeros if reserve(Index) has not been called earlier. - * In this case, the insertion procedure is optimized for a \e sequential insertion mode where elements are assumed to be - * inserted by increasing outer-indices. - * - * If that's not the case, then it is strongly recommended to either use a triplet-list to assemble the matrix, or to first - * call reserve(const SizesType &) to reserve the appropriate number of non-zero elements per inner vector. - * - * Assuming memory has been appropriately reserved, this function performs a sorted insertion in O(1) - * if the elements of each inner vector are inserted in increasing inner index order, and in O(nnz_j) for a random insertion. - * - */ - Scalar& insert(Index row, Index col); - - public: - - /** Removes all non zeros but keep allocated memory - * - * This function does not free the currently allocated memory. To release as much as memory as possible, - * call \code mat.data().squeeze(); \endcode after resizing it. - * - * \sa resize(Index,Index), data() - */ - inline void setZero() - { - m_data.clear(); - memset(m_outerIndex, 0, (m_outerSize+1)*sizeof(StorageIndex)); - if(m_innerNonZeros) - memset(m_innerNonZeros, 0, (m_outerSize)*sizeof(StorageIndex)); - } - - /** Preallocates \a reserveSize non zeros. - * - * Precondition: the matrix must be in compressed mode. */ - inline void reserve(Index reserveSize) - { - eigen_assert(isCompressed() && "This function does not make sense in non compressed mode."); - m_data.reserve(reserveSize); - } - - #ifdef EIGEN_PARSED_BY_DOXYGEN - /** Preallocates \a reserveSize[\c j] non zeros for each column (resp. row) \c j. - * - * This function turns the matrix in non-compressed mode. - * - * The type \c SizesType must expose the following interface: - \code - typedef value_type; - const value_type& operator[](i) const; - \endcode - * for \c i in the [0,this->outerSize()[ range. - * Typical choices include std::vector, Eigen::VectorXi, Eigen::VectorXi::Constant, etc. - */ - template - inline void reserve(const SizesType& reserveSizes); - #else - template - inline void reserve(const SizesType& reserveSizes, const typename SizesType::value_type& enableif = - #if (!EIGEN_COMP_MSVC) || (EIGEN_COMP_MSVC>=1500) // MSVC 2005 fails to compile with this typename - typename - #endif - SizesType::value_type()) - { - EIGEN_UNUSED_VARIABLE(enableif); - reserveInnerVectors(reserveSizes); - } - #endif // EIGEN_PARSED_BY_DOXYGEN - protected: - template - inline void reserveInnerVectors(const SizesType& reserveSizes) - { - if(isCompressed()) - { - Index totalReserveSize = 0; - // turn the matrix into non-compressed mode - m_innerNonZeros = static_cast(std::malloc(m_outerSize * sizeof(StorageIndex))); - if (!m_innerNonZeros) internal::throw_std_bad_alloc(); - - // temporarily use m_innerSizes to hold the new starting points. - StorageIndex* newOuterIndex = m_innerNonZeros; - - StorageIndex count = 0; - for(Index j=0; j=0; --j) - { - StorageIndex innerNNZ = previousOuterIndex - m_outerIndex[j]; - for(Index i=innerNNZ-1; i>=0; --i) - { - m_data.index(newOuterIndex[j]+i) = m_data.index(m_outerIndex[j]+i); - m_data.value(newOuterIndex[j]+i) = m_data.value(m_outerIndex[j]+i); - } - previousOuterIndex = m_outerIndex[j]; - m_outerIndex[j] = newOuterIndex[j]; - m_innerNonZeros[j] = innerNNZ; - } - if(m_outerSize>0) - m_outerIndex[m_outerSize] = m_outerIndex[m_outerSize-1] + m_innerNonZeros[m_outerSize-1] + reserveSizes[m_outerSize-1]; - - m_data.resize(m_outerIndex[m_outerSize]); - } - else - { - StorageIndex* newOuterIndex = static_cast(std::malloc((m_outerSize+1)*sizeof(StorageIndex))); - if (!newOuterIndex) internal::throw_std_bad_alloc(); - - StorageIndex count = 0; - for(Index j=0; j(reserveSizes[j], alreadyReserved); - count += toReserve + m_innerNonZeros[j]; - } - newOuterIndex[m_outerSize] = count; - - m_data.resize(count); - for(Index j=m_outerSize-1; j>=0; --j) - { - Index offset = newOuterIndex[j] - m_outerIndex[j]; - if(offset>0) - { - StorageIndex innerNNZ = m_innerNonZeros[j]; - for(Index i=innerNNZ-1; i>=0; --i) - { - m_data.index(newOuterIndex[j]+i) = m_data.index(m_outerIndex[j]+i); - m_data.value(newOuterIndex[j]+i) = m_data.value(m_outerIndex[j]+i); - } - } - } - - std::swap(m_outerIndex, newOuterIndex); - std::free(newOuterIndex); - } - - } - public: - - //--- low level purely coherent filling --- - - /** \internal - * \returns a reference to the non zero coefficient at position \a row, \a col assuming that: - * - the nonzero does not already exist - * - the new coefficient is the last one according to the storage order - * - * Before filling a given inner vector you must call the statVec(Index) function. - * - * After an insertion session, you should call the finalize() function. - * - * \sa insert, insertBackByOuterInner, startVec */ - inline Scalar& insertBack(Index row, Index col) - { - return insertBackByOuterInner(IsRowMajor?row:col, IsRowMajor?col:row); - } - - /** \internal - * \sa insertBack, startVec */ - inline Scalar& insertBackByOuterInner(Index outer, Index inner) - { - eigen_assert(Index(m_outerIndex[outer+1]) == m_data.size() && "Invalid ordered insertion (invalid outer index)"); - eigen_assert( (m_outerIndex[outer+1]-m_outerIndex[outer]==0 || m_data.index(m_data.size()-1)(m_data.size()); - Index i = m_outerSize; - // find the last filled column - while (i>=0 && m_outerIndex[i]==0) - --i; - ++i; - while (i<=m_outerSize) - { - m_outerIndex[i] = size; - ++i; - } - } - } - - //--- - - template - void setFromTriplets(const InputIterators& begin, const InputIterators& end); - - template - void setFromTriplets(const InputIterators& begin, const InputIterators& end, DupFunctor dup_func); - - void sumupDuplicates() { collapseDuplicates(internal::scalar_sum_op()); } - - template - void collapseDuplicates(DupFunctor dup_func = DupFunctor()); - - //--- - - /** \internal - * same as insert(Index,Index) except that the indices are given relative to the storage order */ - Scalar& insertByOuterInner(Index j, Index i) - { - return insert(IsRowMajor ? j : i, IsRowMajor ? i : j); - } - - /** Turns the matrix into the \em compressed format. - */ - void makeCompressed() - { - if(isCompressed()) - return; - - eigen_internal_assert(m_outerIndex!=0 && m_outerSize>0); - - Index oldStart = m_outerIndex[1]; - m_outerIndex[1] = m_innerNonZeros[0]; - for(Index j=1; j0) - { - for(Index k=0; k(std::malloc(m_outerSize * sizeof(StorageIndex))); - for (Index i = 0; i < m_outerSize; i++) - { - m_innerNonZeros[i] = m_outerIndex[i+1] - m_outerIndex[i]; - } - } - - /** Suppresses all nonzeros which are \b much \b smaller \b than \a reference under the tolerance \a epsilon */ - void prune(const Scalar& reference, const RealScalar& epsilon = NumTraits::dummy_precision()) - { - prune(default_prunning_func(reference,epsilon)); - } - - /** Turns the matrix into compressed format, and suppresses all nonzeros which do not satisfy the predicate \a keep. - * The functor type \a KeepFunc must implement the following function: - * \code - * bool operator() (const Index& row, const Index& col, const Scalar& value) const; - * \endcode - * \sa prune(Scalar,RealScalar) - */ - template - void prune(const KeepFunc& keep = KeepFunc()) - { - // TODO optimize the uncompressed mode to avoid moving and allocating the data twice - makeCompressed(); - - StorageIndex k = 0; - for(Index j=0; jrows() == rows && this->cols() == cols) return; - - // If one dimension is null, then there is nothing to be preserved - if(rows==0 || cols==0) return resize(rows,cols); - - Index innerChange = IsRowMajor ? cols - this->cols() : rows - this->rows(); - Index outerChange = IsRowMajor ? rows - this->rows() : cols - this->cols(); - StorageIndex newInnerSize = convert_index(IsRowMajor ? cols : rows); - - // Deals with inner non zeros - if (m_innerNonZeros) - { - // Resize m_innerNonZeros - StorageIndex *newInnerNonZeros = static_cast(std::realloc(m_innerNonZeros, (m_outerSize + outerChange) * sizeof(StorageIndex))); - if (!newInnerNonZeros) internal::throw_std_bad_alloc(); - m_innerNonZeros = newInnerNonZeros; - - for(Index i=m_outerSize; i(std::malloc((m_outerSize + outerChange) * sizeof(StorageIndex))); - if (!m_innerNonZeros) internal::throw_std_bad_alloc(); - for(Index i = 0; i < m_outerSize + (std::min)(outerChange, Index(0)); i++) - m_innerNonZeros[i] = m_outerIndex[i+1] - m_outerIndex[i]; - for(Index i = m_outerSize; i < m_outerSize + outerChange; i++) - m_innerNonZeros[i] = 0; - } - - // Change the m_innerNonZeros in case of a decrease of inner size - if (m_innerNonZeros && innerChange < 0) - { - for(Index i = 0; i < m_outerSize + (std::min)(outerChange, Index(0)); i++) - { - StorageIndex &n = m_innerNonZeros[i]; - StorageIndex start = m_outerIndex[i]; - while (n > 0 && m_data.index(start+n-1) >= newInnerSize) --n; - } - } - - m_innerSize = newInnerSize; - - // Re-allocate outer index structure if necessary - if (outerChange == 0) - return; - - StorageIndex *newOuterIndex = static_cast(std::realloc(m_outerIndex, (m_outerSize + outerChange + 1) * sizeof(StorageIndex))); - if (!newOuterIndex) internal::throw_std_bad_alloc(); - m_outerIndex = newOuterIndex; - if (outerChange > 0) - { - StorageIndex lastIdx = m_outerSize == 0 ? 0 : m_outerIndex[m_outerSize]; - for(Index i=m_outerSize; i(std::malloc((outerSize + 1) * sizeof(StorageIndex))); - if (!m_outerIndex) internal::throw_std_bad_alloc(); - - m_outerSize = outerSize; - } - if(m_innerNonZeros) - { - std::free(m_innerNonZeros); - m_innerNonZeros = 0; - } - memset(m_outerIndex, 0, (m_outerSize+1)*sizeof(StorageIndex)); - } - - /** \internal - * Resize the nonzero vector to \a size */ - void resizeNonZeros(Index size) - { - m_data.resize(size); - } - - /** \returns a const expression of the diagonal coefficients. */ - const ConstDiagonalReturnType diagonal() const { return ConstDiagonalReturnType(*this); } - - /** \returns a read-write expression of the diagonal coefficients. - * \warning If the diagonal entries are written, then all diagonal - * entries \b must already exist, otherwise an assertion will be raised. - */ - DiagonalReturnType diagonal() { return DiagonalReturnType(*this); } - - /** Default constructor yielding an empty \c 0 \c x \c 0 matrix */ - inline SparseMatrix() - : m_outerSize(-1), m_innerSize(0), m_outerIndex(0), m_innerNonZeros(0) - { - check_template_parameters(); - resize(0, 0); - } - - /** Constructs a \a rows \c x \a cols empty matrix */ - inline SparseMatrix(Index rows, Index cols) - : m_outerSize(0), m_innerSize(0), m_outerIndex(0), m_innerNonZeros(0) - { - check_template_parameters(); - resize(rows, cols); - } - - /** Constructs a sparse matrix from the sparse expression \a other */ - template - inline SparseMatrix(const SparseMatrixBase& other) - : m_outerSize(0), m_innerSize(0), m_outerIndex(0), m_innerNonZeros(0) - { - EIGEN_STATIC_ASSERT((internal::is_same::value), - YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY) - check_template_parameters(); - const bool needToTranspose = (Flags & RowMajorBit) != (internal::evaluator::Flags & RowMajorBit); - if (needToTranspose) - *this = other.derived(); - else - { - #ifdef EIGEN_SPARSE_CREATE_TEMPORARY_PLUGIN - EIGEN_SPARSE_CREATE_TEMPORARY_PLUGIN - #endif - internal::call_assignment_no_alias(*this, other.derived()); - } - } - - /** Constructs a sparse matrix from the sparse selfadjoint view \a other */ - template - inline SparseMatrix(const SparseSelfAdjointView& other) - : m_outerSize(0), m_innerSize(0), m_outerIndex(0), m_innerNonZeros(0) - { - check_template_parameters(); - Base::operator=(other); - } - - /** Copy constructor (it performs a deep copy) */ - inline SparseMatrix(const SparseMatrix& other) - : Base(), m_outerSize(0), m_innerSize(0), m_outerIndex(0), m_innerNonZeros(0) - { - check_template_parameters(); - *this = other.derived(); - } - - /** \brief Copy constructor with in-place evaluation */ - template - SparseMatrix(const ReturnByValue& other) - : Base(), m_outerSize(0), m_innerSize(0), m_outerIndex(0), m_innerNonZeros(0) - { - check_template_parameters(); - initAssignment(other); - other.evalTo(*this); - } - - /** \brief Copy constructor with in-place evaluation */ - template - explicit SparseMatrix(const DiagonalBase& other) - : Base(), m_outerSize(0), m_innerSize(0), m_outerIndex(0), m_innerNonZeros(0) - { - check_template_parameters(); - *this = other.derived(); - } - - /** Swaps the content of two sparse matrices of the same type. - * This is a fast operation that simply swaps the underlying pointers and parameters. */ - inline void swap(SparseMatrix& other) - { - //EIGEN_DBG_SPARSE(std::cout << "SparseMatrix:: swap\n"); - std::swap(m_outerIndex, other.m_outerIndex); - std::swap(m_innerSize, other.m_innerSize); - std::swap(m_outerSize, other.m_outerSize); - std::swap(m_innerNonZeros, other.m_innerNonZeros); - m_data.swap(other.m_data); - } - - /** Sets *this to the identity matrix. - * This function also turns the matrix into compressed mode, and drop any reserved memory. */ - inline void setIdentity() - { - eigen_assert(rows() == cols() && "ONLY FOR SQUARED MATRICES"); - this->m_data.resize(rows()); - Eigen::Map(this->m_data.indexPtr(), rows()).setLinSpaced(0, StorageIndex(rows()-1)); - Eigen::Map(this->m_data.valuePtr(), rows()).setOnes(); - Eigen::Map(this->m_outerIndex, rows()+1).setLinSpaced(0, StorageIndex(rows())); - std::free(m_innerNonZeros); - m_innerNonZeros = 0; - } - inline SparseMatrix& operator=(const SparseMatrix& other) - { - if (other.isRValue()) - { - swap(other.const_cast_derived()); - } - else if(this!=&other) - { - #ifdef EIGEN_SPARSE_CREATE_TEMPORARY_PLUGIN - EIGEN_SPARSE_CREATE_TEMPORARY_PLUGIN - #endif - initAssignment(other); - if(other.isCompressed()) - { - internal::smart_copy(other.m_outerIndex, other.m_outerIndex + m_outerSize + 1, m_outerIndex); - m_data = other.m_data; - } - else - { - Base::operator=(other); - } - } - return *this; - } - -#ifndef EIGEN_PARSED_BY_DOXYGEN - template - inline SparseMatrix& operator=(const EigenBase& other) - { return Base::operator=(other.derived()); } - - template - inline SparseMatrix& operator=(const Product& other); -#endif // EIGEN_PARSED_BY_DOXYGEN - - template - EIGEN_DONT_INLINE SparseMatrix& operator=(const SparseMatrixBase& other); - - friend std::ostream & operator << (std::ostream & s, const SparseMatrix& m) - { - EIGEN_DBG_SPARSE( - s << "Nonzero entries:\n"; - if(m.isCompressed()) - { - for (Index i=0; i&>(m); - return s; - } - - /** Destructor */ - inline ~SparseMatrix() - { - std::free(m_outerIndex); - std::free(m_innerNonZeros); - } - - /** Overloaded for performance */ - Scalar sum() const; - -# ifdef EIGEN_SPARSEMATRIX_PLUGIN -# include EIGEN_SPARSEMATRIX_PLUGIN -# endif - -protected: - - template - void initAssignment(const Other& other) - { - resize(other.rows(), other.cols()); - if(m_innerNonZeros) - { - std::free(m_innerNonZeros); - m_innerNonZeros = 0; - } - } - - /** \internal - * \sa insert(Index,Index) */ - EIGEN_DONT_INLINE Scalar& insertCompressed(Index row, Index col); - - /** \internal - * A vector object that is equal to 0 everywhere but v at the position i */ - class SingletonVector - { - StorageIndex m_index; - StorageIndex m_value; - public: - typedef StorageIndex value_type; - SingletonVector(Index i, Index v) - : m_index(convert_index(i)), m_value(convert_index(v)) - {} - - StorageIndex operator[](Index i) const { return i==m_index ? m_value : 0; } - }; - - /** \internal - * \sa insert(Index,Index) */ - EIGEN_DONT_INLINE Scalar& insertUncompressed(Index row, Index col); - -public: - /** \internal - * \sa insert(Index,Index) */ - EIGEN_STRONG_INLINE Scalar& insertBackUncompressed(Index row, Index col) - { - const Index outer = IsRowMajor ? row : col; - const Index inner = IsRowMajor ? col : row; - - eigen_assert(!isCompressed()); - eigen_assert(m_innerNonZeros[outer]<=(m_outerIndex[outer+1] - m_outerIndex[outer])); - - Index p = m_outerIndex[outer] + m_innerNonZeros[outer]++; - m_data.index(p) = convert_index(inner); - return (m_data.value(p) = Scalar(0)); - } -protected: - struct IndexPosPair { - IndexPosPair(Index a_i, Index a_p) : i(a_i), p(a_p) {} - Index i; - Index p; - }; - - /** \internal assign \a diagXpr to the diagonal of \c *this - * There are different strategies: - * 1 - if *this is overwritten (Func==assign_op) or *this is empty, then we can work treat *this as a dense vector expression. - * 2 - otherwise, for each diagonal coeff, - * 2.a - if it already exists, then we update it, - * 2.b - otherwise, if *this is uncompressed and that the current inner-vector has empty room for at least 1 element, then we perform an in-place insertion. - * 2.c - otherwise, we'll have to reallocate and copy everything, so instead of doing so for each new element, it is recorded in a std::vector. - * 3 - at the end, if some entries failed to be inserted in-place, then we alloc a new buffer, copy each chunk at the right position, and insert the new elements. - * - * TODO: some piece of code could be isolated and reused for a general in-place update strategy. - * TODO: if we start to defer the insertion of some elements (i.e., case 2.c executed once), - * then it *might* be better to disable case 2.b since they will have to be copied anyway. - */ - template - void assignDiagonal(const DiagXpr diagXpr, const Func& assignFunc) - { - Index n = diagXpr.size(); - - const bool overwrite = internal::is_same >::value; - if(overwrite) - { - if((this->rows()!=n) || (this->cols()!=n)) - this->resize(n, n); - } - - if(m_data.size()==0 || overwrite) - { - typedef Array ArrayXI; - this->makeCompressed(); - this->resizeNonZeros(n); - Eigen::Map(this->innerIndexPtr(), n).setLinSpaced(0,StorageIndex(n)-1); - Eigen::Map(this->outerIndexPtr(), n+1).setLinSpaced(0,StorageIndex(n)); - Eigen::Map > values = this->coeffs(); - values.setZero(); - internal::call_assignment_no_alias(values, diagXpr, assignFunc); - } - else - { - bool isComp = isCompressed(); - internal::evaluator diaEval(diagXpr); - std::vector newEntries; - - // 1 - try in-place update and record insertion failures - for(Index i = 0; ilower_bound(i,i); - Index p = lb.value; - if(lb.found) - { - // the coeff already exists - assignFunc.assignCoeff(m_data.value(p), diaEval.coeff(i)); - } - else if((!isComp) && m_innerNonZeros[i] < (m_outerIndex[i+1]-m_outerIndex[i])) - { - // non compressed mode with local room for inserting one element - m_data.moveChunk(p, p+1, m_outerIndex[i]+m_innerNonZeros[i]-p); - m_innerNonZeros[i]++; - m_data.value(p) = Scalar(0); - m_data.index(p) = StorageIndex(i); - assignFunc.assignCoeff(m_data.value(p), diaEval.coeff(i)); - } - else - { - // defer insertion - newEntries.push_back(IndexPosPair(i,p)); - } - } - // 2 - insert deferred entries - Index n_entries = Index(newEntries.size()); - if(n_entries>0) - { - Storage newData(m_data.size()+n_entries); - Index prev_p = 0; - Index prev_i = 0; - for(Index k=0; k::IsSigned,THE_INDEX_TYPE_MUST_BE_A_SIGNED_TYPE); - EIGEN_STATIC_ASSERT((Options&(ColMajor|RowMajor))==Options,INVALID_MATRIX_TEMPLATE_PARAMETERS); - } - - struct default_prunning_func { - default_prunning_func(const Scalar& ref, const RealScalar& eps) : reference(ref), epsilon(eps) {} - inline bool operator() (const Index&, const Index&, const Scalar& value) const - { - return !internal::isMuchSmallerThan(value, reference, epsilon); - } - Scalar reference; - RealScalar epsilon; - }; -}; - -namespace internal { - -template -void set_from_triplets(const InputIterator& begin, const InputIterator& end, SparseMatrixType& mat, DupFunctor dup_func) -{ - enum { IsRowMajor = SparseMatrixType::IsRowMajor }; - typedef typename SparseMatrixType::Scalar Scalar; - typedef typename SparseMatrixType::StorageIndex StorageIndex; - SparseMatrix trMat(mat.rows(),mat.cols()); - - if(begin!=end) - { - // pass 1: count the nnz per inner-vector - typename SparseMatrixType::IndexVector wi(trMat.outerSize()); - wi.setZero(); - for(InputIterator it(begin); it!=end; ++it) - { - eigen_assert(it->row()>=0 && it->row()col()>=0 && it->col()col() : it->row())++; - } - - // pass 2: insert all the elements into trMat - trMat.reserve(wi); - for(InputIterator it(begin); it!=end; ++it) - trMat.insertBackUncompressed(it->row(),it->col()) = it->value(); - - // pass 3: - trMat.collapseDuplicates(dup_func); - } - - // pass 4: transposed copy -> implicit sorting - mat = trMat; -} - -} - - -/** Fill the matrix \c *this with the list of \em triplets defined by the iterator range \a begin - \a end. - * - * A \em triplet is a tuple (i,j,value) defining a non-zero element. - * The input list of triplets does not have to be sorted, and can contains duplicated elements. - * In any case, the result is a \b sorted and \b compressed sparse matrix where the duplicates have been summed up. - * This is a \em O(n) operation, with \em n the number of triplet elements. - * The initial contents of \c *this is destroyed. - * The matrix \c *this must be properly resized beforehand using the SparseMatrix(Index,Index) constructor, - * or the resize(Index,Index) method. The sizes are not extracted from the triplet list. - * - * The \a InputIterators value_type must provide the following interface: - * \code - * Scalar value() const; // the value - * Scalar row() const; // the row index i - * Scalar col() const; // the column index j - * \endcode - * See for instance the Eigen::Triplet template class. - * - * Here is a typical usage example: - * \code - typedef Triplet T; - std::vector tripletList; - tripletList.reserve(estimation_of_entries); - for(...) - { - // ... - tripletList.push_back(T(i,j,v_ij)); - } - SparseMatrixType m(rows,cols); - m.setFromTriplets(tripletList.begin(), tripletList.end()); - // m is ready to go! - * \endcode - * - * \warning The list of triplets is read multiple times (at least twice). Therefore, it is not recommended to define - * an abstract iterator over a complex data-structure that would be expensive to evaluate. The triplets should rather - * be explicitly stored into a std::vector for instance. - */ -template -template -void SparseMatrix::setFromTriplets(const InputIterators& begin, const InputIterators& end) -{ - internal::set_from_triplets >(begin, end, *this, internal::scalar_sum_op()); -} - -/** The same as setFromTriplets but when duplicates are met the functor \a dup_func is applied: - * \code - * value = dup_func(OldValue, NewValue) - * \endcode - * Here is a C++11 example keeping the latest entry only: - * \code - * mat.setFromTriplets(triplets.begin(), triplets.end(), [] (const Scalar&,const Scalar &b) { return b; }); - * \endcode - */ -template -template -void SparseMatrix::setFromTriplets(const InputIterators& begin, const InputIterators& end, DupFunctor dup_func) -{ - internal::set_from_triplets, DupFunctor>(begin, end, *this, dup_func); -} - -/** \internal */ -template -template -void SparseMatrix::collapseDuplicates(DupFunctor dup_func) -{ - eigen_assert(!isCompressed()); - // TODO, in practice we should be able to use m_innerNonZeros for that task - IndexVector wi(innerSize()); - wi.fill(-1); - StorageIndex count = 0; - // for each inner-vector, wi[inner_index] will hold the position of first element into the index/value buffers - for(Index j=0; j=start) - { - // we already meet this entry => accumulate it - m_data.value(wi(i)) = dup_func(m_data.value(wi(i)), m_data.value(k)); - } - else - { - m_data.value(count) = m_data.value(k); - m_data.index(count) = m_data.index(k); - wi(i) = count; - ++count; - } - } - m_outerIndex[j] = start; - } - m_outerIndex[m_outerSize] = count; - - // turn the matrix into compressed form - std::free(m_innerNonZeros); - m_innerNonZeros = 0; - m_data.resize(m_outerIndex[m_outerSize]); -} - -template -template -EIGEN_DONT_INLINE SparseMatrix& SparseMatrix::operator=(const SparseMatrixBase& other) -{ - EIGEN_STATIC_ASSERT((internal::is_same::value), - YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY) - - #ifdef EIGEN_SPARSE_CREATE_TEMPORARY_PLUGIN - EIGEN_SPARSE_CREATE_TEMPORARY_PLUGIN - #endif - - const bool needToTranspose = (Flags & RowMajorBit) != (internal::evaluator::Flags & RowMajorBit); - if (needToTranspose) - { - #ifdef EIGEN_SPARSE_TRANSPOSED_COPY_PLUGIN - EIGEN_SPARSE_TRANSPOSED_COPY_PLUGIN - #endif - // two passes algorithm: - // 1 - compute the number of coeffs per dest inner vector - // 2 - do the actual copy/eval - // Since each coeff of the rhs has to be evaluated twice, let's evaluate it if needed - typedef typename internal::nested_eval::type >::type OtherCopy; - typedef typename internal::remove_all::type _OtherCopy; - typedef internal::evaluator<_OtherCopy> OtherCopyEval; - OtherCopy otherCopy(other.derived()); - OtherCopyEval otherCopyEval(otherCopy); - - SparseMatrix dest(other.rows(),other.cols()); - Eigen::Map (dest.m_outerIndex,dest.outerSize()).setZero(); - - // pass 1 - // FIXME the above copy could be merged with that pass - for (Index j=0; jswap(dest); - return *this; - } - else - { - if(other.isRValue()) - { - initAssignment(other.derived()); - } - // there is no special optimization - return Base::operator=(other.derived()); - } -} - -template -typename SparseMatrix<_Scalar,_Options,_StorageIndex>::Scalar& SparseMatrix<_Scalar,_Options,_StorageIndex>::insert(Index row, Index col) -{ - eigen_assert(row>=0 && row=0 && col(std::malloc(m_outerSize * sizeof(StorageIndex))); - if(!m_innerNonZeros) internal::throw_std_bad_alloc(); - - memset(m_innerNonZeros, 0, (m_outerSize)*sizeof(StorageIndex)); - - // pack all inner-vectors to the end of the pre-allocated space - // and allocate the entire free-space to the first inner-vector - StorageIndex end = convert_index(m_data.allocatedSize()); - for(Index j=1; j<=m_outerSize; ++j) - m_outerIndex[j] = end; - } - else - { - // turn the matrix into non-compressed mode - m_innerNonZeros = static_cast(std::malloc(m_outerSize * sizeof(StorageIndex))); - if(!m_innerNonZeros) internal::throw_std_bad_alloc(); - for(Index j=0; j=0 && m_innerNonZeros[j]==0) - m_outerIndex[j--] = p; - - // push back the new element - ++m_innerNonZeros[outer]; - m_data.append(Scalar(0), inner); - - // check for reallocation - if(data_end != m_data.allocatedSize()) - { - // m_data has been reallocated - // -> move remaining inner-vectors back to the end of the free-space - // so that the entire free-space is allocated to the current inner-vector. - eigen_internal_assert(data_end < m_data.allocatedSize()); - StorageIndex new_end = convert_index(m_data.allocatedSize()); - for(Index k=outer+1; k<=m_outerSize; ++k) - if(m_outerIndex[k]==data_end) - m_outerIndex[k] = new_end; - } - return m_data.value(p); - } - - // Second case: the next inner-vector is packed to the end - // and the current inner-vector end match the used-space. - if(m_outerIndex[outer+1]==data_end && m_outerIndex[outer]+m_innerNonZeros[outer]==m_data.size()) - { - eigen_internal_assert(outer+1==m_outerSize || m_innerNonZeros[outer+1]==0); - - // add space for the new element - ++m_innerNonZeros[outer]; - m_data.resize(m_data.size()+1); - - // check for reallocation - if(data_end != m_data.allocatedSize()) - { - // m_data has been reallocated - // -> move remaining inner-vectors back to the end of the free-space - // so that the entire free-space is allocated to the current inner-vector. - eigen_internal_assert(data_end < m_data.allocatedSize()); - StorageIndex new_end = convert_index(m_data.allocatedSize()); - for(Index k=outer+1; k<=m_outerSize; ++k) - if(m_outerIndex[k]==data_end) - m_outerIndex[k] = new_end; - } - - // and insert it at the right position (sorted insertion) - Index startId = m_outerIndex[outer]; - Index p = m_outerIndex[outer]+m_innerNonZeros[outer]-1; - while ( (p > startId) && (m_data.index(p-1) > inner) ) - { - m_data.index(p) = m_data.index(p-1); - m_data.value(p) = m_data.value(p-1); - --p; - } - - m_data.index(p) = convert_index(inner); - return (m_data.value(p) = Scalar(0)); - } - - if(m_data.size() != m_data.allocatedSize()) - { - // make sure the matrix is compatible to random un-compressed insertion: - m_data.resize(m_data.allocatedSize()); - this->reserveInnerVectors(Array::Constant(m_outerSize, 2)); - } - - return insertUncompressed(row,col); -} - -template -EIGEN_DONT_INLINE typename SparseMatrix<_Scalar,_Options,_StorageIndex>::Scalar& SparseMatrix<_Scalar,_Options,_StorageIndex>::insertUncompressed(Index row, Index col) -{ - eigen_assert(!isCompressed()); - - const Index outer = IsRowMajor ? row : col; - const StorageIndex inner = convert_index(IsRowMajor ? col : row); - - Index room = m_outerIndex[outer+1] - m_outerIndex[outer]; - StorageIndex innerNNZ = m_innerNonZeros[outer]; - if(innerNNZ>=room) - { - // this inner vector is full, we need to reallocate the whole buffer :( - reserve(SingletonVector(outer,std::max(2,innerNNZ))); - } - - Index startId = m_outerIndex[outer]; - Index p = startId + m_innerNonZeros[outer]; - while ( (p > startId) && (m_data.index(p-1) > inner) ) - { - m_data.index(p) = m_data.index(p-1); - m_data.value(p) = m_data.value(p-1); - --p; - } - eigen_assert((p<=startId || m_data.index(p-1)!=inner) && "you cannot insert an element that already exists, you must call coeffRef to this end"); - - m_innerNonZeros[outer]++; - - m_data.index(p) = inner; - return (m_data.value(p) = Scalar(0)); -} - -template -EIGEN_DONT_INLINE typename SparseMatrix<_Scalar,_Options,_StorageIndex>::Scalar& SparseMatrix<_Scalar,_Options,_StorageIndex>::insertCompressed(Index row, Index col) -{ - eigen_assert(isCompressed()); - - const Index outer = IsRowMajor ? row : col; - const Index inner = IsRowMajor ? col : row; - - Index previousOuter = outer; - if (m_outerIndex[outer+1]==0) - { - // we start a new inner vector - while (previousOuter>=0 && m_outerIndex[previousOuter]==0) - { - m_outerIndex[previousOuter] = convert_index(m_data.size()); - --previousOuter; - } - m_outerIndex[outer+1] = m_outerIndex[outer]; - } - - // here we have to handle the tricky case where the outerIndex array - // starts with: [ 0 0 0 0 0 1 ...] and we are inserted in, e.g., - // the 2nd inner vector... - bool isLastVec = (!(previousOuter==-1 && m_data.size()!=0)) - && (std::size_t(m_outerIndex[outer+1]) == m_data.size()); - - std::size_t startId = m_outerIndex[outer]; - // FIXME let's make sure sizeof(long int) == sizeof(std::size_t) - std::size_t p = m_outerIndex[outer+1]; - ++m_outerIndex[outer+1]; - - double reallocRatio = 1; - if (m_data.allocatedSize()<=m_data.size()) - { - // if there is no preallocated memory, let's reserve a minimum of 32 elements - if (m_data.size()==0) - { - m_data.reserve(32); - } - else - { - // we need to reallocate the data, to reduce multiple reallocations - // we use a smart resize algorithm based on the current filling ratio - // in addition, we use double to avoid integers overflows - double nnzEstimate = double(m_outerIndex[outer])*double(m_outerSize)/double(outer+1); - reallocRatio = (nnzEstimate-double(m_data.size()))/double(m_data.size()); - // furthermore we bound the realloc ratio to: - // 1) reduce multiple minor realloc when the matrix is almost filled - // 2) avoid to allocate too much memory when the matrix is almost empty - reallocRatio = (std::min)((std::max)(reallocRatio,1.5),8.); - } - } - m_data.resize(m_data.size()+1,reallocRatio); - - if (!isLastVec) - { - if (previousOuter==-1) - { - // oops wrong guess. - // let's correct the outer offsets - for (Index k=0; k<=(outer+1); ++k) - m_outerIndex[k] = 0; - Index k=outer+1; - while(m_outerIndex[k]==0) - m_outerIndex[k++] = 1; - while (k<=m_outerSize && m_outerIndex[k]!=0) - m_outerIndex[k++]++; - p = 0; - --k; - k = m_outerIndex[k]-1; - while (k>0) - { - m_data.index(k) = m_data.index(k-1); - m_data.value(k) = m_data.value(k-1); - k--; - } - } - else - { - // we are not inserting into the last inner vec - // update outer indices: - Index j = outer+2; - while (j<=m_outerSize && m_outerIndex[j]!=0) - m_outerIndex[j++]++; - --j; - // shift data of last vecs: - Index k = m_outerIndex[j]-1; - while (k>=Index(p)) - { - m_data.index(k) = m_data.index(k-1); - m_data.value(k) = m_data.value(k-1); - k--; - } - } - } - - while ( (p > startId) && (m_data.index(p-1) > inner) ) - { - m_data.index(p) = m_data.index(p-1); - m_data.value(p) = m_data.value(p-1); - --p; - } - - m_data.index(p) = inner; - return (m_data.value(p) = Scalar(0)); -} - -namespace internal { - -template -struct evaluator > - : evaluator > > -{ - typedef evaluator > > Base; - typedef SparseMatrix<_Scalar,_Options,_StorageIndex> SparseMatrixType; - evaluator() : Base() {} - explicit evaluator(const SparseMatrixType &mat) : Base(mat) {} -}; - -} - -} // end namespace Eigen - -#endif // EIGEN_SPARSEMATRIX_H diff --git a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseMatrixBase.h b/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseMatrixBase.h deleted file mode 100644 index 80b6e8ed2..000000000 --- a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseMatrixBase.h +++ /dev/null @@ -1,398 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008-2014 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_SPARSEMATRIXBASE_H -#define EIGEN_SPARSEMATRIXBASE_H - -namespace Eigen { - -/** \ingroup SparseCore_Module - * - * \class SparseMatrixBase - * - * \brief Base class of any sparse matrices or sparse expressions - * - * \tparam Derived is the derived type, e.g. a sparse matrix type, or an expression, etc. - * - * This class can be extended with the help of the plugin mechanism described on the page - * \ref TopicCustomizing_Plugins by defining the preprocessor symbol \c EIGEN_SPARSEMATRIXBASE_PLUGIN. - */ -template class SparseMatrixBase - : public EigenBase -{ - public: - - typedef typename internal::traits::Scalar Scalar; - - /** The numeric type of the expression' coefficients, e.g. float, double, int or std::complex, etc. - * - * It is an alias for the Scalar type */ - typedef Scalar value_type; - - typedef typename internal::packet_traits::type PacketScalar; - typedef typename internal::traits::StorageKind StorageKind; - - /** The integer type used to \b store indices within a SparseMatrix. - * For a \c SparseMatrix it an alias of the third template parameter \c IndexType. */ - typedef typename internal::traits::StorageIndex StorageIndex; - - typedef typename internal::add_const_on_value_type_if_arithmetic< - typename internal::packet_traits::type - >::type PacketReturnType; - - typedef SparseMatrixBase StorageBaseType; - - typedef Matrix IndexVector; - typedef Matrix ScalarVector; - - template - Derived& operator=(const EigenBase &other); - - enum { - - RowsAtCompileTime = internal::traits::RowsAtCompileTime, - /**< The number of rows at compile-time. This is just a copy of the value provided - * by the \a Derived type. If a value is not known at compile-time, - * it is set to the \a Dynamic constant. - * \sa MatrixBase::rows(), MatrixBase::cols(), ColsAtCompileTime, SizeAtCompileTime */ - - ColsAtCompileTime = internal::traits::ColsAtCompileTime, - /**< The number of columns at compile-time. This is just a copy of the value provided - * by the \a Derived type. If a value is not known at compile-time, - * it is set to the \a Dynamic constant. - * \sa MatrixBase::rows(), MatrixBase::cols(), RowsAtCompileTime, SizeAtCompileTime */ - - - SizeAtCompileTime = (internal::size_at_compile_time::RowsAtCompileTime, - internal::traits::ColsAtCompileTime>::ret), - /**< This is equal to the number of coefficients, i.e. the number of - * rows times the number of columns, or to \a Dynamic if this is not - * known at compile-time. \sa RowsAtCompileTime, ColsAtCompileTime */ - - MaxRowsAtCompileTime = RowsAtCompileTime, - MaxColsAtCompileTime = ColsAtCompileTime, - - MaxSizeAtCompileTime = (internal::size_at_compile_time::ret), - - IsVectorAtCompileTime = RowsAtCompileTime == 1 || ColsAtCompileTime == 1, - /**< This is set to true if either the number of rows or the number of - * columns is known at compile-time to be equal to 1. Indeed, in that case, - * we are dealing with a column-vector (if there is only one column) or with - * a row-vector (if there is only one row). */ - - NumDimensions = int(MaxSizeAtCompileTime) == 1 ? 0 : bool(IsVectorAtCompileTime) ? 1 : 2, - /**< This value is equal to Tensor::NumDimensions, i.e. 0 for scalars, 1 for vectors, - * and 2 for matrices. - */ - - Flags = internal::traits::Flags, - /**< This stores expression \ref flags flags which may or may not be inherited by new expressions - * constructed from this one. See the \ref flags "list of flags". - */ - - IsRowMajor = Flags&RowMajorBit ? 1 : 0, - - InnerSizeAtCompileTime = int(IsVectorAtCompileTime) ? int(SizeAtCompileTime) - : int(IsRowMajor) ? int(ColsAtCompileTime) : int(RowsAtCompileTime), - - #ifndef EIGEN_PARSED_BY_DOXYGEN - _HasDirectAccess = (int(Flags)&DirectAccessBit) ? 1 : 0 // workaround sunCC - #endif - }; - - /** \internal the return type of MatrixBase::adjoint() */ - typedef typename internal::conditional::IsComplex, - CwiseUnaryOp, Eigen::Transpose >, - Transpose - >::type AdjointReturnType; - typedef Transpose TransposeReturnType; - typedef typename internal::add_const >::type ConstTransposeReturnType; - - // FIXME storage order do not match evaluator storage order - typedef SparseMatrix PlainObject; - -#ifndef EIGEN_PARSED_BY_DOXYGEN - /** This is the "real scalar" type; if the \a Scalar type is already real numbers - * (e.g. int, float or double) then \a RealScalar is just the same as \a Scalar. If - * \a Scalar is \a std::complex then RealScalar is \a T. - * - * \sa class NumTraits - */ - typedef typename NumTraits::Real RealScalar; - - /** \internal the return type of coeff() - */ - typedef typename internal::conditional<_HasDirectAccess, const Scalar&, Scalar>::type CoeffReturnType; - - /** \internal Represents a matrix with all coefficients equal to one another*/ - typedef CwiseNullaryOp,Matrix > ConstantReturnType; - - /** type of the equivalent dense matrix */ - typedef Matrix DenseMatrixType; - /** type of the equivalent square matrix */ - typedef Matrix SquareMatrixType; - - inline const Derived& derived() const { return *static_cast(this); } - inline Derived& derived() { return *static_cast(this); } - inline Derived& const_cast_derived() const - { return *static_cast(const_cast(this)); } - - typedef EigenBase Base; - -#endif // not EIGEN_PARSED_BY_DOXYGEN - -#define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::SparseMatrixBase -#ifdef EIGEN_PARSED_BY_DOXYGEN -#define EIGEN_DOC_UNARY_ADDONS(METHOD,OP) /**

This method does not change the sparsity of \c *this: the OP is applied to explicitly stored coefficients only. \sa SparseCompressedBase::coeffs()

*/ -#define EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL /**

\warning This method returns a read-only expression for any sparse matrices. \sa \ref TutorialSparse_SubMatrices "Sparse block operations"

*/ -#define EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(COND) /**

\warning This method returns a read-write expression for COND sparse matrices only. Otherwise, the returned expression is read-only. \sa \ref TutorialSparse_SubMatrices "Sparse block operations"

*/ -#else -#define EIGEN_DOC_UNARY_ADDONS(X,Y) -#define EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL -#define EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF(COND) -#endif -# include "Eigen/src/plugins/CommonCwiseUnaryOps.h" -# include "Eigen/src/plugins/CommonCwiseBinaryOps.h" -# include "Eigen/src/plugins/MatrixCwiseUnaryOps.h" -# include "Eigen/src/plugins/MatrixCwiseBinaryOps.h" -# include "Eigen/src/plugins/BlockMethods.h" -# ifdef EIGEN_SPARSEMATRIXBASE_PLUGIN -# include EIGEN_SPARSEMATRIXBASE_PLUGIN -# endif -#undef EIGEN_CURRENT_STORAGE_BASE_CLASS -#undef EIGEN_DOC_UNARY_ADDONS -#undef EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL -#undef EIGEN_DOC_BLOCK_ADDONS_INNER_PANEL_IF - - /** \returns the number of rows. \sa cols() */ - inline Index rows() const { return derived().rows(); } - /** \returns the number of columns. \sa rows() */ - inline Index cols() const { return derived().cols(); } - /** \returns the number of coefficients, which is \a rows()*cols(). - * \sa rows(), cols(). */ - inline Index size() const { return rows() * cols(); } - /** \returns true if either the number of rows or the number of columns is equal to 1. - * In other words, this function returns - * \code rows()==1 || cols()==1 \endcode - * \sa rows(), cols(), IsVectorAtCompileTime. */ - inline bool isVector() const { return rows()==1 || cols()==1; } - /** \returns the size of the storage major dimension, - * i.e., the number of columns for a columns major matrix, and the number of rows otherwise */ - Index outerSize() const { return (int(Flags)&RowMajorBit) ? this->rows() : this->cols(); } - /** \returns the size of the inner dimension according to the storage order, - * i.e., the number of rows for a columns major matrix, and the number of cols otherwise */ - Index innerSize() const { return (int(Flags)&RowMajorBit) ? this->cols() : this->rows(); } - - bool isRValue() const { return m_isRValue; } - Derived& markAsRValue() { m_isRValue = true; return derived(); } - - SparseMatrixBase() : m_isRValue(false) { /* TODO check flags */ } - - - template - Derived& operator=(const ReturnByValue& other); - - template - inline Derived& operator=(const SparseMatrixBase& other); - - inline Derived& operator=(const Derived& other); - - protected: - - template - inline Derived& assign(const OtherDerived& other); - - template - inline void assignGeneric(const OtherDerived& other); - - public: - - friend std::ostream & operator << (std::ostream & s, const SparseMatrixBase& m) - { - typedef typename Derived::Nested Nested; - typedef typename internal::remove_all::type NestedCleaned; - - if (Flags&RowMajorBit) - { - Nested nm(m.derived()); - internal::evaluator thisEval(nm); - for (Index row=0; row::InnerIterator it(thisEval, row); it; ++it) - { - for ( ; col thisEval(nm); - if (m.cols() == 1) { - Index row = 0; - for (typename internal::evaluator::InnerIterator it(thisEval, 0); it; ++it) - { - for ( ; row trans = m; - s << static_cast >&>(trans); - } - } - return s; - } - - template - Derived& operator+=(const SparseMatrixBase& other); - template - Derived& operator-=(const SparseMatrixBase& other); - - template - Derived& operator+=(const DiagonalBase& other); - template - Derived& operator-=(const DiagonalBase& other); - - template - Derived& operator+=(const EigenBase &other); - template - Derived& operator-=(const EigenBase &other); - - Derived& operator*=(const Scalar& other); - Derived& operator/=(const Scalar& other); - - template struct CwiseProductDenseReturnType { - typedef CwiseBinaryOp::Scalar, - typename internal::traits::Scalar - >::ReturnType>, - const Derived, - const OtherDerived - > Type; - }; - - template - EIGEN_STRONG_INLINE const typename CwiseProductDenseReturnType::Type - cwiseProduct(const MatrixBase &other) const; - - // sparse * diagonal - template - const Product - operator*(const DiagonalBase &other) const - { return Product(derived(), other.derived()); } - - // diagonal * sparse - template friend - const Product - operator*(const DiagonalBase &lhs, const SparseMatrixBase& rhs) - { return Product(lhs.derived(), rhs.derived()); } - - // sparse * sparse - template - const Product - operator*(const SparseMatrixBase &other) const; - - // sparse * dense - template - const Product - operator*(const MatrixBase &other) const - { return Product(derived(), other.derived()); } - - // dense * sparse - template friend - const Product - operator*(const MatrixBase &lhs, const SparseMatrixBase& rhs) - { return Product(lhs.derived(), rhs.derived()); } - - /** \returns an expression of P H P^-1 where H is the matrix represented by \c *this */ - SparseSymmetricPermutationProduct twistedBy(const PermutationMatrix& perm) const - { - return SparseSymmetricPermutationProduct(derived(), perm); - } - - template - Derived& operator*=(const SparseMatrixBase& other); - - template - inline const TriangularView triangularView() const; - - template struct SelfAdjointViewReturnType { typedef SparseSelfAdjointView Type; }; - template struct ConstSelfAdjointViewReturnType { typedef const SparseSelfAdjointView Type; }; - - template inline - typename ConstSelfAdjointViewReturnType::Type selfadjointView() const; - template inline - typename SelfAdjointViewReturnType::Type selfadjointView(); - - template Scalar dot(const MatrixBase& other) const; - template Scalar dot(const SparseMatrixBase& other) const; - RealScalar squaredNorm() const; - RealScalar norm() const; - RealScalar blueNorm() const; - - TransposeReturnType transpose() { return TransposeReturnType(derived()); } - const ConstTransposeReturnType transpose() const { return ConstTransposeReturnType(derived()); } - const AdjointReturnType adjoint() const { return AdjointReturnType(transpose()); } - - DenseMatrixType toDense() const - { - return DenseMatrixType(derived()); - } - - template - bool isApprox(const SparseMatrixBase& other, - const RealScalar& prec = NumTraits::dummy_precision()) const; - - template - bool isApprox(const MatrixBase& other, - const RealScalar& prec = NumTraits::dummy_precision()) const - { return toDense().isApprox(other,prec); } - - /** \returns the matrix or vector obtained by evaluating this expression. - * - * Notice that in the case of a plain matrix or vector (not an expression) this function just returns - * a const reference, in order to avoid a useless copy. - */ - inline const typename internal::eval::type eval() const - { return typename internal::eval::type(derived()); } - - Scalar sum() const; - - inline const SparseView - pruned(const Scalar& reference = Scalar(0), const RealScalar& epsilon = NumTraits::dummy_precision()) const; - - protected: - - bool m_isRValue; - - static inline StorageIndex convert_index(const Index idx) { - return internal::convert_index(idx); - } - private: - template void evalTo(Dest &) const; -}; - -} // end namespace Eigen - -#endif // EIGEN_SPARSEMATRIXBASE_H diff --git a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparsePermutation.h b/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparsePermutation.h deleted file mode 100644 index ef38357ae..000000000 --- a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparsePermutation.h +++ /dev/null @@ -1,178 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2012 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_SPARSE_PERMUTATION_H -#define EIGEN_SPARSE_PERMUTATION_H - -// This file implements sparse * permutation products - -namespace Eigen { - -namespace internal { - -template -struct permutation_matrix_product -{ - typedef typename nested_eval::type MatrixType; - typedef typename remove_all::type MatrixTypeCleaned; - - typedef typename MatrixTypeCleaned::Scalar Scalar; - typedef typename MatrixTypeCleaned::StorageIndex StorageIndex; - - enum { - SrcStorageOrder = MatrixTypeCleaned::Flags&RowMajorBit ? RowMajor : ColMajor, - MoveOuter = SrcStorageOrder==RowMajor ? Side==OnTheLeft : Side==OnTheRight - }; - - typedef typename internal::conditional, - SparseMatrix >::type ReturnType; - - template - static inline void run(Dest& dst, const PermutationType& perm, const ExpressionType& xpr) - { - MatrixType mat(xpr); - if(MoveOuter) - { - SparseMatrix tmp(mat.rows(), mat.cols()); - Matrix sizes(mat.outerSize()); - for(Index j=0; j tmp(mat.rows(), mat.cols()); - Matrix sizes(tmp.outerSize()); - sizes.setZero(); - PermutationMatrix perm_cpy; - if((Side==OnTheLeft) ^ Transposed) - perm_cpy = perm; - else - perm_cpy = perm.transpose(); - - for(Index j=0; j struct product_promote_storage_type { typedef Sparse ret; }; -template struct product_promote_storage_type { typedef Sparse ret; }; - -// TODO, the following two overloads are only needed to define the right temporary type through -// typename traits >::ReturnType -// whereas it should be correctly handled by traits >::PlainObject - -template -struct product_evaluator, ProductTag, PermutationShape, SparseShape> - : public evaluator::ReturnType> -{ - typedef Product XprType; - typedef typename permutation_matrix_product::ReturnType PlainObject; - typedef evaluator Base; - - enum { - Flags = Base::Flags | EvalBeforeNestingBit - }; - - explicit product_evaluator(const XprType& xpr) - : m_result(xpr.rows(), xpr.cols()) - { - ::new (static_cast(this)) Base(m_result); - generic_product_impl::evalTo(m_result, xpr.lhs(), xpr.rhs()); - } - -protected: - PlainObject m_result; -}; - -template -struct product_evaluator, ProductTag, SparseShape, PermutationShape > - : public evaluator::ReturnType> -{ - typedef Product XprType; - typedef typename permutation_matrix_product::ReturnType PlainObject; - typedef evaluator Base; - - enum { - Flags = Base::Flags | EvalBeforeNestingBit - }; - - explicit product_evaluator(const XprType& xpr) - : m_result(xpr.rows(), xpr.cols()) - { - ::new (static_cast(this)) Base(m_result); - generic_product_impl::evalTo(m_result, xpr.lhs(), xpr.rhs()); - } - -protected: - PlainObject m_result; -}; - -} // end namespace internal - -/** \returns the matrix with the permutation applied to the columns - */ -template -inline const Product -operator*(const SparseMatrixBase& matrix, const PermutationBase& perm) -{ return Product(matrix.derived(), perm.derived()); } - -/** \returns the matrix with the permutation applied to the rows - */ -template -inline const Product -operator*( const PermutationBase& perm, const SparseMatrixBase& matrix) -{ return Product(perm.derived(), matrix.derived()); } - - -/** \returns the matrix with the inverse permutation applied to the columns. - */ -template -inline const Product, AliasFreeProduct> -operator*(const SparseMatrixBase& matrix, const InverseImpl& tperm) -{ - return Product, AliasFreeProduct>(matrix.derived(), tperm.derived()); -} - -/** \returns the matrix with the inverse permutation applied to the rows. - */ -template -inline const Product, SparseDerived, AliasFreeProduct> -operator*(const InverseImpl& tperm, const SparseMatrixBase& matrix) -{ - return Product, SparseDerived, AliasFreeProduct>(tperm.derived(), matrix.derived()); -} - -} // end namespace Eigen - -#endif // EIGEN_SPARSE_SELFADJOINTVIEW_H diff --git a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseProduct.h b/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseProduct.h deleted file mode 100644 index af8a7744d..000000000 --- a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseProduct.h +++ /dev/null @@ -1,181 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008-2015 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_SPARSEPRODUCT_H -#define EIGEN_SPARSEPRODUCT_H - -namespace Eigen { - -/** \returns an expression of the product of two sparse matrices. - * By default a conservative product preserving the symbolic non zeros is performed. - * The automatic pruning of the small values can be achieved by calling the pruned() function - * in which case a totally different product algorithm is employed: - * \code - * C = (A*B).pruned(); // suppress numerical zeros (exact) - * C = (A*B).pruned(ref); - * C = (A*B).pruned(ref,epsilon); - * \endcode - * where \c ref is a meaningful non zero reference value. - * */ -template -template -inline const Product -SparseMatrixBase::operator*(const SparseMatrixBase &other) const -{ - return Product(derived(), other.derived()); -} - -namespace internal { - -// sparse * sparse -template -struct generic_product_impl -{ - template - static void evalTo(Dest& dst, const Lhs& lhs, const Rhs& rhs) - { - evalTo(dst, lhs, rhs, typename evaluator_traits::Shape()); - } - - // dense += sparse * sparse - template - static void addTo(Dest& dst, const ActualLhs& lhs, const Rhs& rhs, typename enable_if::Shape,DenseShape>::value,int*>::type* = 0) - { - typedef typename nested_eval::type LhsNested; - typedef typename nested_eval::type RhsNested; - LhsNested lhsNested(lhs); - RhsNested rhsNested(rhs); - internal::sparse_sparse_to_dense_product_selector::type, - typename remove_all::type, Dest>::run(lhsNested,rhsNested,dst); - } - - // dense -= sparse * sparse - template - static void subTo(Dest& dst, const Lhs& lhs, const Rhs& rhs, typename enable_if::Shape,DenseShape>::value,int*>::type* = 0) - { - addTo(dst, -lhs, rhs); - } - -protected: - - // sparse = sparse * sparse - template - static void evalTo(Dest& dst, const Lhs& lhs, const Rhs& rhs, SparseShape) - { - typedef typename nested_eval::type LhsNested; - typedef typename nested_eval::type RhsNested; - LhsNested lhsNested(lhs); - RhsNested rhsNested(rhs); - internal::conservative_sparse_sparse_product_selector::type, - typename remove_all::type, Dest>::run(lhsNested,rhsNested,dst); - } - - // dense = sparse * sparse - template - static void evalTo(Dest& dst, const Lhs& lhs, const Rhs& rhs, DenseShape) - { - dst.setZero(); - addTo(dst, lhs, rhs); - } -}; - -// sparse * sparse-triangular -template -struct generic_product_impl - : public generic_product_impl -{}; - -// sparse-triangular * sparse -template -struct generic_product_impl - : public generic_product_impl -{}; - -// dense = sparse-product (can be sparse*sparse, sparse*perm, etc.) -template< typename DstXprType, typename Lhs, typename Rhs> -struct Assignment, internal::assign_op::Scalar>, Sparse2Dense> -{ - typedef Product SrcXprType; - static void run(DstXprType &dst, const SrcXprType &src, const internal::assign_op &) - { - Index dstRows = src.rows(); - Index dstCols = src.cols(); - if((dst.rows()!=dstRows) || (dst.cols()!=dstCols)) - dst.resize(dstRows, dstCols); - - generic_product_impl::evalTo(dst,src.lhs(),src.rhs()); - } -}; - -// dense += sparse-product (can be sparse*sparse, sparse*perm, etc.) -template< typename DstXprType, typename Lhs, typename Rhs> -struct Assignment, internal::add_assign_op::Scalar>, Sparse2Dense> -{ - typedef Product SrcXprType; - static void run(DstXprType &dst, const SrcXprType &src, const internal::add_assign_op &) - { - generic_product_impl::addTo(dst,src.lhs(),src.rhs()); - } -}; - -// dense -= sparse-product (can be sparse*sparse, sparse*perm, etc.) -template< typename DstXprType, typename Lhs, typename Rhs> -struct Assignment, internal::sub_assign_op::Scalar>, Sparse2Dense> -{ - typedef Product SrcXprType; - static void run(DstXprType &dst, const SrcXprType &src, const internal::sub_assign_op &) - { - generic_product_impl::subTo(dst,src.lhs(),src.rhs()); - } -}; - -template -struct unary_evaluator >, IteratorBased> - : public evaluator::PlainObject> -{ - typedef SparseView > XprType; - typedef typename XprType::PlainObject PlainObject; - typedef evaluator Base; - - explicit unary_evaluator(const XprType& xpr) - : m_result(xpr.rows(), xpr.cols()) - { - using std::abs; - ::new (static_cast(this)) Base(m_result); - typedef typename nested_eval::type LhsNested; - typedef typename nested_eval::type RhsNested; - LhsNested lhsNested(xpr.nestedExpression().lhs()); - RhsNested rhsNested(xpr.nestedExpression().rhs()); - - internal::sparse_sparse_product_with_pruning_selector::type, - typename remove_all::type, PlainObject>::run(lhsNested,rhsNested,m_result, - abs(xpr.reference())*xpr.epsilon()); - } - -protected: - PlainObject m_result; -}; - -} // end namespace internal - -// sparse matrix = sparse-product (can be sparse*sparse, sparse*perm, etc.) -template -template -SparseMatrix& SparseMatrix::operator=(const Product& src) -{ - // std::cout << "in Assignment : " << DstOptions << "\n"; - SparseMatrix dst(src.rows(),src.cols()); - internal::generic_product_impl::evalTo(dst,src.lhs(),src.rhs()); - this->swap(dst); - return *this; -} - -} // end namespace Eigen - -#endif // EIGEN_SPARSEPRODUCT_H diff --git a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseRedux.h b/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseRedux.h deleted file mode 100644 index 458774962..000000000 --- a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseRedux.h +++ /dev/null @@ -1,49 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008-2014 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_SPARSEREDUX_H -#define EIGEN_SPARSEREDUX_H - -namespace Eigen { - -template -typename internal::traits::Scalar -SparseMatrixBase::sum() const -{ - eigen_assert(rows()>0 && cols()>0 && "you are using a non initialized matrix"); - Scalar res(0); - internal::evaluator thisEval(derived()); - for (Index j=0; j::InnerIterator iter(thisEval,j); iter; ++iter) - res += iter.value(); - return res; -} - -template -typename internal::traits >::Scalar -SparseMatrix<_Scalar,_Options,_Index>::sum() const -{ - eigen_assert(rows()>0 && cols()>0 && "you are using a non initialized matrix"); - if(this->isCompressed()) - return Matrix::Map(m_data.valuePtr(), m_data.size()).sum(); - else - return Base::sum(); -} - -template -typename internal::traits >::Scalar -SparseVector<_Scalar,_Options,_Index>::sum() const -{ - eigen_assert(rows()>0 && cols()>0 && "you are using a non initialized matrix"); - return Matrix::Map(m_data.valuePtr(), m_data.size()).sum(); -} - -} // end namespace Eigen - -#endif // EIGEN_SPARSEREDUX_H diff --git a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseRef.h b/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseRef.h deleted file mode 100644 index 748f87d62..000000000 --- a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseRef.h +++ /dev/null @@ -1,397 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2015 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_SPARSE_REF_H -#define EIGEN_SPARSE_REF_H - -namespace Eigen { - -enum { - StandardCompressedFormat = 2 /**< used by Ref to specify whether the input storage must be in standard compressed form */ -}; - -namespace internal { - -template class SparseRefBase; - -template -struct traits, _Options, _StrideType> > - : public traits > -{ - typedef SparseMatrix PlainObjectType; - enum { - Options = _Options, - Flags = traits::Flags | CompressedAccessBit | NestByRefBit - }; - - template struct match { - enum { - StorageOrderMatch = PlainObjectType::IsVectorAtCompileTime || Derived::IsVectorAtCompileTime || ((PlainObjectType::Flags&RowMajorBit)==(Derived::Flags&RowMajorBit)), - MatchAtCompileTime = (Derived::Flags&CompressedAccessBit) && StorageOrderMatch - }; - typedef typename internal::conditional::type type; - }; - -}; - -template -struct traits, _Options, _StrideType> > - : public traits, _Options, _StrideType> > -{ - enum { - Flags = (traits >::Flags | CompressedAccessBit | NestByRefBit) & ~LvalueBit - }; -}; - -template -struct traits, _Options, _StrideType> > - : public traits > -{ - typedef SparseVector PlainObjectType; - enum { - Options = _Options, - Flags = traits::Flags | CompressedAccessBit | NestByRefBit - }; - - template struct match { - enum { - MatchAtCompileTime = (Derived::Flags&CompressedAccessBit) && Derived::IsVectorAtCompileTime - }; - typedef typename internal::conditional::type type; - }; - -}; - -template -struct traits, _Options, _StrideType> > - : public traits, _Options, _StrideType> > -{ - enum { - Flags = (traits >::Flags | CompressedAccessBit | NestByRefBit) & ~LvalueBit - }; -}; - -template -struct traits > : public traits {}; - -template class SparseRefBase - : public SparseMapBase -{ -public: - - typedef SparseMapBase Base; - EIGEN_SPARSE_PUBLIC_INTERFACE(SparseRefBase) - - SparseRefBase() - : Base(RowsAtCompileTime==Dynamic?0:RowsAtCompileTime,ColsAtCompileTime==Dynamic?0:ColsAtCompileTime, 0, 0, 0, 0, 0) - {} - -protected: - - template - void construct(Expression& expr) - { - if(expr.outerIndexPtr()==0) - ::new (static_cast(this)) Base(expr.size(), expr.nonZeros(), expr.innerIndexPtr(), expr.valuePtr()); - else - ::new (static_cast(this)) Base(expr.rows(), expr.cols(), expr.nonZeros(), expr.outerIndexPtr(), expr.innerIndexPtr(), expr.valuePtr(), expr.innerNonZeroPtr()); - } -}; - -} // namespace internal - - -/** - * \ingroup SparseCore_Module - * - * \brief A sparse matrix expression referencing an existing sparse expression - * - * \tparam SparseMatrixType the equivalent sparse matrix type of the referenced data, it must be a template instance of class SparseMatrix. - * \tparam Options specifies whether the a standard compressed format is required \c Options is \c #StandardCompressedFormat, or \c 0. - * The default is \c 0. - * - * \sa class Ref - */ -#ifndef EIGEN_PARSED_BY_DOXYGEN -template -class Ref, Options, StrideType > - : public internal::SparseRefBase, Options, StrideType > > -#else -template -class Ref - : public SparseMapBase // yes, that's weird to use Derived here, but that works! -#endif -{ - typedef SparseMatrix PlainObjectType; - typedef internal::traits Traits; - template - inline Ref(const SparseMatrix& expr); - template - inline Ref(const MappedSparseMatrix& expr); - public: - - typedef internal::SparseRefBase Base; - EIGEN_SPARSE_PUBLIC_INTERFACE(Ref) - - - #ifndef EIGEN_PARSED_BY_DOXYGEN - template - inline Ref(SparseMatrix& expr) - { - EIGEN_STATIC_ASSERT(bool(Traits::template match >::MatchAtCompileTime), STORAGE_LAYOUT_DOES_NOT_MATCH); - eigen_assert( ((Options & int(StandardCompressedFormat))==0) || (expr.isCompressed()) ); - Base::construct(expr.derived()); - } - - template - inline Ref(MappedSparseMatrix& expr) - { - EIGEN_STATIC_ASSERT(bool(Traits::template match >::MatchAtCompileTime), STORAGE_LAYOUT_DOES_NOT_MATCH); - eigen_assert( ((Options & int(StandardCompressedFormat))==0) || (expr.isCompressed()) ); - Base::construct(expr.derived()); - } - - template - inline Ref(const SparseCompressedBase& expr) - #else - /** Implicit constructor from any sparse expression (2D matrix or 1D vector) */ - template - inline Ref(SparseCompressedBase& expr) - #endif - { - EIGEN_STATIC_ASSERT(bool(internal::is_lvalue::value), THIS_EXPRESSION_IS_NOT_A_LVALUE__IT_IS_READ_ONLY); - EIGEN_STATIC_ASSERT(bool(Traits::template match::MatchAtCompileTime), STORAGE_LAYOUT_DOES_NOT_MATCH); - eigen_assert( ((Options & int(StandardCompressedFormat))==0) || (expr.isCompressed()) ); - Base::construct(expr.const_cast_derived()); - } -}; - -// this is the const ref version -template -class Ref, Options, StrideType> - : public internal::SparseRefBase, Options, StrideType> > -{ - typedef SparseMatrix TPlainObjectType; - typedef internal::traits Traits; - public: - - typedef internal::SparseRefBase Base; - EIGEN_SPARSE_PUBLIC_INTERFACE(Ref) - - template - inline Ref(const SparseMatrixBase& expr) : m_hasCopy(false) - { - construct(expr.derived(), typename Traits::template match::type()); - } - - inline Ref(const Ref& other) : Base(other), m_hasCopy(false) { - // copy constructor shall not copy the m_object, to avoid unnecessary malloc and copy - } - - template - inline Ref(const RefBase& other) : m_hasCopy(false) { - construct(other.derived(), typename Traits::template match::type()); - } - - ~Ref() { - if(m_hasCopy) { - TPlainObjectType* obj = reinterpret_cast(&m_storage); - obj->~TPlainObjectType(); - } - } - - protected: - - template - void construct(const Expression& expr,internal::true_type) - { - if((Options & int(StandardCompressedFormat)) && (!expr.isCompressed())) - { - TPlainObjectType* obj = reinterpret_cast(&m_storage); - ::new (obj) TPlainObjectType(expr); - m_hasCopy = true; - Base::construct(*obj); - } - else - { - Base::construct(expr); - } - } - - template - void construct(const Expression& expr, internal::false_type) - { - TPlainObjectType* obj = reinterpret_cast(&m_storage); - ::new (obj) TPlainObjectType(expr); - m_hasCopy = true; - Base::construct(*obj); - } - - protected: - typename internal::aligned_storage::type m_storage; - bool m_hasCopy; -}; - - - -/** - * \ingroup SparseCore_Module - * - * \brief A sparse vector expression referencing an existing sparse vector expression - * - * \tparam SparseVectorType the equivalent sparse vector type of the referenced data, it must be a template instance of class SparseVector. - * - * \sa class Ref - */ -#ifndef EIGEN_PARSED_BY_DOXYGEN -template -class Ref, Options, StrideType > - : public internal::SparseRefBase, Options, StrideType > > -#else -template -class Ref - : public SparseMapBase -#endif -{ - typedef SparseVector PlainObjectType; - typedef internal::traits Traits; - template - inline Ref(const SparseVector& expr); - public: - - typedef internal::SparseRefBase Base; - EIGEN_SPARSE_PUBLIC_INTERFACE(Ref) - - #ifndef EIGEN_PARSED_BY_DOXYGEN - template - inline Ref(SparseVector& expr) - { - EIGEN_STATIC_ASSERT(bool(Traits::template match >::MatchAtCompileTime), STORAGE_LAYOUT_DOES_NOT_MATCH); - Base::construct(expr.derived()); - } - - template - inline Ref(const SparseCompressedBase& expr) - #else - /** Implicit constructor from any 1D sparse vector expression */ - template - inline Ref(SparseCompressedBase& expr) - #endif - { - EIGEN_STATIC_ASSERT(bool(internal::is_lvalue::value), THIS_EXPRESSION_IS_NOT_A_LVALUE__IT_IS_READ_ONLY); - EIGEN_STATIC_ASSERT(bool(Traits::template match::MatchAtCompileTime), STORAGE_LAYOUT_DOES_NOT_MATCH); - Base::construct(expr.const_cast_derived()); - } -}; - -// this is the const ref version -template -class Ref, Options, StrideType> - : public internal::SparseRefBase, Options, StrideType> > -{ - typedef SparseVector TPlainObjectType; - typedef internal::traits Traits; - public: - - typedef internal::SparseRefBase Base; - EIGEN_SPARSE_PUBLIC_INTERFACE(Ref) - - template - inline Ref(const SparseMatrixBase& expr) : m_hasCopy(false) - { - construct(expr.derived(), typename Traits::template match::type()); - } - - inline Ref(const Ref& other) : Base(other), m_hasCopy(false) { - // copy constructor shall not copy the m_object, to avoid unnecessary malloc and copy - } - - template - inline Ref(const RefBase& other) : m_hasCopy(false) { - construct(other.derived(), typename Traits::template match::type()); - } - - ~Ref() { - if(m_hasCopy) { - TPlainObjectType* obj = reinterpret_cast(&m_storage); - obj->~TPlainObjectType(); - } - } - - protected: - - template - void construct(const Expression& expr,internal::true_type) - { - Base::construct(expr); - } - - template - void construct(const Expression& expr, internal::false_type) - { - TPlainObjectType* obj = reinterpret_cast(&m_storage); - ::new (obj) TPlainObjectType(expr); - m_hasCopy = true; - Base::construct(*obj); - } - - protected: - typename internal::aligned_storage::type m_storage; - bool m_hasCopy; -}; - -namespace internal { - -// FIXME shall we introduce a general evaluatior_ref that we can specialize for any sparse object once, and thus remove this copy-pasta thing... - -template -struct evaluator, Options, StrideType> > - : evaluator, Options, StrideType> > > -{ - typedef evaluator, Options, StrideType> > > Base; - typedef Ref, Options, StrideType> XprType; - evaluator() : Base() {} - explicit evaluator(const XprType &mat) : Base(mat) {} -}; - -template -struct evaluator, Options, StrideType> > - : evaluator, Options, StrideType> > > -{ - typedef evaluator, Options, StrideType> > > Base; - typedef Ref, Options, StrideType> XprType; - evaluator() : Base() {} - explicit evaluator(const XprType &mat) : Base(mat) {} -}; - -template -struct evaluator, Options, StrideType> > - : evaluator, Options, StrideType> > > -{ - typedef evaluator, Options, StrideType> > > Base; - typedef Ref, Options, StrideType> XprType; - evaluator() : Base() {} - explicit evaluator(const XprType &mat) : Base(mat) {} -}; - -template -struct evaluator, Options, StrideType> > - : evaluator, Options, StrideType> > > -{ - typedef evaluator, Options, StrideType> > > Base; - typedef Ref, Options, StrideType> XprType; - evaluator() : Base() {} - explicit evaluator(const XprType &mat) : Base(mat) {} -}; - -} - -} // end namespace Eigen - -#endif // EIGEN_SPARSE_REF_H diff --git a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseSelfAdjointView.h b/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseSelfAdjointView.h deleted file mode 100644 index 85b00e10e..000000000 --- a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseSelfAdjointView.h +++ /dev/null @@ -1,659 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2009-2014 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_SPARSE_SELFADJOINTVIEW_H -#define EIGEN_SPARSE_SELFADJOINTVIEW_H - -namespace Eigen { - -/** \ingroup SparseCore_Module - * \class SparseSelfAdjointView - * - * \brief Pseudo expression to manipulate a triangular sparse matrix as a selfadjoint matrix. - * - * \param MatrixType the type of the dense matrix storing the coefficients - * \param Mode can be either \c #Lower or \c #Upper - * - * This class is an expression of a sefladjoint matrix from a triangular part of a matrix - * with given dense storage of the coefficients. It is the return type of MatrixBase::selfadjointView() - * and most of the time this is the only way that it is used. - * - * \sa SparseMatrixBase::selfadjointView() - */ -namespace internal { - -template -struct traits > : traits { -}; - -template -void permute_symm_to_symm(const MatrixType& mat, SparseMatrix& _dest, const typename MatrixType::StorageIndex* perm = 0); - -template -void permute_symm_to_fullsymm(const MatrixType& mat, SparseMatrix& _dest, const typename MatrixType::StorageIndex* perm = 0); - -} - -template class SparseSelfAdjointView - : public EigenBase > -{ - public: - - enum { - Mode = _Mode, - TransposeMode = ((Mode & Upper) ? Lower : 0) | ((Mode & Lower) ? Upper : 0), - RowsAtCompileTime = internal::traits::RowsAtCompileTime, - ColsAtCompileTime = internal::traits::ColsAtCompileTime - }; - - typedef EigenBase Base; - typedef typename MatrixType::Scalar Scalar; - typedef typename MatrixType::StorageIndex StorageIndex; - typedef Matrix VectorI; - typedef typename internal::ref_selector::non_const_type MatrixTypeNested; - typedef typename internal::remove_all::type _MatrixTypeNested; - - explicit inline SparseSelfAdjointView(MatrixType& matrix) : m_matrix(matrix) - { - eigen_assert(rows()==cols() && "SelfAdjointView is only for squared matrices"); - } - - inline Index rows() const { return m_matrix.rows(); } - inline Index cols() const { return m_matrix.cols(); } - - /** \internal \returns a reference to the nested matrix */ - const _MatrixTypeNested& matrix() const { return m_matrix; } - typename internal::remove_reference::type& matrix() { return m_matrix; } - - /** \returns an expression of the matrix product between a sparse self-adjoint matrix \c *this and a sparse matrix \a rhs. - * - * Note that there is no algorithmic advantage of performing such a product compared to a general sparse-sparse matrix product. - * Indeed, the SparseSelfadjointView operand is first copied into a temporary SparseMatrix before computing the product. - */ - template - Product - operator*(const SparseMatrixBase& rhs) const - { - return Product(*this, rhs.derived()); - } - - /** \returns an expression of the matrix product between a sparse matrix \a lhs and a sparse self-adjoint matrix \a rhs. - * - * Note that there is no algorithmic advantage of performing such a product compared to a general sparse-sparse matrix product. - * Indeed, the SparseSelfadjointView operand is first copied into a temporary SparseMatrix before computing the product. - */ - template friend - Product - operator*(const SparseMatrixBase& lhs, const SparseSelfAdjointView& rhs) - { - return Product(lhs.derived(), rhs); - } - - /** Efficient sparse self-adjoint matrix times dense vector/matrix product */ - template - Product - operator*(const MatrixBase& rhs) const - { - return Product(*this, rhs.derived()); - } - - /** Efficient dense vector/matrix times sparse self-adjoint matrix product */ - template friend - Product - operator*(const MatrixBase& lhs, const SparseSelfAdjointView& rhs) - { - return Product(lhs.derived(), rhs); - } - - /** Perform a symmetric rank K update of the selfadjoint matrix \c *this: - * \f$ this = this + \alpha ( u u^* ) \f$ where \a u is a vector or matrix. - * - * \returns a reference to \c *this - * - * To perform \f$ this = this + \alpha ( u^* u ) \f$ you can simply - * call this function with u.adjoint(). - */ - template - SparseSelfAdjointView& rankUpdate(const SparseMatrixBase& u, const Scalar& alpha = Scalar(1)); - - /** \returns an expression of P H P^-1 */ - // TODO implement twists in a more evaluator friendly fashion - SparseSymmetricPermutationProduct<_MatrixTypeNested,Mode> twistedBy(const PermutationMatrix& perm) const - { - return SparseSymmetricPermutationProduct<_MatrixTypeNested,Mode>(m_matrix, perm); - } - - template - SparseSelfAdjointView& operator=(const SparseSymmetricPermutationProduct& permutedMatrix) - { - internal::call_assignment_no_alias_no_transpose(*this, permutedMatrix); - return *this; - } - - SparseSelfAdjointView& operator=(const SparseSelfAdjointView& src) - { - PermutationMatrix pnull; - return *this = src.twistedBy(pnull); - } - - // Since we override the copy-assignment operator, we need to explicitly re-declare the copy-constructor - EIGEN_DEFAULT_COPY_CONSTRUCTOR(SparseSelfAdjointView) - - template - SparseSelfAdjointView& operator=(const SparseSelfAdjointView& src) - { - PermutationMatrix pnull; - return *this = src.twistedBy(pnull); - } - - void resize(Index rows, Index cols) - { - EIGEN_ONLY_USED_FOR_DEBUG(rows); - EIGEN_ONLY_USED_FOR_DEBUG(cols); - eigen_assert(rows == this->rows() && cols == this->cols() - && "SparseSelfadjointView::resize() does not actually allow to resize."); - } - - protected: - - MatrixTypeNested m_matrix; - //mutable VectorI m_countPerRow; - //mutable VectorI m_countPerCol; - private: - template void evalTo(Dest &) const; -}; - -/*************************************************************************** -* Implementation of SparseMatrixBase methods -***************************************************************************/ - -template -template -typename SparseMatrixBase::template ConstSelfAdjointViewReturnType::Type SparseMatrixBase::selfadjointView() const -{ - return SparseSelfAdjointView(derived()); -} - -template -template -typename SparseMatrixBase::template SelfAdjointViewReturnType::Type SparseMatrixBase::selfadjointView() -{ - return SparseSelfAdjointView(derived()); -} - -/*************************************************************************** -* Implementation of SparseSelfAdjointView methods -***************************************************************************/ - -template -template -SparseSelfAdjointView& -SparseSelfAdjointView::rankUpdate(const SparseMatrixBase& u, const Scalar& alpha) -{ - SparseMatrix tmp = u * u.adjoint(); - if(alpha==Scalar(0)) - m_matrix = tmp.template triangularView(); - else - m_matrix += alpha * tmp.template triangularView(); - - return *this; -} - -namespace internal { - -// TODO currently a selfadjoint expression has the form SelfAdjointView<.,.> -// in the future selfadjoint-ness should be defined by the expression traits -// such that Transpose > is valid. (currently TriangularBase::transpose() is overloaded to make it work) -template -struct evaluator_traits > -{ - typedef typename storage_kind_to_evaluator_kind::Kind Kind; - typedef SparseSelfAdjointShape Shape; -}; - -struct SparseSelfAdjoint2Sparse {}; - -template<> struct AssignmentKind { typedef SparseSelfAdjoint2Sparse Kind; }; -template<> struct AssignmentKind { typedef Sparse2Sparse Kind; }; - -template< typename DstXprType, typename SrcXprType, typename Functor> -struct Assignment -{ - typedef typename DstXprType::StorageIndex StorageIndex; - typedef internal::assign_op AssignOpType; - - template - static void run(SparseMatrix &dst, const SrcXprType &src, const AssignOpType&/*func*/) - { - internal::permute_symm_to_fullsymm(src.matrix(), dst); - } - - // FIXME: the handling of += and -= in sparse matrices should be cleanup so that next two overloads could be reduced to: - template - static void run(SparseMatrix &dst, const SrcXprType &src, const AssignFunc& func) - { - SparseMatrix tmp(src.rows(),src.cols()); - run(tmp, src, AssignOpType()); - call_assignment_no_alias_no_transpose(dst, tmp, func); - } - - template - static void run(SparseMatrix &dst, const SrcXprType &src, - const internal::add_assign_op& /* func */) - { - SparseMatrix tmp(src.rows(),src.cols()); - run(tmp, src, AssignOpType()); - dst += tmp; - } - - template - static void run(SparseMatrix &dst, const SrcXprType &src, - const internal::sub_assign_op& /* func */) - { - SparseMatrix tmp(src.rows(),src.cols()); - run(tmp, src, AssignOpType()); - dst -= tmp; - } - - template - static void run(DynamicSparseMatrix& dst, const SrcXprType &src, const AssignOpType&/*func*/) - { - // TODO directly evaluate into dst; - SparseMatrix tmp(dst.rows(),dst.cols()); - internal::permute_symm_to_fullsymm(src.matrix(), tmp); - dst = tmp; - } -}; - -} // end namespace internal - -/*************************************************************************** -* Implementation of sparse self-adjoint time dense matrix -***************************************************************************/ - -namespace internal { - -template -inline void sparse_selfadjoint_time_dense_product(const SparseLhsType& lhs, const DenseRhsType& rhs, DenseResType& res, const AlphaType& alpha) -{ - EIGEN_ONLY_USED_FOR_DEBUG(alpha); - - typedef typename internal::nested_eval::type SparseLhsTypeNested; - typedef typename internal::remove_all::type SparseLhsTypeNestedCleaned; - typedef evaluator LhsEval; - typedef typename LhsEval::InnerIterator LhsIterator; - typedef typename SparseLhsType::Scalar LhsScalar; - - enum { - LhsIsRowMajor = (LhsEval::Flags&RowMajorBit)==RowMajorBit, - ProcessFirstHalf = - ((Mode&(Upper|Lower))==(Upper|Lower)) - || ( (Mode&Upper) && !LhsIsRowMajor) - || ( (Mode&Lower) && LhsIsRowMajor), - ProcessSecondHalf = !ProcessFirstHalf - }; - - SparseLhsTypeNested lhs_nested(lhs); - LhsEval lhsEval(lhs_nested); - - // work on one column at once - for (Index k=0; k::ReturnType rhs_j(alpha*rhs(j,k)); - // accumulator for partial scalar product - typename DenseResType::Scalar res_j(0); - for(; (ProcessFirstHalf ? i && i.index() < j : i) ; ++i) - { - LhsScalar lhs_ij = i.value(); - if(!LhsIsRowMajor) lhs_ij = numext::conj(lhs_ij); - res_j += lhs_ij * rhs.coeff(i.index(),k); - res(i.index(),k) += numext::conj(lhs_ij) * rhs_j; - } - res.coeffRef(j,k) += alpha * res_j; - - // handle diagonal coeff - if (ProcessFirstHalf && i && (i.index()==j)) - res.coeffRef(j,k) += alpha * i.value() * rhs.coeff(j,k); - } - } -} - - -template -struct generic_product_impl -: generic_product_impl_base > -{ - template - static void scaleAndAddTo(Dest& dst, const LhsView& lhsView, const Rhs& rhs, const typename Dest::Scalar& alpha) - { - typedef typename LhsView::_MatrixTypeNested Lhs; - typedef typename nested_eval::type LhsNested; - typedef typename nested_eval::type RhsNested; - LhsNested lhsNested(lhsView.matrix()); - RhsNested rhsNested(rhs); - - internal::sparse_selfadjoint_time_dense_product(lhsNested, rhsNested, dst, alpha); - } -}; - -template -struct generic_product_impl -: generic_product_impl_base > -{ - template - static void scaleAndAddTo(Dest& dst, const Lhs& lhs, const RhsView& rhsView, const typename Dest::Scalar& alpha) - { - typedef typename RhsView::_MatrixTypeNested Rhs; - typedef typename nested_eval::type LhsNested; - typedef typename nested_eval::type RhsNested; - LhsNested lhsNested(lhs); - RhsNested rhsNested(rhsView.matrix()); - - // transpose everything - Transpose dstT(dst); - internal::sparse_selfadjoint_time_dense_product(rhsNested.transpose(), lhsNested.transpose(), dstT, alpha); - } -}; - -// NOTE: these two overloads are needed to evaluate the sparse selfadjoint view into a full sparse matrix -// TODO: maybe the copy could be handled by generic_product_impl so that these overloads would not be needed anymore - -template -struct product_evaluator, ProductTag, SparseSelfAdjointShape, SparseShape> - : public evaluator::PlainObject> -{ - typedef Product XprType; - typedef typename XprType::PlainObject PlainObject; - typedef evaluator Base; - - product_evaluator(const XprType& xpr) - : m_lhs(xpr.lhs()), m_result(xpr.rows(), xpr.cols()) - { - ::new (static_cast(this)) Base(m_result); - generic_product_impl::evalTo(m_result, m_lhs, xpr.rhs()); - } - -protected: - typename Rhs::PlainObject m_lhs; - PlainObject m_result; -}; - -template -struct product_evaluator, ProductTag, SparseShape, SparseSelfAdjointShape> - : public evaluator::PlainObject> -{ - typedef Product XprType; - typedef typename XprType::PlainObject PlainObject; - typedef evaluator Base; - - product_evaluator(const XprType& xpr) - : m_rhs(xpr.rhs()), m_result(xpr.rows(), xpr.cols()) - { - ::new (static_cast(this)) Base(m_result); - generic_product_impl::evalTo(m_result, xpr.lhs(), m_rhs); - } - -protected: - typename Lhs::PlainObject m_rhs; - PlainObject m_result; -}; - -} // namespace internal - -/*************************************************************************** -* Implementation of symmetric copies and permutations -***************************************************************************/ -namespace internal { - -template -void permute_symm_to_fullsymm(const MatrixType& mat, SparseMatrix& _dest, const typename MatrixType::StorageIndex* perm) -{ - typedef typename MatrixType::StorageIndex StorageIndex; - typedef typename MatrixType::Scalar Scalar; - typedef SparseMatrix Dest; - typedef Matrix VectorI; - typedef evaluator MatEval; - typedef typename evaluator::InnerIterator MatIterator; - - MatEval matEval(mat); - Dest& dest(_dest.derived()); - enum { - StorageOrderMatch = int(Dest::IsRowMajor) == int(MatrixType::IsRowMajor) - }; - - Index size = mat.rows(); - VectorI count; - count.resize(size); - count.setZero(); - dest.resize(size,size); - for(Index j = 0; jc) || ( Mode==Upper && r(it.index()); - Index r = it.row(); - Index c = it.col(); - - StorageIndex jp = perm ? perm[j] : j; - StorageIndex ip = perm ? perm[i] : i; - - if(Mode==int(Upper|Lower)) - { - Index k = count[StorageOrderMatch ? jp : ip]++; - dest.innerIndexPtr()[k] = StorageOrderMatch ? ip : jp; - dest.valuePtr()[k] = it.value(); - } - else if(r==c) - { - Index k = count[ip]++; - dest.innerIndexPtr()[k] = ip; - dest.valuePtr()[k] = it.value(); - } - else if(( (Mode&Lower)==Lower && r>c) || ( (Mode&Upper)==Upper && r -void permute_symm_to_symm(const MatrixType& mat, SparseMatrix& _dest, const typename MatrixType::StorageIndex* perm) -{ - typedef typename MatrixType::StorageIndex StorageIndex; - typedef typename MatrixType::Scalar Scalar; - SparseMatrix& dest(_dest.derived()); - typedef Matrix VectorI; - typedef evaluator MatEval; - typedef typename evaluator::InnerIterator MatIterator; - - enum { - SrcOrder = MatrixType::IsRowMajor ? RowMajor : ColMajor, - StorageOrderMatch = int(SrcOrder) == int(DstOrder), - DstMode = DstOrder==RowMajor ? (_DstMode==Upper ? Lower : Upper) : _DstMode, - SrcMode = SrcOrder==RowMajor ? (_SrcMode==Upper ? Lower : Upper) : _SrcMode - }; - - MatEval matEval(mat); - - Index size = mat.rows(); - VectorI count(size); - count.setZero(); - dest.resize(size,size); - for(StorageIndex j = 0; jj)) - continue; - - StorageIndex ip = perm ? perm[i] : i; - count[int(DstMode)==int(Lower) ? (std::min)(ip,jp) : (std::max)(ip,jp)]++; - } - } - dest.outerIndexPtr()[0] = 0; - for(Index j=0; jj)) - continue; - - StorageIndex jp = perm ? perm[j] : j; - StorageIndex ip = perm? perm[i] : i; - - Index k = count[int(DstMode)==int(Lower) ? (std::min)(ip,jp) : (std::max)(ip,jp)]++; - dest.innerIndexPtr()[k] = int(DstMode)==int(Lower) ? (std::max)(ip,jp) : (std::min)(ip,jp); - - if(!StorageOrderMatch) std::swap(ip,jp); - if( ((int(DstMode)==int(Lower) && ipjp))) - dest.valuePtr()[k] = numext::conj(it.value()); - else - dest.valuePtr()[k] = it.value(); - } - } -} - -} - -// TODO implement twists in a more evaluator friendly fashion - -namespace internal { - -template -struct traits > : traits { -}; - -} - -template -class SparseSymmetricPermutationProduct - : public EigenBase > -{ - public: - typedef typename MatrixType::Scalar Scalar; - typedef typename MatrixType::StorageIndex StorageIndex; - enum { - RowsAtCompileTime = internal::traits::RowsAtCompileTime, - ColsAtCompileTime = internal::traits::ColsAtCompileTime - }; - protected: - typedef PermutationMatrix Perm; - public: - typedef Matrix VectorI; - typedef typename MatrixType::Nested MatrixTypeNested; - typedef typename internal::remove_all::type NestedExpression; - - SparseSymmetricPermutationProduct(const MatrixType& mat, const Perm& perm) - : m_matrix(mat), m_perm(perm) - {} - - inline Index rows() const { return m_matrix.rows(); } - inline Index cols() const { return m_matrix.cols(); } - - const NestedExpression& matrix() const { return m_matrix; } - const Perm& perm() const { return m_perm; } - - protected: - MatrixTypeNested m_matrix; - const Perm& m_perm; - -}; - -namespace internal { - -template -struct Assignment, internal::assign_op, Sparse2Sparse> -{ - typedef SparseSymmetricPermutationProduct SrcXprType; - typedef typename DstXprType::StorageIndex DstIndex; - template - static void run(SparseMatrix &dst, const SrcXprType &src, const internal::assign_op &) - { - // internal::permute_symm_to_fullsymm(m_matrix,_dest,m_perm.indices().data()); - SparseMatrix tmp; - internal::permute_symm_to_fullsymm(src.matrix(),tmp,src.perm().indices().data()); - dst = tmp; - } - - template - static void run(SparseSelfAdjointView& dst, const SrcXprType &src, const internal::assign_op &) - { - internal::permute_symm_to_symm(src.matrix(),dst.matrix(),src.perm().indices().data()); - } -}; - -} // end namespace internal - -} // end namespace Eigen - -#endif // EIGEN_SPARSE_SELFADJOINTVIEW_H diff --git a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseSolverBase.h b/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseSolverBase.h deleted file mode 100644 index b4c9a422f..000000000 --- a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseSolverBase.h +++ /dev/null @@ -1,124 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2014 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_SPARSESOLVERBASE_H -#define EIGEN_SPARSESOLVERBASE_H - -namespace Eigen { - -namespace internal { - - /** \internal - * Helper functions to solve with a sparse right-hand-side and result. - * The rhs is decomposed into small vertical panels which are solved through dense temporaries. - */ -template -typename enable_if::type -solve_sparse_through_dense_panels(const Decomposition &dec, const Rhs& rhs, Dest &dest) -{ - EIGEN_STATIC_ASSERT((Dest::Flags&RowMajorBit)==0,THIS_METHOD_IS_ONLY_FOR_COLUMN_MAJOR_MATRICES); - typedef typename Dest::Scalar DestScalar; - // we process the sparse rhs per block of NbColsAtOnce columns temporarily stored into a dense matrix. - static const Index NbColsAtOnce = 4; - Index rhsCols = rhs.cols(); - Index size = rhs.rows(); - // the temporary matrices do not need more columns than NbColsAtOnce: - Index tmpCols = (std::min)(rhsCols, NbColsAtOnce); - Eigen::Matrix tmp(size,tmpCols); - Eigen::Matrix tmpX(size,tmpCols); - for(Index k=0; k(rhsCols-k, NbColsAtOnce); - tmp.leftCols(actualCols) = rhs.middleCols(k,actualCols); - tmpX.leftCols(actualCols) = dec.solve(tmp.leftCols(actualCols)); - dest.middleCols(k,actualCols) = tmpX.leftCols(actualCols).sparseView(); - } -} - -// Overload for vector as rhs -template -typename enable_if::type -solve_sparse_through_dense_panels(const Decomposition &dec, const Rhs& rhs, Dest &dest) -{ - typedef typename Dest::Scalar DestScalar; - Index size = rhs.rows(); - Eigen::Matrix rhs_dense(rhs); - Eigen::Matrix dest_dense(size); - dest_dense = dec.solve(rhs_dense); - dest = dest_dense.sparseView(); -} - -} // end namespace internal - -/** \class SparseSolverBase - * \ingroup SparseCore_Module - * \brief A base class for sparse solvers - * - * \tparam Derived the actual type of the solver. - * - */ -template -class SparseSolverBase : internal::noncopyable -{ - public: - - /** Default constructor */ - SparseSolverBase() - : m_isInitialized(false) - {} - - ~SparseSolverBase() - {} - - Derived& derived() { return *static_cast(this); } - const Derived& derived() const { return *static_cast(this); } - - /** \returns an expression of the solution x of \f$ A x = b \f$ using the current decomposition of A. - * - * \sa compute() - */ - template - inline const Solve - solve(const MatrixBase& b) const - { - eigen_assert(m_isInitialized && "Solver is not initialized."); - eigen_assert(derived().rows()==b.rows() && "solve(): invalid number of rows of the right hand side matrix b"); - return Solve(derived(), b.derived()); - } - - /** \returns an expression of the solution x of \f$ A x = b \f$ using the current decomposition of A. - * - * \sa compute() - */ - template - inline const Solve - solve(const SparseMatrixBase& b) const - { - eigen_assert(m_isInitialized && "Solver is not initialized."); - eigen_assert(derived().rows()==b.rows() && "solve(): invalid number of rows of the right hand side matrix b"); - return Solve(derived(), b.derived()); - } - - #ifndef EIGEN_PARSED_BY_DOXYGEN - /** \internal default implementation of solving with a sparse rhs */ - template - void _solve_impl(const SparseMatrixBase &b, SparseMatrixBase &dest) const - { - internal::solve_sparse_through_dense_panels(derived(), b.derived(), dest.derived()); - } - #endif // EIGEN_PARSED_BY_DOXYGEN - - protected: - - mutable bool m_isInitialized; -}; - -} // end namespace Eigen - -#endif // EIGEN_SPARSESOLVERBASE_H diff --git a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseSparseProductWithPruning.h b/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseSparseProductWithPruning.h deleted file mode 100644 index 88820a48f..000000000 --- a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseSparseProductWithPruning.h +++ /dev/null @@ -1,198 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008-2014 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_SPARSESPARSEPRODUCTWITHPRUNING_H -#define EIGEN_SPARSESPARSEPRODUCTWITHPRUNING_H - -namespace Eigen { - -namespace internal { - - -// perform a pseudo in-place sparse * sparse product assuming all matrices are col major -template -static void sparse_sparse_product_with_pruning_impl(const Lhs& lhs, const Rhs& rhs, ResultType& res, const typename ResultType::RealScalar& tolerance) -{ - // return sparse_sparse_product_with_pruning_impl2(lhs,rhs,res); - - typedef typename remove_all::type::Scalar RhsScalar; - typedef typename remove_all::type::Scalar ResScalar; - typedef typename remove_all::type::StorageIndex StorageIndex; - - // make sure to call innerSize/outerSize since we fake the storage order. - Index rows = lhs.innerSize(); - Index cols = rhs.outerSize(); - //Index size = lhs.outerSize(); - eigen_assert(lhs.outerSize() == rhs.innerSize()); - - // allocate a temporary buffer - AmbiVector tempVector(rows); - - // mimics a resizeByInnerOuter: - if(ResultType::IsRowMajor) - res.resize(cols, rows); - else - res.resize(rows, cols); - - evaluator lhsEval(lhs); - evaluator rhsEval(rhs); - - // estimate the number of non zero entries - // given a rhs column containing Y non zeros, we assume that the respective Y columns - // of the lhs differs in average of one non zeros, thus the number of non zeros for - // the product of a rhs column with the lhs is X+Y where X is the average number of non zero - // per column of the lhs. - // Therefore, we have nnz(lhs*rhs) = nnz(lhs) + nnz(rhs) - Index estimated_nnz_prod = lhsEval.nonZerosEstimate() + rhsEval.nonZerosEstimate(); - - res.reserve(estimated_nnz_prod); - double ratioColRes = double(estimated_nnz_prod)/(double(lhs.rows())*double(rhs.cols())); - for (Index j=0; j::InnerIterator rhsIt(rhsEval, j); rhsIt; ++rhsIt) - { - // FIXME should be written like this: tmp += rhsIt.value() * lhs.col(rhsIt.index()) - tempVector.restart(); - RhsScalar x = rhsIt.value(); - for (typename evaluator::InnerIterator lhsIt(lhsEval, rhsIt.index()); lhsIt; ++lhsIt) - { - tempVector.coeffRef(lhsIt.index()) += lhsIt.value() * x; - } - } - res.startVec(j); - for (typename AmbiVector::Iterator it(tempVector,tolerance); it; ++it) - res.insertBackByOuterInner(j,it.index()) = it.value(); - } - res.finalize(); -} - -template::Flags&RowMajorBit, - int RhsStorageOrder = traits::Flags&RowMajorBit, - int ResStorageOrder = traits::Flags&RowMajorBit> -struct sparse_sparse_product_with_pruning_selector; - -template -struct sparse_sparse_product_with_pruning_selector -{ - typedef typename ResultType::RealScalar RealScalar; - - static void run(const Lhs& lhs, const Rhs& rhs, ResultType& res, const RealScalar& tolerance) - { - typename remove_all::type _res(res.rows(), res.cols()); - internal::sparse_sparse_product_with_pruning_impl(lhs, rhs, _res, tolerance); - res.swap(_res); - } -}; - -template -struct sparse_sparse_product_with_pruning_selector -{ - typedef typename ResultType::RealScalar RealScalar; - static void run(const Lhs& lhs, const Rhs& rhs, ResultType& res, const RealScalar& tolerance) - { - // we need a col-major matrix to hold the result - typedef SparseMatrix SparseTemporaryType; - SparseTemporaryType _res(res.rows(), res.cols()); - internal::sparse_sparse_product_with_pruning_impl(lhs, rhs, _res, tolerance); - res = _res; - } -}; - -template -struct sparse_sparse_product_with_pruning_selector -{ - typedef typename ResultType::RealScalar RealScalar; - static void run(const Lhs& lhs, const Rhs& rhs, ResultType& res, const RealScalar& tolerance) - { - // let's transpose the product to get a column x column product - typename remove_all::type _res(res.rows(), res.cols()); - internal::sparse_sparse_product_with_pruning_impl(rhs, lhs, _res, tolerance); - res.swap(_res); - } -}; - -template -struct sparse_sparse_product_with_pruning_selector -{ - typedef typename ResultType::RealScalar RealScalar; - static void run(const Lhs& lhs, const Rhs& rhs, ResultType& res, const RealScalar& tolerance) - { - typedef SparseMatrix ColMajorMatrixLhs; - typedef SparseMatrix ColMajorMatrixRhs; - ColMajorMatrixLhs colLhs(lhs); - ColMajorMatrixRhs colRhs(rhs); - internal::sparse_sparse_product_with_pruning_impl(colLhs, colRhs, res, tolerance); - - // let's transpose the product to get a column x column product -// typedef SparseMatrix SparseTemporaryType; -// SparseTemporaryType _res(res.cols(), res.rows()); -// sparse_sparse_product_with_pruning_impl(rhs, lhs, _res); -// res = _res.transpose(); - } -}; - -template -struct sparse_sparse_product_with_pruning_selector -{ - typedef typename ResultType::RealScalar RealScalar; - static void run(const Lhs& lhs, const Rhs& rhs, ResultType& res, const RealScalar& tolerance) - { - typedef SparseMatrix RowMajorMatrixLhs; - RowMajorMatrixLhs rowLhs(lhs); - sparse_sparse_product_with_pruning_selector(rowLhs,rhs,res,tolerance); - } -}; - -template -struct sparse_sparse_product_with_pruning_selector -{ - typedef typename ResultType::RealScalar RealScalar; - static void run(const Lhs& lhs, const Rhs& rhs, ResultType& res, const RealScalar& tolerance) - { - typedef SparseMatrix RowMajorMatrixRhs; - RowMajorMatrixRhs rowRhs(rhs); - sparse_sparse_product_with_pruning_selector(lhs,rowRhs,res,tolerance); - } -}; - -template -struct sparse_sparse_product_with_pruning_selector -{ - typedef typename ResultType::RealScalar RealScalar; - static void run(const Lhs& lhs, const Rhs& rhs, ResultType& res, const RealScalar& tolerance) - { - typedef SparseMatrix ColMajorMatrixRhs; - ColMajorMatrixRhs colRhs(rhs); - internal::sparse_sparse_product_with_pruning_impl(lhs, colRhs, res, tolerance); - } -}; - -template -struct sparse_sparse_product_with_pruning_selector -{ - typedef typename ResultType::RealScalar RealScalar; - static void run(const Lhs& lhs, const Rhs& rhs, ResultType& res, const RealScalar& tolerance) - { - typedef SparseMatrix ColMajorMatrixLhs; - ColMajorMatrixLhs colLhs(lhs); - internal::sparse_sparse_product_with_pruning_impl(colLhs, rhs, res, tolerance); - } -}; - -} // end namespace internal - -} // end namespace Eigen - -#endif // EIGEN_SPARSESPARSEPRODUCTWITHPRUNING_H diff --git a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseTranspose.h b/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseTranspose.h deleted file mode 100644 index 3757d4c6b..000000000 --- a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseTranspose.h +++ /dev/null @@ -1,92 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008-2015 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_SPARSETRANSPOSE_H -#define EIGEN_SPARSETRANSPOSE_H - -namespace Eigen { - -namespace internal { - template - class SparseTransposeImpl - : public SparseMatrixBase > - {}; - - template - class SparseTransposeImpl - : public SparseCompressedBase > - { - typedef SparseCompressedBase > Base; - public: - using Base::derived; - typedef typename Base::Scalar Scalar; - typedef typename Base::StorageIndex StorageIndex; - - inline Index nonZeros() const { return derived().nestedExpression().nonZeros(); } - - inline const Scalar* valuePtr() const { return derived().nestedExpression().valuePtr(); } - inline const StorageIndex* innerIndexPtr() const { return derived().nestedExpression().innerIndexPtr(); } - inline const StorageIndex* outerIndexPtr() const { return derived().nestedExpression().outerIndexPtr(); } - inline const StorageIndex* innerNonZeroPtr() const { return derived().nestedExpression().innerNonZeroPtr(); } - - inline Scalar* valuePtr() { return derived().nestedExpression().valuePtr(); } - inline StorageIndex* innerIndexPtr() { return derived().nestedExpression().innerIndexPtr(); } - inline StorageIndex* outerIndexPtr() { return derived().nestedExpression().outerIndexPtr(); } - inline StorageIndex* innerNonZeroPtr() { return derived().nestedExpression().innerNonZeroPtr(); } - }; -} - -template class TransposeImpl - : public internal::SparseTransposeImpl -{ - protected: - typedef internal::SparseTransposeImpl Base; -}; - -namespace internal { - -template -struct unary_evaluator, IteratorBased> - : public evaluator_base > -{ - typedef typename evaluator::InnerIterator EvalIterator; - public: - typedef Transpose XprType; - - inline Index nonZerosEstimate() const { - return m_argImpl.nonZerosEstimate(); - } - - class InnerIterator : public EvalIterator - { - public: - EIGEN_STRONG_INLINE InnerIterator(const unary_evaluator& unaryOp, Index outer) - : EvalIterator(unaryOp.m_argImpl,outer) - {} - - Index row() const { return EvalIterator::col(); } - Index col() const { return EvalIterator::row(); } - }; - - enum { - CoeffReadCost = evaluator::CoeffReadCost, - Flags = XprType::Flags - }; - - explicit unary_evaluator(const XprType& op) :m_argImpl(op.nestedExpression()) {} - - protected: - evaluator m_argImpl; -}; - -} // end namespace internal - -} // end namespace Eigen - -#endif // EIGEN_SPARSETRANSPOSE_H diff --git a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseTriangularView.h b/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseTriangularView.h deleted file mode 100644 index 9ac120266..000000000 --- a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseTriangularView.h +++ /dev/null @@ -1,189 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2009-2015 Gael Guennebaud -// Copyright (C) 2012 Désiré Nuentsa-Wakam -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_SPARSE_TRIANGULARVIEW_H -#define EIGEN_SPARSE_TRIANGULARVIEW_H - -namespace Eigen { - -/** \ingroup SparseCore_Module - * - * \brief Base class for a triangular part in a \b sparse matrix - * - * This class is an abstract base class of class TriangularView, and objects of type TriangularViewImpl cannot be instantiated. - * It extends class TriangularView with additional methods which are available for sparse expressions only. - * - * \sa class TriangularView, SparseMatrixBase::triangularView() - */ -template class TriangularViewImpl - : public SparseMatrixBase > -{ - enum { SkipFirst = ((Mode&Lower) && !(MatrixType::Flags&RowMajorBit)) - || ((Mode&Upper) && (MatrixType::Flags&RowMajorBit)), - SkipLast = !SkipFirst, - SkipDiag = (Mode&ZeroDiag) ? 1 : 0, - HasUnitDiag = (Mode&UnitDiag) ? 1 : 0 - }; - - typedef TriangularView TriangularViewType; - - protected: - // dummy solve function to make TriangularView happy. - void solve() const; - - typedef SparseMatrixBase Base; - public: - - EIGEN_SPARSE_PUBLIC_INTERFACE(TriangularViewType) - - typedef typename MatrixType::Nested MatrixTypeNested; - typedef typename internal::remove_reference::type MatrixTypeNestedNonRef; - typedef typename internal::remove_all::type MatrixTypeNestedCleaned; - - template - EIGEN_DEVICE_FUNC - EIGEN_STRONG_INLINE void _solve_impl(const RhsType &rhs, DstType &dst) const { - if(!(internal::is_same::value && internal::extract_data(dst) == internal::extract_data(rhs))) - dst = rhs; - this->solveInPlace(dst); - } - - /** Applies the inverse of \c *this to the dense vector or matrix \a other, "in-place" */ - template void solveInPlace(MatrixBase& other) const; - - /** Applies the inverse of \c *this to the sparse vector or matrix \a other, "in-place" */ - template void solveInPlace(SparseMatrixBase& other) const; - -}; - -namespace internal { - -template -struct unary_evaluator, IteratorBased> - : evaluator_base > -{ - typedef TriangularView XprType; - -protected: - - typedef typename XprType::Scalar Scalar; - typedef typename XprType::StorageIndex StorageIndex; - typedef typename evaluator::InnerIterator EvalIterator; - - enum { SkipFirst = ((Mode&Lower) && !(ArgType::Flags&RowMajorBit)) - || ((Mode&Upper) && (ArgType::Flags&RowMajorBit)), - SkipLast = !SkipFirst, - SkipDiag = (Mode&ZeroDiag) ? 1 : 0, - HasUnitDiag = (Mode&UnitDiag) ? 1 : 0 - }; - -public: - - enum { - CoeffReadCost = evaluator::CoeffReadCost, - Flags = XprType::Flags - }; - - explicit unary_evaluator(const XprType &xpr) : m_argImpl(xpr.nestedExpression()), m_arg(xpr.nestedExpression()) {} - - inline Index nonZerosEstimate() const { - return m_argImpl.nonZerosEstimate(); - } - - class InnerIterator : public EvalIterator - { - typedef EvalIterator Base; - public: - - EIGEN_STRONG_INLINE InnerIterator(const unary_evaluator& xprEval, Index outer) - : Base(xprEval.m_argImpl,outer), m_returnOne(false), m_containsDiag(Base::outer()index()<=outer : this->index()=Base::outer())) - { - if((!SkipFirst) && Base::operator bool()) - Base::operator++(); - m_returnOne = m_containsDiag; - } - } - - EIGEN_STRONG_INLINE InnerIterator& operator++() - { - if(HasUnitDiag && m_returnOne) - m_returnOne = false; - else - { - Base::operator++(); - if(HasUnitDiag && (!SkipFirst) && ((!Base::operator bool()) || Base::index()>=Base::outer())) - { - if((!SkipFirst) && Base::operator bool()) - Base::operator++(); - m_returnOne = m_containsDiag; - } - } - return *this; - } - - EIGEN_STRONG_INLINE operator bool() const - { - if(HasUnitDiag && m_returnOne) - return true; - if(SkipFirst) return Base::operator bool(); - else - { - if (SkipDiag) return (Base::operator bool() && this->index() < this->outer()); - else return (Base::operator bool() && this->index() <= this->outer()); - } - } - -// inline Index row() const { return (ArgType::Flags&RowMajorBit ? Base::outer() : this->index()); } -// inline Index col() const { return (ArgType::Flags&RowMajorBit ? this->index() : Base::outer()); } - inline StorageIndex index() const - { - if(HasUnitDiag && m_returnOne) return internal::convert_index(Base::outer()); - else return Base::index(); - } - inline Scalar value() const - { - if(HasUnitDiag && m_returnOne) return Scalar(1); - else return Base::value(); - } - - protected: - bool m_returnOne; - bool m_containsDiag; - private: - Scalar& valueRef(); - }; - -protected: - evaluator m_argImpl; - const ArgType& m_arg; -}; - -} // end namespace internal - -template -template -inline const TriangularView -SparseMatrixBase::triangularView() const -{ - return TriangularView(derived()); -} - -} // end namespace Eigen - -#endif // EIGEN_SPARSE_TRIANGULARVIEW_H diff --git a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseUtil.h b/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseUtil.h deleted file mode 100644 index ceb936887..000000000 --- a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseUtil.h +++ /dev/null @@ -1,186 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008-2014 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_SPARSEUTIL_H -#define EIGEN_SPARSEUTIL_H - -namespace Eigen { - -#ifdef NDEBUG -#define EIGEN_DBG_SPARSE(X) -#else -#define EIGEN_DBG_SPARSE(X) X -#endif - -#define EIGEN_SPARSE_INHERIT_ASSIGNMENT_OPERATOR(Derived, Op) \ -template \ -EIGEN_STRONG_INLINE Derived& operator Op(const Eigen::SparseMatrixBase& other) \ -{ \ - return Base::operator Op(other.derived()); \ -} \ -EIGEN_STRONG_INLINE Derived& operator Op(const Derived& other) \ -{ \ - return Base::operator Op(other); \ -} - -#define EIGEN_SPARSE_INHERIT_SCALAR_ASSIGNMENT_OPERATOR(Derived, Op) \ -template \ -EIGEN_STRONG_INLINE Derived& operator Op(const Other& scalar) \ -{ \ - return Base::operator Op(scalar); \ -} - -#define EIGEN_SPARSE_INHERIT_ASSIGNMENT_OPERATORS(Derived) \ -EIGEN_SPARSE_INHERIT_ASSIGNMENT_OPERATOR(Derived, =) - - -#define EIGEN_SPARSE_PUBLIC_INTERFACE(Derived) \ - EIGEN_GENERIC_PUBLIC_INTERFACE(Derived) - - -const int CoherentAccessPattern = 0x1; -const int InnerRandomAccessPattern = 0x2 | CoherentAccessPattern; -const int OuterRandomAccessPattern = 0x4 | CoherentAccessPattern; -const int RandomAccessPattern = 0x8 | OuterRandomAccessPattern | InnerRandomAccessPattern; - -template class SparseMatrix; -template class DynamicSparseMatrix; -template class SparseVector; -template class MappedSparseMatrix; - -template class SparseSelfAdjointView; -template class SparseDiagonalProduct; -template class SparseView; - -template class SparseSparseProduct; -template class SparseTimeDenseProduct; -template class DenseTimeSparseProduct; -template class SparseDenseOuterProduct; - -template struct SparseSparseProductReturnType; -template::ColsAtCompileTime,internal::traits::RowsAtCompileTime)> struct DenseSparseProductReturnType; - -template::ColsAtCompileTime,internal::traits::RowsAtCompileTime)> struct SparseDenseProductReturnType; -template class SparseSymmetricPermutationProduct; - -namespace internal { - -template struct sparse_eval; - -template struct eval - : sparse_eval::RowsAtCompileTime,traits::ColsAtCompileTime,traits::Flags> -{}; - -template struct sparse_eval { - typedef typename traits::Scalar _Scalar; - typedef typename traits::StorageIndex _StorageIndex; - public: - typedef SparseVector<_Scalar, RowMajor, _StorageIndex> type; -}; - -template struct sparse_eval { - typedef typename traits::Scalar _Scalar; - typedef typename traits::StorageIndex _StorageIndex; - public: - typedef SparseVector<_Scalar, ColMajor, _StorageIndex> type; -}; - -// TODO this seems almost identical to plain_matrix_type -template struct sparse_eval { - typedef typename traits::Scalar _Scalar; - typedef typename traits::StorageIndex _StorageIndex; - enum { _Options = ((Flags&RowMajorBit)==RowMajorBit) ? RowMajor : ColMajor }; - public: - typedef SparseMatrix<_Scalar, _Options, _StorageIndex> type; -}; - -template struct sparse_eval { - typedef typename traits::Scalar _Scalar; - public: - typedef Matrix<_Scalar, 1, 1> type; -}; - -template struct plain_matrix_type -{ - typedef typename traits::Scalar _Scalar; - typedef typename traits::StorageIndex _StorageIndex; - enum { _Options = ((evaluator::Flags&RowMajorBit)==RowMajorBit) ? RowMajor : ColMajor }; - public: - typedef SparseMatrix<_Scalar, _Options, _StorageIndex> type; -}; - -template -struct plain_object_eval - : sparse_eval::RowsAtCompileTime,traits::ColsAtCompileTime, evaluator::Flags> -{}; - -template -struct solve_traits -{ - typedef typename sparse_eval::Flags>::type PlainObject; -}; - -template -struct generic_xpr_base -{ - typedef SparseMatrixBase type; -}; - -struct SparseTriangularShape { static std::string debugName() { return "SparseTriangularShape"; } }; -struct SparseSelfAdjointShape { static std::string debugName() { return "SparseSelfAdjointShape"; } }; - -template<> struct glue_shapes { typedef SparseSelfAdjointShape type; }; -template<> struct glue_shapes { typedef SparseTriangularShape type; }; - -// return type of SparseCompressedBase::lower_bound; -struct LowerBoundIndex { - LowerBoundIndex() : value(-1), found(false) {} - LowerBoundIndex(Index val, bool ok) : value(val), found(ok) {} - Index value; - bool found; -}; - -} // end namespace internal - -/** \ingroup SparseCore_Module - * - * \class Triplet - * - * \brief A small structure to hold a non zero as a triplet (i,j,value). - * - * \sa SparseMatrix::setFromTriplets() - */ -template::StorageIndex > -class Triplet -{ -public: - Triplet() : m_row(0), m_col(0), m_value(0) {} - - Triplet(const StorageIndex& i, const StorageIndex& j, const Scalar& v = Scalar(0)) - : m_row(i), m_col(j), m_value(v) - {} - - /** \returns the row index of the element */ - const StorageIndex& row() const { return m_row; } - - /** \returns the column index of the element */ - const StorageIndex& col() const { return m_col; } - - /** \returns the value of the element */ - const Scalar& value() const { return m_value; } -protected: - StorageIndex m_row, m_col; - Scalar m_value; -}; - -} // end namespace Eigen - -#endif // EIGEN_SPARSEUTIL_H diff --git a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseVector.h b/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseVector.h deleted file mode 100644 index 05779be68..000000000 --- a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseVector.h +++ /dev/null @@ -1,478 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008-2015 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_SPARSEVECTOR_H -#define EIGEN_SPARSEVECTOR_H - -namespace Eigen { - -/** \ingroup SparseCore_Module - * \class SparseVector - * - * \brief a sparse vector class - * - * \tparam _Scalar the scalar type, i.e. the type of the coefficients - * - * See http://www.netlib.org/linalg/html_templates/node91.html for details on the storage scheme. - * - * This class can be extended with the help of the plugin mechanism described on the page - * \ref TopicCustomizing_Plugins by defining the preprocessor symbol \c EIGEN_SPARSEVECTOR_PLUGIN. - */ - -namespace internal { -template -struct traits > -{ - typedef _Scalar Scalar; - typedef _StorageIndex StorageIndex; - typedef Sparse StorageKind; - typedef MatrixXpr XprKind; - enum { - IsColVector = (_Options & RowMajorBit) ? 0 : 1, - - RowsAtCompileTime = IsColVector ? Dynamic : 1, - ColsAtCompileTime = IsColVector ? 1 : Dynamic, - MaxRowsAtCompileTime = RowsAtCompileTime, - MaxColsAtCompileTime = ColsAtCompileTime, - Flags = _Options | NestByRefBit | LvalueBit | (IsColVector ? 0 : RowMajorBit) | CompressedAccessBit, - SupportedAccessPatterns = InnerRandomAccessPattern - }; -}; - -// Sparse-Vector-Assignment kinds: -enum { - SVA_RuntimeSwitch, - SVA_Inner, - SVA_Outer -}; - -template< typename Dest, typename Src, - int AssignmentKind = !bool(Src::IsVectorAtCompileTime) ? SVA_RuntimeSwitch - : Src::InnerSizeAtCompileTime==1 ? SVA_Outer - : SVA_Inner> -struct sparse_vector_assign_selector; - -} - -template -class SparseVector - : public SparseCompressedBase > -{ - typedef SparseCompressedBase Base; - using Base::convert_index; - public: - EIGEN_SPARSE_PUBLIC_INTERFACE(SparseVector) - EIGEN_SPARSE_INHERIT_ASSIGNMENT_OPERATOR(SparseVector, +=) - EIGEN_SPARSE_INHERIT_ASSIGNMENT_OPERATOR(SparseVector, -=) - - typedef internal::CompressedStorage Storage; - enum { IsColVector = internal::traits::IsColVector }; - - enum { - Options = _Options - }; - - EIGEN_STRONG_INLINE Index rows() const { return IsColVector ? m_size : 1; } - EIGEN_STRONG_INLINE Index cols() const { return IsColVector ? 1 : m_size; } - EIGEN_STRONG_INLINE Index innerSize() const { return m_size; } - EIGEN_STRONG_INLINE Index outerSize() const { return 1; } - - EIGEN_STRONG_INLINE const Scalar* valuePtr() const { return m_data.valuePtr(); } - EIGEN_STRONG_INLINE Scalar* valuePtr() { return m_data.valuePtr(); } - - EIGEN_STRONG_INLINE const StorageIndex* innerIndexPtr() const { return m_data.indexPtr(); } - EIGEN_STRONG_INLINE StorageIndex* innerIndexPtr() { return m_data.indexPtr(); } - - inline const StorageIndex* outerIndexPtr() const { return 0; } - inline StorageIndex* outerIndexPtr() { return 0; } - inline const StorageIndex* innerNonZeroPtr() const { return 0; } - inline StorageIndex* innerNonZeroPtr() { return 0; } - - /** \internal */ - inline Storage& data() { return m_data; } - /** \internal */ - inline const Storage& data() const { return m_data; } - - inline Scalar coeff(Index row, Index col) const - { - eigen_assert(IsColVector ? (col==0 && row>=0 && row=0 && col=0 && i=0 && row=0 && col=0 && i=0 && row=0 && col=0 && i= startId) && (m_data.index(p) > i) ) - { - m_data.index(p+1) = m_data.index(p); - m_data.value(p+1) = m_data.value(p); - --p; - } - m_data.index(p+1) = convert_index(i); - m_data.value(p+1) = 0; - return m_data.value(p+1); - } - - /** - */ - inline void reserve(Index reserveSize) { m_data.reserve(reserveSize); } - - - inline void finalize() {} - - /** \copydoc SparseMatrix::prune(const Scalar&,const RealScalar&) */ - void prune(const Scalar& reference, const RealScalar& epsilon = NumTraits::dummy_precision()) - { - m_data.prune(reference,epsilon); - } - - /** Resizes the sparse vector to \a rows x \a cols - * - * This method is provided for compatibility with matrices. - * For a column vector, \a cols must be equal to 1. - * For a row vector, \a rows must be equal to 1. - * - * \sa resize(Index) - */ - void resize(Index rows, Index cols) - { - eigen_assert((IsColVector ? cols : rows)==1 && "Outer dimension must equal 1"); - resize(IsColVector ? rows : cols); - } - - /** Resizes the sparse vector to \a newSize - * This method deletes all entries, thus leaving an empty sparse vector - * - * \sa conservativeResize(), setZero() */ - void resize(Index newSize) - { - m_size = newSize; - m_data.clear(); - } - - /** Resizes the sparse vector to \a newSize, while leaving old values untouched. - * - * If the size of the vector is decreased, then the storage of the out-of bounds coefficients is kept and reserved. - * Call .data().squeeze() to free extra memory. - * - * \sa reserve(), setZero() - */ - void conservativeResize(Index newSize) - { - if (newSize < m_size) - { - Index i = 0; - while (i - inline SparseVector(const SparseMatrixBase& other) - : m_size(0) - { - #ifdef EIGEN_SPARSE_CREATE_TEMPORARY_PLUGIN - EIGEN_SPARSE_CREATE_TEMPORARY_PLUGIN - #endif - check_template_parameters(); - *this = other.derived(); - } - - inline SparseVector(const SparseVector& other) - : Base(other), m_size(0) - { - check_template_parameters(); - *this = other.derived(); - } - - /** Swaps the values of \c *this and \a other. - * Overloaded for performance: this version performs a \em shallow swap by swapping pointers and attributes only. - * \sa SparseMatrixBase::swap() - */ - inline void swap(SparseVector& other) - { - std::swap(m_size, other.m_size); - m_data.swap(other.m_data); - } - - template - inline void swap(SparseMatrix& other) - { - eigen_assert(other.outerSize()==1); - std::swap(m_size, other.m_innerSize); - m_data.swap(other.m_data); - } - - inline SparseVector& operator=(const SparseVector& other) - { - if (other.isRValue()) - { - swap(other.const_cast_derived()); - } - else - { - resize(other.size()); - m_data = other.m_data; - } - return *this; - } - - template - inline SparseVector& operator=(const SparseMatrixBase& other) - { - SparseVector tmp(other.size()); - internal::sparse_vector_assign_selector::run(tmp,other.derived()); - this->swap(tmp); - return *this; - } - - #ifndef EIGEN_PARSED_BY_DOXYGEN - template - inline SparseVector& operator=(const SparseSparseProduct& product) - { - return Base::operator=(product); - } - #endif - - friend std::ostream & operator << (std::ostream & s, const SparseVector& m) - { - for (Index i=0; i::IsSigned,THE_INDEX_TYPE_MUST_BE_A_SIGNED_TYPE); - EIGEN_STATIC_ASSERT((_Options&(ColMajor|RowMajor))==Options,INVALID_MATRIX_TEMPLATE_PARAMETERS); - } - - Storage m_data; - Index m_size; -}; - -namespace internal { - -template -struct evaluator > - : evaluator_base > -{ - typedef SparseVector<_Scalar,_Options,_Index> SparseVectorType; - typedef evaluator_base Base; - typedef typename SparseVectorType::InnerIterator InnerIterator; - typedef typename SparseVectorType::ReverseInnerIterator ReverseInnerIterator; - - enum { - CoeffReadCost = NumTraits<_Scalar>::ReadCost, - Flags = SparseVectorType::Flags - }; - - evaluator() : Base() {} - - explicit evaluator(const SparseVectorType &mat) : m_matrix(&mat) - { - EIGEN_INTERNAL_CHECK_COST_VALUE(CoeffReadCost); - } - - inline Index nonZerosEstimate() const { - return m_matrix->nonZeros(); - } - - operator SparseVectorType&() { return m_matrix->const_cast_derived(); } - operator const SparseVectorType&() const { return *m_matrix; } - - const SparseVectorType *m_matrix; -}; - -template< typename Dest, typename Src> -struct sparse_vector_assign_selector { - static void run(Dest& dst, const Src& src) { - eigen_internal_assert(src.innerSize()==src.size()); - typedef internal::evaluator SrcEvaluatorType; - SrcEvaluatorType srcEval(src); - for(typename SrcEvaluatorType::InnerIterator it(srcEval, 0); it; ++it) - dst.insert(it.index()) = it.value(); - } -}; - -template< typename Dest, typename Src> -struct sparse_vector_assign_selector { - static void run(Dest& dst, const Src& src) { - eigen_internal_assert(src.outerSize()==src.size()); - typedef internal::evaluator SrcEvaluatorType; - SrcEvaluatorType srcEval(src); - for(Index i=0; i -struct sparse_vector_assign_selector { - static void run(Dest& dst, const Src& src) { - if(src.outerSize()==1) sparse_vector_assign_selector::run(dst, src); - else sparse_vector_assign_selector::run(dst, src); - } -}; - -} - -} // end namespace Eigen - -#endif // EIGEN_SPARSEVECTOR_H diff --git a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseView.h b/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseView.h deleted file mode 100644 index 92b3d1f7b..000000000 --- a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/SparseView.h +++ /dev/null @@ -1,254 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2011-2014 Gael Guennebaud -// Copyright (C) 2010 Daniel Lowengrub -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_SPARSEVIEW_H -#define EIGEN_SPARSEVIEW_H - -namespace Eigen { - -namespace internal { - -template -struct traits > : traits -{ - typedef typename MatrixType::StorageIndex StorageIndex; - typedef Sparse StorageKind; - enum { - Flags = int(traits::Flags) & (RowMajorBit) - }; -}; - -} // end namespace internal - -/** \ingroup SparseCore_Module - * \class SparseView - * - * \brief Expression of a dense or sparse matrix with zero or too small values removed - * - * \tparam MatrixType the type of the object of which we are removing the small entries - * - * This class represents an expression of a given dense or sparse matrix with - * entries smaller than \c reference * \c epsilon are removed. - * It is the return type of MatrixBase::sparseView() and SparseMatrixBase::pruned() - * and most of the time this is the only way it is used. - * - * \sa MatrixBase::sparseView(), SparseMatrixBase::pruned() - */ -template -class SparseView : public SparseMatrixBase > -{ - typedef typename MatrixType::Nested MatrixTypeNested; - typedef typename internal::remove_all::type _MatrixTypeNested; - typedef SparseMatrixBase Base; -public: - EIGEN_SPARSE_PUBLIC_INTERFACE(SparseView) - typedef typename internal::remove_all::type NestedExpression; - - explicit SparseView(const MatrixType& mat, const Scalar& reference = Scalar(0), - const RealScalar &epsilon = NumTraits::dummy_precision()) - : m_matrix(mat), m_reference(reference), m_epsilon(epsilon) {} - - inline Index rows() const { return m_matrix.rows(); } - inline Index cols() const { return m_matrix.cols(); } - - inline Index innerSize() const { return m_matrix.innerSize(); } - inline Index outerSize() const { return m_matrix.outerSize(); } - - /** \returns the nested expression */ - const typename internal::remove_all::type& - nestedExpression() const { return m_matrix; } - - Scalar reference() const { return m_reference; } - RealScalar epsilon() const { return m_epsilon; } - -protected: - MatrixTypeNested m_matrix; - Scalar m_reference; - RealScalar m_epsilon; -}; - -namespace internal { - -// TODO find a way to unify the two following variants -// This is tricky because implementing an inner iterator on top of an IndexBased evaluator is -// not easy because the evaluators do not expose the sizes of the underlying expression. - -template -struct unary_evaluator, IteratorBased> - : public evaluator_base > -{ - typedef typename evaluator::InnerIterator EvalIterator; - public: - typedef SparseView XprType; - - class InnerIterator : public EvalIterator - { - protected: - typedef typename XprType::Scalar Scalar; - public: - - EIGEN_STRONG_INLINE InnerIterator(const unary_evaluator& sve, Index outer) - : EvalIterator(sve.m_argImpl,outer), m_view(sve.m_view) - { - incrementToNonZero(); - } - - EIGEN_STRONG_INLINE InnerIterator& operator++() - { - EvalIterator::operator++(); - incrementToNonZero(); - return *this; - } - - using EvalIterator::value; - - protected: - const XprType &m_view; - - private: - void incrementToNonZero() - { - while((bool(*this)) && internal::isMuchSmallerThan(value(), m_view.reference(), m_view.epsilon())) - { - EvalIterator::operator++(); - } - } - }; - - enum { - CoeffReadCost = evaluator::CoeffReadCost, - Flags = XprType::Flags - }; - - explicit unary_evaluator(const XprType& xpr) : m_argImpl(xpr.nestedExpression()), m_view(xpr) {} - - protected: - evaluator m_argImpl; - const XprType &m_view; -}; - -template -struct unary_evaluator, IndexBased> - : public evaluator_base > -{ - public: - typedef SparseView XprType; - protected: - enum { IsRowMajor = (XprType::Flags&RowMajorBit)==RowMajorBit }; - typedef typename XprType::Scalar Scalar; - typedef typename XprType::StorageIndex StorageIndex; - public: - - class InnerIterator - { - public: - - EIGEN_STRONG_INLINE InnerIterator(const unary_evaluator& sve, Index outer) - : m_sve(sve), m_inner(0), m_outer(outer), m_end(sve.m_view.innerSize()) - { - incrementToNonZero(); - } - - EIGEN_STRONG_INLINE InnerIterator& operator++() - { - m_inner++; - incrementToNonZero(); - return *this; - } - - EIGEN_STRONG_INLINE Scalar value() const - { - return (IsRowMajor) ? m_sve.m_argImpl.coeff(m_outer, m_inner) - : m_sve.m_argImpl.coeff(m_inner, m_outer); - } - - EIGEN_STRONG_INLINE StorageIndex index() const { return m_inner; } - inline Index row() const { return IsRowMajor ? m_outer : index(); } - inline Index col() const { return IsRowMajor ? index() : m_outer; } - - EIGEN_STRONG_INLINE operator bool() const { return m_inner < m_end && m_inner>=0; } - - protected: - const unary_evaluator &m_sve; - Index m_inner; - const Index m_outer; - const Index m_end; - - private: - void incrementToNonZero() - { - while((bool(*this)) && internal::isMuchSmallerThan(value(), m_sve.m_view.reference(), m_sve.m_view.epsilon())) - { - m_inner++; - } - } - }; - - enum { - CoeffReadCost = evaluator::CoeffReadCost, - Flags = XprType::Flags - }; - - explicit unary_evaluator(const XprType& xpr) : m_argImpl(xpr.nestedExpression()), m_view(xpr) {} - - protected: - evaluator m_argImpl; - const XprType &m_view; -}; - -} // end namespace internal - -/** \ingroup SparseCore_Module - * - * \returns a sparse expression of the dense expression \c *this with values smaller than - * \a reference * \a epsilon removed. - * - * This method is typically used when prototyping to convert a quickly assembled dense Matrix \c D to a SparseMatrix \c S: - * \code - * MatrixXd D(n,m); - * SparseMatrix S; - * S = D.sparseView(); // suppress numerical zeros (exact) - * S = D.sparseView(reference); - * S = D.sparseView(reference,epsilon); - * \endcode - * where \a reference is a meaningful non zero reference value, - * and \a epsilon is a tolerance factor defaulting to NumTraits::dummy_precision(). - * - * \sa SparseMatrixBase::pruned(), class SparseView */ -template -const SparseView MatrixBase::sparseView(const Scalar& reference, - const typename NumTraits::Real& epsilon) const -{ - return SparseView(derived(), reference, epsilon); -} - -/** \returns an expression of \c *this with values smaller than - * \a reference * \a epsilon removed. - * - * This method is typically used in conjunction with the product of two sparse matrices - * to automatically prune the smallest values as follows: - * \code - * C = (A*B).pruned(); // suppress numerical zeros (exact) - * C = (A*B).pruned(ref); - * C = (A*B).pruned(ref,epsilon); - * \endcode - * where \c ref is a meaningful non zero reference value. - * */ -template -const SparseView -SparseMatrixBase::pruned(const Scalar& reference, - const RealScalar& epsilon) const -{ - return SparseView(derived(), reference, epsilon); -} - -} // end namespace Eigen - -#endif diff --git a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/TriangularSolver.h b/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/TriangularSolver.h deleted file mode 100644 index f9c56ba79..000000000 --- a/subprojects/robotpy-wpimath/wpimath/_impl/src/eigen/Eigen/src/SparseCore/TriangularSolver.h +++ /dev/null @@ -1,315 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_SPARSETRIANGULARSOLVER_H -#define EIGEN_SPARSETRIANGULARSOLVER_H - -namespace Eigen { - -namespace internal { - -template::Flags) & RowMajorBit> -struct sparse_solve_triangular_selector; - -// forward substitution, row-major -template -struct sparse_solve_triangular_selector -{ - typedef typename Rhs::Scalar Scalar; - typedef evaluator LhsEval; - typedef typename evaluator::InnerIterator LhsIterator; - static void run(const Lhs& lhs, Rhs& other) - { - LhsEval lhsEval(lhs); - for(Index col=0 ; col -struct sparse_solve_triangular_selector -{ - typedef typename Rhs::Scalar Scalar; - typedef evaluator LhsEval; - typedef typename evaluator::InnerIterator LhsIterator; - static void run(const Lhs& lhs, Rhs& other) - { - LhsEval lhsEval(lhs); - for(Index col=0 ; col=0 ; --i) - { - Scalar tmp = other.coeff(i,col); - Scalar l_ii(0); - LhsIterator it(lhsEval, i); - while(it && it.index() -struct sparse_solve_triangular_selector -{ - typedef typename Rhs::Scalar Scalar; - typedef evaluator LhsEval; - typedef typename evaluator::InnerIterator LhsIterator; - static void run(const Lhs& lhs, Rhs& other) - { - LhsEval lhsEval(lhs); - for(Index col=0 ; col -struct sparse_solve_triangular_selector -{ - typedef typename Rhs::Scalar Scalar; - typedef evaluator LhsEval; - typedef typename evaluator::InnerIterator LhsIterator; - static void run(const Lhs& lhs, Rhs& other) - { - LhsEval lhsEval(lhs); - for(Index col=0 ; col=0; --i) - { - Scalar& tmp = other.coeffRef(i,col); - if (tmp!=Scalar(0)) // optimization when other is actually sparse - { - if(!(Mode & UnitDiag)) - { - // TODO replace this by a binary search. make sure the binary search is safe for partially sorted elements - LhsIterator it(lhsEval, i); - while(it && it.index()!=i) - ++it; - eigen_assert(it && it.index()==i); - other.coeffRef(i,col) /= it.value(); - } - LhsIterator it(lhsEval, i); - for(; it && it.index() -template -void TriangularViewImpl::solveInPlace(MatrixBase& other) const -{ - eigen_assert(derived().cols() == derived().rows() && derived().cols() == other.rows()); - eigen_assert((!(Mode & ZeroDiag)) && bool(Mode & (Upper|Lower))); - - enum { copy = internal::traits::Flags & RowMajorBit }; - - typedef typename internal::conditional::type, OtherDerived&>::type OtherCopy; - OtherCopy otherCopy(other.derived()); - - internal::sparse_solve_triangular_selector::type, Mode>::run(derived().nestedExpression(), otherCopy); - - if (copy) - other = otherCopy; -} -#endif - -// pure sparse path - -namespace internal { - -template -struct sparse_solve_triangular_sparse_selector; - -// forward substitution, col-major -template -struct sparse_solve_triangular_sparse_selector -{ - typedef typename Rhs::Scalar Scalar; - typedef typename promote_index_type::StorageIndex, - typename traits::StorageIndex>::type StorageIndex; - static void run(const Lhs& lhs, Rhs& other) - { - const bool IsLower = (UpLo==Lower); - AmbiVector tempVector(other.rows()*2); - tempVector.setBounds(0,other.rows()); - - Rhs res(other.rows(), other.cols()); - res.reserve(other.nonZeros()); - - for(Index col=0 ; col=0; - i+=IsLower?1:-1) - { - tempVector.restart(); - Scalar& ci = tempVector.coeffRef(i); - if (ci!=Scalar(0)) - { - // find - typename Lhs::InnerIterator it(lhs, i); - if(!(Mode & UnitDiag)) - { - if (IsLower) - { - eigen_assert(it.index()==i); - ci /= it.value(); - } - else - ci /= lhs.coeff(i,i); - } - tempVector.restart(); - if (IsLower) - { - if (it.index()==i) - ++it; - for(; it; ++it) - tempVector.coeffRef(it.index()) -= ci * it.value(); - } - else - { - for(; it && it.index()::Iterator it(tempVector/*,1e-12*/); it; ++it) - { - ++ count; -// std::cerr << "fill " << it.index() << ", " << col << "\n"; -// std::cout << it.value() << " "; - // FIXME use insertBack - res.insert(it.index(), col) = it.value(); - } -// std::cout << "tempVector.nonZeros() == " << int(count) << " / " << (other.rows()) << "\n"; - } - res.finalize(); - other = res.markAsRValue(); - } -}; - -} // end namespace internal - -#ifndef EIGEN_PARSED_BY_DOXYGEN -template -template -void TriangularViewImpl::solveInPlace(SparseMatrixBase& other) const -{ - eigen_assert(derived().cols() == derived().rows() && derived().cols() == other.rows()); - eigen_assert( (!(Mode & ZeroDiag)) && bool(Mode & (Upper|Lower))); - -// enum { copy = internal::traits::Flags & RowMajorBit }; - -// typedef typename internal::conditional::type, OtherDerived&>::type OtherCopy; -// OtherCopy otherCopy(other.derived()); - - internal::sparse_solve_triangular_sparse_selector::run(derived().nestedExpression(), other.derived()); - -// if (copy) -// other = otherCopy; -} -#endif - -} // end namespace Eigen - -#endif // EIGEN_SPARSETRIANGULARSOLVER_H diff --git a/subprojects/robotpy-wpimath/wpimath/_impl/src/type_casters/frc_eigen.h b/subprojects/robotpy-wpimath/wpimath/_impl/src/type_casters/frc_eigen.h new file mode 100644 index 000000000..d1c219aa1 --- /dev/null +++ b/subprojects/robotpy-wpimath/wpimath/_impl/src/type_casters/frc_eigen.h @@ -0,0 +1,4 @@ +#pragma once + +// the FRC types are just aliases for Eigen types, so use that +#include diff --git a/subprojects/robotpy-wpimath/wpimath/controller/__init__.py b/subprojects/robotpy-wpimath/wpimath/controller/__init__.py index 5ba1f1212..4fe1fcdce 100644 --- a/subprojects/robotpy-wpimath/wpimath/controller/__init__.py +++ b/subprojects/robotpy-wpimath/wpimath/controller/__init__.py @@ -1,4 +1,4 @@ -# autogenerated by 'robotpy-build create-imports wpimath.controller wpimath._controls._controls.controller' +# autogenerated by 'semiwrap create-imports wpimath.controller wpimath._controls._controls.controller' from .._controls._controls.controller import ( ArmFeedforward, BangBangController, diff --git a/subprojects/robotpy-wpimath/wpimath/estimator/__init__.py b/subprojects/robotpy-wpimath/wpimath/estimator/__init__.py index e6de6b052..dd9b3ca8e 100644 --- a/subprojects/robotpy-wpimath/wpimath/estimator/__init__.py +++ b/subprojects/robotpy-wpimath/wpimath/estimator/__init__.py @@ -1,4 +1,4 @@ -# autogenerated by 'robotpy-build create-imports wpimath.estimator wpimath._controls._controls.estimator' +# autogenerated by 'semiwrap create-imports wpimath.estimator wpimath._controls._controls.estimator' from .._controls._controls.estimator import ( DifferentialDrivePoseEstimator, DifferentialDrivePoseEstimator3d, diff --git a/subprojects/robotpy-wpimath/wpimath/filter/__init__.py b/subprojects/robotpy-wpimath/wpimath/filter/__init__.py index e5ecf5710..c9386e49d 100644 --- a/subprojects/robotpy-wpimath/wpimath/filter/__init__.py +++ b/subprojects/robotpy-wpimath/wpimath/filter/__init__.py @@ -1,6 +1,6 @@ -from . import _init_filter +from . import _init__filter -# autogenerated by 'robotpy-build create-imports wpimath.filter wpimath.filter._filter' +# autogenerated by 'semiwrap create-imports wpimath.filter wpimath.filter._filter' from ._filter import Debouncer, LinearFilter, MedianFilter, SlewRateLimiter __all__ = ["Debouncer", "LinearFilter", "MedianFilter", "SlewRateLimiter"] diff --git a/subprojects/robotpy-wpimath/wpimath/filter/filter.cpp b/subprojects/robotpy-wpimath/wpimath/filter/filter.cpp index 956ee7fab..1f541d1e9 100644 --- a/subprojects/robotpy-wpimath/wpimath/filter/filter.cpp +++ b/subprojects/robotpy-wpimath/wpimath/filter/filter.cpp @@ -1,7 +1,7 @@ -#include "rpygen_wrapper.hpp" +#include "semiwrap_init.wpimath.filter._filter.hpp" -RPYBUILD_PYBIND11_MODULE(m) +SEMIWRAP_PYBIND11_MODULE(m) { initWrapper(m); } diff --git a/subprojects/robotpy-wpimath/wpimath/geometry/__init__.py b/subprojects/robotpy-wpimath/wpimath/geometry/__init__.py index 52d57b25e..894909d4b 100644 --- a/subprojects/robotpy-wpimath/wpimath/geometry/__init__.py +++ b/subprojects/robotpy-wpimath/wpimath/geometry/__init__.py @@ -1,6 +1,6 @@ -from . import _init_geometry +from . import _init__geometry -# autogenerated by 'robotpy-build create-imports wpimath.geometry wpimath.geometry._geometry' +# autogenerated by 'semiwrap create-imports wpimath.geometry wpimath.geometry._geometry' from ._geometry import ( CoordinateAxis, CoordinateSystem, diff --git a/subprojects/robotpy-wpimath/wpimath/geometry/geometry.cpp b/subprojects/robotpy-wpimath/wpimath/geometry/geometry.cpp index 956ee7fab..3ae0f5430 100644 --- a/subprojects/robotpy-wpimath/wpimath/geometry/geometry.cpp +++ b/subprojects/robotpy-wpimath/wpimath/geometry/geometry.cpp @@ -1,7 +1,7 @@ -#include "rpygen_wrapper.hpp" +#include "semiwrap_init.wpimath.geometry._geometry.hpp" -RPYBUILD_PYBIND11_MODULE(m) +SEMIWRAP_PYBIND11_MODULE(m) { initWrapper(m); } diff --git a/subprojects/robotpy-wpimath/wpimath/interpolation/__init__.py b/subprojects/robotpy-wpimath/wpimath/interpolation/__init__.py index 4e5fbde8f..c71091b33 100644 --- a/subprojects/robotpy-wpimath/wpimath/interpolation/__init__.py +++ b/subprojects/robotpy-wpimath/wpimath/interpolation/__init__.py @@ -1,4 +1,4 @@ -from . import _init_interpolation # noqa: F401 +from . import _init__interpolation # noqa: F401 # autogenerated by 'robotpy-build create-imports wpimath.interpolation wpimath.interpolation._interpolation' from ._interpolation import ( diff --git a/subprojects/robotpy-wpimath/wpimath/interpolation/interpolation.cpp b/subprojects/robotpy-wpimath/wpimath/interpolation/interpolation.cpp index 956ee7fab..d7e3226cc 100644 --- a/subprojects/robotpy-wpimath/wpimath/interpolation/interpolation.cpp +++ b/subprojects/robotpy-wpimath/wpimath/interpolation/interpolation.cpp @@ -1,7 +1,7 @@ -#include "rpygen_wrapper.hpp" +#include "semiwrap_init.wpimath.interpolation._interpolation.hpp" -RPYBUILD_PYBIND11_MODULE(m) +SEMIWRAP_PYBIND11_MODULE(m) { initWrapper(m); } diff --git a/subprojects/robotpy-wpimath/wpimath/kinematics/__init__.py b/subprojects/robotpy-wpimath/wpimath/kinematics/__init__.py index b3df2cb5f..4327debb3 100644 --- a/subprojects/robotpy-wpimath/wpimath/kinematics/__init__.py +++ b/subprojects/robotpy-wpimath/wpimath/kinematics/__init__.py @@ -1,4 +1,4 @@ -from . import _init_kinematics +from . import _init__kinematics # autogenerated by 'robotpy-build create-imports wpimath.kinematics' from ._kinematics import ( diff --git a/subprojects/robotpy-wpimath/wpimath/kinematics/kinematics.cpp b/subprojects/robotpy-wpimath/wpimath/kinematics/kinematics.cpp index 956ee7fab..6b35ec1de 100644 --- a/subprojects/robotpy-wpimath/wpimath/kinematics/kinematics.cpp +++ b/subprojects/robotpy-wpimath/wpimath/kinematics/kinematics.cpp @@ -1,7 +1,7 @@ -#include "rpygen_wrapper.hpp" +#include "semiwrap_init.wpimath.kinematics._kinematics.hpp" -RPYBUILD_PYBIND11_MODULE(m) +SEMIWRAP_PYBIND11_MODULE(m) { initWrapper(m); } diff --git a/subprojects/robotpy-wpimath/wpimath/optimization/__init__.py b/subprojects/robotpy-wpimath/wpimath/optimization/__init__.py index 46dd766a2..8f7a6c650 100644 --- a/subprojects/robotpy-wpimath/wpimath/optimization/__init__.py +++ b/subprojects/robotpy-wpimath/wpimath/optimization/__init__.py @@ -1,4 +1,4 @@ -# autogenerated by 'robotpy-build create-imports wpimath.optimization wpimath._controls._controls.optimization' +# autogenerated by 'semiwrap create-imports wpimath.optimization wpimath._controls._controls.optimization' from .._controls._controls.optimization import SimulatedAnnealing __all__ = ["SimulatedAnnealing"] diff --git a/subprojects/robotpy-wpimath/wpimath/path/__init__.py b/subprojects/robotpy-wpimath/wpimath/path/__init__.py index 7c361284d..8e82c2640 100644 --- a/subprojects/robotpy-wpimath/wpimath/path/__init__.py +++ b/subprojects/robotpy-wpimath/wpimath/path/__init__.py @@ -1,4 +1,4 @@ -# autogenerated by 'robotpy-build create-imports wpimath.path wpimath._controls._controls.path' +# autogenerated by 'semiwrap create-imports wpimath.path wpimath._controls._controls.path' from .._controls._controls.path import TravelingSalesman __all__ = ["TravelingSalesman"] diff --git a/subprojects/robotpy-wpimath/wpimath/py.typed b/subprojects/robotpy-wpimath/wpimath/py.typed new file mode 100644 index 000000000..e69de29bb diff --git a/subprojects/robotpy-wpimath/wpimath/spline/__init__.py b/subprojects/robotpy-wpimath/wpimath/spline/__init__.py index ce1642cae..37f1a65ec 100644 --- a/subprojects/robotpy-wpimath/wpimath/spline/__init__.py +++ b/subprojects/robotpy-wpimath/wpimath/spline/__init__.py @@ -1,6 +1,6 @@ -from . import _init_spline +from . import _init__spline -# autogenerated by 'robotpy-build create-imports wpimath.spline wpimath.spline._spline' +# autogenerated by 'semiwrap create-imports wpimath.spline wpimath.spline._spline' from ._spline import ( CubicHermiteSpline, QuinticHermiteSpline, diff --git a/subprojects/robotpy-wpimath/wpimath/spline/spline.cpp b/subprojects/robotpy-wpimath/wpimath/spline/spline.cpp index 956ee7fab..b3cd6d33a 100644 --- a/subprojects/robotpy-wpimath/wpimath/spline/spline.cpp +++ b/subprojects/robotpy-wpimath/wpimath/spline/spline.cpp @@ -1,7 +1,7 @@ -#include "rpygen_wrapper.hpp" +#include "semiwrap_init.wpimath.spline._spline.hpp" -RPYBUILD_PYBIND11_MODULE(m) +SEMIWRAP_PYBIND11_MODULE(m) { initWrapper(m); } diff --git a/subprojects/robotpy-wpimath/wpimath/src/wpimath.cpp b/subprojects/robotpy-wpimath/wpimath/src/wpimath.cpp index c734f989f..15fff1702 100644 --- a/subprojects/robotpy-wpimath/wpimath/src/wpimath.cpp +++ b/subprojects/robotpy-wpimath/wpimath/src/wpimath.cpp @@ -1,4 +1,4 @@ -#include "rpygen_wrapper.hpp" +#include "semiwrap_init.wpimath._wpimath.hpp" -RPYBUILD_PYBIND11_MODULE(m) { initWrapper(m); } +SEMIWRAP_PYBIND11_MODULE(m) { initWrapper(m); } diff --git a/subprojects/robotpy-wpimath/wpimath/system/__init__.py b/subprojects/robotpy-wpimath/wpimath/system/__init__.py index cd78129cb..500033b15 100644 --- a/subprojects/robotpy-wpimath/wpimath/system/__init__.py +++ b/subprojects/robotpy-wpimath/wpimath/system/__init__.py @@ -1,4 +1,4 @@ -# autogenerated by 'robotpy-build create-imports wpimath.system wpimath._controls._controls.system' +# autogenerated by 'semiwrap create-imports wpimath.system wpimath._controls._controls.system' from .._controls._controls.system import ( LinearSystemLoop_1_1_1, LinearSystemLoop_2_1_1, diff --git a/subprojects/robotpy-wpimath/wpimath/trajectory/__init__.py b/subprojects/robotpy-wpimath/wpimath/trajectory/__init__.py index ba3be88da..944b9d117 100644 --- a/subprojects/robotpy-wpimath/wpimath/trajectory/__init__.py +++ b/subprojects/robotpy-wpimath/wpimath/trajectory/__init__.py @@ -1,4 +1,4 @@ -# autogenerated by 'robotpy-build create-imports wpimath.trajectory wpimath._controls._controls.trajectory' +# autogenerated by 'semiwrap create-imports wpimath.trajectory wpimath._controls._controls.trajectory' from .._controls._controls.trajectory import ( ExponentialProfileMeterVolts, Trajectory, diff --git a/subprojects/robotpy-wpimath/wpimath/trajectory/constraint/__init__.py b/subprojects/robotpy-wpimath/wpimath/trajectory/constraint/__init__.py index aa7f14cbd..392ba9d8c 100644 --- a/subprojects/robotpy-wpimath/wpimath/trajectory/constraint/__init__.py +++ b/subprojects/robotpy-wpimath/wpimath/trajectory/constraint/__init__.py @@ -1,4 +1,4 @@ -# autogenerated by 'robotpy-build create-imports wpimath.trajectory.constraint wpimath._controls._controls.constraint' +# autogenerated by 'semiwrap create-imports wpimath.trajectory.constraint wpimath._controls._controls.constraint' from ..._controls._controls.constraint import ( CentripetalAccelerationConstraint, DifferentialDriveKinematicsConstraint, From 1237fa177e0c4ab5b34e593c5bb8f420588a5d60 Mon Sep 17 00:00:00 2001 From: Dustin Spicuzza Date: Sat, 19 Apr 2025 14:16:25 -0400 Subject: [PATCH 09/20] Update robotpy-wpimath test project to semiwrap --- .../robotpy-wpimath/tests/cpp/.gitignore | 8 ++-- .../robotpy-wpimath/tests/cpp/meson.build | 11 ++++++ .../robotpy-wpimath/tests/cpp/pyproject.toml | 38 ++++++++++--------- .../tests/cpp/semiwrap/.gitignore | 3 ++ .../tests/cpp/{gen => semiwrap}/module.yml | 0 .../robotpy-wpimath/tests/cpp/setup.py | 5 --- .../tests/cpp/wpimath_test/__init__.py | 4 +- .../tests/cpp/wpimath_test/src/module.cpp | 4 +- .../robotpy-wpimath/tests/run_tests.py | 7 +--- 9 files changed, 43 insertions(+), 37 deletions(-) create mode 100644 subprojects/robotpy-wpimath/tests/cpp/meson.build create mode 100644 subprojects/robotpy-wpimath/tests/cpp/semiwrap/.gitignore rename subprojects/robotpy-wpimath/tests/cpp/{gen => semiwrap}/module.yml (100%) delete mode 100644 subprojects/robotpy-wpimath/tests/cpp/setup.py diff --git a/subprojects/robotpy-wpimath/tests/cpp/.gitignore b/subprojects/robotpy-wpimath/tests/cpp/.gitignore index 444f3c1a7..fa044c389 100644 --- a/subprojects/robotpy-wpimath/tests/cpp/.gitignore +++ b/subprojects/robotpy-wpimath/tests/cpp/.gitignore @@ -2,8 +2,6 @@ *.so *.dylib -/wpimath_test/pkgcfg.py -/wpimath_test/py.typed -/wpimath_test/_init_wpimath_test.py -/wpimath_test/rpy-include -/wpimath_test/_wpimath_test \ No newline at end of file +/wpimath_test/wpimath_test.pc +/wpimath_test/_init__wpimath_test.py +/wpimath_test/trampolines \ No newline at end of file diff --git a/subprojects/robotpy-wpimath/tests/cpp/meson.build b/subprojects/robotpy-wpimath/tests/cpp/meson.build new file mode 100644 index 000000000..58573a52b --- /dev/null +++ b/subprojects/robotpy-wpimath/tests/cpp/meson.build @@ -0,0 +1,11 @@ +project('wpimath-test', ['cpp'], + default_options: ['warning_level=1', 'cpp_std=c++20', + 'b_colorout=auto', 'optimization=2', 'b_pie=true']) + +subdir('semiwrap') + +wpimath_test_sources += files( + 'wpimath_test/src/module.cpp', +) + +subdir('semiwrap/modules') diff --git a/subprojects/robotpy-wpimath/tests/cpp/pyproject.toml b/subprojects/robotpy-wpimath/tests/cpp/pyproject.toml index 9a3e58388..679f4bdf0 100644 --- a/subprojects/robotpy-wpimath/tests/cpp/pyproject.toml +++ b/subprojects/robotpy-wpimath/tests/cpp/pyproject.toml @@ -1,25 +1,27 @@ [build-system] -requires = ["robotpy-build"] - -[tool.robotpy-build] -base_package = "wpimath_test" +build-backend = "hatchling.build" +requires = [ + "semiwrap", "hatch-meson", "hatchling", +] -[tool.robotpy-build.wrappers."wpimath_test"] +[project] name = "wpimath_test" -depends = ["wpimath_cpp"] -sources = [ - "wpimath_test/src/module.cpp", +version = "0.1" +description = "Test project for verifying robotpy-build behavior" +authors = [ + {name = "RobotPy Development Team", email = "robotpy@googlegroups.com"}, ] -generation_data = "gen" +license = "BSD-3-Clause" -[tool.robotpy-build.wrappers."wpimath_test".autogen_headers] -module = "module.h" +[tool.hatch.build.hooks.semiwrap] +[tool.hatch.build.hooks.meson] -[tool.robotpy-build.metadata] +[tool.semiwrap] + +[tool.semiwrap.extension_modules."wpimath_test._wpimath_test"] name = "wpimath_test" -description = "Test project for verifying robotpy-build behavior" -author = "RobotPy Development Team" -author_email = "robotpy@googlegroups.com" -license = "BSD-3-Clause" -install_requires = [] -url = "" \ No newline at end of file +depends = ["wpimath"] +includes = ["wpimath_test/include"] + +[tool.semiwrap.extension_modules."wpimath_test._wpimath_test".headers] +module = "module.h" diff --git a/subprojects/robotpy-wpimath/tests/cpp/semiwrap/.gitignore b/subprojects/robotpy-wpimath/tests/cpp/semiwrap/.gitignore new file mode 100644 index 000000000..6cdce1027 --- /dev/null +++ b/subprojects/robotpy-wpimath/tests/cpp/semiwrap/.gitignore @@ -0,0 +1,3 @@ +/meson.build +/modules/meson.build +/trampolines/meson.build diff --git a/subprojects/robotpy-wpimath/tests/cpp/gen/module.yml b/subprojects/robotpy-wpimath/tests/cpp/semiwrap/module.yml similarity index 100% rename from subprojects/robotpy-wpimath/tests/cpp/gen/module.yml rename to subprojects/robotpy-wpimath/tests/cpp/semiwrap/module.yml diff --git a/subprojects/robotpy-wpimath/tests/cpp/setup.py b/subprojects/robotpy-wpimath/tests/cpp/setup.py deleted file mode 100644 index 3542d0c9a..000000000 --- a/subprojects/robotpy-wpimath/tests/cpp/setup.py +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env python3 - -from robotpy_build.setup import setup - -setup() diff --git a/subprojects/robotpy-wpimath/tests/cpp/wpimath_test/__init__.py b/subprojects/robotpy-wpimath/tests/cpp/wpimath_test/__init__.py index 04cd99228..5dff80ff0 100644 --- a/subprojects/robotpy-wpimath/tests/cpp/wpimath_test/__init__.py +++ b/subprojects/robotpy-wpimath/tests/cpp/wpimath_test/__init__.py @@ -1,8 +1,8 @@ -from . import _init_wpimath_test +from . import _init__wpimath_test # autogenerated by 'robotpy-build create-imports wpimath_test' from ._wpimath_test import SomeClass __all__ = ["SomeClass"] -del _init_wpimath_test +del _init__wpimath_test diff --git a/subprojects/robotpy-wpimath/tests/cpp/wpimath_test/src/module.cpp b/subprojects/robotpy-wpimath/tests/cpp/wpimath_test/src/module.cpp index 4014b2848..c101790b3 100644 --- a/subprojects/robotpy-wpimath/tests/cpp/wpimath_test/src/module.cpp +++ b/subprojects/robotpy-wpimath/tests/cpp/wpimath_test/src/module.cpp @@ -1,9 +1,9 @@ -#include "rpygen_wrapper.hpp" +#include "semiwrap_init.wpimath_test._wpimath_test.hpp" #include #include -RPYBUILD_PYBIND11_MODULE(m) +SEMIWRAP_PYBIND11_MODULE(m) { initWrapper(m); } diff --git a/subprojects/robotpy-wpimath/tests/run_tests.py b/subprojects/robotpy-wpimath/tests/run_tests.py index c8e66c13b..1859bb6e4 100755 --- a/subprojects/robotpy-wpimath/tests/run_tests.py +++ b/subprojects/robotpy-wpimath/tests/run_tests.py @@ -9,9 +9,6 @@ root = abspath(dirname(__file__)) os.chdir(root) - env = os.environ.copy() - env["SETUPTOOLS_SCM_PRETEND_VERSION"] = "0.0.1" - subprocess.check_call( [ sys.executable, @@ -19,11 +16,11 @@ "pip", "--disable-pip-version-check", "install", + "-v", "--force-reinstall", "--no-build-isolation", "./cpp", - ], - env=env, + ] ) subprocess.check_call([sys.executable, "-m", "pytest", "--ignore=cpp"]) From 186696999265dfb607ce2a2d05ab99244b074ada Mon Sep 17 00:00:00 2001 From: Dustin Spicuzza Date: Sun, 18 May 2025 23:57:46 -0400 Subject: [PATCH 10/20] Update robotpy-cscore to semiwrap --- subprojects/robotpy-cscore/.gitignore | 16 +-- subprojects/robotpy-cscore/cscore/__init__.py | 2 +- .../robotpy-cscore/cscore/src/main.cpp | 4 +- subprojects/robotpy-cscore/meson.build | 26 +++++ subprojects/robotpy-cscore/pyproject.toml | 102 +++++++++++------- .../robotpy-cscore/semiwrap/.gitignore | 3 + .../{gen => semiwrap}/CameraServer.yml | 7 +- .../{gen => semiwrap}/cscore_cpp.yml | 7 +- .../{gen => semiwrap}/cscore_cv.yml | 5 +- .../{gen => semiwrap}/cscore_oo.yml | 27 +++-- .../{gen => semiwrap}/cscore_runloop.yml | 0 subprojects/robotpy-cscore/setup.py | 5 - 12 files changed, 126 insertions(+), 78 deletions(-) create mode 100644 subprojects/robotpy-cscore/meson.build create mode 100644 subprojects/robotpy-cscore/semiwrap/.gitignore rename subprojects/robotpy-cscore/{gen => semiwrap}/CameraServer.yml (97%) rename subprojects/robotpy-cscore/{gen => semiwrap}/cscore_cpp.yml (99%) rename subprojects/robotpy-cscore/{gen => semiwrap}/cscore_cv.yml (98%) rename subprojects/robotpy-cscore/{gen => semiwrap}/cscore_oo.yml (95%) rename subprojects/robotpy-cscore/{gen => semiwrap}/cscore_runloop.yml (100%) delete mode 100644 subprojects/robotpy-cscore/setup.py diff --git a/subprojects/robotpy-cscore/.gitignore b/subprojects/robotpy-cscore/.gitignore index fc4ef093b..78c06534f 100644 --- a/subprojects/robotpy-cscore/.gitignore +++ b/subprojects/robotpy-cscore/.gitignore @@ -3,16 +3,16 @@ __pycache__ *.so *.dll +*.pybind11.json +*.pc -/cscore/_init_cscore.py +/cscore/_init__cscore.py +/cscore/trampolines +/cscore/version.py -dist -build -version.py - -/cscore/pkgcfg.py -/cscore/py.typed -/cscore/_cscore +/lib +/dist +/build .project .pydevproject diff --git a/subprojects/robotpy-cscore/cscore/__init__.py b/subprojects/robotpy-cscore/cscore/__init__.py index 0f065ed73..de30fda6b 100644 --- a/subprojects/robotpy-cscore/cscore/__init__.py +++ b/subprojects/robotpy-cscore/cscore/__init__.py @@ -1,4 +1,4 @@ -from . import _init_cscore +from . import _init__cscore # autogenerated by 'robotpy-build create-imports cscore cscore._cscore' from ._cscore import ( diff --git a/subprojects/robotpy-cscore/cscore/src/main.cpp b/subprojects/robotpy-cscore/cscore/src/main.cpp index 9e9db3094..2309c5ae5 100644 --- a/subprojects/robotpy-cscore/cscore/src/main.cpp +++ b/subprojects/robotpy-cscore/cscore/src/main.cpp @@ -1,5 +1,5 @@ -#include +#include #include "cscore_cpp.h" @@ -9,7 +9,7 @@ extern "C" { } #endif -RPYBUILD_PYBIND11_MODULE(m) { +SEMIWRAP_PYBIND11_MODULE(m) { initWrapper(m); static int unused; // the capsule needs something to reference diff --git a/subprojects/robotpy-cscore/meson.build b/subprojects/robotpy-cscore/meson.build new file mode 100644 index 000000000..ddf089e1e --- /dev/null +++ b/subprojects/robotpy-cscore/meson.build @@ -0,0 +1,26 @@ +project('robotpy-cscore', ['cpp'], + default_options: ['warning_level=1', 'cpp_std=c++20', + 'b_colorout=auto', 'optimization=2', 'b_pie=true']) + +subdir('semiwrap') + +cscore_sources += files( + 'cscore/src/main.cpp', + 'cscore/cvnp/cvnp.cpp', + 'cscore/cvnp/cvnp_synonyms.cpp', +) + +# +# Statically link to cscore/opencv to avoid exporting opencv symbols +# + +cpp = meson.get_compiler('cpp') +libs_path = meson.current_source_dir() + '/lib/lib' + +cscore_deps += [ + cpp.find_library('opencv480', dirs: libs_path), + cpp.find_library('cscore', dirs: libs_path), + cpp.find_library('cameraserver', dirs: libs_path), +] + +subdir('semiwrap/modules') diff --git a/subprojects/robotpy-cscore/pyproject.toml b/subprojects/robotpy-cscore/pyproject.toml index af699aae0..2741f5a6d 100644 --- a/subprojects/robotpy-cscore/pyproject.toml +++ b/subprojects/robotpy-cscore/pyproject.toml @@ -1,68 +1,92 @@ -[tool.robotpy-build.metadata] -name = "robotpy-cscore" -description = "RobotPy bindings for cscore image processing library" -author = "RobotPy Development Team" -author_email = "robotpy@googlegroups.com" -url = "https://github.com/robotpy/robotpy-cscore" -license = "BSD-3-Clause" -install_requires = [ - "robotpy-wpiutil==THIS_VERSION", - "robotpy-wpinet==THIS_VERSION", - "pyntcore==THIS_VERSION", -] - [build-system] +build-backend = "hatchling.build" requires = [ - "robotpy-build~=2025.1.0", - "robotpy-wpiutil~=2025.3.2", - "robotpy-wpinet~=2025.3.2", - "pyntcore~=2025.3.2", + "semiwrap~=0.1", + "hatch-meson~=0.1.0b2", + "hatch-robotpy~=0.2", + "hatchling", + "robotpy-wpiutil==2025.3.2.2", + "robotpy-wpinet==2025.3.2.2", + "pyntcore==2025.3.2.2", # "numpy", # required for pybind11-stubgen to not complain, broken in raspbian CI ] -[tool.robotpy-build] -base_package = "cscore" -update_init = [ - "cscore" +[project] +name = "robotpy-cscore" +version = "2025.3.2.2" +description = "RobotPy bindings for cscore image processing library" +authors = [ + {name = "RobotPy Development Team", email = "robotpy@googlegroups.com"}, +] +license = "BSD-3-Clause" +dependencies = [ + "robotpy-wpiutil==2025.3.2.2", + "robotpy-wpinet==2025.3.2.2", + "pyntcore==2025.3.2.2", ] -[tool.robotpy-build.static_libs."cscore_cpp".maven_lib_download] +[project.urls] +"Source code" = "https://github.com/robotpy/mostrobotpy" + +[tool.hatch.build.targets.wheel] +packages = ["cscore"] + +[tool.hatch.build.hooks.robotpy] +version_file = "cscore/version.py" + +# +# cscore is different -- we download everything as a static library +# and don't include them in the wheel to avoid OpenCV symbol conflicts +# + + +[[tool.hatch.build.hooks.robotpy.maven_lib_download]] artifact_id = "cscore-cpp" group_id = "edu.wpi.first.cscore" repo_url = "https://frcmaven.wpi.edu/artifactory/release" version = "2025.3.2" -libs = ["cscore"] +staticlibs = ["cscore"] +extract_to = "lib" -[tool.robotpy-build.static_libs."cameraserver_cpp".maven_lib_download] +[[tool.hatch.build.hooks.robotpy.maven_lib_download]] artifact_id = "cameraserver-cpp" group_id = "edu.wpi.first.cameraserver" repo_url = "https://frcmaven.wpi.edu/artifactory/release" version = "2025.3.2" -libs = ["cameraserver"] +staticlibs = ["cameraserver"] +extract_to = "lib" -[tool.robotpy-build.static_libs."opencv_cpp".maven_lib_download] +[[tool.hatch.build.hooks.robotpy.maven_lib_download]] artifact_id = "opencv-cpp" group_id = "edu.wpi.first.thirdparty.frc2024.opencv" repo_url = "https://frcmaven.wpi.edu/artifactory/release" version = "4.8.0-1" -libs = ["opencv480"] +staticlibs = ["opencv480"] +extract_to = "lib" -[tool.robotpy-build.wrappers."cscore"] -name = "cscore" -sources = [ - "cscore/src/main.cpp", - "cscore/cvnp/cvnp.cpp", - "cscore/cvnp/cvnp_synonyms.cpp", +[tool.hatch.build.hooks.semiwrap] + +[tool.hatch.build.hooks.meson] + + +[tool.semiwrap] +update_init = [ + "cscore" ] -depends = ["wpiutil", "wpinet", "ntcore", "opencv_cpp", "cscore_cpp", "cameraserver_cpp", ] -generation_data = "gen" +[tool.semiwrap.extension_modules."cscore._cscore"] +name = "cscore" + +depends = ["wpiutil", "wpinet", "ntcore", "cscore-casters"] +includes = [ + "lib/include" +] -[tool.robotpy-build.wrappers."cscore".autogen_headers] +[tool.semiwrap.extension_modules."cscore._cscore".headers] # cameraserver CameraServer = "cameraserver/CameraServer.h" @@ -72,6 +96,10 @@ cscore_oo = "cscore_oo.h" cscore_cv = "cscore_cv.h" cscore_runloop = "cscore_runloop.h" -[[tool.robotpy-build.wrappers."cscore".type_casters]] +[tool.semiwrap.export_type_casters.cscore-casters] +pypackage = "cscore" +includedir = ["cscore"] + +[[tool.semiwrap.export_type_casters.cscore-casters.headers]] header = "cvnp/cvnp.h" types = ["cv::Mat"] diff --git a/subprojects/robotpy-cscore/semiwrap/.gitignore b/subprojects/robotpy-cscore/semiwrap/.gitignore new file mode 100644 index 000000000..6cdce1027 --- /dev/null +++ b/subprojects/robotpy-cscore/semiwrap/.gitignore @@ -0,0 +1,3 @@ +/meson.build +/modules/meson.build +/trampolines/meson.build diff --git a/subprojects/robotpy-cscore/gen/CameraServer.yml b/subprojects/robotpy-cscore/semiwrap/CameraServer.yml similarity index 97% rename from subprojects/robotpy-cscore/gen/CameraServer.yml rename to subprojects/robotpy-cscore/semiwrap/CameraServer.yml index 874cc2cc0..ad06074bc 100644 --- a/subprojects/robotpy-cscore/gen/CameraServer.yml +++ b/subprojects/robotpy-cscore/semiwrap/CameraServer.yml @@ -1,10 +1,9 @@ ---- extra_includes: - optional classes: - CameraServer: + frc::CameraServer: attributes: kBasePort: kSize640x480: @@ -56,7 +55,7 @@ classes: AddCamera: RemoveCamera: SetSize: - inline_code: | + inline_code: |- .def_static("waitForever", []() { auto time_module = py::module::import("time"); while (true) { @@ -66,4 +65,4 @@ classes: .def_static("enableLogging", [](std::optional level) { auto lm = py::module::import("cscore._logging"); lm.attr("enableLogging")(level); - }, py::arg("level") = py::none(), py::doc("Enable cscore logging")) \ No newline at end of file + }, py::arg("level") = py::none(), py::doc("Enable cscore logging")) diff --git a/subprojects/robotpy-cscore/gen/cscore_cpp.yml b/subprojects/robotpy-cscore/semiwrap/cscore_cpp.yml similarity index 99% rename from subprojects/robotpy-cscore/gen/cscore_cpp.yml rename to subprojects/robotpy-cscore/semiwrap/cscore_cpp.yml index c8e7166ac..29c63fde3 100644 --- a/subprojects/robotpy-cscore/gen/cscore_cpp.yml +++ b/subprojects/robotpy-cscore/semiwrap/cscore_cpp.yml @@ -1,4 +1,3 @@ ---- functions: GetPropertyKind: @@ -242,7 +241,7 @@ functions: GetNetworkInterfaces: ignore: true classes: - UsbCameraInfo: + cs::UsbCameraInfo: attributes: dev: path: @@ -250,7 +249,7 @@ classes: otherPaths: vendorId: productId: - VideoMode: + cs::VideoMode: force_no_trampoline: true ignored_bases: - CS_VideoMode @@ -269,7 +268,7 @@ classes: .def_readwrite("width", &VideoMode::width) .def_readwrite("height", &VideoMode::height) .def_readwrite("fps", &VideoMode::fps) - RawEvent: + cs::RawEvent: attributes: kind: ignore: true diff --git a/subprojects/robotpy-cscore/gen/cscore_cv.yml b/subprojects/robotpy-cscore/semiwrap/cscore_cv.yml similarity index 98% rename from subprojects/robotpy-cscore/gen/cscore_cv.yml rename to subprojects/robotpy-cscore/semiwrap/cscore_cv.yml index 80e1226a6..90339a716 100644 --- a/subprojects/robotpy-cscore/gen/cscore_cv.yml +++ b/subprojects/robotpy-cscore/semiwrap/cscore_cv.yml @@ -1,4 +1,3 @@ ---- extra_includes: - opencv2/core/core.hpp @@ -24,7 +23,7 @@ functions: GrabSinkFrameTimeout: ignore: true classes: - CvSource: + cs::CvSource: doc: A source for user code to provide OpenCV images as video frames. force_no_trampoline: true methods: @@ -35,7 +34,7 @@ classes: std::string_view, const VideoMode&: std::string_view, VideoMode::PixelFormat, int, int, int: PutFrame: - CvSink: + cs::CvSink: doc: A sink for user code to accept video frames as OpenCV images. force_no_trampoline: true methods: diff --git a/subprojects/robotpy-cscore/gen/cscore_oo.yml b/subprojects/robotpy-cscore/semiwrap/cscore_oo.yml similarity index 95% rename from subprojects/robotpy-cscore/gen/cscore_oo.yml rename to subprojects/robotpy-cscore/semiwrap/cscore_oo.yml index 103fbb4d5..e04b6281e 100644 --- a/subprojects/robotpy-cscore/gen/cscore_oo.yml +++ b/subprojects/robotpy-cscore/semiwrap/cscore_oo.yml @@ -1,7 +1,6 @@ ---- classes: - VideoProperty: + cs::VideoProperty: enums: Kind: methods: @@ -25,7 +24,7 @@ classes: SetString: GetChoices: GetLastStatus: - VideoSource: + cs::VideoSource: enums: Kind: ConnectionStrategy: @@ -62,7 +61,7 @@ classes: GetLastStatus: EnumerateSinks: EnumerateSources: - VideoCamera: + cs::VideoCamera: force_no_trampoline: true enums: WhiteBalance: @@ -79,7 +78,7 @@ classes: SetExposureAuto: SetExposureHoldCurrent: SetExposureManual: - UsbCamera: + cs::UsbCamera: force_no_trampoline: true methods: UsbCamera: @@ -92,7 +91,7 @@ classes: GetPath: GetInfo: SetConnectVerbose: - HttpCamera: + cs::HttpCamera: force_no_trampoline: true constants: - cs::HttpCamera::HttpCameraKind::kUnknown @@ -114,7 +113,7 @@ classes: std::initializer_list: ignore: true GetUrls: - AxisCamera: + cs::AxisCamera: force_no_trampoline: true methods: AxisCamera: @@ -125,7 +124,7 @@ classes: std::string_view, std::span: std::string_view, std::initializer_list: ignore: true - ImageSource: + cs::ImageSource: force_no_trampoline: true methods: NotifyError: @@ -141,7 +140,7 @@ classes: const VideoProperty&, std::initializer_list: ignore: true ImageSource: - VideoSink: + cs::VideoSink: enums: Kind: methods: @@ -164,7 +163,7 @@ classes: GetSourceProperty: GetLastStatus: EnumerateSinks: - MjpegServer: + cs::MjpegServer: force_no_trampoline: true methods: MjpegServer: @@ -178,22 +177,22 @@ classes: SetFPS: SetCompression: SetDefaultCompression: - ImageSink: + cs::ImageSink: force_no_trampoline: true methods: SetDescription: GetError: SetEnabled: ImageSink: - VideoEvent: + cs::VideoEvent: force_no_trampoline: true methods: GetSource: GetSink: GetProperty: - VideoListener: + cs::VideoListener: methods: VideoListener: overloads: "": - std::function, int, bool: \ No newline at end of file + std::function, int, bool: diff --git a/subprojects/robotpy-cscore/gen/cscore_runloop.yml b/subprojects/robotpy-cscore/semiwrap/cscore_runloop.yml similarity index 100% rename from subprojects/robotpy-cscore/gen/cscore_runloop.yml rename to subprojects/robotpy-cscore/semiwrap/cscore_runloop.yml diff --git a/subprojects/robotpy-cscore/setup.py b/subprojects/robotpy-cscore/setup.py deleted file mode 100644 index 3542d0c9a..000000000 --- a/subprojects/robotpy-cscore/setup.py +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env python3 - -from robotpy_build.setup import setup - -setup() From b04de143a27cfa03c4f53904c5aa2ad055b53b4e Mon Sep 17 00:00:00 2001 From: Dustin Spicuzza Date: Sat, 19 Apr 2025 13:57:53 -0400 Subject: [PATCH 11/20] Update robotpy-apriltag to semiwrap --- subprojects/robotpy-apriltag/.gitignore | 7 +- subprojects/robotpy-apriltag/meson.build | 11 +++ subprojects/robotpy-apriltag/pyproject.toml | 72 ++++++++++--------- .../robotpy_apriltag/__init__.py | 4 +- .../robotpy_apriltag/py.typed | 0 .../robotpy_apriltag/src/main.cpp | 4 +- .../robotpy-apriltag/semiwrap/.gitignore | 3 + .../{gen => semiwrap}/AprilTag.yml | 3 +- .../{gen => semiwrap}/AprilTagDetection.yml | 5 +- .../{gen => semiwrap}/AprilTagDetector.yml | 11 ++- .../{gen => semiwrap}/AprilTagFieldLayout.yml | 5 +- .../{gen => semiwrap}/AprilTagFields.yml | 1 - .../AprilTagPoseEstimate.yml | 3 +- .../AprilTagPoseEstimator.yml | 7 +- subprojects/robotpy-apriltag/setup.py | 5 -- 15 files changed, 75 insertions(+), 66 deletions(-) create mode 100644 subprojects/robotpy-apriltag/meson.build create mode 100644 subprojects/robotpy-apriltag/robotpy_apriltag/py.typed create mode 100644 subprojects/robotpy-apriltag/semiwrap/.gitignore rename subprojects/robotpy-apriltag/{gen => semiwrap}/AprilTag.yml (93%) rename subprojects/robotpy-apriltag/{gen => semiwrap}/AprilTagDetection.yml (95%) rename subprojects/robotpy-apriltag/{gen => semiwrap}/AprilTagDetector.yml (95%) rename subprojects/robotpy-apriltag/{gen => semiwrap}/AprilTagFieldLayout.yml (92%) rename subprojects/robotpy-apriltag/{gen => semiwrap}/AprilTagFields.yml (94%) rename subprojects/robotpy-apriltag/{gen => semiwrap}/AprilTagPoseEstimate.yml (79%) rename subprojects/robotpy-apriltag/{gen => semiwrap}/AprilTagPoseEstimator.yml (92%) delete mode 100644 subprojects/robotpy-apriltag/setup.py diff --git a/subprojects/robotpy-apriltag/.gitignore b/subprojects/robotpy-apriltag/.gitignore index 1acb48df0..ec19347c6 100644 --- a/subprojects/robotpy-apriltag/.gitignore +++ b/subprojects/robotpy-apriltag/.gitignore @@ -12,8 +12,7 @@ __pycache__ /robotpy_apriltag/include /robotpy_apriltag/lib -/robotpy_apriltag/_init_apriltag.py -/robotpy_apriltag/pkgcfg.py +/robotpy_apriltag/_init__apriltag.py +/robotpy_apriltag/apriltag.pc /robotpy_apriltag/version.py -/robotpy_apriltag/py.typed -/robotpy_apriltag/rpy-include \ No newline at end of file +/robotpy_apriltag/trampolines \ No newline at end of file diff --git a/subprojects/robotpy-apriltag/meson.build b/subprojects/robotpy-apriltag/meson.build new file mode 100644 index 000000000..fb670b1e1 --- /dev/null +++ b/subprojects/robotpy-apriltag/meson.build @@ -0,0 +1,11 @@ +project('robotpy-apriltag', ['cpp'], + default_options: ['warning_level=1', 'cpp_std=c++20', + 'b_colorout=auto', 'optimization=2', 'b_pie=true']) + +subdir('semiwrap') + +apriltag_sources += files( + 'robotpy_apriltag/src/main.cpp', +) + +subdir('semiwrap/modules') diff --git a/subprojects/robotpy-apriltag/pyproject.toml b/subprojects/robotpy-apriltag/pyproject.toml index c6caf40cf..a18241e7d 100644 --- a/subprojects/robotpy-apriltag/pyproject.toml +++ b/subprojects/robotpy-apriltag/pyproject.toml @@ -1,24 +1,45 @@ -[tool.robotpy-build.metadata] +[build-system] +build-backend = "hatchling.build" +requires = [ + "semiwrap~=0.1", + "hatch-meson~=0.1.0b2", + "hatch-robotpy~=0.2", + "hatchling", + "robotpy-native-apriltag==2025.3.2", + "robotpy-wpiutil==2025.3.2.2", + "robotpy-wpimath==2025.3.2.2", +] + +[project] name = "robotpy-apriltag" +version = "2025.3.2.2" description = "RobotPy bindings for WPILib's AprilTag library" -author = "RobotPy Development Team" -author_email = "robotpy@googlegroups.com" -url = "https://github.com/robotpy/robotpy-cscore" +authors = [ + {name = "RobotPy Development Team", email = "robotpy@googlegroups.com"}, +] license = "BSD-3-Clause" -install_requires = [ - "robotpy-wpiutil==THIS_VERSION", - "robotpy-wpimath==THIS_VERSION", +dependencies = [ + "robotpy-native-apriltag==2025.3.2", + "robotpy-wpiutil==2025.3.2.2", + "robotpy-wpimath==2025.3.2.2", ] -[build-system] -requires = [ - "robotpy-build~=2025.1.0", - "robotpy-wpiutil~=2025.3.2", - "robotpy-wpimath~=2025.3.2", -] +[project.urls] +"Source code" = "https://github.com/robotpy/mostrobotpy" + + +[tool.hatch.build.hooks.robotpy] +version_file = "robotpy_apriltag/version.py" -[tool.robotpy-build] -base_package = "robotpy_apriltag" +[tool.hatch.build.hooks.semiwrap] + +[tool.hatch.build.hooks.meson] + +[tool.hatch.build.targets.wheel] +packages = ["robotpy_apriltag"] + + +[tool.semiwrap] update_init = [ "robotpy_apriltag robotpy_apriltag._apriltag" ] @@ -36,25 +57,12 @@ scan_headers_ignore = [ "tag36h11.h", ] -[tool.robotpy-build.wrappers."robotpy_apriltag".maven_lib_download] -artifact_id = "apriltag-cpp" -group_id = "edu.wpi.first.apriltag" -repo_url = "https://frcmaven.wpi.edu/artifactory/release" -version = "2025.3.2" - -libs = ["apriltag"] - -[tool.robotpy-build.wrappers."robotpy_apriltag"] +[tool.semiwrap.extension_modules."robotpy_apriltag._apriltag"] name = "apriltag" +wraps = ["robotpy-native-apriltag"] +depends = ["wpiutil", "wpimath"] -sources = [ - "robotpy_apriltag/src/main.cpp", -] - -depends = ["wpiutil", "wpimath_cpp"] -generation_data = "gen" - -[tool.robotpy-build.wrappers."robotpy_apriltag".autogen_headers] +[tool.semiwrap.extension_modules."robotpy_apriltag._apriltag".headers] # frc/apriltag AprilTag = "frc/apriltag/AprilTag.h" AprilTagDetection = "frc/apriltag/AprilTagDetection.h" diff --git a/subprojects/robotpy-apriltag/robotpy_apriltag/__init__.py b/subprojects/robotpy-apriltag/robotpy_apriltag/__init__.py index f40314d4e..233e3e6d9 100644 --- a/subprojects/robotpy-apriltag/robotpy_apriltag/__init__.py +++ b/subprojects/robotpy-apriltag/robotpy_apriltag/__init__.py @@ -1,6 +1,6 @@ -from . import _init_apriltag +from . import _init__apriltag -# autogenerated by 'robotpy-build create-imports robotpy_apriltag robotpy_apriltag._apriltag' +# autogenerated by 'semiwrap create-imports robotpy_apriltag robotpy_apriltag._apriltag' from ._apriltag import ( AprilTag, AprilTagDetection, diff --git a/subprojects/robotpy-apriltag/robotpy_apriltag/py.typed b/subprojects/robotpy-apriltag/robotpy_apriltag/py.typed new file mode 100644 index 000000000..e69de29bb diff --git a/subprojects/robotpy-apriltag/robotpy_apriltag/src/main.cpp b/subprojects/robotpy-apriltag/robotpy_apriltag/src/main.cpp index c734f989f..caba6f678 100644 --- a/subprojects/robotpy-apriltag/robotpy_apriltag/src/main.cpp +++ b/subprojects/robotpy-apriltag/robotpy_apriltag/src/main.cpp @@ -1,4 +1,4 @@ -#include "rpygen_wrapper.hpp" +#include "semiwrap_init.robotpy_apriltag._apriltag.hpp" -RPYBUILD_PYBIND11_MODULE(m) { initWrapper(m); } +SEMIWRAP_PYBIND11_MODULE(m) { initWrapper(m); } diff --git a/subprojects/robotpy-apriltag/semiwrap/.gitignore b/subprojects/robotpy-apriltag/semiwrap/.gitignore new file mode 100644 index 000000000..6cdce1027 --- /dev/null +++ b/subprojects/robotpy-apriltag/semiwrap/.gitignore @@ -0,0 +1,3 @@ +/meson.build +/modules/meson.build +/trampolines/meson.build diff --git a/subprojects/robotpy-apriltag/gen/AprilTag.yml b/subprojects/robotpy-apriltag/semiwrap/AprilTag.yml similarity index 93% rename from subprojects/robotpy-apriltag/gen/AprilTag.yml rename to subprojects/robotpy-apriltag/semiwrap/AprilTag.yml index 5ad097268..90a268cc1 100644 --- a/subprojects/robotpy-apriltag/gen/AprilTag.yml +++ b/subprojects/robotpy-apriltag/semiwrap/AprilTag.yml @@ -1,4 +1,3 @@ ---- functions: to_json: @@ -6,7 +5,7 @@ functions: from_json: ignore: true classes: - AprilTag: + frc::AprilTag: attributes: ID: pose: diff --git a/subprojects/robotpy-apriltag/gen/AprilTagDetection.yml b/subprojects/robotpy-apriltag/semiwrap/AprilTagDetection.yml similarity index 95% rename from subprojects/robotpy-apriltag/gen/AprilTagDetection.yml rename to subprojects/robotpy-apriltag/semiwrap/AprilTagDetection.yml index 857c794a8..af100ecb3 100644 --- a/subprojects/robotpy-apriltag/gen/AprilTagDetection.yml +++ b/subprojects/robotpy-apriltag/semiwrap/AprilTagDetection.yml @@ -1,10 +1,9 @@ ---- extra_includes: - pybind11/eigen.h classes: - AprilTagDetection: + frc::AprilTagDetection: methods: GetFamily: GetId: @@ -20,7 +19,7 @@ classes: return py::str("") .format(self.GetFamily(), self.GetId(), self.GetHamming(), self.GetDecisionMargin(), self.GetCenter()); }) - AprilTagDetection::Point: + frc::AprilTagDetection::Point: attributes: x: y: diff --git a/subprojects/robotpy-apriltag/gen/AprilTagDetector.yml b/subprojects/robotpy-apriltag/semiwrap/AprilTagDetector.yml similarity index 95% rename from subprojects/robotpy-apriltag/gen/AprilTagDetector.yml rename to subprojects/robotpy-apriltag/semiwrap/AprilTagDetector.yml index fa2fbc34c..d22d7ddbd 100644 --- a/subprojects/robotpy-apriltag/gen/AprilTagDetector.yml +++ b/subprojects/robotpy-apriltag/semiwrap/AprilTagDetector.yml @@ -1,10 +1,9 @@ ---- extra_includes: - pybind11_typing.h classes: - AprilTagDetector: + frc::AprilTagDetector: methods: AprilTagDetector: SetConfig: @@ -61,7 +60,7 @@ classes: :return: list of results )doc" ) - AprilTagDetector::Config: + frc::AprilTagDetector::Config: attributes: numThreads: quadDecimate: @@ -71,7 +70,7 @@ classes: debug: methods: operator==: - AprilTagDetector::QuadThresholdParameters: + frc::AprilTagDetector::QuadThresholdParameters: attributes: minClusterPixels: maxNumMaxima: @@ -81,7 +80,7 @@ classes: deglitch: methods: operator==: - AprilTagDetector::Results: + frc::AprilTagDetector::Results: rename: _Results ignored_bases: - std::span @@ -89,7 +88,7 @@ classes: methods: Results: overloads: - "": + '': ignore: true void*, const private_init&: ignore: true diff --git a/subprojects/robotpy-apriltag/gen/AprilTagFieldLayout.yml b/subprojects/robotpy-apriltag/semiwrap/AprilTagFieldLayout.yml similarity index 92% rename from subprojects/robotpy-apriltag/gen/AprilTagFieldLayout.yml rename to subprojects/robotpy-apriltag/semiwrap/AprilTagFieldLayout.yml index 0ab67cd68..6f8a7ede6 100644 --- a/subprojects/robotpy-apriltag/gen/AprilTagFieldLayout.yml +++ b/subprojects/robotpy-apriltag/semiwrap/AprilTagFieldLayout.yml @@ -1,4 +1,3 @@ ---- functions: to_json: @@ -8,13 +7,13 @@ functions: LoadAprilTagLayoutField: ignore: true classes: - AprilTagFieldLayout: + frc::AprilTagFieldLayout: enums: OriginPosition: methods: AprilTagFieldLayout: overloads: - "": + '': std::string_view: std::vector, units::meter_t, units::meter_t: LoadField: diff --git a/subprojects/robotpy-apriltag/gen/AprilTagFields.yml b/subprojects/robotpy-apriltag/semiwrap/AprilTagFields.yml similarity index 94% rename from subprojects/robotpy-apriltag/gen/AprilTagFields.yml rename to subprojects/robotpy-apriltag/semiwrap/AprilTagFields.yml index 36d88aaca..0939cbef0 100644 --- a/subprojects/robotpy-apriltag/gen/AprilTagFields.yml +++ b/subprojects/robotpy-apriltag/semiwrap/AprilTagFields.yml @@ -1,4 +1,3 @@ ---- enums: AprilTagField: diff --git a/subprojects/robotpy-apriltag/gen/AprilTagPoseEstimate.yml b/subprojects/robotpy-apriltag/semiwrap/AprilTagPoseEstimate.yml similarity index 79% rename from subprojects/robotpy-apriltag/gen/AprilTagPoseEstimate.yml rename to subprojects/robotpy-apriltag/semiwrap/AprilTagPoseEstimate.yml index bbfcd9a58..5d0eb510b 100644 --- a/subprojects/robotpy-apriltag/gen/AprilTagPoseEstimate.yml +++ b/subprojects/robotpy-apriltag/semiwrap/AprilTagPoseEstimate.yml @@ -1,7 +1,6 @@ ---- classes: - AprilTagPoseEstimate: + frc::AprilTagPoseEstimate: attributes: pose1: pose2: diff --git a/subprojects/robotpy-apriltag/gen/AprilTagPoseEstimator.yml b/subprojects/robotpy-apriltag/semiwrap/AprilTagPoseEstimator.yml similarity index 92% rename from subprojects/robotpy-apriltag/gen/AprilTagPoseEstimator.yml rename to subprojects/robotpy-apriltag/semiwrap/AprilTagPoseEstimator.yml index 557b7ad3f..ec89f1f9e 100644 --- a/subprojects/robotpy-apriltag/gen/AprilTagPoseEstimator.yml +++ b/subprojects/robotpy-apriltag/semiwrap/AprilTagPoseEstimator.yml @@ -1,10 +1,9 @@ ---- extra_includes: - frc/apriltag/AprilTagDetection.h classes: - AprilTagPoseEstimator: + frc::AprilTagPoseEstimator: methods: AprilTagPoseEstimator: SetConfig: @@ -21,7 +20,7 @@ classes: overloads: const AprilTagDetection& [const]: std::span, std::span [const]: - AprilTagPoseEstimator::Config: + frc::AprilTagPoseEstimator::Config: force_no_default_constructor: true attributes: tagSize: @@ -31,7 +30,7 @@ classes: cy: methods: operator==: - inline_code: + inline_code: | .def(py::init([](units::meter_t tagSize, double fx, double fy, double cx, double cy) { AprilTagPoseEstimator::Config cfg{tagSize, fx, fy, cx, cy}; return std::make_unique(std::move(cfg)); diff --git a/subprojects/robotpy-apriltag/setup.py b/subprojects/robotpy-apriltag/setup.py deleted file mode 100644 index 3542d0c9a..000000000 --- a/subprojects/robotpy-apriltag/setup.py +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env python3 - -from robotpy_build.setup import setup - -setup() From 2494329eb79b7aa568c4f11f4c905cf8c56e393c Mon Sep 17 00:00:00 2001 From: Dustin Spicuzza Date: Sat, 19 Apr 2025 18:08:53 -0400 Subject: [PATCH 12/20] Update robotpy-wpilib to semiwrap --- subprojects/robotpy-wpilib/.gitignore | 52 ++--- subprojects/robotpy-wpilib/gen/I2C.yml | 29 --- subprojects/robotpy-wpilib/meson.build | 46 ++++ subprojects/robotpy-wpilib/pyproject.toml | 218 ++++++++---------- .../robotpy-wpilib/semiwrap/.gitignore | 3 + .../{gen => semiwrap}/ADIS16448_IMU.yml | 5 +- .../{gen => semiwrap}/ADIS16470_IMU.yml | 5 +- .../{gen => semiwrap}/ADXL345_I2C.yml | 8 +- .../{gen => semiwrap}/ADXL345_SPI.yml | 7 +- .../{gen => semiwrap}/ADXL362.yml | 7 +- .../{gen => semiwrap}/ADXRS450_Gyro.yml | 7 +- .../{gen => semiwrap}/AddressableLED.yml | 11 +- .../{gen => semiwrap}/Alert.yml | 3 +- .../{gen => semiwrap}/AnalogAccelerometer.yml | 5 +- .../{gen => semiwrap}/AnalogEncoder.yml | 5 +- .../{gen => semiwrap}/AnalogGyro.yml | 5 +- .../{gen => semiwrap}/AnalogInput.yml | 5 +- .../{gen => semiwrap}/AnalogOutput.yml | 5 +- .../{gen => semiwrap}/AnalogPotentiometer.yml | 5 +- .../{gen => semiwrap}/AnalogTrigger.yml | 3 +- .../{gen => semiwrap}/AnalogTriggerOutput.yml | 5 +- .../{gen => semiwrap}/AnalogTriggerType.yml | 1 - .../BuiltInAccelerometer.yml | 3 +- .../robotpy-wpilib/{gen => semiwrap}/CAN.yml | 16 +- .../{gen => semiwrap}/Color.yml | 3 +- .../{gen => semiwrap}/Color8Bit.yml | 3 +- .../{gen => semiwrap}/Compressor.yml | 3 +- .../CompressorConfigType.yml | 1 - .../{gen => semiwrap}/Controller.yml | 3 +- .../{gen => semiwrap}/Counter.yml | 5 +- .../robotpy-wpilib/{gen => semiwrap}/DMA.yml | 5 +- .../{gen => semiwrap}/DMASample.yml | 5 +- .../{gen => semiwrap}/DMC60.yml | 5 +- .../{gen => semiwrap}/DSControlWord.yml | 3 +- .../{gen => semiwrap}/DataLogManager.yml | 3 +- .../DifferentialDriveVoltageConstraint.yml | 5 +- .../{gen => semiwrap}/DigitalGlitchFilter.yml | 5 +- .../{gen => semiwrap}/DigitalInput.yml | 5 +- .../{gen => semiwrap}/DigitalOutput.yml | 5 +- .../{gen => semiwrap}/DigitalSource.yml | 5 +- .../{gen => semiwrap}/DoubleSolenoid.yml | 5 +- .../{gen => semiwrap}/DriverStation.yml | 3 +- .../DriverStationModeThread.yml | 3 +- .../{gen => semiwrap}/DutyCycle.yml | 5 +- .../{gen => semiwrap}/DutyCycleEncoder.yml | 5 +- .../{gen => semiwrap}/Encoder.yml | 5 +- .../{gen => semiwrap}/Errors.yml | 3 +- .../{gen => semiwrap}/Field2d.yml | 5 +- .../{gen => semiwrap}/FieldObject2d.yml | 5 +- .../{gen => semiwrap}/Filesystem.yml | 1 - .../{gen => semiwrap}/Filter.yml | 5 +- subprojects/robotpy-wpilib/semiwrap/I2C.yml | 26 +++ .../InterruptableSensorBase.yml | 7 +- .../{gen => semiwrap}/IterativeRobot.yml | 5 +- .../{gen => semiwrap}/IterativeRobotBase.yml | 5 +- .../{gen => semiwrap}/Jaguar.yml | 5 +- .../{gen => semiwrap}/Joystick.yml | 3 +- .../{gen => semiwrap}/LEDPattern.yml | 9 +- .../{gen => semiwrap}/ListenerExecutor.yml | 5 +- .../{gen => semiwrap}/LiveWindow.yml | 3 +- .../{gen => semiwrap}/Mechanism2d.yml | 3 +- .../{gen => semiwrap}/MechanismLigament2d.yml | 3 +- .../{gen => semiwrap}/MechanismObject2d.yml | 7 +- .../{gen => semiwrap}/MechanismRoot2d.yml | 7 +- .../MotorControllerGroup.yml | 3 +- .../{gen => semiwrap}/MotorSafety.yml | 7 +- .../{gen => semiwrap}/NidecBrushless.yml | 5 +- .../{gen => semiwrap}/Notifier.yml | 5 +- .../{gen => semiwrap}/PS4Controller.yml | 7 +- .../{gen => semiwrap}/PS5Controller.yml | 7 +- .../robotpy-wpilib/{gen => semiwrap}/PWM.yml | 5 +- .../{gen => semiwrap}/PWMMotorController.yml | 3 +- .../{gen => semiwrap}/PWMSparkFlex.yml | 3 +- .../{gen => semiwrap}/PWMSparkMax.yml | 5 +- .../{gen => semiwrap}/PWMSpeedController.yml | 5 +- .../{gen => semiwrap}/PWMTalonFX.yml | 5 +- .../{gen => semiwrap}/PWMTalonSRX.yml | 5 +- .../{gen => semiwrap}/PWMVenom.yml | 5 +- .../{gen => semiwrap}/PWMVictorSPX.yml | 5 +- .../{gen => semiwrap}/PneumaticHub.yml | 11 +- .../{gen => semiwrap}/PneumaticsBase.yml | 3 +- .../PneumaticsControlModule.yml | 5 +- .../PneumaticsModuleType.yml | 1 - .../{gen => semiwrap}/Potentiometer.yml | 5 +- .../{gen => semiwrap}/PowerDistribution.yml | 11 +- .../{gen => semiwrap}/Preferences.yml | 3 +- .../{gen => semiwrap}/Relay.yml | 5 +- .../{gen => semiwrap}/Resource.yml | 5 +- .../{gen => semiwrap}/RobotBase.yml | 7 +- .../{gen => semiwrap}/RobotController.yml | 8 +- .../{gen => semiwrap}/RobotState.yml | 5 +- .../{gen => semiwrap}/RuntimeType.yml | 1 - .../{gen => semiwrap}/SD540.yml | 5 +- .../robotpy-wpilib/{gen => semiwrap}/SPI.yml | 15 +- .../{gen => semiwrap}/SendableBuilderImpl.yml | 5 +- .../SendableCameraWrapper.yml | 5 +- .../{gen => semiwrap}/SendableChooser.yml | 7 +- .../{gen => semiwrap}/SendableChooserBase.yml | 5 +- .../{gen => semiwrap}/SensorUtil.yml | 3 +- .../{gen => semiwrap}/SerialPort.yml | 9 +- .../{gen => semiwrap}/Servo.yml | 5 +- .../{gen => semiwrap}/SharpIR.yml | 3 +- .../{gen => semiwrap}/SimpleWidget.yml | 7 +- .../{gen => semiwrap}/SlewRateLimiter.yml | 7 +- .../{gen => semiwrap}/SmartDashboard.yml | 7 +- .../{gen => semiwrap}/Solenoid.yml | 5 +- .../{gen => semiwrap}/SolenoidBase.yml | 7 +- .../{gen => semiwrap}/Spark.yml | 5 +- .../{gen => semiwrap}/StadiaController.yml | 7 +- .../SynchronousInterrupt.yml | 3 +- .../{gen => semiwrap}/SysIdRoutineLog.yml | 5 +- .../{gen => semiwrap}/Talon.yml | 5 +- .../{gen => semiwrap}/Threads.yml | 1 - .../{gen => semiwrap}/TimedRobot.yml | 7 +- .../{gen => semiwrap}/Timer.yml | 5 +- .../{gen => semiwrap}/TimesliceRobot.yml | 3 +- .../{gen => semiwrap}/Tracer.yml | 11 +- .../{gen => semiwrap}/Ultrasonic.yml | 5 +- .../{gen => semiwrap}/Utility.yml | 1 - .../{gen => semiwrap}/Victor.yml | 5 +- .../{gen => semiwrap}/VictorSP.yml | 5 +- .../{gen => semiwrap}/WPIErrors.yml | 1 - .../{gen => semiwrap}/WPILibVersion.yml | 1 - .../{gen => semiwrap}/Watchdog.yml | 5 +- .../{gen => semiwrap}/XboxController.yml | 7 +- .../counter/EdgeConfiguration.yml | 1 - .../counter/ExternalDirectionCounter.yml | 3 +- .../{gen => semiwrap}/counter/Tachometer.yml | 3 +- .../counter/UpDownCounter.yml | 3 +- .../drive/DifferentialDrive.yml | 8 +- .../{gen => semiwrap}/drive/MecanumDrive.yml | 7 +- .../drive/RobotDriveBase.yml | 5 +- .../{gen => semiwrap}/event/BooleanEvent.yml | 3 +- .../{gen => semiwrap}/event/EventLoop.yml | 3 +- .../event/NetworkBooleanEvent.yml | 5 +- .../interfaces}/CounterBase.yml | 5 +- .../interfaces}/GenericHID.yml | 5 +- .../interfaces}/MotorController.yml | 5 +- .../shuffleboard/BuiltInLayouts.yml | 1 - .../shuffleboard/BuiltInWidgets.yml | 1 - .../shuffleboard/ComplexWidget.yml | 3 +- .../shuffleboard/LayoutType.yml | 3 +- .../shuffleboard/RecordingController.yml | 3 +- .../shuffleboard/Shuffleboard.yml | 3 +- .../shuffleboard/ShuffleboardComponent.yml | 5 +- .../ShuffleboardComponentBase.yml | 3 +- .../shuffleboard/ShuffleboardContainer.yml | 3 +- .../ShuffleboardEventImportance.yml | 1 - .../shuffleboard/ShuffleboardInstance.yml | 3 +- .../shuffleboard/ShuffleboardLayout.yml | 3 +- .../shuffleboard/ShuffleboardRoot.yml | 3 +- .../shuffleboard/ShuffleboardTab.yml | 3 +- .../shuffleboard/ShuffleboardValue.yml | 3 +- .../shuffleboard/ShuffleboardWidget.yml | 4 +- .../shuffleboard/SimpleWidget.yml | 5 +- .../shuffleboard/SuppliedValueWidget.yml | 3 +- .../shuffleboard/WidgetType.yml | 3 +- .../simulation/ADIS16448_IMUSim.yml | 3 +- .../simulation/ADIS16470_IMUSim.yml | 3 +- .../simulation/ADXL345Sim.yml | 3 +- .../simulation/ADXL362Sim.yml | 3 +- .../simulation/ADXRS450_GyroSim.yml | 5 +- .../simulation/AddressableLEDSim.yml | 7 +- .../simulation/AnalogEncoderSim.yml | 5 +- .../simulation/AnalogGyroSim.yml | 5 +- .../simulation/AnalogInputSim.yml | 5 +- .../simulation/AnalogOutputSim.yml | 5 +- .../simulation/AnalogTriggerSim.yml | 5 +- .../simulation/BatterySim.yml | 5 +- .../simulation/BuiltInAccelerometerSim.yml | 7 +- .../simulation/CTREPCMSim.yml | 7 +- .../simulation/CallbackStore.yml | 6 +- .../simulation/DCMotorSim.yml | 3 +- .../{gen => semiwrap}/simulation/DIOSim.yml | 5 +- .../simulation/DifferentialDrivetrainSim.yml | 24 +- .../simulation/DigitalPWMSim.yml | 5 +- .../simulation/DoubleSolenoidSim.yml | 3 +- .../simulation/DriverStationSim.yml | 5 +- .../simulation/DutyCycleEncoderSim.yml | 5 +- .../simulation/DutyCycleSim.yml | 5 +- .../simulation/ElevatorSim.yml | 21 +- .../simulation/EncoderSim.yml | 5 +- .../simulation/FlywheelSim.yml | 8 +- .../simulation/GenericHIDSim.yml | 5 +- .../simulation/JoystickSim.yml | 5 +- .../simulation/LinearSystemSim.yml | 10 +- .../simulation/Mechanism2D.yml | 5 +- .../{gen => semiwrap}/simulation/PCMSim.yml | 7 +- .../{gen => semiwrap}/simulation/PDPSim.yml | 5 +- .../simulation/PS4ControllerSim.yml | 3 +- .../simulation/PS5ControllerSim.yml | 5 +- .../{gen => semiwrap}/simulation/PWMSim.yml | 5 +- .../simulation/PneumaticsBaseSim.yml | 3 +- .../simulation/PowerDistributionSim.yml | 3 +- .../{gen => semiwrap}/simulation/REVPHSim.yml | 5 +- .../{gen => semiwrap}/simulation/RelaySim.yml | 5 +- .../simulation/RoboRioSim.yml | 5 +- .../simulation/SPIAccelerometerSim.yml | 5 +- .../simulation/SendableChooserSim.yml | 3 +- .../simulation/SharpIRSim.yml | 3 +- .../simulation/SimDeviceSim.yml | 5 +- .../{gen => semiwrap}/simulation/SimHooks.yml | 1 - .../simulation/SingleJointedArmSim.yml | 18 +- .../simulation/SolenoidSim.yml | 5 +- .../simulation/StadiaControllerSim.yml | 3 +- .../simulation/UltrasonicSim.yml | 3 +- .../simulation/XboxControllerSim.yml | 3 +- subprojects/robotpy-wpilib/setup.py | 5 - subprojects/robotpy-wpilib/wpilib/__init__.py | 6 +- .../robotpy-wpilib/wpilib/_impl/__init__.py | 1 - .../robotpy-wpilib/wpilib/counter/__init__.py | 4 +- .../robotpy-wpilib/wpilib/counter/counter.cpp | 4 +- .../robotpy-wpilib/wpilib/drive/__init__.py | 6 +- .../robotpy-wpilib/wpilib/drive/drive.cpp | 4 +- .../robotpy-wpilib/wpilib/event/__init__.py | 4 +- .../robotpy-wpilib/wpilib/event/event.cpp | 4 +- .../wpilib/interfaces/__init__.py | 6 +- .../wpilib/interfaces/interfaces.cpp | 4 +- subprojects/robotpy-wpilib/wpilib/py.typed | 0 .../wpilib/shuffleboard/ShuffleboardData.h | 2 +- .../wpilib/shuffleboard/__init__.py | 6 +- .../wpilib/shuffleboard/shuffleboard.cpp | 4 +- .../wpilib/simulation/__init__.py | 6 +- .../wpilib/simulation/simulation.cpp | 4 +- .../robotpy-wpilib/wpilib/src/main.cpp | 4 +- .../wpilib/src/rpy/Filesystem.inc | 2 +- .../robotpy-wpilib/wpilib/src/rpy/Notifier.h | 2 +- .../wpilib/src/rpy/SmartDashboardData.h | 2 +- .../robotpy-wpilib/wpilib/sysid/__init__.py | 2 +- 229 files changed, 522 insertions(+), 933 deletions(-) delete mode 100644 subprojects/robotpy-wpilib/gen/I2C.yml create mode 100644 subprojects/robotpy-wpilib/meson.build create mode 100644 subprojects/robotpy-wpilib/semiwrap/.gitignore rename subprojects/robotpy-wpilib/{gen => semiwrap}/ADIS16448_IMU.yml (96%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/ADIS16470_IMU.yml (96%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/ADXL345_I2C.yml (87%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/ADXL345_SPI.yml (91%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/ADXL362.yml (89%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/ADXRS450_Gyro.yml (86%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/AddressableLED.yml (86%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/Alert.yml (97%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/AnalogAccelerometer.yml (89%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/AnalogEncoder.yml (95%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/AnalogGyro.yml (94%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/AnalogInput.yml (96%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/AnalogOutput.yml (91%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/AnalogPotentiometer.yml (89%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/AnalogTrigger.yml (97%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/AnalogTriggerOutput.yml (88%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/AnalogTriggerType.yml (87%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/BuiltInAccelerometer.yml (91%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/CAN.yml (69%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/Color.yml (99%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/Color8Bit.yml (98%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/Compressor.yml (96%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/CompressorConfigType.yml (88%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/Controller.yml (78%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/Counter.yml (98%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/DMA.yml (93%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/DMASample.yml (91%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/DMC60.yml (70%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/DSControlWord.yml (96%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/DataLogManager.yml (90%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/DifferentialDriveVoltageConstraint.yml (63%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/DigitalGlitchFilter.yml (91%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/DigitalInput.yml (89%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/DigitalOutput.yml (91%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/DigitalSource.yml (90%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/DoubleSolenoid.yml (90%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/DriverStation.yml (98%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/DriverStationModeThread.yml (79%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/DutyCycle.yml (94%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/DutyCycleEncoder.yml (96%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/Encoder.yml (97%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/Errors.yml (89%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/Field2d.yml (92%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/FieldObject2d.yml (92%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/Filesystem.yml (97%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/Filter.yml (87%) create mode 100644 subprojects/robotpy-wpilib/semiwrap/I2C.yml rename subprojects/robotpy-wpilib/{gen => semiwrap}/InterruptableSensorBase.yml (90%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/IterativeRobot.yml (66%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/IterativeRobotBase.yml (97%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/Jaguar.yml (70%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/Joystick.yml (98%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/LEDPattern.yml (90%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/ListenerExecutor.yml (57%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/LiveWindow.yml (97%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/Mechanism2d.yml (92%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/MechanismLigament2d.yml (89%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/MechanismObject2d.yml (94%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/MechanismRoot2d.yml (95%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/MotorControllerGroup.yml (97%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/MotorSafety.yml (79%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/NidecBrushless.yml (89%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/Notifier.yml (91%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/PS4Controller.yml (96%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/PS5Controller.yml (96%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/PWM.yml (95%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/PWMMotorController.yml (95%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/PWMSparkFlex.yml (67%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/PWMSparkMax.yml (68%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/PWMSpeedController.yml (83%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/PWMTalonFX.yml (69%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/PWMTalonSRX.yml (68%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/PWMVenom.yml (69%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/PWMVictorSPX.yml (68%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/PneumaticHub.yml (93%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/PneumaticsBase.yml (97%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/PneumaticsControlModule.yml (96%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/PneumaticsModuleType.yml (88%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/Potentiometer.yml (64%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/PowerDistribution.yml (94%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/Preferences.yml (96%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/Relay.yml (93%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/Resource.yml (81%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/RobotBase.yml (97%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/RobotController.yml (93%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/RobotState.yml (83%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/RuntimeType.yml (85%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/SD540.yml (70%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/SPI.yml (85%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/SendableBuilderImpl.yml (96%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/SendableCameraWrapper.yml (82%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/SendableChooser.yml (92%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/SendableChooserBase.yml (91%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/SensorUtil.yml (97%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/SerialPort.yml (90%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/Servo.yml (86%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/SharpIR.yml (94%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/SimpleWidget.yml (76%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/SlewRateLimiter.yml (79%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/SmartDashboard.yml (99%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/Solenoid.yml (90%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/SolenoidBase.yml (93%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/Spark.yml (70%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/StadiaController.yml (96%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/SynchronousInterrupt.yml (92%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/SysIdRoutineLog.yml (91%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/Talon.yml (70%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/Threads.yml (97%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/TimedRobot.yml (81%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/Timer.yml (89%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/TimesliceRobot.yml (72%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/Tracer.yml (82%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/Ultrasonic.yml (95%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/Utility.yml (95%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/Victor.yml (70%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/VictorSP.yml (69%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/WPIErrors.yml (99%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/WPILibVersion.yml (88%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/Watchdog.yml (93%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/XboxController.yml (95%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/counter/EdgeConfiguration.yml (87%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/counter/ExternalDirectionCounter.yml (92%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/counter/Tachometer.yml (96%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/counter/UpDownCounter.yml (94%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/drive/DifferentialDrive.yml (98%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/drive/MecanumDrive.yml (93%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/drive/RobotDriveBase.yml (89%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/event/BooleanEvent.yml (96%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/event/EventLoop.yml (93%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/event/NetworkBooleanEvent.yml (92%) rename subprojects/robotpy-wpilib/{gen => semiwrap/interfaces}/CounterBase.yml (80%) rename subprojects/robotpy-wpilib/{gen => semiwrap/interfaces}/GenericHID.yml (96%) rename subprojects/robotpy-wpilib/{gen => semiwrap/interfaces}/MotorController.yml (73%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/shuffleboard/BuiltInLayouts.yml (86%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/shuffleboard/BuiltInWidgets.yml (86%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/shuffleboard/ComplexWidget.yml (93%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/shuffleboard/LayoutType.yml (76%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/shuffleboard/RecordingController.yml (86%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/shuffleboard/Shuffleboard.yml (96%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/shuffleboard/ShuffleboardComponent.yml (98%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/shuffleboard/ShuffleboardComponentBase.yml (93%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/shuffleboard/ShuffleboardContainer.yml (99%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/shuffleboard/ShuffleboardEventImportance.yml (95%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/shuffleboard/ShuffleboardInstance.yml (91%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/shuffleboard/ShuffleboardLayout.yml (83%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/shuffleboard/ShuffleboardRoot.yml (92%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/shuffleboard/ShuffleboardTab.yml (91%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/shuffleboard/ShuffleboardValue.yml (89%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/shuffleboard/ShuffleboardWidget.yml (98%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/shuffleboard/SimpleWidget.yml (91%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/shuffleboard/SuppliedValueWidget.yml (97%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/shuffleboard/WidgetType.yml (76%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/ADIS16448_IMUSim.yml (89%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/ADIS16470_IMUSim.yml (89%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/ADXL345Sim.yml (89%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/ADXL362Sim.yml (82%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/ADXRS450_GyroSim.yml (71%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/AddressableLEDSim.yml (90%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/AnalogEncoderSim.yml (82%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/AnalogGyroSim.yml (90%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/AnalogInputSim.yml (95%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/AnalogOutputSim.yml (88%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/AnalogTriggerSim.yml (91%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/BatterySim.yml (90%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/BuiltInAccelerometerSim.yml (87%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/CTREPCMSim.yml (91%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/CallbackStore.yml (95%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/DCMotorSim.yml (97%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/DIOSim.yml (94%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/DifferentialDrivetrainSim.yml (88%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/DigitalPWMSim.yml (91%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/DoubleSolenoidSim.yml (90%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/DriverStationSim.yml (96%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/DutyCycleEncoderSim.yml (87%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/DutyCycleSim.yml (91%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/ElevatorSim.yml (88%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/EncoderSim.yml (96%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/FlywheelSim.yml (92%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/GenericHIDSim.yml (90%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/JoystickSim.yml (86%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/LinearSystemSim.yml (95%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/Mechanism2D.yml (68%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/PCMSim.yml (94%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/PDPSim.yml (93%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/PS4ControllerSim.yml (95%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/PS5ControllerSim.yml (91%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/PWMSim.yml (95%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/PneumaticsBaseSim.yml (96%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/PowerDistributionSim.yml (94%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/REVPHSim.yml (95%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/RelaySim.yml (93%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/RoboRioSim.yml (97%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/SPIAccelerometerSim.yml (88%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/SendableChooserSim.yml (84%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/SharpIRSim.yml (86%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/SimDeviceSim.yml (98%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/SimHooks.yml (97%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/SingleJointedArmSim.yml (88%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/SolenoidSim.yml (89%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/StadiaControllerSim.yml (94%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/UltrasonicSim.yml (89%) rename subprojects/robotpy-wpilib/{gen => semiwrap}/simulation/XboxControllerSim.yml (96%) delete mode 100644 subprojects/robotpy-wpilib/setup.py create mode 100644 subprojects/robotpy-wpilib/wpilib/py.typed diff --git a/subprojects/robotpy-wpilib/.gitignore b/subprojects/robotpy-wpilib/.gitignore index 9747e7589..569b089cd 100644 --- a/subprojects/robotpy-wpilib/.gitignore +++ b/subprojects/robotpy-wpilib/.gitignore @@ -17,40 +17,30 @@ build dist MANIFEST -/wpilib/pkgcfg.py -/wpilib/py.typed +/wpilib/wpilib.pc +/wpilib/trampolines /wpilib/version.py -/wpilib/_init_wpilib.py -/wpilib/controller/_init_controller.py -/wpilib/controller/pkgcfg.py -/wpilib/counter/_init_counter.py -/wpilib/counter/pkgcfg.py -/wpilib/drive/_init_drive.py -/wpilib/drive/pkgcfg.py -/wpilib/event/_init_event.py -/wpilib/event/pkgcfg.py -/wpilib/geometry/_init_geometry.py -/wpilib/geometry/pkgcfg.py -/wpilib/interfaces/_init_interfaces.py -/wpilib/interfaces/pkgcfg.py -/wpilib/kinematics/_init_kinematics.py -/wpilib/kinematics/pkgcfg.py -/wpilib/shuffleboard/_init_shuffleboard.py -/wpilib/shuffleboard/pkgcfg.py -/wpilib/simulation/_init_simulation.py -/wpilib/simulation/pkgcfg.py -/wpilib/spline/_init_spline.py -/wpilib/spline/pkgcfg.py -/wpilib/trajectory/_init_trajectory.py -/wpilib/trajectory/pkgcfg.py -/wpilib/trajectory/constraint/_init_constraint.py -/wpilib/trajectory/constraint/pkgcfg.py +/wpilib/_init__wpilib.py +/wpilib/counter/_init__counter.py +/wpilib/counter/wpilib_counter.pc +/wpilib/counter/trampolines +/wpilib/drive/_init__drive.py +/wpilib/drive/wpilib_drive.pc +/wpilib/drive/trampolines +/wpilib/event/_init__event.py +/wpilib/event/wpilib_event.pc +/wpilib/event/trampolines +/wpilib/interfaces/_init__interfaces.py +/wpilib/interfaces/wpilib_interfaces.pc +/wpilib/interfaces/trampolines +/wpilib/shuffleboard/_init__shuffleboard.py +/wpilib/shuffleboard/wpilib_shuffleboard.pc +/wpilib/shuffleboard/trampolines +/wpilib/simulation/_init__simulation.py +/wpilib/simulation/wpilib_simulation.pc +/wpilib/simulation/trampolines rpy-include -/wpilib/_impl/_init_wpilibc.py -/wpilib/_impl/pkgcfg.py -/wpilib/_impl/include -/wpilib/_impl/lib diff --git a/subprojects/robotpy-wpilib/gen/I2C.yml b/subprojects/robotpy-wpilib/gen/I2C.yml deleted file mode 100644 index 8d266278f..000000000 --- a/subprojects/robotpy-wpilib/gen/I2C.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- - -classes: - I2C: - shared_ptr: true - enums: - Port: - methods: - I2C: - GetPort: - GetDeviceAddress: - Transaction: - buffers: - - { type: IN, src: dataToSend, len: sendSize } - - { type: OUT, src: dataReceived, len: receiveSize } - AddressOnly: - Write: - WriteBulk: - buffers: - - { type: IN, src: data, len: count } - Read: - buffers: - - { type: OUT, src: data, len: count } - ReadOnly: - buffers: - - { type: OUT, src: buffer, len: count } - VerifySensor: - buffers: - - { type: IN, src: expected, len: count } diff --git a/subprojects/robotpy-wpilib/meson.build b/subprojects/robotpy-wpilib/meson.build new file mode 100644 index 000000000..814fe9325 --- /dev/null +++ b/subprojects/robotpy-wpilib/meson.build @@ -0,0 +1,46 @@ +project('wpilib', ['cpp'], + default_options: ['warning_level=1', 'cpp_std=c++20', + 'b_colorout=auto', 'optimization=2', 'b_pie=true']) + +subdir('semiwrap') + +dyn_camsrv = declare_dependency(compile_args: ['-DDYNAMIC_CAMERA_SERVER=1']) + +wpilib_sources += files( + 'wpilib/src/main.cpp', + 'wpilib/src/rpy/ControlWord.cpp', + 'wpilib/src/rpy/Notifier.cpp', + 'wpilib/src/rpy/SmartDashboardData.cpp', + 'wpilib/src/rpy/MotorControllerGroup.cpp', +) + +wpilib_deps += [dyn_camsrv] + +wpilib_counter_sources += files( + 'wpilib/counter/counter.cpp', +) + +wpilib_drive_sources += files( + 'wpilib/drive/drive.cpp', +) + +wpilib_event_sources += files( + 'wpilib/event/event.cpp', +) + +wpilib_interfaces_sources += files( + 'wpilib/interfaces/interfaces.cpp', +) + +wpilib_shuffleboard_sources += files( + 'wpilib/shuffleboard/shuffleboard.cpp', + 'wpilib/shuffleboard/ShuffleboardData.cpp', +) + +wpilib_shuffleboard_deps += [dyn_camsrv] + +wpilib_simulation_sources += files( + 'wpilib/simulation/simulation.cpp', +) + +subdir('semiwrap/modules') diff --git a/subprojects/robotpy-wpilib/pyproject.toml b/subprojects/robotpy-wpilib/pyproject.toml index d6c6d661a..2ed6684b3 100644 --- a/subprojects/robotpy-wpilib/pyproject.toml +++ b/subprojects/robotpy-wpilib/pyproject.toml @@ -1,32 +1,53 @@ -[tool.robotpy-build.metadata] +[build-system] +build-backend = "hatchling.build" +requires = [ + "semiwrap~=0.1", + "hatch-meson~=0.1.0b2", + "hatch-robotpy~=0.2", + "hatchling", + "robotpy-native-wpilib==2025.3.2", + "robotpy-wpiutil==2025.3.2.2", + "robotpy-wpimath==2025.3.2.2", + "robotpy-hal==2025.3.2.2", + "pyntcore==2025.3.2.2", +] + +[project] name = "wpilib" +version = "2025.3.2.2" description = "Binary wrapper for FRC WPILib" -author = "RobotPy Development Team" -author_email = "robotpy@googlegroups.com" -url = "https://github.com/robotpy/robotpy-wpilib" +authors = [ + {name = "RobotPy Development Team", email = "robotpy@googlegroups.com"}, +] license = "BSD-3-Clause" -install_requires = [ - "robotpy-wpiutil==THIS_VERSION", - "robotpy-wpimath==THIS_VERSION", - "robotpy-hal==THIS_VERSION", - "pyntcore==THIS_VERSION", - "robotpy-cli~=2024.0b", +dependencies = [ + "robotpy-native-wpilib==2025.3.2", + "robotpy-wpiutil==2025.3.2.2", + "robotpy-wpimath==2025.3.2.2", + "robotpy-hal==2025.3.2.2", + "pyntcore==2025.3.2.2", + "robotpy-cli~=2024.0b" ] -[tool.robotpy-build.metadata.entry_points] -robotpy = ["run = wpilib._impl.start:Main"] +[project.urls] +"Source code" = "https://github.com/robotpy/mostrobotpy" -[build-system] -requires = [ - "robotpy-build~=2025.1.0", - "robotpy-wpiutil~=2025.3.2", - "robotpy-wpimath~=2025.3.2", - "robotpy-hal~=2025.3.2", - "pyntcore~=2025.3.2", -] +[project.entry-points.robotpy] +run = "wpilib._impl.start:Main" + + +[tool.hatch.build.hooks.robotpy] +version_file = "wpilib/version.py" -[tool.robotpy-build] -base_package = "wpilib" +[tool.hatch.build.hooks.semiwrap] + +[tool.hatch.build.hooks.meson] + +[tool.hatch.build.targets.wheel] +packages = ["wpilib"] + + +[tool.semiwrap] update_init = [ "wpilib", "wpilib.counter", @@ -63,46 +84,24 @@ scan_headers_ignore = [ # Internals "rpy/ControlWord.h", "rpy/SmartDashboardData.h", + "ShuffleboardData.h", ] -[tool.robotpy-build.wrappers."wpilib._impl".maven_lib_download] -artifact_id = "wpilibc-cpp" -group_id = "edu.wpi.first.wpilibc" -repo_url = "https://frcmaven.wpi.edu/artifactory/release" -version = "2025.3.2" - -libs = ["wpilibc"] - -[tool.robotpy-build.wrappers."wpilib._impl"] -name = "wpilibc" -depends = ["wpiHal", "wpiutil", "wpimath_cpp", "ntcore"] - -[tool.robotpy-build.wrappers."wpilib"] -name = "wpilib_core" -extension = "_wpilib" - -sources = [ - "wpilib/src/main.cpp", - "wpilib/src/rpy/ControlWord.cpp", - "wpilib/src/rpy/Notifier.cpp", - "wpilib/src/rpy/SmartDashboardData.cpp", - "wpilib/src/rpy/MotorControllerGroup.cpp", -] - -extra_includes = ["wpilib/src"] - -generation_data = "gen" +[tool.semiwrap.extension_modules."wpilib._wpilib"] +name = "wpilib" +wraps = ["robotpy-native-wpilib"] depends = [ - "wpiHal", "wpiutil", "ntcore", - "wpimath_cpp", "wpimath_geometry", "wpimath_controls", - "wpilibc", "wpilibc_interfaces", "wpilibc_event" + "wpihal", "wpiutil", "ntcore", + "wpimath", "wpimath_geometry", "wpimath_controls", + "wpilib_interfaces", "wpilib_event" ] +includes = ["wpilib/src"] -pp_defines = [ - "DYNAMIC_CAMERA_SERVER 1" -] +# pp_defines = [ +# "DYNAMIC_CAMERA_SERVER 1" +# ] -[tool.robotpy-build.wrappers."wpilib".autogen_headers] +[tool.semiwrap.extension_modules."wpilib._wpilib".headers] # frc ADIS16448_IMU = "frc/ADIS16448_IMU.h" ADIS16470_IMU = "frc/ADIS16470_IMU.h" @@ -219,92 +218,72 @@ SysIdRoutineLog = "frc/sysid/SysIdRoutineLog.h" Color = "frc/util/Color.h" Color8Bit = "frc/util/Color8Bit.h" -[tool.robotpy-build.wrappers."wpilib.counter"] -name = "wpilibc_counter" -extension = "_counter" -sources = ["wpilib/counter/counter.cpp"] -depends = [ - "wpilib_core", "wpilibc_interfaces", "wpilibc", - "wpiHal", "wpiutil", "ntcore" -] -generation_data = "gen/counter" +[tool.semiwrap.extension_modules."wpilib.counter._counter"] +name = "wpilib_counter" +wraps = ["robotpy-native-wpilib"] +depends = ["wpilib"] +yaml_path = "semiwrap/counter" -[tool.robotpy-build.wrappers."wpilib.counter".autogen_headers] +[tool.semiwrap.extension_modules."wpilib.counter._counter".headers] # frc/counter EdgeConfiguration = "frc/counter/EdgeConfiguration.h" ExternalDirectionCounter = "frc/counter/ExternalDirectionCounter.h" Tachometer = "frc/counter/Tachometer.h" UpDownCounter = "frc/counter/UpDownCounter.h" -[tool.robotpy-build.wrappers."wpilib.drive"] -name = "wpilibc_drive" -extension = "_drive" -sources = ["wpilib/drive/drive.cpp"] -depends = [ - "wpilib_core", "wpilibc_interfaces", "wpilibc", - "wpiHal", "wpiutil", "ntcore" -] -generation_data = "gen/drive" +[tool.semiwrap.extension_modules."wpilib.drive._drive"] +name = "wpilib_drive" +wraps = ["robotpy-native-wpilib"] +depends = ["wpilib"] +yaml_path = "semiwrap/drive" -[tool.robotpy-build.wrappers."wpilib.drive".autogen_headers] +[tool.semiwrap.extension_modules."wpilib.drive._drive".headers] # frc/drive DifferentialDrive = "frc/drive/DifferentialDrive.h" MecanumDrive = "frc/drive/MecanumDrive.h" RobotDriveBase = "frc/drive/RobotDriveBase.h" -[tool.robotpy-build.wrappers."wpilib.event"] -name = "wpilibc_event" -extension = "_event" -sources = ["wpilib/event/event.cpp"] -depends = [ - "wpilibc", "wpiHal", "wpimath_filter", "wpimath_cpp", "wpiutil", "ntcore" -] -generation_data = "gen/event" +[tool.semiwrap.extension_modules."wpilib.event._event"] +name = "wpilib_event" +wraps = ["robotpy-native-wpilib"] +# depends = ["wpilib", "wpimath_filter"] +depends = ["wpimath_filter"] +yaml_path = "semiwrap/event" -[tool.robotpy-build.wrappers."wpilib.event".autogen_headers] +[tool.semiwrap.extension_modules."wpilib.event._event".headers] # frc/event BooleanEvent = "frc/event/BooleanEvent.h" EventLoop = "frc/event/EventLoop.h" NetworkBooleanEvent = "frc/event/NetworkBooleanEvent.h" -[tool.robotpy-build.wrappers."wpilib.interfaces"] -name = "wpilibc_interfaces" -extension = "_interfaces" -sources = ["wpilib/interfaces/interfaces.cpp"] -depends = [ - "wpilibc", "wpilibc_event", "wpiHal", "wpiutil", "ntcore", - "wpimath_cpp", "wpimath_geometry" -] -generation_data = "gen" +[tool.semiwrap.extension_modules."wpilib.interfaces._interfaces"] +name = "wpilib_interfaces" +wraps = ["robotpy-native-wpilib"] +depends = ["wpilib_event", "wpimath_geometry"] +yaml_path = "semiwrap/interfaces" -[tool.robotpy-build.wrappers."wpilib.interfaces".autogen_headers] +[tool.semiwrap.extension_modules."wpilib.interfaces._interfaces".headers] # frc CounterBase = "frc/CounterBase.h" GenericHID = "frc/GenericHID.h" MotorController = "frc/motorcontrol/MotorController.h" -[tool.robotpy-build.wrappers."wpilib.shuffleboard"] -name = "wpilibc_shuffleboard" -extension = "_shuffleboard" -sources = [ - "wpilib/shuffleboard/shuffleboard.cpp", - "wpilib/shuffleboard/ShuffleboardData.cpp", -] -depends = [ - "wpilib_core", "wpilibc_interfaces", "wpilibc", - "wpiHal", "wpiutil", "ntcore" -] -generation_data = "gen/shuffleboard" -pp_defines = [ - "DYNAMIC_CAMERA_SERVER 1" -] +[tool.semiwrap.extension_modules."wpilib.shuffleboard._shuffleboard"] +name = "wpilib_shuffleboard" +wraps = ["robotpy-native-wpilib"] +depends = ["wpilib", "wpilib_interfaces"] +yaml_path = "semiwrap/shuffleboard" + +# pp_defines = [ +# "DYNAMIC_CAMERA_SERVER 1" +# ] -[tool.robotpy-build.wrappers."wpilib.shuffleboard".autogen_headers] +[tool.semiwrap.extension_modules."wpilib.shuffleboard._shuffleboard".headers] # frc/shuffleboard BuiltInLayouts = "frc/shuffleboard/BuiltInLayouts.h" @@ -328,19 +307,14 @@ SimpleWidget = "frc/shuffleboard/SimpleWidget.h" SuppliedValueWidget = "frc/shuffleboard/SuppliedValueWidget.h" WidgetType = "frc/shuffleboard/WidgetType.h" -[tool.robotpy-build.wrappers."wpilib.simulation"] -name = "wpilibc_simulation" -extension = "_simulation" -sources = ["wpilib/simulation/simulation.cpp"] -depends = [ - "wpilib_core", "wpilibc", "wpiHal", "wpiutil", - "wpimath_cpp", "wpimath_controls", "wpimath_geometry", "wpimath_kinematics", - "ntcore" -] -generation_data = "gen/simulation" +[tool.semiwrap.extension_modules."wpilib.simulation._simulation"] +name = "wpilib_simulation" +wraps = ["robotpy-native-wpilib"] +depends = ["wpilib", "wpimath_controls", "wpimath_geometry", "wpimath_kinematics"] +yaml_path = "semiwrap/simulation" -[tool.robotpy-build.wrappers."wpilib.simulation".autogen_headers] +[tool.semiwrap.extension_modules."wpilib.simulation._simulation".headers] # frc/simulation ADIS16448_IMUSim = "frc/simulation/ADIS16448_IMUSim.h" ADIS16470_IMUSim = "frc/simulation/ADIS16470_IMUSim.h" diff --git a/subprojects/robotpy-wpilib/semiwrap/.gitignore b/subprojects/robotpy-wpilib/semiwrap/.gitignore new file mode 100644 index 000000000..6cdce1027 --- /dev/null +++ b/subprojects/robotpy-wpilib/semiwrap/.gitignore @@ -0,0 +1,3 @@ +/meson.build +/modules/meson.build +/trampolines/meson.build diff --git a/subprojects/robotpy-wpilib/gen/ADIS16448_IMU.yml b/subprojects/robotpy-wpilib/semiwrap/ADIS16448_IMU.yml similarity index 96% rename from subprojects/robotpy-wpilib/gen/ADIS16448_IMU.yml rename to subprojects/robotpy-wpilib/semiwrap/ADIS16448_IMU.yml index d103657d2..2fdcd2c9f 100644 --- a/subprojects/robotpy-wpilib/gen/ADIS16448_IMU.yml +++ b/subprojects/robotpy-wpilib/semiwrap/ADIS16448_IMU.yml @@ -1,10 +1,9 @@ ---- extra_includes: - networktables/NTSendableBuilder.h classes: - ADIS16448_IMU: + frc::ADIS16448_IMU: enums: CalibrationTime: IMUAxis: @@ -13,7 +12,7 @@ classes: methods: ADIS16448_IMU: overloads: - "": + '': IMUAxis, SPI::Port, CalibrationTime: Calibrate: ConfigCalTime: diff --git a/subprojects/robotpy-wpilib/gen/ADIS16470_IMU.yml b/subprojects/robotpy-wpilib/semiwrap/ADIS16470_IMU.yml similarity index 96% rename from subprojects/robotpy-wpilib/gen/ADIS16470_IMU.yml rename to subprojects/robotpy-wpilib/semiwrap/ADIS16470_IMU.yml index 53777da70..36cb45e20 100644 --- a/subprojects/robotpy-wpilib/gen/ADIS16470_IMU.yml +++ b/subprojects/robotpy-wpilib/semiwrap/ADIS16470_IMU.yml @@ -1,10 +1,9 @@ ---- extra_includes: - networktables/NTSendableBuilder.h classes: - ADIS16470_IMU: + frc::ADIS16470_IMU: attributes: m_yaw_axis: m_pitch_axis: @@ -17,7 +16,7 @@ classes: methods: ADIS16470_IMU: overloads: - "": + '': IMUAxis, IMUAxis, IMUAxis: IMUAxis, IMUAxis, IMUAxis, frc::SPI::Port, CalibrationTime: ConfigDecRate: diff --git a/subprojects/robotpy-wpilib/gen/ADXL345_I2C.yml b/subprojects/robotpy-wpilib/semiwrap/ADXL345_I2C.yml similarity index 87% rename from subprojects/robotpy-wpilib/gen/ADXL345_I2C.yml rename to subprojects/robotpy-wpilib/semiwrap/ADXL345_I2C.yml index d4063ac45..b15ef94b4 100644 --- a/subprojects/robotpy-wpilib/gen/ADXL345_I2C.yml +++ b/subprojects/robotpy-wpilib/semiwrap/ADXL345_I2C.yml @@ -1,10 +1,8 @@ ---- - extra_includes: - networktables/NTSendableBuilder.h classes: - ADXL345_I2C: + frc::ADXL345_I2C: constants: - frc::ADXL345_I2C::Range::kRange_2G ignored_bases: @@ -25,9 +23,7 @@ classes: GetAcceleration: GetAccelerations: InitSendable: - - ADXL345_I2C::AllAxes: - shared_ptr: false + frc::ADXL345_I2C::AllAxes: attributes: XAxis: YAxis: diff --git a/subprojects/robotpy-wpilib/gen/ADXL345_SPI.yml b/subprojects/robotpy-wpilib/semiwrap/ADXL345_SPI.yml similarity index 91% rename from subprojects/robotpy-wpilib/gen/ADXL345_SPI.yml rename to subprojects/robotpy-wpilib/semiwrap/ADXL345_SPI.yml index 62cd0f59c..29c4a29b7 100644 --- a/subprojects/robotpy-wpilib/gen/ADXL345_SPI.yml +++ b/subprojects/robotpy-wpilib/semiwrap/ADXL345_SPI.yml @@ -1,11 +1,9 @@ ---- - extra_includes: - networktables/NTSendableBuilder.h - frc/DigitalSource.h classes: - ADXL345_SPI: + frc::ADXL345_SPI: constants: - frc::ADXL345_SPI::Range::kRange_2G ignored_bases: @@ -35,8 +33,7 @@ classes: GetAcceleration: GetAccelerations: InitSendable: - ADXL345_SPI::AllAxes: - shared_ptr: false + frc::ADXL345_SPI::AllAxes: attributes: XAxis: YAxis: diff --git a/subprojects/robotpy-wpilib/gen/ADXL362.yml b/subprojects/robotpy-wpilib/semiwrap/ADXL362.yml similarity index 89% rename from subprojects/robotpy-wpilib/gen/ADXL362.yml rename to subprojects/robotpy-wpilib/semiwrap/ADXL362.yml index f8ee07e2f..87ffdc4cd 100644 --- a/subprojects/robotpy-wpilib/gen/ADXL362.yml +++ b/subprojects/robotpy-wpilib/semiwrap/ADXL362.yml @@ -1,11 +1,9 @@ ---- - extra_includes: - networktables/NTSendableBuilder.h - frc/DigitalSource.h classes: - ADXL362: + frc::ADXL362: constants: - frc::ADXL362::Range::kRange_2G ignored_bases: @@ -26,8 +24,7 @@ classes: GetAcceleration: GetAccelerations: InitSendable: - ADXL362::AllAxes: - shared_ptr: false + frc::ADXL362::AllAxes: attributes: XAxis: YAxis: diff --git a/subprojects/robotpy-wpilib/gen/ADXRS450_Gyro.yml b/subprojects/robotpy-wpilib/semiwrap/ADXRS450_Gyro.yml similarity index 86% rename from subprojects/robotpy-wpilib/gen/ADXRS450_Gyro.yml rename to subprojects/robotpy-wpilib/semiwrap/ADXRS450_Gyro.yml index 2a15eab1e..9acf9229c 100644 --- a/subprojects/robotpy-wpilib/gen/ADXRS450_Gyro.yml +++ b/subprojects/robotpy-wpilib/semiwrap/ADXRS450_Gyro.yml @@ -1,18 +1,15 @@ ---- - extra_includes: - wpi/sendable/SendableBuilder.h - frc/DigitalSource.h classes: - ADXRS450_Gyro: - shared_ptr: true + frc::ADXRS450_Gyro: ignored_bases: - wpi::SendableHelper methods: ADXRS450_Gyro: overloads: - "": + '': SPI::Port: IsConnected: GetAngle: diff --git a/subprojects/robotpy-wpilib/gen/AddressableLED.yml b/subprojects/robotpy-wpilib/semiwrap/AddressableLED.yml similarity index 86% rename from subprojects/robotpy-wpilib/gen/AddressableLED.yml rename to subprojects/robotpy-wpilib/semiwrap/AddressableLED.yml index 0fa0640b2..c158c941b 100644 --- a/subprojects/robotpy-wpilib/gen/AddressableLED.yml +++ b/subprojects/robotpy-wpilib/semiwrap/AddressableLED.yml @@ -1,7 +1,10 @@ ---- + +functions: + format_as: + ignore: true classes: - AddressableLED: + frc::AddressableLED: methods: AddressableLED: SetLength: @@ -14,14 +17,14 @@ classes: SetSyncTime: Start: Stop: - AddressableLED::LEDData: + frc::AddressableLED::LEDData: force_no_trampoline: true base_qualnames: HAL_AddressableLEDData: ::HAL_AddressableLEDData methods: LEDData: overloads: - "": + '': int, int, int: param_override: _r: diff --git a/subprojects/robotpy-wpilib/gen/Alert.yml b/subprojects/robotpy-wpilib/semiwrap/Alert.yml similarity index 97% rename from subprojects/robotpy-wpilib/gen/Alert.yml rename to subprojects/robotpy-wpilib/semiwrap/Alert.yml index 1047429de..e710daf64 100644 --- a/subprojects/robotpy-wpilib/gen/Alert.yml +++ b/subprojects/robotpy-wpilib/semiwrap/Alert.yml @@ -1,11 +1,10 @@ ---- functions: format_as: ignore: true classes: - Alert: + frc::Alert: enums: AlertType: methods: diff --git a/subprojects/robotpy-wpilib/gen/AnalogAccelerometer.yml b/subprojects/robotpy-wpilib/semiwrap/AnalogAccelerometer.yml similarity index 89% rename from subprojects/robotpy-wpilib/gen/AnalogAccelerometer.yml rename to subprojects/robotpy-wpilib/semiwrap/AnalogAccelerometer.yml index 27e39c1fd..44cf4c386 100644 --- a/subprojects/robotpy-wpilib/gen/AnalogAccelerometer.yml +++ b/subprojects/robotpy-wpilib/semiwrap/AnalogAccelerometer.yml @@ -1,11 +1,8 @@ ---- - extra_includes: - wpi/sendable/SendableBuilder.h classes: - AnalogAccelerometer: - shared_ptr: true + frc::AnalogAccelerometer: ignored_bases: - wpi::SendableHelper methods: diff --git a/subprojects/robotpy-wpilib/gen/AnalogEncoder.yml b/subprojects/robotpy-wpilib/semiwrap/AnalogEncoder.yml similarity index 95% rename from subprojects/robotpy-wpilib/gen/AnalogEncoder.yml rename to subprojects/robotpy-wpilib/semiwrap/AnalogEncoder.yml index 873cc08c3..b4f3cc721 100644 --- a/subprojects/robotpy-wpilib/gen/AnalogEncoder.yml +++ b/subprojects/robotpy-wpilib/semiwrap/AnalogEncoder.yml @@ -1,12 +1,9 @@ ---- - extra_includes: - wpi/sendable/SendableBuilder.h - frc/AnalogInput.h classes: - AnalogEncoder: - shared_ptr: true + frc::AnalogEncoder: ignored_bases: - wpi::SendableHelper methods: diff --git a/subprojects/robotpy-wpilib/gen/AnalogGyro.yml b/subprojects/robotpy-wpilib/semiwrap/AnalogGyro.yml similarity index 94% rename from subprojects/robotpy-wpilib/gen/AnalogGyro.yml rename to subprojects/robotpy-wpilib/semiwrap/AnalogGyro.yml index 8b8879ca3..6ec815f98 100644 --- a/subprojects/robotpy-wpilib/gen/AnalogGyro.yml +++ b/subprojects/robotpy-wpilib/semiwrap/AnalogGyro.yml @@ -1,12 +1,9 @@ ---- - extra_includes: - wpi/sendable/SendableBuilder.h - frc/AnalogInput.h classes: - AnalogGyro: - shared_ptr: true + frc::AnalogGyro: ignored_bases: - wpi::SendableHelper attributes: diff --git a/subprojects/robotpy-wpilib/gen/AnalogInput.yml b/subprojects/robotpy-wpilib/semiwrap/AnalogInput.yml similarity index 96% rename from subprojects/robotpy-wpilib/gen/AnalogInput.yml rename to subprojects/robotpy-wpilib/semiwrap/AnalogInput.yml index a0fa305b2..29cf3dbdb 100644 --- a/subprojects/robotpy-wpilib/gen/AnalogInput.yml +++ b/subprojects/robotpy-wpilib/semiwrap/AnalogInput.yml @@ -1,13 +1,10 @@ ---- - extra_includes: - wpi/sendable/SendableBuilder.h - frc/DMA.h - frc/DMASample.h classes: - AnalogInput: - shared_ptr: true + frc::AnalogInput: ignored_bases: - wpi::SendableHelper attributes: diff --git a/subprojects/robotpy-wpilib/gen/AnalogOutput.yml b/subprojects/robotpy-wpilib/semiwrap/AnalogOutput.yml similarity index 91% rename from subprojects/robotpy-wpilib/gen/AnalogOutput.yml rename to subprojects/robotpy-wpilib/semiwrap/AnalogOutput.yml index 6f9ea2105..56ce9ee36 100644 --- a/subprojects/robotpy-wpilib/gen/AnalogOutput.yml +++ b/subprojects/robotpy-wpilib/semiwrap/AnalogOutput.yml @@ -1,11 +1,8 @@ ---- - extra_includes: - wpi/sendable/SendableBuilder.h classes: - AnalogOutput: - shared_ptr: true + frc::AnalogOutput: ignored_bases: - wpi::SendableHelper attributes: diff --git a/subprojects/robotpy-wpilib/gen/AnalogPotentiometer.yml b/subprojects/robotpy-wpilib/semiwrap/AnalogPotentiometer.yml similarity index 89% rename from subprojects/robotpy-wpilib/gen/AnalogPotentiometer.yml rename to subprojects/robotpy-wpilib/semiwrap/AnalogPotentiometer.yml index c7cf7f476..7f48c4ab9 100644 --- a/subprojects/robotpy-wpilib/gen/AnalogPotentiometer.yml +++ b/subprojects/robotpy-wpilib/semiwrap/AnalogPotentiometer.yml @@ -1,11 +1,8 @@ ---- - extra_includes: - wpi/sendable/SendableBuilder.h classes: - AnalogPotentiometer: - shared_ptr: true + frc::AnalogPotentiometer: ignored_bases: - wpi::SendableHelper methods: diff --git a/subprojects/robotpy-wpilib/gen/AnalogTrigger.yml b/subprojects/robotpy-wpilib/semiwrap/AnalogTrigger.yml similarity index 97% rename from subprojects/robotpy-wpilib/gen/AnalogTrigger.yml rename to subprojects/robotpy-wpilib/semiwrap/AnalogTrigger.yml index bc8d4c544..2667829b9 100644 --- a/subprojects/robotpy-wpilib/gen/AnalogTrigger.yml +++ b/subprojects/robotpy-wpilib/semiwrap/AnalogTrigger.yml @@ -1,4 +1,3 @@ ---- extra_includes: - wpi/sendable/SendableBuilder.h @@ -7,7 +6,7 @@ extra_includes: classes: - AnalogTrigger: + frc::AnalogTrigger: ignored_bases: - wpi::SendableHelper methods: diff --git a/subprojects/robotpy-wpilib/gen/AnalogTriggerOutput.yml b/subprojects/robotpy-wpilib/semiwrap/AnalogTriggerOutput.yml similarity index 88% rename from subprojects/robotpy-wpilib/gen/AnalogTriggerOutput.yml rename to subprojects/robotpy-wpilib/semiwrap/AnalogTriggerOutput.yml index ef3ab9ec7..8e9aacc4a 100644 --- a/subprojects/robotpy-wpilib/gen/AnalogTriggerOutput.yml +++ b/subprojects/robotpy-wpilib/semiwrap/AnalogTriggerOutput.yml @@ -1,5 +1,3 @@ ---- - extra_includes: - wpi/sendable/SendableBuilder.h - frc/AnalogInput.h @@ -7,8 +5,7 @@ extra_includes: - frc/AnalogTrigger.h classes: - AnalogTriggerOutput: - shared_ptr: true + frc::AnalogTriggerOutput: ignored_bases: - wpi::SendableHelper methods: diff --git a/subprojects/robotpy-wpilib/gen/AnalogTriggerType.yml b/subprojects/robotpy-wpilib/semiwrap/AnalogTriggerType.yml similarity index 87% rename from subprojects/robotpy-wpilib/gen/AnalogTriggerType.yml rename to subprojects/robotpy-wpilib/semiwrap/AnalogTriggerType.yml index 2b8f0b64c..eef4f8e08 100644 --- a/subprojects/robotpy-wpilib/gen/AnalogTriggerType.yml +++ b/subprojects/robotpy-wpilib/semiwrap/AnalogTriggerType.yml @@ -1,4 +1,3 @@ ---- enums: AnalogTriggerType: diff --git a/subprojects/robotpy-wpilib/gen/BuiltInAccelerometer.yml b/subprojects/robotpy-wpilib/semiwrap/BuiltInAccelerometer.yml similarity index 91% rename from subprojects/robotpy-wpilib/gen/BuiltInAccelerometer.yml rename to subprojects/robotpy-wpilib/semiwrap/BuiltInAccelerometer.yml index cda754931..30a2db496 100644 --- a/subprojects/robotpy-wpilib/gen/BuiltInAccelerometer.yml +++ b/subprojects/robotpy-wpilib/semiwrap/BuiltInAccelerometer.yml @@ -1,10 +1,9 @@ ---- extra_includes: - wpi/sendable/SendableBuilder.h classes: - BuiltInAccelerometer: + frc::BuiltInAccelerometer: ignored_bases: - wpi::SendableHelper constants: diff --git a/subprojects/robotpy-wpilib/gen/CAN.yml b/subprojects/robotpy-wpilib/semiwrap/CAN.yml similarity index 69% rename from subprojects/robotpy-wpilib/gen/CAN.yml rename to subprojects/robotpy-wpilib/semiwrap/CAN.yml index 253c37487..1f4e40c0a 100644 --- a/subprojects/robotpy-wpilib/gen/CAN.yml +++ b/subprojects/robotpy-wpilib/semiwrap/CAN.yml @@ -1,14 +1,10 @@ ---- - classes: - CANData: - shared_ptr: true + frc::CANData: attributes: data: length: timestamp: - CAN: - shared_ptr: true + frc::CAN: attributes: kTeamManufacturer: kTeamDeviceType: @@ -19,16 +15,16 @@ classes: int, int, int: WritePacket: buffers: - - { type: IN, src: data, len: length } + - {type: IN, src: data, len: length} WritePacketNoError: buffers: - - { type: IN, src: data, len: length } + - {type: IN, src: data, len: length} WritePacketRepeating: buffers: - - { type: IN, src: data, len: length } + - {type: IN, src: data, len: length} WritePacketRepeatingNoError: buffers: - - { type: IN, src: data, len: length } + - {type: IN, src: data, len: length} WriteRTRFrame: WriteRTRFrameNoError: StopPacketRepeating: diff --git a/subprojects/robotpy-wpilib/gen/Color.yml b/subprojects/robotpy-wpilib/semiwrap/Color.yml similarity index 99% rename from subprojects/robotpy-wpilib/gen/Color.yml rename to subprojects/robotpy-wpilib/semiwrap/Color.yml index 499bebc5f..83c58bb6c 100644 --- a/subprojects/robotpy-wpilib/gen/Color.yml +++ b/subprojects/robotpy-wpilib/semiwrap/Color.yml @@ -1,10 +1,9 @@ ---- extra_includes: - pybind11/operators.h classes: - Color: + frc::Color: force_type_casters: - wpi::ct_string attributes: diff --git a/subprojects/robotpy-wpilib/gen/Color8Bit.yml b/subprojects/robotpy-wpilib/semiwrap/Color8Bit.yml similarity index 98% rename from subprojects/robotpy-wpilib/gen/Color8Bit.yml rename to subprojects/robotpy-wpilib/semiwrap/Color8Bit.yml index 87e770128..2f3272054 100644 --- a/subprojects/robotpy-wpilib/gen/Color8Bit.yml +++ b/subprojects/robotpy-wpilib/semiwrap/Color8Bit.yml @@ -1,10 +1,9 @@ ---- extra_includes: - pybind11/operators.h classes: - Color8Bit: + frc::Color8Bit: force_type_casters: - wpi::ct_string attributes: diff --git a/subprojects/robotpy-wpilib/gen/Compressor.yml b/subprojects/robotpy-wpilib/semiwrap/Compressor.yml similarity index 96% rename from subprojects/robotpy-wpilib/gen/Compressor.yml rename to subprojects/robotpy-wpilib/semiwrap/Compressor.yml index 2392b2761..fb898b4ac 100644 --- a/subprojects/robotpy-wpilib/gen/Compressor.yml +++ b/subprojects/robotpy-wpilib/semiwrap/Compressor.yml @@ -1,4 +1,3 @@ ---- extra_includes: - wpi/sendable/SendableBuilder.h @@ -7,7 +6,7 @@ extra_includes: - frc/DoubleSolenoid.h classes: - Compressor: + frc::Compressor: ignored_bases: - wpi::SendableHelper methods: diff --git a/subprojects/robotpy-wpilib/gen/CompressorConfigType.yml b/subprojects/robotpy-wpilib/semiwrap/CompressorConfigType.yml similarity index 88% rename from subprojects/robotpy-wpilib/gen/CompressorConfigType.yml rename to subprojects/robotpy-wpilib/semiwrap/CompressorConfigType.yml index 47e9f8154..d1098d1ff 100644 --- a/subprojects/robotpy-wpilib/gen/CompressorConfigType.yml +++ b/subprojects/robotpy-wpilib/semiwrap/CompressorConfigType.yml @@ -1,4 +1,3 @@ ---- enums: CompressorConfigType: diff --git a/subprojects/robotpy-wpilib/gen/Controller.yml b/subprojects/robotpy-wpilib/semiwrap/Controller.yml similarity index 78% rename from subprojects/robotpy-wpilib/gen/Controller.yml rename to subprojects/robotpy-wpilib/semiwrap/Controller.yml index ad5624149..c7f162f62 100644 --- a/subprojects/robotpy-wpilib/gen/Controller.yml +++ b/subprojects/robotpy-wpilib/semiwrap/Controller.yml @@ -1,7 +1,6 @@ ---- classes: - Controller: + frc::Controller: methods: Controller: Enable: diff --git a/subprojects/robotpy-wpilib/gen/Counter.yml b/subprojects/robotpy-wpilib/semiwrap/Counter.yml similarity index 98% rename from subprojects/robotpy-wpilib/gen/Counter.yml rename to subprojects/robotpy-wpilib/semiwrap/Counter.yml index a62cdfa3a..625bc9fde 100644 --- a/subprojects/robotpy-wpilib/gen/Counter.yml +++ b/subprojects/robotpy-wpilib/semiwrap/Counter.yml @@ -1,5 +1,3 @@ ---- - extra_includes: - wpi/sendable/SendableBuilder.h - frc/DigitalGlitchFilter.h @@ -7,8 +5,7 @@ extra_includes: - frc/DMASample.h classes: - Counter: - shared_ptr: true + frc::Counter: ignored_bases: - wpi::SendableHelper typealias: diff --git a/subprojects/robotpy-wpilib/gen/DMA.yml b/subprojects/robotpy-wpilib/semiwrap/DMA.yml similarity index 93% rename from subprojects/robotpy-wpilib/gen/DMA.yml rename to subprojects/robotpy-wpilib/semiwrap/DMA.yml index 8acff4c70..568810f10 100644 --- a/subprojects/robotpy-wpilib/gen/DMA.yml +++ b/subprojects/robotpy-wpilib/semiwrap/DMA.yml @@ -1,5 +1,3 @@ ---- - extra_includes: - frc/AnalogInput.h - frc/Counter.h @@ -9,8 +7,7 @@ extra_includes: - frc/Encoder.h classes: - DMA: - shared_ptr: true + frc::DMA: methods: DMA: SetPause: diff --git a/subprojects/robotpy-wpilib/gen/DMASample.yml b/subprojects/robotpy-wpilib/semiwrap/DMASample.yml similarity index 91% rename from subprojects/robotpy-wpilib/gen/DMASample.yml rename to subprojects/robotpy-wpilib/semiwrap/DMASample.yml index 8c2af3b4b..55663c44d 100644 --- a/subprojects/robotpy-wpilib/gen/DMASample.yml +++ b/subprojects/robotpy-wpilib/semiwrap/DMASample.yml @@ -1,8 +1,5 @@ ---- - classes: - DMASample: - shared_ptr: true + frc::DMASample: methods: Update: GetTime: diff --git a/subprojects/robotpy-wpilib/gen/DMC60.yml b/subprojects/robotpy-wpilib/semiwrap/DMC60.yml similarity index 70% rename from subprojects/robotpy-wpilib/gen/DMC60.yml rename to subprojects/robotpy-wpilib/semiwrap/DMC60.yml index 32019aa4a..4adbfcadc 100644 --- a/subprojects/robotpy-wpilib/gen/DMC60.yml +++ b/subprojects/robotpy-wpilib/semiwrap/DMC60.yml @@ -1,10 +1,7 @@ ---- - extra_includes: - wpi/sendable/SendableBuilder.h classes: - DMC60: - shared_ptr: true + frc::DMC60: methods: DMC60: diff --git a/subprojects/robotpy-wpilib/gen/DSControlWord.yml b/subprojects/robotpy-wpilib/semiwrap/DSControlWord.yml similarity index 96% rename from subprojects/robotpy-wpilib/gen/DSControlWord.yml rename to subprojects/robotpy-wpilib/semiwrap/DSControlWord.yml index 5fb531c2c..ea5f3347c 100644 --- a/subprojects/robotpy-wpilib/gen/DSControlWord.yml +++ b/subprojects/robotpy-wpilib/semiwrap/DSControlWord.yml @@ -1,7 +1,6 @@ ---- classes: - DSControlWord: + frc::DSControlWord: methods: DSControlWord: IsEnabled: diff --git a/subprojects/robotpy-wpilib/gen/DataLogManager.yml b/subprojects/robotpy-wpilib/semiwrap/DataLogManager.yml similarity index 90% rename from subprojects/robotpy-wpilib/gen/DataLogManager.yml rename to subprojects/robotpy-wpilib/semiwrap/DataLogManager.yml index bcbdd5059..36eb75ad4 100644 --- a/subprojects/robotpy-wpilib/gen/DataLogManager.yml +++ b/subprojects/robotpy-wpilib/semiwrap/DataLogManager.yml @@ -1,10 +1,9 @@ ---- extra_includes: - wpi/DataLog.h classes: - DataLogManager: + frc::DataLogManager: methods: Start: Stop: diff --git a/subprojects/robotpy-wpilib/gen/DifferentialDriveVoltageConstraint.yml b/subprojects/robotpy-wpilib/semiwrap/DifferentialDriveVoltageConstraint.yml similarity index 63% rename from subprojects/robotpy-wpilib/gen/DifferentialDriveVoltageConstraint.yml rename to subprojects/robotpy-wpilib/semiwrap/DifferentialDriveVoltageConstraint.yml index 258e4a8dd..9c0f5ee1f 100644 --- a/subprojects/robotpy-wpilib/gen/DifferentialDriveVoltageConstraint.yml +++ b/subprojects/robotpy-wpilib/semiwrap/DifferentialDriveVoltageConstraint.yml @@ -1,8 +1,5 @@ ---- - classes: - DifferentialDriveVoltageConstraint: - shared_ptr: true + frc::DifferentialDriveVoltageConstraint: methods: DifferentialDriveVoltageConstraint: MaxVelocity: diff --git a/subprojects/robotpy-wpilib/gen/DigitalGlitchFilter.yml b/subprojects/robotpy-wpilib/semiwrap/DigitalGlitchFilter.yml similarity index 91% rename from subprojects/robotpy-wpilib/gen/DigitalGlitchFilter.yml rename to subprojects/robotpy-wpilib/semiwrap/DigitalGlitchFilter.yml index 1e104d075..2a944a40c 100644 --- a/subprojects/robotpy-wpilib/gen/DigitalGlitchFilter.yml +++ b/subprojects/robotpy-wpilib/semiwrap/DigitalGlitchFilter.yml @@ -1,13 +1,10 @@ ---- - extra_includes: - wpi/sendable/SendableBuilder.h - frc/Counter.h - frc/Encoder.h classes: - DigitalGlitchFilter: - shared_ptr: true + frc::DigitalGlitchFilter: ignored_bases: - wpi::SendableHelper methods: diff --git a/subprojects/robotpy-wpilib/gen/DigitalInput.yml b/subprojects/robotpy-wpilib/semiwrap/DigitalInput.yml similarity index 89% rename from subprojects/robotpy-wpilib/gen/DigitalInput.yml rename to subprojects/robotpy-wpilib/semiwrap/DigitalInput.yml index 22ae01a5e..789653c84 100644 --- a/subprojects/robotpy-wpilib/gen/DigitalInput.yml +++ b/subprojects/robotpy-wpilib/semiwrap/DigitalInput.yml @@ -1,12 +1,9 @@ ---- - extra_includes: - wpi/sendable/SendableBuilder.h - frc/DigitalGlitchFilter.h classes: - DigitalInput: - shared_ptr: true + frc::DigitalInput: ignored_bases: - wpi::SendableHelper methods: diff --git a/subprojects/robotpy-wpilib/gen/DigitalOutput.yml b/subprojects/robotpy-wpilib/semiwrap/DigitalOutput.yml similarity index 91% rename from subprojects/robotpy-wpilib/gen/DigitalOutput.yml rename to subprojects/robotpy-wpilib/semiwrap/DigitalOutput.yml index 3504477a1..4da16d78a 100644 --- a/subprojects/robotpy-wpilib/gen/DigitalOutput.yml +++ b/subprojects/robotpy-wpilib/semiwrap/DigitalOutput.yml @@ -1,11 +1,8 @@ ---- - extra_includes: - wpi/sendable/SendableBuilder.h classes: - DigitalOutput: - shared_ptr: true + frc::DigitalOutput: ignored_bases: - wpi::SendableHelper methods: diff --git a/subprojects/robotpy-wpilib/gen/DigitalSource.yml b/subprojects/robotpy-wpilib/semiwrap/DigitalSource.yml similarity index 90% rename from subprojects/robotpy-wpilib/gen/DigitalSource.yml rename to subprojects/robotpy-wpilib/semiwrap/DigitalSource.yml index 33c5b2eda..5666268de 100644 --- a/subprojects/robotpy-wpilib/gen/DigitalSource.yml +++ b/subprojects/robotpy-wpilib/semiwrap/DigitalSource.yml @@ -1,8 +1,5 @@ ---- - classes: - DigitalSource: - shared_ptr: true + frc::DigitalSource: methods: DigitalSource: GetPortHandleForRouting: diff --git a/subprojects/robotpy-wpilib/gen/DoubleSolenoid.yml b/subprojects/robotpy-wpilib/semiwrap/DoubleSolenoid.yml similarity index 90% rename from subprojects/robotpy-wpilib/gen/DoubleSolenoid.yml rename to subprojects/robotpy-wpilib/semiwrap/DoubleSolenoid.yml index 7e8aec3ee..0610e512e 100644 --- a/subprojects/robotpy-wpilib/gen/DoubleSolenoid.yml +++ b/subprojects/robotpy-wpilib/semiwrap/DoubleSolenoid.yml @@ -1,11 +1,8 @@ ---- - extra_includes: - wpi/sendable/SendableBuilder.h classes: - DoubleSolenoid: - shared_ptr: true + frc::DoubleSolenoid: ignored_bases: - wpi::SendableHelper enums: diff --git a/subprojects/robotpy-wpilib/gen/DriverStation.yml b/subprojects/robotpy-wpilib/semiwrap/DriverStation.yml similarity index 98% rename from subprojects/robotpy-wpilib/gen/DriverStation.yml rename to subprojects/robotpy-wpilib/semiwrap/DriverStation.yml index e987db2e9..3a75ed8ee 100644 --- a/subprojects/robotpy-wpilib/gen/DriverStation.yml +++ b/subprojects/robotpy-wpilib/semiwrap/DriverStation.yml @@ -1,11 +1,10 @@ ---- extra_includes: - rpy/ControlWord.h - wpi/DataLog.h classes: - DriverStation: + frc::DriverStation: attributes: kJoystickPorts: enums: diff --git a/subprojects/robotpy-wpilib/gen/DriverStationModeThread.yml b/subprojects/robotpy-wpilib/semiwrap/DriverStationModeThread.yml similarity index 79% rename from subprojects/robotpy-wpilib/gen/DriverStationModeThread.yml rename to subprojects/robotpy-wpilib/semiwrap/DriverStationModeThread.yml index 72838dd08..e899412f2 100644 --- a/subprojects/robotpy-wpilib/gen/DriverStationModeThread.yml +++ b/subprojects/robotpy-wpilib/semiwrap/DriverStationModeThread.yml @@ -1,7 +1,6 @@ ---- classes: - DriverStationModeThread: + frc::internal::DriverStationModeThread: rename: _DriverStationModeThread methods: DriverStationModeThread: diff --git a/subprojects/robotpy-wpilib/gen/DutyCycle.yml b/subprojects/robotpy-wpilib/semiwrap/DutyCycle.yml similarity index 94% rename from subprojects/robotpy-wpilib/gen/DutyCycle.yml rename to subprojects/robotpy-wpilib/semiwrap/DutyCycle.yml index 683fc3b18..50cc174df 100644 --- a/subprojects/robotpy-wpilib/gen/DutyCycle.yml +++ b/subprojects/robotpy-wpilib/semiwrap/DutyCycle.yml @@ -1,5 +1,3 @@ ---- - extra_includes: - wpi/sendable/SendableBuilder.h - frc/AnalogTrigger.h @@ -8,8 +6,7 @@ extra_includes: - frc/DMASample.h classes: - DutyCycle: - shared_ptr: true + frc::DutyCycle: ignored_bases: - wpi::SendableHelper methods: diff --git a/subprojects/robotpy-wpilib/gen/DutyCycleEncoder.yml b/subprojects/robotpy-wpilib/semiwrap/DutyCycleEncoder.yml similarity index 96% rename from subprojects/robotpy-wpilib/gen/DutyCycleEncoder.yml rename to subprojects/robotpy-wpilib/semiwrap/DutyCycleEncoder.yml index 8a30c20c1..aaa847df1 100644 --- a/subprojects/robotpy-wpilib/gen/DutyCycleEncoder.yml +++ b/subprojects/robotpy-wpilib/semiwrap/DutyCycleEncoder.yml @@ -1,13 +1,10 @@ ---- - extra_includes: - wpi/sendable/SendableBuilder.h - frc/DutyCycle.h - frc/DigitalSource.h classes: - DutyCycleEncoder: - shared_ptr: true + frc::DutyCycleEncoder: ignored_bases: - wpi::SendableHelper methods: diff --git a/subprojects/robotpy-wpilib/gen/Encoder.yml b/subprojects/robotpy-wpilib/semiwrap/Encoder.yml similarity index 97% rename from subprojects/robotpy-wpilib/gen/Encoder.yml rename to subprojects/robotpy-wpilib/semiwrap/Encoder.yml index b89d805ca..c9a559515 100644 --- a/subprojects/robotpy-wpilib/gen/Encoder.yml +++ b/subprojects/robotpy-wpilib/semiwrap/Encoder.yml @@ -1,5 +1,3 @@ ---- - extra_includes: - wpi/sendable/SendableBuilder.h - frc/DigitalSource.h @@ -8,8 +6,7 @@ extra_includes: - frc/DMASample.h classes: - Encoder: - shared_ptr: true + frc::Encoder: ignored_bases: - wpi::SendableHelper typealias: diff --git a/subprojects/robotpy-wpilib/gen/Errors.yml b/subprojects/robotpy-wpilib/semiwrap/Errors.yml similarity index 89% rename from subprojects/robotpy-wpilib/gen/Errors.yml rename to subprojects/robotpy-wpilib/semiwrap/Errors.yml index 2462a38cc..e91be621c 100644 --- a/subprojects/robotpy-wpilib/gen/Errors.yml +++ b/subprojects/robotpy-wpilib/semiwrap/Errors.yml @@ -1,4 +1,3 @@ ---- functions: GetErrorMessage: @@ -11,5 +10,5 @@ functions: MakeError: ignore: true classes: - RuntimeError: + frc::RuntimeError: ignore: true diff --git a/subprojects/robotpy-wpilib/gen/Field2d.yml b/subprojects/robotpy-wpilib/semiwrap/Field2d.yml similarity index 92% rename from subprojects/robotpy-wpilib/gen/Field2d.yml rename to subprojects/robotpy-wpilib/semiwrap/Field2d.yml index c31343950..51ef19b86 100644 --- a/subprojects/robotpy-wpilib/gen/Field2d.yml +++ b/subprojects/robotpy-wpilib/semiwrap/Field2d.yml @@ -1,11 +1,8 @@ ---- - extra_includes: - networktables/NTSendableBuilder.h classes: - Field2d: - shared_ptr: true + frc::Field2d: ignored_bases: - wpi::SendableHelper methods: diff --git a/subprojects/robotpy-wpilib/gen/FieldObject2d.yml b/subprojects/robotpy-wpilib/semiwrap/FieldObject2d.yml similarity index 92% rename from subprojects/robotpy-wpilib/gen/FieldObject2d.yml rename to subprojects/robotpy-wpilib/semiwrap/FieldObject2d.yml index 7d10e38d9..1bf734ef9 100644 --- a/subprojects/robotpy-wpilib/gen/FieldObject2d.yml +++ b/subprojects/robotpy-wpilib/semiwrap/FieldObject2d.yml @@ -1,11 +1,8 @@ ---- - extra_includes: - frc/trajectory/Trajectory.h classes: - FieldObject2d: - shared_ptr: true + frc::FieldObject2d: nodelete: true methods: FieldObject2d: diff --git a/subprojects/robotpy-wpilib/gen/Filesystem.yml b/subprojects/robotpy-wpilib/semiwrap/Filesystem.yml similarity index 97% rename from subprojects/robotpy-wpilib/gen/Filesystem.yml rename to subprojects/robotpy-wpilib/semiwrap/Filesystem.yml index 97d89872a..37ec008f9 100644 --- a/subprojects/robotpy-wpilib/gen/Filesystem.yml +++ b/subprojects/robotpy-wpilib/semiwrap/Filesystem.yml @@ -1,4 +1,3 @@ ---- functions: GetOperatingDirectory: diff --git a/subprojects/robotpy-wpilib/gen/Filter.yml b/subprojects/robotpy-wpilib/semiwrap/Filter.yml similarity index 87% rename from subprojects/robotpy-wpilib/gen/Filter.yml rename to subprojects/robotpy-wpilib/semiwrap/Filter.yml index 01af9d4f2..e4e9da20a 100644 --- a/subprojects/robotpy-wpilib/gen/Filter.yml +++ b/subprojects/robotpy-wpilib/semiwrap/Filter.yml @@ -1,8 +1,5 @@ ---- - classes: - Filter: - shared_ptr: true + frc::Filter: methods: Filter: overloads: diff --git a/subprojects/robotpy-wpilib/semiwrap/I2C.yml b/subprojects/robotpy-wpilib/semiwrap/I2C.yml new file mode 100644 index 000000000..5ac39cbf5 --- /dev/null +++ b/subprojects/robotpy-wpilib/semiwrap/I2C.yml @@ -0,0 +1,26 @@ +classes: + frc::I2C: + enums: + Port: + methods: + I2C: + GetPort: + GetDeviceAddress: + Transaction: + buffers: + - {type: IN, src: dataToSend, len: sendSize} + - {type: OUT, src: dataReceived, len: receiveSize} + AddressOnly: + Write: + WriteBulk: + buffers: + - {type: IN, src: data, len: count} + Read: + buffers: + - {type: OUT, src: data, len: count} + ReadOnly: + buffers: + - {type: OUT, src: buffer, len: count} + VerifySensor: + buffers: + - {type: IN, src: expected, len: count} diff --git a/subprojects/robotpy-wpilib/gen/InterruptableSensorBase.yml b/subprojects/robotpy-wpilib/semiwrap/InterruptableSensorBase.yml similarity index 90% rename from subprojects/robotpy-wpilib/gen/InterruptableSensorBase.yml rename to subprojects/robotpy-wpilib/semiwrap/InterruptableSensorBase.yml index 0a5174441..5dabdb341 100644 --- a/subprojects/robotpy-wpilib/gen/InterruptableSensorBase.yml +++ b/subprojects/robotpy-wpilib/semiwrap/InterruptableSensorBase.yml @@ -1,8 +1,5 @@ ---- - classes: - InterruptableSensorBase: - shared_ptr: true + frc::InterruptableSensorBase: typealias: - frc::InterruptableSensorBase::WaitResult attributes: @@ -19,7 +16,7 @@ classes: HAL_InterruptHandlerFunction, void*: ignore: true std::function: - "": + '': CancelInterrupts: WaitForInterrupt: EnableInterrupts: diff --git a/subprojects/robotpy-wpilib/gen/IterativeRobot.yml b/subprojects/robotpy-wpilib/semiwrap/IterativeRobot.yml similarity index 66% rename from subprojects/robotpy-wpilib/gen/IterativeRobot.yml rename to subprojects/robotpy-wpilib/semiwrap/IterativeRobot.yml index b56b417ca..8cb936db6 100644 --- a/subprojects/robotpy-wpilib/gen/IterativeRobot.yml +++ b/subprojects/robotpy-wpilib/semiwrap/IterativeRobot.yml @@ -1,8 +1,5 @@ ---- - classes: - IterativeRobot: - shared_ptr: false + frc::IterativeRobot: methods: IterativeRobot: StartCompetition: diff --git a/subprojects/robotpy-wpilib/gen/IterativeRobotBase.yml b/subprojects/robotpy-wpilib/semiwrap/IterativeRobotBase.yml similarity index 97% rename from subprojects/robotpy-wpilib/gen/IterativeRobotBase.yml rename to subprojects/robotpy-wpilib/semiwrap/IterativeRobotBase.yml index 74257e791..e32883833 100644 --- a/subprojects/robotpy-wpilib/gen/IterativeRobotBase.yml +++ b/subprojects/robotpy-wpilib/semiwrap/IterativeRobotBase.yml @@ -1,8 +1,5 @@ ---- - classes: - IterativeRobotBase: - shared_ptr: false + frc::IterativeRobotBase: attributes: m_period: methods: diff --git a/subprojects/robotpy-wpilib/gen/Jaguar.yml b/subprojects/robotpy-wpilib/semiwrap/Jaguar.yml similarity index 70% rename from subprojects/robotpy-wpilib/gen/Jaguar.yml rename to subprojects/robotpy-wpilib/semiwrap/Jaguar.yml index 64c6400c1..20503e66c 100644 --- a/subprojects/robotpy-wpilib/gen/Jaguar.yml +++ b/subprojects/robotpy-wpilib/semiwrap/Jaguar.yml @@ -1,10 +1,7 @@ ---- - extra_includes: - wpi/sendable/SendableBuilder.h classes: - Jaguar: - shared_ptr: true + frc::Jaguar: methods: Jaguar: diff --git a/subprojects/robotpy-wpilib/gen/Joystick.yml b/subprojects/robotpy-wpilib/semiwrap/Joystick.yml similarity index 98% rename from subprojects/robotpy-wpilib/gen/Joystick.yml rename to subprojects/robotpy-wpilib/semiwrap/Joystick.yml index 24c947748..511ff6a9d 100644 --- a/subprojects/robotpy-wpilib/gen/Joystick.yml +++ b/subprojects/robotpy-wpilib/semiwrap/Joystick.yml @@ -1,10 +1,9 @@ ---- extra_includes: - frc/DriverStation.h classes: - Joystick: + frc::Joystick: attributes: kDefaultXChannel: kDefaultYChannel: diff --git a/subprojects/robotpy-wpilib/gen/LEDPattern.yml b/subprojects/robotpy-wpilib/semiwrap/LEDPattern.yml similarity index 90% rename from subprojects/robotpy-wpilib/gen/LEDPattern.yml rename to subprojects/robotpy-wpilib/semiwrap/LEDPattern.yml index 0d0369ec9..6f57a590b 100644 --- a/subprojects/robotpy-wpilib/gen/LEDPattern.yml +++ b/subprojects/robotpy-wpilib/semiwrap/LEDPattern.yml @@ -1,13 +1,12 @@ ---- classes: - LEDPattern: + frc::LEDPattern: attributes: kOff: enums: GradientType: methods: - 'Off': + "Off": LEDPattern: ApplyTo: overloads: @@ -40,3 +39,7 @@ classes: GradientType, std::initializer_list: ignore: true Rainbow: + frc::LEDPattern::LEDReader: + methods: + LEDReader: + size: \ No newline at end of file diff --git a/subprojects/robotpy-wpilib/gen/ListenerExecutor.yml b/subprojects/robotpy-wpilib/semiwrap/ListenerExecutor.yml similarity index 57% rename from subprojects/robotpy-wpilib/gen/ListenerExecutor.yml rename to subprojects/robotpy-wpilib/semiwrap/ListenerExecutor.yml index 6de5f527c..47eaa9b10 100644 --- a/subprojects/robotpy-wpilib/gen/ListenerExecutor.yml +++ b/subprojects/robotpy-wpilib/semiwrap/ListenerExecutor.yml @@ -1,8 +1,5 @@ ---- - classes: - ListenerExecutor: - shared_ptr: true + frc::ListenerExecutor: methods: Execute: RunListenerTasks: diff --git a/subprojects/robotpy-wpilib/gen/LiveWindow.yml b/subprojects/robotpy-wpilib/semiwrap/LiveWindow.yml similarity index 97% rename from subprojects/robotpy-wpilib/gen/LiveWindow.yml rename to subprojects/robotpy-wpilib/semiwrap/LiveWindow.yml index ccfc5eba3..adb1988f1 100644 --- a/subprojects/robotpy-wpilib/gen/LiveWindow.yml +++ b/subprojects/robotpy-wpilib/semiwrap/LiveWindow.yml @@ -1,11 +1,10 @@ ---- extra_includes: - wpi/sendable/Sendable.h - pybind11/functional.h classes: - LiveWindow: + frc::LiveWindow: methods: GetInstance: ignore: true diff --git a/subprojects/robotpy-wpilib/gen/Mechanism2d.yml b/subprojects/robotpy-wpilib/semiwrap/Mechanism2d.yml similarity index 92% rename from subprojects/robotpy-wpilib/gen/Mechanism2d.yml rename to subprojects/robotpy-wpilib/semiwrap/Mechanism2d.yml index 51e65409a..c9c2bcf2a 100644 --- a/subprojects/robotpy-wpilib/gen/Mechanism2d.yml +++ b/subprojects/robotpy-wpilib/semiwrap/Mechanism2d.yml @@ -1,10 +1,9 @@ ---- extra_includes: - wpi/sendable/SendableBuilder.h classes: - Mechanism2d: + frc::Mechanism2d: ignored_bases: - wpi::SendableHelper methods: diff --git a/subprojects/robotpy-wpilib/gen/MechanismLigament2d.yml b/subprojects/robotpy-wpilib/semiwrap/MechanismLigament2d.yml similarity index 89% rename from subprojects/robotpy-wpilib/gen/MechanismLigament2d.yml rename to subprojects/robotpy-wpilib/semiwrap/MechanismLigament2d.yml index c8f430977..ac61fc6c1 100644 --- a/subprojects/robotpy-wpilib/gen/MechanismLigament2d.yml +++ b/subprojects/robotpy-wpilib/semiwrap/MechanismLigament2d.yml @@ -1,7 +1,6 @@ ---- classes: - MechanismLigament2d: + frc::MechanismLigament2d: methods: MechanismLigament2d: ignore: true diff --git a/subprojects/robotpy-wpilib/gen/MechanismObject2d.yml b/subprojects/robotpy-wpilib/semiwrap/MechanismObject2d.yml similarity index 94% rename from subprojects/robotpy-wpilib/gen/MechanismObject2d.yml rename to subprojects/robotpy-wpilib/semiwrap/MechanismObject2d.yml index 336e0d5b8..38f6f8209 100644 --- a/subprojects/robotpy-wpilib/gen/MechanismObject2d.yml +++ b/subprojects/robotpy-wpilib/semiwrap/MechanismObject2d.yml @@ -1,10 +1,9 @@ ---- extra_includes: - frc/smartdashboard/MechanismLigament2d.h classes: - MechanismObject2d: + frc::MechanismObject2d: force_type_casters: - units::degree_t attributes: @@ -19,7 +18,7 @@ classes: UpdateEntries: # keep this in sync with MechanismRoot2d.yml -inline_code: | +inline_code: |- cls_MechanismObject2d .def("appendLigament", [](MechanismObject2d *self, std::string_view name, double length, units::degree_t angle, @@ -30,4 +29,4 @@ inline_code: | py::arg("lineWidth") = 6, py::arg("color") = frc::Color8Bit{235, 137, 52}, "Append a ligament node", py::return_value_policy::reference_internal) - ; \ No newline at end of file + ; diff --git a/subprojects/robotpy-wpilib/gen/MechanismRoot2d.yml b/subprojects/robotpy-wpilib/semiwrap/MechanismRoot2d.yml similarity index 95% rename from subprojects/robotpy-wpilib/gen/MechanismRoot2d.yml rename to subprojects/robotpy-wpilib/semiwrap/MechanismRoot2d.yml index 94478871d..b8b37bfe5 100644 --- a/subprojects/robotpy-wpilib/gen/MechanismRoot2d.yml +++ b/subprojects/robotpy-wpilib/semiwrap/MechanismRoot2d.yml @@ -1,10 +1,9 @@ ---- extra_includes: - frc/smartdashboard/MechanismLigament2d.h classes: - MechanismRoot2d: + frc::MechanismRoot2d: force_type_casters: - units::degree_t methods: @@ -17,7 +16,7 @@ classes: ignore: true # keep this in sync with MechanismRoot2d.h -inline_code: | +inline_code: |- cls_MechanismRoot2d .def("getName", [](MechanismRoot2d *self) { return self->GetName(); }, release_gil()) .def("appendLigament", [](MechanismRoot2d *self, @@ -29,4 +28,4 @@ inline_code: | py::arg("lineWidth") = 6, py::arg("color") = frc::Color8Bit{235, 137, 52}, release_gil(), "Append a ligament node", py::return_value_policy::reference_internal) - ; \ No newline at end of file + ; diff --git a/subprojects/robotpy-wpilib/gen/MotorControllerGroup.yml b/subprojects/robotpy-wpilib/semiwrap/MotorControllerGroup.yml similarity index 97% rename from subprojects/robotpy-wpilib/gen/MotorControllerGroup.yml rename to subprojects/robotpy-wpilib/semiwrap/MotorControllerGroup.yml index cda4c4cc8..d02bec6be 100644 --- a/subprojects/robotpy-wpilib/gen/MotorControllerGroup.yml +++ b/subprojects/robotpy-wpilib/semiwrap/MotorControllerGroup.yml @@ -1,11 +1,10 @@ ---- extra_includes: - wpi/sendable/SendableBuilder.h - pybind11/stl.h classes: - PyMotorControllerGroup: + frc::PyMotorControllerGroup: rename: MotorControllerGroup ignored_bases: - wpi::SendableHelper diff --git a/subprojects/robotpy-wpilib/gen/MotorSafety.yml b/subprojects/robotpy-wpilib/semiwrap/MotorSafety.yml similarity index 79% rename from subprojects/robotpy-wpilib/gen/MotorSafety.yml rename to subprojects/robotpy-wpilib/semiwrap/MotorSafety.yml index 7c786e22b..4b4ec84d5 100644 --- a/subprojects/robotpy-wpilib/gen/MotorSafety.yml +++ b/subprojects/robotpy-wpilib/semiwrap/MotorSafety.yml @@ -1,11 +1,8 @@ ---- - extra_includes: - wpi/SmallString.h classes: - MotorSafety: - shared_ptr: true + frc::MotorSafety: methods: MotorSafety: Feed: @@ -17,4 +14,4 @@ classes: Check: CheckMotors: StopMotor: - GetDescription: \ No newline at end of file + GetDescription: diff --git a/subprojects/robotpy-wpilib/gen/NidecBrushless.yml b/subprojects/robotpy-wpilib/semiwrap/NidecBrushless.yml similarity index 89% rename from subprojects/robotpy-wpilib/gen/NidecBrushless.yml rename to subprojects/robotpy-wpilib/semiwrap/NidecBrushless.yml index 26275c597..89455f377 100644 --- a/subprojects/robotpy-wpilib/gen/NidecBrushless.yml +++ b/subprojects/robotpy-wpilib/semiwrap/NidecBrushless.yml @@ -1,12 +1,9 @@ ---- - extra_includes: - wpi/sendable/SendableBuilder.h - wpi/SmallString.h classes: - NidecBrushless: - shared_ptr: true + frc::NidecBrushless: ignored_bases: - wpi::SendableHelper methods: diff --git a/subprojects/robotpy-wpilib/gen/Notifier.yml b/subprojects/robotpy-wpilib/semiwrap/Notifier.yml similarity index 91% rename from subprojects/robotpy-wpilib/gen/Notifier.yml rename to subprojects/robotpy-wpilib/semiwrap/Notifier.yml index 7024a6f07..cfa1876b0 100644 --- a/subprojects/robotpy-wpilib/gen/Notifier.yml +++ b/subprojects/robotpy-wpilib/semiwrap/Notifier.yml @@ -1,8 +1,5 @@ ---- - classes: - PyNotifier: - shared_ptr: true + frc::PyNotifier: rename: Notifier methods: PyNotifier: diff --git a/subprojects/robotpy-wpilib/gen/PS4Controller.yml b/subprojects/robotpy-wpilib/semiwrap/PS4Controller.yml similarity index 96% rename from subprojects/robotpy-wpilib/gen/PS4Controller.yml rename to subprojects/robotpy-wpilib/semiwrap/PS4Controller.yml index 97a04ddc7..0491ac42c 100644 --- a/subprojects/robotpy-wpilib/gen/PS4Controller.yml +++ b/subprojects/robotpy-wpilib/semiwrap/PS4Controller.yml @@ -1,11 +1,10 @@ ---- extra_includes: - wpi/sendable/SendableBuilder.h - frc/event/BooleanEvent.h classes: - PS4Controller: + frc::PS4Controller: ignored_bases: - wpi::SendableHelper methods: @@ -76,7 +75,7 @@ classes: GetTouchpadButtonPressed: GetTouchpadButtonReleased: InitSendable: - PS4Controller::Button: + frc::PS4Controller::Button: attributes: kSquare: kCross: @@ -92,7 +91,7 @@ classes: kR3: kPS: kTouchpad: - PS4Controller::Axis: + frc::PS4Controller::Axis: attributes: kLeftX: kLeftY: diff --git a/subprojects/robotpy-wpilib/gen/PS5Controller.yml b/subprojects/robotpy-wpilib/semiwrap/PS5Controller.yml similarity index 96% rename from subprojects/robotpy-wpilib/gen/PS5Controller.yml rename to subprojects/robotpy-wpilib/semiwrap/PS5Controller.yml index 96f635ae9..af4169888 100644 --- a/subprojects/robotpy-wpilib/gen/PS5Controller.yml +++ b/subprojects/robotpy-wpilib/semiwrap/PS5Controller.yml @@ -1,10 +1,9 @@ ---- extra_includes: - wpi/sendable/SendableBuilder.h classes: - PS5Controller: + frc::PS5Controller: ignored_bases: - wpi::SendableHelper methods: @@ -75,7 +74,7 @@ classes: GetTouchpadButtonPressed: GetTouchpadButtonReleased: InitSendable: - PS5Controller::Button: + frc::PS5Controller::Button: attributes: kSquare: kCross: @@ -91,7 +90,7 @@ classes: kR3: kPS: kTouchpad: - PS5Controller::Axis: + frc::PS5Controller::Axis: attributes: kLeftX: kLeftY: diff --git a/subprojects/robotpy-wpilib/gen/PWM.yml b/subprojects/robotpy-wpilib/semiwrap/PWM.yml similarity index 95% rename from subprojects/robotpy-wpilib/gen/PWM.yml rename to subprojects/robotpy-wpilib/semiwrap/PWM.yml index c80c2952c..8ed8c5325 100644 --- a/subprojects/robotpy-wpilib/gen/PWM.yml +++ b/subprojects/robotpy-wpilib/semiwrap/PWM.yml @@ -1,13 +1,10 @@ ---- - extra_includes: - wpi/sendable/SendableBuilder.h - frc/AddressableLED.h - wpi/SmallString.h classes: - PWM: - shared_ptr: true + frc::PWM: ignored_bases: - wpi::SendableHelper enums: diff --git a/subprojects/robotpy-wpilib/gen/PWMMotorController.yml b/subprojects/robotpy-wpilib/semiwrap/PWMMotorController.yml similarity index 95% rename from subprojects/robotpy-wpilib/gen/PWMMotorController.yml rename to subprojects/robotpy-wpilib/semiwrap/PWMMotorController.yml index c06871e53..676b0f8ab 100644 --- a/subprojects/robotpy-wpilib/gen/PWMMotorController.yml +++ b/subprojects/robotpy-wpilib/semiwrap/PWMMotorController.yml @@ -1,11 +1,10 @@ ---- extra_includes: - wpi/sendable/SendableBuilder.h - frc/DMA.h classes: - PWMMotorController: + frc::PWMMotorController: ignored_bases: - wpi::SendableHelper attributes: diff --git a/subprojects/robotpy-wpilib/gen/PWMSparkFlex.yml b/subprojects/robotpy-wpilib/semiwrap/PWMSparkFlex.yml similarity index 67% rename from subprojects/robotpy-wpilib/gen/PWMSparkFlex.yml rename to subprojects/robotpy-wpilib/semiwrap/PWMSparkFlex.yml index 6039a898d..87bac76b1 100644 --- a/subprojects/robotpy-wpilib/gen/PWMSparkFlex.yml +++ b/subprojects/robotpy-wpilib/semiwrap/PWMSparkFlex.yml @@ -1,6 +1,5 @@ ---- classes: - PWMSparkFlex: + frc::PWMSparkFlex: methods: PWMSparkFlex: diff --git a/subprojects/robotpy-wpilib/gen/PWMSparkMax.yml b/subprojects/robotpy-wpilib/semiwrap/PWMSparkMax.yml similarity index 68% rename from subprojects/robotpy-wpilib/gen/PWMSparkMax.yml rename to subprojects/robotpy-wpilib/semiwrap/PWMSparkMax.yml index ae871e940..3c13a9d36 100644 --- a/subprojects/robotpy-wpilib/gen/PWMSparkMax.yml +++ b/subprojects/robotpy-wpilib/semiwrap/PWMSparkMax.yml @@ -1,10 +1,7 @@ ---- - extra_includes: - wpi/sendable/SendableBuilder.h classes: - PWMSparkMax: - shared_ptr: true + frc::PWMSparkMax: methods: PWMSparkMax: diff --git a/subprojects/robotpy-wpilib/gen/PWMSpeedController.yml b/subprojects/robotpy-wpilib/semiwrap/PWMSpeedController.yml similarity index 83% rename from subprojects/robotpy-wpilib/gen/PWMSpeedController.yml rename to subprojects/robotpy-wpilib/semiwrap/PWMSpeedController.yml index b3e6c707e..95e2053c5 100644 --- a/subprojects/robotpy-wpilib/gen/PWMSpeedController.yml +++ b/subprojects/robotpy-wpilib/semiwrap/PWMSpeedController.yml @@ -1,11 +1,8 @@ ---- - extra_includes: - wpi/sendable/SendableBuilder.h classes: - PWMSpeedController: - shared_ptr: true + frc::PWMSpeedController: methods: Set: Get: diff --git a/subprojects/robotpy-wpilib/gen/PWMTalonFX.yml b/subprojects/robotpy-wpilib/semiwrap/PWMTalonFX.yml similarity index 69% rename from subprojects/robotpy-wpilib/gen/PWMTalonFX.yml rename to subprojects/robotpy-wpilib/semiwrap/PWMTalonFX.yml index 76c6ffcc1..3c05e86f8 100644 --- a/subprojects/robotpy-wpilib/gen/PWMTalonFX.yml +++ b/subprojects/robotpy-wpilib/semiwrap/PWMTalonFX.yml @@ -1,10 +1,7 @@ ---- - extra_includes: - wpi/sendable/SendableBuilder.h classes: - PWMTalonFX: - shared_ptr: true + frc::PWMTalonFX: methods: PWMTalonFX: diff --git a/subprojects/robotpy-wpilib/gen/PWMTalonSRX.yml b/subprojects/robotpy-wpilib/semiwrap/PWMTalonSRX.yml similarity index 68% rename from subprojects/robotpy-wpilib/gen/PWMTalonSRX.yml rename to subprojects/robotpy-wpilib/semiwrap/PWMTalonSRX.yml index 6e5ffd534..6e979fd27 100644 --- a/subprojects/robotpy-wpilib/gen/PWMTalonSRX.yml +++ b/subprojects/robotpy-wpilib/semiwrap/PWMTalonSRX.yml @@ -1,10 +1,7 @@ ---- - extra_includes: - wpi/sendable/SendableBuilder.h classes: - PWMTalonSRX: - shared_ptr: true + frc::PWMTalonSRX: methods: PWMTalonSRX: diff --git a/subprojects/robotpy-wpilib/gen/PWMVenom.yml b/subprojects/robotpy-wpilib/semiwrap/PWMVenom.yml similarity index 69% rename from subprojects/robotpy-wpilib/gen/PWMVenom.yml rename to subprojects/robotpy-wpilib/semiwrap/PWMVenom.yml index 9a47ac793..522f24456 100644 --- a/subprojects/robotpy-wpilib/gen/PWMVenom.yml +++ b/subprojects/robotpy-wpilib/semiwrap/PWMVenom.yml @@ -1,10 +1,7 @@ ---- - extra_includes: - wpi/sendable/SendableBuilder.h classes: - PWMVenom: - shared_ptr: true + frc::PWMVenom: methods: PWMVenom: diff --git a/subprojects/robotpy-wpilib/gen/PWMVictorSPX.yml b/subprojects/robotpy-wpilib/semiwrap/PWMVictorSPX.yml similarity index 68% rename from subprojects/robotpy-wpilib/gen/PWMVictorSPX.yml rename to subprojects/robotpy-wpilib/semiwrap/PWMVictorSPX.yml index 475da9e8f..f7bcedd1d 100644 --- a/subprojects/robotpy-wpilib/gen/PWMVictorSPX.yml +++ b/subprojects/robotpy-wpilib/semiwrap/PWMVictorSPX.yml @@ -1,10 +1,7 @@ ---- - extra_includes: - wpi/sendable/SendableBuilder.h classes: - PWMVictorSPX: - shared_ptr: true + frc::PWMVictorSPX: methods: PWMVictorSPX: diff --git a/subprojects/robotpy-wpilib/gen/PneumaticHub.yml b/subprojects/robotpy-wpilib/semiwrap/PneumaticHub.yml similarity index 93% rename from subprojects/robotpy-wpilib/gen/PneumaticHub.yml rename to subprojects/robotpy-wpilib/semiwrap/PneumaticHub.yml index 5a2875411..bec31015e 100644 --- a/subprojects/robotpy-wpilib/gen/PneumaticHub.yml +++ b/subprojects/robotpy-wpilib/semiwrap/PneumaticHub.yml @@ -1,4 +1,3 @@ ---- extra_includes: - wpi/sendable/SendableBuilder.h @@ -7,11 +6,11 @@ extra_includes: - frc/DoubleSolenoid.h classes: - PneumaticHub: + frc::PneumaticHub: methods: PneumaticHub: overloads: - "": + '': int: GetCompressor: DisableCompressor: @@ -45,7 +44,7 @@ classes: GetSolenoidsVoltage: GetAnalogVoltage: GetPressure: - PneumaticHub::Version: + frc::PneumaticHub::Version: attributes: FirmwareMajor: FirmwareMinor: @@ -53,7 +52,7 @@ classes: HardwareMinor: HardwareMajor: UniqueId: - PneumaticHub::Faults: + frc::PneumaticHub::Faults: attributes: Channel0Fault: Channel1Fault: @@ -79,7 +78,7 @@ classes: HardwareFault: methods: GetChannelFault: - PneumaticHub::StickyFaults: + frc::PneumaticHub::StickyFaults: attributes: CompressorOverCurrent: CompressorOpen: diff --git a/subprojects/robotpy-wpilib/gen/PneumaticsBase.yml b/subprojects/robotpy-wpilib/semiwrap/PneumaticsBase.yml similarity index 97% rename from subprojects/robotpy-wpilib/gen/PneumaticsBase.yml rename to subprojects/robotpy-wpilib/semiwrap/PneumaticsBase.yml index 2c95f0cdb..2ab61671e 100644 --- a/subprojects/robotpy-wpilib/gen/PneumaticsBase.yml +++ b/subprojects/robotpy-wpilib/semiwrap/PneumaticsBase.yml @@ -1,4 +1,3 @@ ---- extra_includes: - wpi/sendable/SendableBuilder.h @@ -8,7 +7,7 @@ extra_includes: classes: - PneumaticsBase: + frc::PneumaticsBase: methods: GetCompressor: GetPressureSwitch: diff --git a/subprojects/robotpy-wpilib/gen/PneumaticsControlModule.yml b/subprojects/robotpy-wpilib/semiwrap/PneumaticsControlModule.yml similarity index 96% rename from subprojects/robotpy-wpilib/gen/PneumaticsControlModule.yml rename to subprojects/robotpy-wpilib/semiwrap/PneumaticsControlModule.yml index 0d26b925d..212d42b85 100644 --- a/subprojects/robotpy-wpilib/gen/PneumaticsControlModule.yml +++ b/subprojects/robotpy-wpilib/semiwrap/PneumaticsControlModule.yml @@ -1,4 +1,3 @@ ---- extra_includes: - wpi/sendable/SendableBuilder.h @@ -7,11 +6,11 @@ extra_includes: - frc/DoubleSolenoid.h classes: - PneumaticsControlModule: + frc::PneumaticsControlModule: methods: PneumaticsControlModule: overloads: - "": + '': int: GetCompressor: DisableCompressor: diff --git a/subprojects/robotpy-wpilib/gen/PneumaticsModuleType.yml b/subprojects/robotpy-wpilib/semiwrap/PneumaticsModuleType.yml similarity index 88% rename from subprojects/robotpy-wpilib/gen/PneumaticsModuleType.yml rename to subprojects/robotpy-wpilib/semiwrap/PneumaticsModuleType.yml index 42d8837bf..5479b7ee1 100644 --- a/subprojects/robotpy-wpilib/gen/PneumaticsModuleType.yml +++ b/subprojects/robotpy-wpilib/semiwrap/PneumaticsModuleType.yml @@ -1,4 +1,3 @@ ---- enums: PneumaticsModuleType: diff --git a/subprojects/robotpy-wpilib/gen/Potentiometer.yml b/subprojects/robotpy-wpilib/semiwrap/Potentiometer.yml similarity index 64% rename from subprojects/robotpy-wpilib/gen/Potentiometer.yml rename to subprojects/robotpy-wpilib/semiwrap/Potentiometer.yml index ef2c8c033..ab5facc05 100644 --- a/subprojects/robotpy-wpilib/gen/Potentiometer.yml +++ b/subprojects/robotpy-wpilib/semiwrap/Potentiometer.yml @@ -1,8 +1,5 @@ ---- - classes: - Potentiometer: - shared_ptr: true + frc::Potentiometer: methods: Potentiometer: Get: diff --git a/subprojects/robotpy-wpilib/gen/PowerDistribution.yml b/subprojects/robotpy-wpilib/semiwrap/PowerDistribution.yml similarity index 94% rename from subprojects/robotpy-wpilib/gen/PowerDistribution.yml rename to subprojects/robotpy-wpilib/semiwrap/PowerDistribution.yml index 2a2dfb1e4..792dade99 100644 --- a/subprojects/robotpy-wpilib/gen/PowerDistribution.yml +++ b/subprojects/robotpy-wpilib/semiwrap/PowerDistribution.yml @@ -1,10 +1,9 @@ ---- extra_includes: - wpi/sendable/SendableBuilder.h classes: - PowerDistribution: + frc::PowerDistribution: ignored_bases: - wpi::SendableHelper attributes: @@ -14,7 +13,7 @@ classes: methods: PowerDistribution: overloads: - "": + '': int, ModuleType: GetVoltage: GetTemperature: @@ -34,7 +33,7 @@ classes: GetNumChannels: GetAllCurrents: InitSendable: - PowerDistribution::Version: + frc::PowerDistribution::Version: attributes: FirmwareMajor: FirmwareMinor: @@ -42,7 +41,7 @@ classes: HardwareMinor: HardwareMajor: UniqueId: - PowerDistribution::Faults: + frc::PowerDistribution::Faults: attributes: Channel0BreakerFault: Channel1BreakerFault: @@ -73,7 +72,7 @@ classes: HardwareFault: methods: GetBreakerFault: - PowerDistribution::StickyFaults: + frc::PowerDistribution::StickyFaults: attributes: Channel0BreakerFault: Channel1BreakerFault: diff --git a/subprojects/robotpy-wpilib/gen/Preferences.yml b/subprojects/robotpy-wpilib/semiwrap/Preferences.yml similarity index 96% rename from subprojects/robotpy-wpilib/gen/Preferences.yml rename to subprojects/robotpy-wpilib/semiwrap/Preferences.yml index d93e052d0..4fed7294e 100644 --- a/subprojects/robotpy-wpilib/gen/Preferences.yml +++ b/subprojects/robotpy-wpilib/semiwrap/Preferences.yml @@ -1,7 +1,6 @@ ---- classes: - Preferences: + frc::Preferences: methods: GetInstance: ignore: true diff --git a/subprojects/robotpy-wpilib/gen/Relay.yml b/subprojects/robotpy-wpilib/semiwrap/Relay.yml similarity index 93% rename from subprojects/robotpy-wpilib/gen/Relay.yml rename to subprojects/robotpy-wpilib/semiwrap/Relay.yml index 8dccbb273..e42fc0f0c 100644 --- a/subprojects/robotpy-wpilib/gen/Relay.yml +++ b/subprojects/robotpy-wpilib/semiwrap/Relay.yml @@ -1,12 +1,9 @@ ---- - extra_includes: - wpi/sendable/SendableBuilder.h - wpi/SmallString.h classes: - Relay: - shared_ptr: true + frc::Relay: ignored_bases: - wpi::SendableHelper enums: diff --git a/subprojects/robotpy-wpilib/gen/Resource.yml b/subprojects/robotpy-wpilib/semiwrap/Resource.yml similarity index 81% rename from subprojects/robotpy-wpilib/gen/Resource.yml rename to subprojects/robotpy-wpilib/semiwrap/Resource.yml index 6cc2d5f89..add3d0568 100644 --- a/subprojects/robotpy-wpilib/gen/Resource.yml +++ b/subprojects/robotpy-wpilib/semiwrap/Resource.yml @@ -1,8 +1,5 @@ ---- - classes: - Resource: - shared_ptr: true + frc::Resource: methods: CreateResourceObject: Resource: diff --git a/subprojects/robotpy-wpilib/gen/RobotBase.yml b/subprojects/robotpy-wpilib/semiwrap/RobotBase.yml similarity index 97% rename from subprojects/robotpy-wpilib/gen/RobotBase.yml rename to subprojects/robotpy-wpilib/semiwrap/RobotBase.yml index 309954bdf..8da55ce93 100644 --- a/subprojects/robotpy-wpilib/gen/RobotBase.yml +++ b/subprojects/robotpy-wpilib/semiwrap/RobotBase.yml @@ -1,5 +1,3 @@ ---- - extra_includes: - frc/DriverStation.h - rpy/ControlWord.h @@ -15,8 +13,7 @@ functions: ResetMotorSafety: ignore: true classes: - RobotBase: - shared_ptr: false + frc::RobotBase: attributes: m_ds: rename: ds @@ -67,6 +64,6 @@ classes: ".. versionadded:: 2019.2.1\n" "\n" ".. note:: This function only exists in RobotPy\n")); - + auto logger = py::module::import("logging").attr("getLogger")("robot"); cls_RobotBase.attr("logger") = logger; diff --git a/subprojects/robotpy-wpilib/gen/RobotController.yml b/subprojects/robotpy-wpilib/semiwrap/RobotController.yml similarity index 93% rename from subprojects/robotpy-wpilib/gen/RobotController.yml rename to subprojects/robotpy-wpilib/semiwrap/RobotController.yml index 796c2f230..b9b68b548 100644 --- a/subprojects/robotpy-wpilib/gen/RobotController.yml +++ b/subprojects/robotpy-wpilib/semiwrap/RobotController.yml @@ -1,19 +1,15 @@ ---- - enums: RadioLEDState: classes: - CANStatus: - shared_ptr: false + frc::CANStatus: attributes: percentBusUtilization: busOffCount: txFullCount: receiveErrorCount: transmitErrorCount: - RobotController: - shared_ptr: false + frc::RobotController: nodelete: true methods: RobotController: diff --git a/subprojects/robotpy-wpilib/gen/RobotState.yml b/subprojects/robotpy-wpilib/semiwrap/RobotState.yml similarity index 83% rename from subprojects/robotpy-wpilib/gen/RobotState.yml rename to subprojects/robotpy-wpilib/semiwrap/RobotState.yml index fe8cbc1d6..dd55ad159 100644 --- a/subprojects/robotpy-wpilib/gen/RobotState.yml +++ b/subprojects/robotpy-wpilib/semiwrap/RobotState.yml @@ -1,8 +1,5 @@ ---- - classes: - RobotState: - shared_ptr: false + frc::RobotState: nodelete: true methods: RobotState: diff --git a/subprojects/robotpy-wpilib/gen/RuntimeType.yml b/subprojects/robotpy-wpilib/semiwrap/RuntimeType.yml similarity index 85% rename from subprojects/robotpy-wpilib/gen/RuntimeType.yml rename to subprojects/robotpy-wpilib/semiwrap/RuntimeType.yml index 5631a20b7..103032201 100644 --- a/subprojects/robotpy-wpilib/gen/RuntimeType.yml +++ b/subprojects/robotpy-wpilib/semiwrap/RuntimeType.yml @@ -1,4 +1,3 @@ ---- enums: RuntimeType: diff --git a/subprojects/robotpy-wpilib/gen/SD540.yml b/subprojects/robotpy-wpilib/semiwrap/SD540.yml similarity index 70% rename from subprojects/robotpy-wpilib/gen/SD540.yml rename to subprojects/robotpy-wpilib/semiwrap/SD540.yml index 6a8912ea0..756428a73 100644 --- a/subprojects/robotpy-wpilib/gen/SD540.yml +++ b/subprojects/robotpy-wpilib/semiwrap/SD540.yml @@ -1,10 +1,7 @@ ---- - extra_includes: - wpi/sendable/SendableBuilder.h classes: - SD540: - shared_ptr: true + frc::SD540: methods: SD540: diff --git a/subprojects/robotpy-wpilib/gen/SPI.yml b/subprojects/robotpy-wpilib/semiwrap/SPI.yml similarity index 85% rename from subprojects/robotpy-wpilib/gen/SPI.yml rename to subprojects/robotpy-wpilib/semiwrap/SPI.yml index 2caf0b522..a703b7e84 100644 --- a/subprojects/robotpy-wpilib/gen/SPI.yml +++ b/subprojects/robotpy-wpilib/semiwrap/SPI.yml @@ -1,11 +1,8 @@ ---- - extra_includes: - frc/DigitalSource.h classes: - SPI: - shared_ptr: true + frc::SPI: attributes: m_port: ignore: true @@ -35,14 +32,14 @@ classes: SetChipSelectActiveLow: Write: buffers: - - { type: IN, src: data, len: size } + - {type: IN, src: data, len: size} Read: buffers: - - { type: OUT, src: dataReceived, len: size } + - {type: OUT, src: dataReceived, len: size} Transaction: buffers: - - { type: IN, src: dataToSend, len: size } - - { type: OUT, src: dataReceived, len: size } + - {type: IN, src: dataToSend, len: size} + - {type: OUT, src: dataReceived, len: size} # TODO: dataToSend buffer must be at least as long as dataReceived buffer InitAuto: FreeAuto: @@ -59,7 +56,7 @@ classes: overloads: uint32_t*, int, units::second_t: buffers: - - { type: OUT, src: buffer, len: numToRead } + - {type: OUT, src: buffer, len: numToRead} uint32_t*, int, double: ignore: true GetAutoDroppedCount: diff --git a/subprojects/robotpy-wpilib/gen/SendableBuilderImpl.yml b/subprojects/robotpy-wpilib/semiwrap/SendableBuilderImpl.yml similarity index 96% rename from subprojects/robotpy-wpilib/gen/SendableBuilderImpl.yml rename to subprojects/robotpy-wpilib/semiwrap/SendableBuilderImpl.yml index c1fe88c20..e3df995ec 100644 --- a/subprojects/robotpy-wpilib/gen/SendableBuilderImpl.yml +++ b/subprojects/robotpy-wpilib/semiwrap/SendableBuilderImpl.yml @@ -1,6 +1,5 @@ ---- classes: - SendableBuilderImpl: + frc::SendableBuilderImpl: methods: SendableBuilderImpl: SetTable: @@ -50,4 +49,4 @@ classes: AddSmallFloatArrayProperty: AddSmallDoubleArrayProperty: AddSmallStringArrayProperty: - AddSmallRawProperty: \ No newline at end of file + AddSmallRawProperty: diff --git a/subprojects/robotpy-wpilib/gen/SendableCameraWrapper.yml b/subprojects/robotpy-wpilib/semiwrap/SendableCameraWrapper.yml similarity index 82% rename from subprojects/robotpy-wpilib/gen/SendableCameraWrapper.yml rename to subprojects/robotpy-wpilib/semiwrap/SendableCameraWrapper.yml index d8789ee9e..395cd4182 100644 --- a/subprojects/robotpy-wpilib/gen/SendableCameraWrapper.yml +++ b/subprojects/robotpy-wpilib/semiwrap/SendableCameraWrapper.yml @@ -1,13 +1,10 @@ ---- - attributes: kProtocol: functions: GetSendableCameraWrapper: AddToSendableRegistry: classes: - SendableCameraWrapper: - shared_ptr: true + frc::SendableCameraWrapper: methods: SendableCameraWrapper: Wrap: diff --git a/subprojects/robotpy-wpilib/gen/SendableChooser.yml b/subprojects/robotpy-wpilib/semiwrap/SendableChooser.yml similarity index 92% rename from subprojects/robotpy-wpilib/gen/SendableChooser.yml rename to subprojects/robotpy-wpilib/semiwrap/SendableChooser.yml index 8d150a0ce..68947a3c3 100644 --- a/subprojects/robotpy-wpilib/gen/SendableChooser.yml +++ b/subprojects/robotpy-wpilib/semiwrap/SendableChooser.yml @@ -1,11 +1,8 @@ ---- - extra_includes: - gilsafe_object.h classes: - SendableChooser: - shared_ptr: true + frc::SendableChooser: template_params: - T methods: @@ -42,4 +39,4 @@ templates: SendableChooser: qualname: frc::SendableChooser params: - - rpy::gilsafe_object + - semiwrap::gilsafe_object diff --git a/subprojects/robotpy-wpilib/gen/SendableChooserBase.yml b/subprojects/robotpy-wpilib/semiwrap/SendableChooserBase.yml similarity index 91% rename from subprojects/robotpy-wpilib/gen/SendableChooserBase.yml rename to subprojects/robotpy-wpilib/semiwrap/SendableChooserBase.yml index f22954b1d..21004cbc0 100644 --- a/subprojects/robotpy-wpilib/gen/SendableChooserBase.yml +++ b/subprojects/robotpy-wpilib/semiwrap/SendableChooserBase.yml @@ -1,13 +1,10 @@ ---- - extra_includes: - wpi/sendable/SendableBuilder.h classes: - SendableChooserBase: + frc::SendableChooserBase: ignored_bases: - wpi::SendableHelper - shared_ptr: true attributes: kDefault: kOptions: diff --git a/subprojects/robotpy-wpilib/gen/SensorUtil.yml b/subprojects/robotpy-wpilib/semiwrap/SensorUtil.yml similarity index 97% rename from subprojects/robotpy-wpilib/gen/SensorUtil.yml rename to subprojects/robotpy-wpilib/semiwrap/SensorUtil.yml index 7b9de874e..780fc73fb 100644 --- a/subprojects/robotpy-wpilib/gen/SensorUtil.yml +++ b/subprojects/robotpy-wpilib/semiwrap/SensorUtil.yml @@ -1,7 +1,6 @@ ---- classes: - SensorUtil: + frc::SensorUtil: nodelete: true attributes: kDigitalChannels: diff --git a/subprojects/robotpy-wpilib/gen/SerialPort.yml b/subprojects/robotpy-wpilib/semiwrap/SerialPort.yml similarity index 90% rename from subprojects/robotpy-wpilib/gen/SerialPort.yml rename to subprojects/robotpy-wpilib/semiwrap/SerialPort.yml index 5476bb0a2..0bb859adb 100644 --- a/subprojects/robotpy-wpilib/gen/SerialPort.yml +++ b/subprojects/robotpy-wpilib/semiwrap/SerialPort.yml @@ -1,8 +1,5 @@ ---- - classes: - SerialPort: - shared_ptr: true + frc::SerialPort: enums: Parity: StopBits: @@ -37,12 +34,12 @@ classes: GetBytesReceived: Read: buffers: - - { type: OUT, src: buffer, len: count } + - {type: OUT, src: buffer, len: count} Write: overloads: const char*, int: buffers: - - { type: IN, src: buffer, len: count } + - {type: IN, src: buffer, len: count} std::string_view: ignore: true SetTimeout: diff --git a/subprojects/robotpy-wpilib/gen/Servo.yml b/subprojects/robotpy-wpilib/semiwrap/Servo.yml similarity index 86% rename from subprojects/robotpy-wpilib/gen/Servo.yml rename to subprojects/robotpy-wpilib/semiwrap/Servo.yml index 6b57dd23a..1c1c8a9ac 100644 --- a/subprojects/robotpy-wpilib/gen/Servo.yml +++ b/subprojects/robotpy-wpilib/semiwrap/Servo.yml @@ -1,11 +1,8 @@ ---- - extra_includes: - wpi/sendable/SendableBuilder.h classes: - Servo: - shared_ptr: true + frc::Servo: methods: Servo: Set: diff --git a/subprojects/robotpy-wpilib/gen/SharpIR.yml b/subprojects/robotpy-wpilib/semiwrap/SharpIR.yml similarity index 94% rename from subprojects/robotpy-wpilib/gen/SharpIR.yml rename to subprojects/robotpy-wpilib/semiwrap/SharpIR.yml index 99babe2fb..dce24288c 100644 --- a/subprojects/robotpy-wpilib/gen/SharpIR.yml +++ b/subprojects/robotpy-wpilib/semiwrap/SharpIR.yml @@ -1,10 +1,9 @@ ---- extra_includes: - wpi/sendable/SendableBuilder.h classes: - SharpIR: + frc::SharpIR: ignored_bases: - wpi::SendableHelper methods: diff --git a/subprojects/robotpy-wpilib/gen/SimpleWidget.yml b/subprojects/robotpy-wpilib/semiwrap/SimpleWidget.yml similarity index 76% rename from subprojects/robotpy-wpilib/gen/SimpleWidget.yml rename to subprojects/robotpy-wpilib/semiwrap/SimpleWidget.yml index 778713884..7e8d8a0f3 100644 --- a/subprojects/robotpy-wpilib/gen/SimpleWidget.yml +++ b/subprojects/robotpy-wpilib/semiwrap/SimpleWidget.yml @@ -1,15 +1,12 @@ ---- - extra_includes: - frc/shuffleboard/ShuffleboardContainer.h classes: - SimpleWidget: - shared_ptr: true + frc::SimpleWidget: methods: SimpleWidget: GetEntry: overloads: - "": + '': std::string_view: BuildInto: diff --git a/subprojects/robotpy-wpilib/gen/SlewRateLimiter.yml b/subprojects/robotpy-wpilib/semiwrap/SlewRateLimiter.yml similarity index 79% rename from subprojects/robotpy-wpilib/gen/SlewRateLimiter.yml rename to subprojects/robotpy-wpilib/semiwrap/SlewRateLimiter.yml index 47031fd34..61f6a042c 100644 --- a/subprojects/robotpy-wpilib/gen/SlewRateLimiter.yml +++ b/subprojects/robotpy-wpilib/semiwrap/SlewRateLimiter.yml @@ -1,8 +1,5 @@ ---- - classes: - SlewRateLimiter: - shared_ptr: true + frc::SlewRateLimiter: template_params: - Unit typealias: @@ -17,4 +14,4 @@ templates: SlewRateLimiter: qualname: frc::SlewRateLimiter params: - - units::dimensionless::scalar \ No newline at end of file + - units::dimensionless::scalar diff --git a/subprojects/robotpy-wpilib/gen/SmartDashboard.yml b/subprojects/robotpy-wpilib/semiwrap/SmartDashboard.yml similarity index 99% rename from subprojects/robotpy-wpilib/gen/SmartDashboard.yml rename to subprojects/robotpy-wpilib/semiwrap/SmartDashboard.yml index 081fb9f99..c76bac2ea 100644 --- a/subprojects/robotpy-wpilib/gen/SmartDashboard.yml +++ b/subprojects/robotpy-wpilib/semiwrap/SmartDashboard.yml @@ -1,4 +1,3 @@ ---- extra_includes: - src/rpy/SmartDashboardData.h @@ -6,7 +5,7 @@ extra_includes: - wpi/sendable/SendableRegistry.h classes: - SmartDashboard: + frc::SmartDashboard: methods: init: ContainsKey: @@ -167,11 +166,11 @@ classes: PostListenerTask: UpdateValues: -inline_code: | +inline_code: |- // ensure that the smart dashboard data is released when python shuts down static int unused; // the capsule needs something to reference py::capsule cleanup(&unused, [](void *) { rpy::destroySmartDashboardData(); }); m.add_object("_sd_cleanup", cleanup); - m.def("_clearSmartDashboardData", &rpy::clearSmartDashboardData); \ No newline at end of file + m.def("_clearSmartDashboardData", &rpy::clearSmartDashboardData); diff --git a/subprojects/robotpy-wpilib/gen/Solenoid.yml b/subprojects/robotpy-wpilib/semiwrap/Solenoid.yml similarity index 90% rename from subprojects/robotpy-wpilib/gen/Solenoid.yml rename to subprojects/robotpy-wpilib/semiwrap/Solenoid.yml index a327505ac..3a6652e67 100644 --- a/subprojects/robotpy-wpilib/gen/Solenoid.yml +++ b/subprojects/robotpy-wpilib/semiwrap/Solenoid.yml @@ -1,11 +1,8 @@ ---- - extra_includes: - wpi/sendable/SendableBuilder.h classes: - Solenoid: - shared_ptr: true + frc::Solenoid: ignored_bases: - wpi::SendableHelper methods: diff --git a/subprojects/robotpy-wpilib/gen/SolenoidBase.yml b/subprojects/robotpy-wpilib/semiwrap/SolenoidBase.yml similarity index 93% rename from subprojects/robotpy-wpilib/gen/SolenoidBase.yml rename to subprojects/robotpy-wpilib/semiwrap/SolenoidBase.yml index 5690b8924..f2bc0088a 100644 --- a/subprojects/robotpy-wpilib/gen/SolenoidBase.yml +++ b/subprojects/robotpy-wpilib/semiwrap/SolenoidBase.yml @@ -1,8 +1,5 @@ ---- - classes: - SolenoidBase: - shared_ptr: true + frc::SolenoidBase: attributes: m_maxModules: m_maxPorts: @@ -32,5 +29,5 @@ classes: overloads: int: rename: clearAllPCMStickyFaultsByModule - "": + '': SolenoidBase: diff --git a/subprojects/robotpy-wpilib/gen/Spark.yml b/subprojects/robotpy-wpilib/semiwrap/Spark.yml similarity index 70% rename from subprojects/robotpy-wpilib/gen/Spark.yml rename to subprojects/robotpy-wpilib/semiwrap/Spark.yml index e831523c5..6e8dd2d5b 100644 --- a/subprojects/robotpy-wpilib/gen/Spark.yml +++ b/subprojects/robotpy-wpilib/semiwrap/Spark.yml @@ -1,10 +1,7 @@ ---- - extra_includes: - wpi/sendable/SendableBuilder.h classes: - Spark: - shared_ptr: true + frc::Spark: methods: Spark: diff --git a/subprojects/robotpy-wpilib/gen/StadiaController.yml b/subprojects/robotpy-wpilib/semiwrap/StadiaController.yml similarity index 96% rename from subprojects/robotpy-wpilib/gen/StadiaController.yml rename to subprojects/robotpy-wpilib/semiwrap/StadiaController.yml index 8aada62de..81c1f3698 100644 --- a/subprojects/robotpy-wpilib/gen/StadiaController.yml +++ b/subprojects/robotpy-wpilib/semiwrap/StadiaController.yml @@ -1,10 +1,9 @@ ---- extra_includes: - wpi/sendable/SendableBuilder.h classes: - StadiaController: + frc::StadiaController: ignored_bases: - wpi::SendableHelper methods: @@ -80,7 +79,7 @@ classes: GetRightBumperButtonPressed: GetRightBumperButtonReleased: InitSendable: - StadiaController::Button: + frc::StadiaController::Button: attributes: kA: kB: @@ -97,7 +96,7 @@ classes: kLeftTrigger: kGoogle: kFrame: - StadiaController::Axis: + frc::StadiaController::Axis: attributes: kLeftX: kRightX: diff --git a/subprojects/robotpy-wpilib/gen/SynchronousInterrupt.yml b/subprojects/robotpy-wpilib/semiwrap/SynchronousInterrupt.yml similarity index 92% rename from subprojects/robotpy-wpilib/gen/SynchronousInterrupt.yml rename to subprojects/robotpy-wpilib/semiwrap/SynchronousInterrupt.yml index 53af004d0..76dcd740e 100644 --- a/subprojects/robotpy-wpilib/gen/SynchronousInterrupt.yml +++ b/subprojects/robotpy-wpilib/semiwrap/SynchronousInterrupt.yml @@ -1,10 +1,9 @@ ---- extra_includes: - frc/DigitalSource.h classes: - SynchronousInterrupt: + frc::SynchronousInterrupt: enums: WaitResult: methods: diff --git a/subprojects/robotpy-wpilib/gen/SysIdRoutineLog.yml b/subprojects/robotpy-wpilib/semiwrap/SysIdRoutineLog.yml similarity index 91% rename from subprojects/robotpy-wpilib/gen/SysIdRoutineLog.yml rename to subprojects/robotpy-wpilib/semiwrap/SysIdRoutineLog.yml index 738b41179..d4229cc0d 100644 --- a/subprojects/robotpy-wpilib/gen/SysIdRoutineLog.yml +++ b/subprojects/robotpy-wpilib/semiwrap/SysIdRoutineLog.yml @@ -1,4 +1,3 @@ ---- enums: State: @@ -7,14 +6,14 @@ enums: .def("__str__", &SysIdRoutineLog::StateEnumToString) classes: - SysIdRoutineLog: + frc::sysid::SysIdRoutineLog: subpackage: sysid methods: SysIdRoutineLog: RecordState: Motor: StateEnumToString: - SysIdRoutineLog::MotorLog: + frc::sysid::SysIdRoutineLog::MotorLog: subpackage: sysid methods: MotorLog: diff --git a/subprojects/robotpy-wpilib/gen/Talon.yml b/subprojects/robotpy-wpilib/semiwrap/Talon.yml similarity index 70% rename from subprojects/robotpy-wpilib/gen/Talon.yml rename to subprojects/robotpy-wpilib/semiwrap/Talon.yml index cfc192c8d..85558634e 100644 --- a/subprojects/robotpy-wpilib/gen/Talon.yml +++ b/subprojects/robotpy-wpilib/semiwrap/Talon.yml @@ -1,10 +1,7 @@ ---- - extra_includes: - wpi/sendable/SendableBuilder.h classes: - Talon: - shared_ptr: true + frc::Talon: methods: Talon: diff --git a/subprojects/robotpy-wpilib/gen/Threads.yml b/subprojects/robotpy-wpilib/semiwrap/Threads.yml similarity index 97% rename from subprojects/robotpy-wpilib/gen/Threads.yml rename to subprojects/robotpy-wpilib/semiwrap/Threads.yml index 6da89a259..7311066d4 100644 --- a/subprojects/robotpy-wpilib/gen/Threads.yml +++ b/subprojects/robotpy-wpilib/semiwrap/Threads.yml @@ -1,4 +1,3 @@ ---- functions: GetThreadPriority: diff --git a/subprojects/robotpy-wpilib/gen/TimedRobot.yml b/subprojects/robotpy-wpilib/semiwrap/TimedRobot.yml similarity index 81% rename from subprojects/robotpy-wpilib/gen/TimedRobot.yml rename to subprojects/robotpy-wpilib/semiwrap/TimedRobot.yml index c5ba71b56..c787bb715 100644 --- a/subprojects/robotpy-wpilib/gen/TimedRobot.yml +++ b/subprojects/robotpy-wpilib/semiwrap/TimedRobot.yml @@ -1,8 +1,5 @@ ---- - classes: - TimedRobot: - shared_ptr: false + frc::TimedRobot: attributes: kDefaultPeriod: methods: @@ -12,7 +9,7 @@ classes: AddPeriodic: param_override: offset: - default: "0_s" + default: 0_s TimedRobot: overloads: double: diff --git a/subprojects/robotpy-wpilib/gen/Timer.yml b/subprojects/robotpy-wpilib/semiwrap/Timer.yml similarity index 89% rename from subprojects/robotpy-wpilib/gen/Timer.yml rename to subprojects/robotpy-wpilib/semiwrap/Timer.yml index d01566bbf..2dcd07485 100644 --- a/subprojects/robotpy-wpilib/gen/Timer.yml +++ b/subprojects/robotpy-wpilib/semiwrap/Timer.yml @@ -1,11 +1,8 @@ ---- - functions: Wait: GetTime: classes: - Timer: - shared_ptr: true + frc::Timer: attributes: kRolloverTime: methods: diff --git a/subprojects/robotpy-wpilib/gen/TimesliceRobot.yml b/subprojects/robotpy-wpilib/semiwrap/TimesliceRobot.yml similarity index 72% rename from subprojects/robotpy-wpilib/gen/TimesliceRobot.yml rename to subprojects/robotpy-wpilib/semiwrap/TimesliceRobot.yml index 55a67dc34..a6dc9da7d 100644 --- a/subprojects/robotpy-wpilib/gen/TimesliceRobot.yml +++ b/subprojects/robotpy-wpilib/semiwrap/TimesliceRobot.yml @@ -1,7 +1,6 @@ ---- classes: - TimesliceRobot: + frc::TimesliceRobot: methods: TimesliceRobot: Schedule: diff --git a/subprojects/robotpy-wpilib/gen/Tracer.yml b/subprojects/robotpy-wpilib/semiwrap/Tracer.yml similarity index 82% rename from subprojects/robotpy-wpilib/gen/Tracer.yml rename to subprojects/robotpy-wpilib/semiwrap/Tracer.yml index 74abae98c..e3c60eff8 100644 --- a/subprojects/robotpy-wpilib/gen/Tracer.yml +++ b/subprojects/robotpy-wpilib/semiwrap/Tracer.yml @@ -1,12 +1,9 @@ ---- - extra_includes: - wpi/SmallString.h - wpi/raw_ostream.h classes: - Tracer: - shared_ptr: true + frc::Tracer: methods: Tracer: ResetTimer: @@ -14,11 +11,11 @@ classes: AddEpoch: PrintEpochs: overloads: - "": + '': wpi::raw_ostream&: ignore: true -inline_code: | +inline_code: |- cls_Tracer .def("getEpochs", [](Tracer * self) -> py::str { @@ -31,4 +28,4 @@ inline_code: | "\n" ".. versionadded:: 2021.1.2\n" "\n" - ".. note:: This function only exists in RobotPy\n"); \ No newline at end of file + ".. note:: This function only exists in RobotPy\n"); diff --git a/subprojects/robotpy-wpilib/gen/Ultrasonic.yml b/subprojects/robotpy-wpilib/semiwrap/Ultrasonic.yml similarity index 95% rename from subprojects/robotpy-wpilib/gen/Ultrasonic.yml rename to subprojects/robotpy-wpilib/semiwrap/Ultrasonic.yml index ca8cb0ea2..9cadb649d 100644 --- a/subprojects/robotpy-wpilib/gen/Ultrasonic.yml +++ b/subprojects/robotpy-wpilib/semiwrap/Ultrasonic.yml @@ -1,13 +1,10 @@ ---- - extra_includes: - wpi/sendable/SendableBuilder.h - frc/DigitalInput.h - frc/DigitalOutput.h classes: - Ultrasonic: - shared_ptr: true + frc::Ultrasonic: ignored_bases: - wpi::SendableHelper enums: diff --git a/subprojects/robotpy-wpilib/gen/Utility.yml b/subprojects/robotpy-wpilib/semiwrap/Utility.yml similarity index 95% rename from subprojects/robotpy-wpilib/gen/Utility.yml rename to subprojects/robotpy-wpilib/semiwrap/Utility.yml index b1f12a072..b5c3db73a 100644 --- a/subprojects/robotpy-wpilib/gen/Utility.yml +++ b/subprojects/robotpy-wpilib/semiwrap/Utility.yml @@ -1,4 +1,3 @@ ---- functions: wpi_assert_impl: diff --git a/subprojects/robotpy-wpilib/gen/Victor.yml b/subprojects/robotpy-wpilib/semiwrap/Victor.yml similarity index 70% rename from subprojects/robotpy-wpilib/gen/Victor.yml rename to subprojects/robotpy-wpilib/semiwrap/Victor.yml index b561af060..b55c81f1c 100644 --- a/subprojects/robotpy-wpilib/gen/Victor.yml +++ b/subprojects/robotpy-wpilib/semiwrap/Victor.yml @@ -1,10 +1,7 @@ ---- - extra_includes: - wpi/sendable/SendableBuilder.h classes: - Victor: - shared_ptr: true + frc::Victor: methods: Victor: diff --git a/subprojects/robotpy-wpilib/gen/VictorSP.yml b/subprojects/robotpy-wpilib/semiwrap/VictorSP.yml similarity index 69% rename from subprojects/robotpy-wpilib/gen/VictorSP.yml rename to subprojects/robotpy-wpilib/semiwrap/VictorSP.yml index 5cf22023c..19a8129cf 100644 --- a/subprojects/robotpy-wpilib/gen/VictorSP.yml +++ b/subprojects/robotpy-wpilib/semiwrap/VictorSP.yml @@ -1,10 +1,7 @@ ---- - extra_includes: - wpi/sendable/SendableBuilder.h classes: - VictorSP: - shared_ptr: true + frc::VictorSP: methods: VictorSP: diff --git a/subprojects/robotpy-wpilib/gen/WPIErrors.yml b/subprojects/robotpy-wpilib/semiwrap/WPIErrors.yml similarity index 99% rename from subprojects/robotpy-wpilib/gen/WPIErrors.yml rename to subprojects/robotpy-wpilib/semiwrap/WPIErrors.yml index e53c83d6a..d0fc1715a 100644 --- a/subprojects/robotpy-wpilib/gen/WPIErrors.yml +++ b/subprojects/robotpy-wpilib/semiwrap/WPIErrors.yml @@ -1,4 +1,3 @@ ---- functions: wpi_error_s_ModuleIndexOutOfRange: diff --git a/subprojects/robotpy-wpilib/gen/WPILibVersion.yml b/subprojects/robotpy-wpilib/semiwrap/WPILibVersion.yml similarity index 88% rename from subprojects/robotpy-wpilib/gen/WPILibVersion.yml rename to subprojects/robotpy-wpilib/semiwrap/WPILibVersion.yml index 96106d0e5..9c1357a9f 100644 --- a/subprojects/robotpy-wpilib/gen/WPILibVersion.yml +++ b/subprojects/robotpy-wpilib/semiwrap/WPILibVersion.yml @@ -1,4 +1,3 @@ ---- functions: GetWPILibVersion: diff --git a/subprojects/robotpy-wpilib/gen/Watchdog.yml b/subprojects/robotpy-wpilib/semiwrap/Watchdog.yml similarity index 93% rename from subprojects/robotpy-wpilib/gen/Watchdog.yml rename to subprojects/robotpy-wpilib/semiwrap/Watchdog.yml index 6b29dcf56..fd407f06a 100644 --- a/subprojects/robotpy-wpilib/gen/Watchdog.yml +++ b/subprojects/robotpy-wpilib/semiwrap/Watchdog.yml @@ -1,8 +1,5 @@ ---- - classes: - Watchdog: - shared_ptr: true + frc::Watchdog: methods: Watchdog: overloads: diff --git a/subprojects/robotpy-wpilib/gen/XboxController.yml b/subprojects/robotpy-wpilib/semiwrap/XboxController.yml similarity index 95% rename from subprojects/robotpy-wpilib/gen/XboxController.yml rename to subprojects/robotpy-wpilib/semiwrap/XboxController.yml index b746a7ff9..c84bebbde 100644 --- a/subprojects/robotpy-wpilib/gen/XboxController.yml +++ b/subprojects/robotpy-wpilib/semiwrap/XboxController.yml @@ -1,4 +1,3 @@ ---- extra_includes: - wpi/sendable/SendableBuilder.h @@ -6,7 +5,7 @@ extra_includes: - frc/event/BooleanEvent.h classes: - XboxController: + frc::XboxController: ignored_bases: - wpi::SendableHelper methods: @@ -72,7 +71,7 @@ classes: GetRightBumperButtonPressed: GetRightBumperButtonReleased: InitSendable: - XboxController::Button: + frc::XboxController::Button: attributes: kLeftBumper: kRightBumper: @@ -84,7 +83,7 @@ classes: kY: kBack: kStart: - XboxController::Axis: + frc::XboxController::Axis: attributes: kLeftX: kRightX: diff --git a/subprojects/robotpy-wpilib/gen/counter/EdgeConfiguration.yml b/subprojects/robotpy-wpilib/semiwrap/counter/EdgeConfiguration.yml similarity index 87% rename from subprojects/robotpy-wpilib/gen/counter/EdgeConfiguration.yml rename to subprojects/robotpy-wpilib/semiwrap/counter/EdgeConfiguration.yml index 723f1be29..eb5529d17 100644 --- a/subprojects/robotpy-wpilib/gen/counter/EdgeConfiguration.yml +++ b/subprojects/robotpy-wpilib/semiwrap/counter/EdgeConfiguration.yml @@ -1,4 +1,3 @@ ---- enums: EdgeConfiguration: diff --git a/subprojects/robotpy-wpilib/gen/counter/ExternalDirectionCounter.yml b/subprojects/robotpy-wpilib/semiwrap/counter/ExternalDirectionCounter.yml similarity index 92% rename from subprojects/robotpy-wpilib/gen/counter/ExternalDirectionCounter.yml rename to subprojects/robotpy-wpilib/semiwrap/counter/ExternalDirectionCounter.yml index dc430cedf..ff6eaec34 100644 --- a/subprojects/robotpy-wpilib/gen/counter/ExternalDirectionCounter.yml +++ b/subprojects/robotpy-wpilib/semiwrap/counter/ExternalDirectionCounter.yml @@ -1,9 +1,8 @@ ---- extra_includes: - frc/DigitalSource.h classes: - ExternalDirectionCounter: + frc::ExternalDirectionCounter: ignored_bases: - wpi::SendableHelper methods: diff --git a/subprojects/robotpy-wpilib/gen/counter/Tachometer.yml b/subprojects/robotpy-wpilib/semiwrap/counter/Tachometer.yml similarity index 96% rename from subprojects/robotpy-wpilib/gen/counter/Tachometer.yml rename to subprojects/robotpy-wpilib/semiwrap/counter/Tachometer.yml index 703942b4b..5a8440eda 100644 --- a/subprojects/robotpy-wpilib/gen/counter/Tachometer.yml +++ b/subprojects/robotpy-wpilib/semiwrap/counter/Tachometer.yml @@ -1,9 +1,8 @@ ---- extra_includes: - frc/DigitalSource.h classes: - Tachometer: + frc::Tachometer: ignored_bases: - wpi::SendableHelper methods: diff --git a/subprojects/robotpy-wpilib/gen/counter/UpDownCounter.yml b/subprojects/robotpy-wpilib/semiwrap/counter/UpDownCounter.yml similarity index 94% rename from subprojects/robotpy-wpilib/gen/counter/UpDownCounter.yml rename to subprojects/robotpy-wpilib/semiwrap/counter/UpDownCounter.yml index 98593fd98..3314e10c0 100644 --- a/subprojects/robotpy-wpilib/gen/counter/UpDownCounter.yml +++ b/subprojects/robotpy-wpilib/semiwrap/counter/UpDownCounter.yml @@ -1,10 +1,9 @@ ---- extra_includes: - frc/DigitalSource.h classes: - UpDownCounter: + frc::UpDownCounter: ignored_bases: - wpi::SendableHelper methods: diff --git a/subprojects/robotpy-wpilib/gen/drive/DifferentialDrive.yml b/subprojects/robotpy-wpilib/semiwrap/drive/DifferentialDrive.yml similarity index 98% rename from subprojects/robotpy-wpilib/gen/drive/DifferentialDrive.yml rename to subprojects/robotpy-wpilib/semiwrap/drive/DifferentialDrive.yml index b0359975e..37efa296e 100644 --- a/subprojects/robotpy-wpilib/gen/drive/DifferentialDrive.yml +++ b/subprojects/robotpy-wpilib/semiwrap/drive/DifferentialDrive.yml @@ -1,12 +1,9 @@ ---- - extra_includes: - wpi/sendable/SendableBuilder.h - frc/motorcontrol/MotorController.h classes: - DifferentialDrive: - shared_ptr: true + frc::DifferentialDrive: ignored_bases: - wpi::SendableHelper attributes: @@ -33,7 +30,6 @@ classes: StopMotor: GetDescription: InitSendable: - doc: | A class for driving differential drive/skid-steer drive platforms such as the Kit of Parts drive base, "tank drive", or West Coast Drive. @@ -114,7 +110,7 @@ classes: * :meth:`curvatureDrive` is similar in concept to ``RobotDrive.drive`` with the addition of a quick turn mode. However, it is not designed to give exactly the same response. - DifferentialDrive::WheelSpeeds: + frc::DifferentialDrive::WheelSpeeds: attributes: left: right: diff --git a/subprojects/robotpy-wpilib/gen/drive/MecanumDrive.yml b/subprojects/robotpy-wpilib/semiwrap/drive/MecanumDrive.yml similarity index 93% rename from subprojects/robotpy-wpilib/gen/drive/MecanumDrive.yml rename to subprojects/robotpy-wpilib/semiwrap/drive/MecanumDrive.yml index ee50b5619..7b09f989f 100644 --- a/subprojects/robotpy-wpilib/gen/drive/MecanumDrive.yml +++ b/subprojects/robotpy-wpilib/semiwrap/drive/MecanumDrive.yml @@ -1,11 +1,10 @@ ---- extra_includes: - wpi/sendable/SendableBuilder.h - frc/motorcontrol/MotorController.h classes: - MecanumDrive: + frc::MecanumDrive: force_type_casters: - units::radian_t ignored_bases: @@ -34,9 +33,9 @@ classes: StopMotor: GetDescription: InitSendable: - MecanumDrive::WheelSpeeds: + frc::MecanumDrive::WheelSpeeds: attributes: frontLeft: frontRight: rearLeft: - rearRight: \ No newline at end of file + rearRight: diff --git a/subprojects/robotpy-wpilib/gen/drive/RobotDriveBase.yml b/subprojects/robotpy-wpilib/semiwrap/drive/RobotDriveBase.yml similarity index 89% rename from subprojects/robotpy-wpilib/gen/drive/RobotDriveBase.yml rename to subprojects/robotpy-wpilib/semiwrap/drive/RobotDriveBase.yml index 82295940c..236dd7431 100644 --- a/subprojects/robotpy-wpilib/gen/drive/RobotDriveBase.yml +++ b/subprojects/robotpy-wpilib/semiwrap/drive/RobotDriveBase.yml @@ -1,12 +1,9 @@ ---- - extra_includes: - frc/motorcontrol/MotorController.h - wpi/SmallString.h classes: - RobotDriveBase: - shared_ptr: true + frc::RobotDriveBase: attributes: m_deadband: m_maxOutput: diff --git a/subprojects/robotpy-wpilib/gen/event/BooleanEvent.yml b/subprojects/robotpy-wpilib/semiwrap/event/BooleanEvent.yml similarity index 96% rename from subprojects/robotpy-wpilib/gen/event/BooleanEvent.yml rename to subprojects/robotpy-wpilib/semiwrap/event/BooleanEvent.yml index 565084794..54f9faa56 100644 --- a/subprojects/robotpy-wpilib/gen/event/BooleanEvent.yml +++ b/subprojects/robotpy-wpilib/semiwrap/event/BooleanEvent.yml @@ -1,7 +1,6 @@ ---- classes: - BooleanEvent: + frc::BooleanEvent: methods: BooleanEvent: GetAsBoolean: diff --git a/subprojects/robotpy-wpilib/gen/event/EventLoop.yml b/subprojects/robotpy-wpilib/semiwrap/event/EventLoop.yml similarity index 93% rename from subprojects/robotpy-wpilib/gen/event/EventLoop.yml rename to subprojects/robotpy-wpilib/semiwrap/event/EventLoop.yml index 659b29344..a973abc3e 100644 --- a/subprojects/robotpy-wpilib/gen/event/EventLoop.yml +++ b/subprojects/robotpy-wpilib/semiwrap/event/EventLoop.yml @@ -1,7 +1,6 @@ ---- classes: - EventLoop: + frc::EventLoop: force_type_casters: - std::function methods: diff --git a/subprojects/robotpy-wpilib/gen/event/NetworkBooleanEvent.yml b/subprojects/robotpy-wpilib/semiwrap/event/NetworkBooleanEvent.yml similarity index 92% rename from subprojects/robotpy-wpilib/gen/event/NetworkBooleanEvent.yml rename to subprojects/robotpy-wpilib/semiwrap/event/NetworkBooleanEvent.yml index caa7f095b..7a05b3319 100644 --- a/subprojects/robotpy-wpilib/gen/event/NetworkBooleanEvent.yml +++ b/subprojects/robotpy-wpilib/semiwrap/event/NetworkBooleanEvent.yml @@ -1,12 +1,11 @@ ---- extra_includes: - networktables/BooleanTopic.h - networktables/NetworkTable.h -- networktables/NetworkTableInstance.h +- networktables/NetworkTableInstance.h classes: - NetworkBooleanEvent: + frc::NetworkBooleanEvent: force_no_trampoline: true methods: NetworkBooleanEvent: diff --git a/subprojects/robotpy-wpilib/gen/CounterBase.yml b/subprojects/robotpy-wpilib/semiwrap/interfaces/CounterBase.yml similarity index 80% rename from subprojects/robotpy-wpilib/gen/CounterBase.yml rename to subprojects/robotpy-wpilib/semiwrap/interfaces/CounterBase.yml index 0fb15d155..889d1c5dc 100644 --- a/subprojects/robotpy-wpilib/gen/CounterBase.yml +++ b/subprojects/robotpy-wpilib/semiwrap/interfaces/CounterBase.yml @@ -1,8 +1,5 @@ ---- - classes: - CounterBase: - shared_ptr: true + frc::CounterBase: enums: EncodingType: methods: diff --git a/subprojects/robotpy-wpilib/gen/GenericHID.yml b/subprojects/robotpy-wpilib/semiwrap/interfaces/GenericHID.yml similarity index 96% rename from subprojects/robotpy-wpilib/gen/GenericHID.yml rename to subprojects/robotpy-wpilib/semiwrap/interfaces/GenericHID.yml index 9aa77615e..92da0dfa5 100644 --- a/subprojects/robotpy-wpilib/gen/GenericHID.yml +++ b/subprojects/robotpy-wpilib/semiwrap/interfaces/GenericHID.yml @@ -1,12 +1,9 @@ ---- - extra_includes: - frc/DriverStation.h - frc/event/BooleanEvent.h classes: - GenericHID: - shared_ptr: true + frc::GenericHID: enums: RumbleType: HIDType: diff --git a/subprojects/robotpy-wpilib/gen/MotorController.yml b/subprojects/robotpy-wpilib/semiwrap/interfaces/MotorController.yml similarity index 73% rename from subprojects/robotpy-wpilib/gen/MotorController.yml rename to subprojects/robotpy-wpilib/semiwrap/interfaces/MotorController.yml index 88f7d46c9..806ed5981 100644 --- a/subprojects/robotpy-wpilib/gen/MotorController.yml +++ b/subprojects/robotpy-wpilib/semiwrap/interfaces/MotorController.yml @@ -1,7 +1,6 @@ ---- classes: - MotorController: + frc::MotorController: methods: Set: SetVoltage: @@ -9,4 +8,4 @@ classes: SetInverted: GetInverted: Disable: - StopMotor: \ No newline at end of file + StopMotor: diff --git a/subprojects/robotpy-wpilib/gen/shuffleboard/BuiltInLayouts.yml b/subprojects/robotpy-wpilib/semiwrap/shuffleboard/BuiltInLayouts.yml similarity index 86% rename from subprojects/robotpy-wpilib/gen/shuffleboard/BuiltInLayouts.yml rename to subprojects/robotpy-wpilib/semiwrap/shuffleboard/BuiltInLayouts.yml index 9150afd20..38ed2e11f 100644 --- a/subprojects/robotpy-wpilib/gen/shuffleboard/BuiltInLayouts.yml +++ b/subprojects/robotpy-wpilib/semiwrap/shuffleboard/BuiltInLayouts.yml @@ -1,4 +1,3 @@ ---- enums: BuiltInLayouts: diff --git a/subprojects/robotpy-wpilib/gen/shuffleboard/BuiltInWidgets.yml b/subprojects/robotpy-wpilib/semiwrap/shuffleboard/BuiltInWidgets.yml similarity index 86% rename from subprojects/robotpy-wpilib/gen/shuffleboard/BuiltInWidgets.yml rename to subprojects/robotpy-wpilib/semiwrap/shuffleboard/BuiltInWidgets.yml index a2e3bce9b..fbd93b6a9 100644 --- a/subprojects/robotpy-wpilib/gen/shuffleboard/BuiltInWidgets.yml +++ b/subprojects/robotpy-wpilib/semiwrap/shuffleboard/BuiltInWidgets.yml @@ -1,4 +1,3 @@ ---- enums: BuiltInWidgets: diff --git a/subprojects/robotpy-wpilib/gen/shuffleboard/ComplexWidget.yml b/subprojects/robotpy-wpilib/semiwrap/shuffleboard/ComplexWidget.yml similarity index 93% rename from subprojects/robotpy-wpilib/gen/shuffleboard/ComplexWidget.yml rename to subprojects/robotpy-wpilib/semiwrap/shuffleboard/ComplexWidget.yml index 401781c96..cc6197da7 100644 --- a/subprojects/robotpy-wpilib/gen/shuffleboard/ComplexWidget.yml +++ b/subprojects/robotpy-wpilib/semiwrap/shuffleboard/ComplexWidget.yml @@ -1,4 +1,3 @@ ---- extra_includes: - wpi/sendable/Sendable.h @@ -6,7 +5,7 @@ extra_includes: - frc/shuffleboard/ShuffleboardContainer.h classes: - ComplexWidget: + frc::ComplexWidget: # virtual base issue: robotpy-build/166 force_no_trampoline: true methods: diff --git a/subprojects/robotpy-wpilib/gen/shuffleboard/LayoutType.yml b/subprojects/robotpy-wpilib/semiwrap/shuffleboard/LayoutType.yml similarity index 76% rename from subprojects/robotpy-wpilib/gen/shuffleboard/LayoutType.yml rename to subprojects/robotpy-wpilib/semiwrap/shuffleboard/LayoutType.yml index 24eb80d77..177c65759 100644 --- a/subprojects/robotpy-wpilib/gen/shuffleboard/LayoutType.yml +++ b/subprojects/robotpy-wpilib/semiwrap/shuffleboard/LayoutType.yml @@ -1,7 +1,6 @@ ---- classes: - LayoutType: + frc::LayoutType: methods: LayoutType: GetLayoutName: diff --git a/subprojects/robotpy-wpilib/gen/shuffleboard/RecordingController.yml b/subprojects/robotpy-wpilib/semiwrap/shuffleboard/RecordingController.yml similarity index 86% rename from subprojects/robotpy-wpilib/gen/shuffleboard/RecordingController.yml rename to subprojects/robotpy-wpilib/semiwrap/shuffleboard/RecordingController.yml index 6a2a39848..f68a7c6af 100644 --- a/subprojects/robotpy-wpilib/gen/shuffleboard/RecordingController.yml +++ b/subprojects/robotpy-wpilib/semiwrap/shuffleboard/RecordingController.yml @@ -1,7 +1,6 @@ ---- classes: - RecordingController: + frc::RecordingController: methods: RecordingController: StartRecording: diff --git a/subprojects/robotpy-wpilib/gen/shuffleboard/Shuffleboard.yml b/subprojects/robotpy-wpilib/semiwrap/shuffleboard/Shuffleboard.yml similarity index 96% rename from subprojects/robotpy-wpilib/gen/shuffleboard/Shuffleboard.yml rename to subprojects/robotpy-wpilib/semiwrap/shuffleboard/Shuffleboard.yml index 75dd03d6b..4184bb7a6 100644 --- a/subprojects/robotpy-wpilib/gen/shuffleboard/Shuffleboard.yml +++ b/subprojects/robotpy-wpilib/semiwrap/shuffleboard/Shuffleboard.yml @@ -1,10 +1,9 @@ ---- extra_includes: - frc/shuffleboard/ShuffleboardTab.h classes: - Shuffleboard: + frc::Shuffleboard: attributes: kBaseTableName: methods: diff --git a/subprojects/robotpy-wpilib/gen/shuffleboard/ShuffleboardComponent.yml b/subprojects/robotpy-wpilib/semiwrap/shuffleboard/ShuffleboardComponent.yml similarity index 98% rename from subprojects/robotpy-wpilib/gen/shuffleboard/ShuffleboardComponent.yml rename to subprojects/robotpy-wpilib/semiwrap/shuffleboard/ShuffleboardComponent.yml index 642b9de57..c59b824dd 100644 --- a/subprojects/robotpy-wpilib/gen/shuffleboard/ShuffleboardComponent.yml +++ b/subprojects/robotpy-wpilib/semiwrap/shuffleboard/ShuffleboardComponent.yml @@ -1,10 +1,9 @@ ---- extra_includes: - frc/shuffleboard/ShuffleboardContainer.h classes: - ShuffleboardComponent: + frc::ShuffleboardComponent: # virtual base issue: robotpy-build/166 force_no_trampoline: true template_params: @@ -34,7 +33,7 @@ templates: qualname: frc::ShuffleboardComponent params: - frc::ShuffleboardLayout - + _SuppliedValueComponent_string: qualname: frc::ShuffleboardComponent params: diff --git a/subprojects/robotpy-wpilib/gen/shuffleboard/ShuffleboardComponentBase.yml b/subprojects/robotpy-wpilib/semiwrap/shuffleboard/ShuffleboardComponentBase.yml similarity index 93% rename from subprojects/robotpy-wpilib/gen/shuffleboard/ShuffleboardComponentBase.yml rename to subprojects/robotpy-wpilib/semiwrap/shuffleboard/ShuffleboardComponentBase.yml index 50fd66cb3..1218f5773 100644 --- a/subprojects/robotpy-wpilib/gen/shuffleboard/ShuffleboardComponentBase.yml +++ b/subprojects/robotpy-wpilib/semiwrap/shuffleboard/ShuffleboardComponentBase.yml @@ -1,11 +1,10 @@ ---- extra_includes: - frc/shuffleboard/ShuffleboardContainer.h classes: - ShuffleboardComponentBase: + frc::ShuffleboardComponentBase: # virtual base issue: robotpy-build/166 force_no_trampoline: true attributes: diff --git a/subprojects/robotpy-wpilib/gen/shuffleboard/ShuffleboardContainer.yml b/subprojects/robotpy-wpilib/semiwrap/shuffleboard/ShuffleboardContainer.yml similarity index 99% rename from subprojects/robotpy-wpilib/gen/shuffleboard/ShuffleboardContainer.yml rename to subprojects/robotpy-wpilib/semiwrap/shuffleboard/ShuffleboardContainer.yml index 0cb8f7af1..859872fcc 100644 --- a/subprojects/robotpy-wpilib/gen/shuffleboard/ShuffleboardContainer.yml +++ b/subprojects/robotpy-wpilib/semiwrap/shuffleboard/ShuffleboardContainer.yml @@ -1,4 +1,3 @@ ---- extra_includes: - frc/shuffleboard/ComplexWidget.h @@ -10,7 +9,7 @@ extra_includes: - wpi/sendable/SendableRegistry.h classes: - ShuffleboardContainer: + frc::ShuffleboardContainer: # virtual base issue: robotpy-build/166 force_no_trampoline: true attributes: diff --git a/subprojects/robotpy-wpilib/gen/shuffleboard/ShuffleboardEventImportance.yml b/subprojects/robotpy-wpilib/semiwrap/shuffleboard/ShuffleboardEventImportance.yml similarity index 95% rename from subprojects/robotpy-wpilib/gen/shuffleboard/ShuffleboardEventImportance.yml rename to subprojects/robotpy-wpilib/semiwrap/shuffleboard/ShuffleboardEventImportance.yml index 0b2a5af27..3fabb79b6 100644 --- a/subprojects/robotpy-wpilib/gen/shuffleboard/ShuffleboardEventImportance.yml +++ b/subprojects/robotpy-wpilib/semiwrap/shuffleboard/ShuffleboardEventImportance.yml @@ -1,4 +1,3 @@ ---- enums: ShuffleboardEventImportance: diff --git a/subprojects/robotpy-wpilib/gen/shuffleboard/ShuffleboardInstance.yml b/subprojects/robotpy-wpilib/semiwrap/shuffleboard/ShuffleboardInstance.yml similarity index 91% rename from subprojects/robotpy-wpilib/gen/shuffleboard/ShuffleboardInstance.yml rename to subprojects/robotpy-wpilib/semiwrap/shuffleboard/ShuffleboardInstance.yml index e9ce9da00..523c54011 100644 --- a/subprojects/robotpy-wpilib/gen/shuffleboard/ShuffleboardInstance.yml +++ b/subprojects/robotpy-wpilib/semiwrap/shuffleboard/ShuffleboardInstance.yml @@ -1,10 +1,9 @@ ---- extra_includes: - networktables/NetworkTableInstance.h classes: - ShuffleboardInstance: + frc::detail::ShuffleboardInstance: rename: _ShuffleboardInstance base_qualnames: ShuffleboardRoot: frc::ShuffleboardRoot diff --git a/subprojects/robotpy-wpilib/gen/shuffleboard/ShuffleboardLayout.yml b/subprojects/robotpy-wpilib/semiwrap/shuffleboard/ShuffleboardLayout.yml similarity index 83% rename from subprojects/robotpy-wpilib/gen/shuffleboard/ShuffleboardLayout.yml rename to subprojects/robotpy-wpilib/semiwrap/shuffleboard/ShuffleboardLayout.yml index 6d98bf8f4..7c25215fa 100644 --- a/subprojects/robotpy-wpilib/gen/shuffleboard/ShuffleboardLayout.yml +++ b/subprojects/robotpy-wpilib/semiwrap/shuffleboard/ShuffleboardLayout.yml @@ -1,7 +1,6 @@ ---- classes: - ShuffleboardLayout: + frc::ShuffleboardLayout: # virtual base issue: robotpy-build/166 force_no_trampoline: true methods: diff --git a/subprojects/robotpy-wpilib/gen/shuffleboard/ShuffleboardRoot.yml b/subprojects/robotpy-wpilib/semiwrap/shuffleboard/ShuffleboardRoot.yml similarity index 92% rename from subprojects/robotpy-wpilib/gen/shuffleboard/ShuffleboardRoot.yml rename to subprojects/robotpy-wpilib/semiwrap/shuffleboard/ShuffleboardRoot.yml index 642517a1b..1c5279573 100644 --- a/subprojects/robotpy-wpilib/gen/shuffleboard/ShuffleboardRoot.yml +++ b/subprojects/robotpy-wpilib/semiwrap/shuffleboard/ShuffleboardRoot.yml @@ -1,10 +1,9 @@ ---- extra_includes: - frc/shuffleboard/ShuffleboardTab.h classes: - ShuffleboardRoot: + frc::ShuffleboardRoot: rename: _ShuffleboardRoot methods: GetTab: diff --git a/subprojects/robotpy-wpilib/gen/shuffleboard/ShuffleboardTab.yml b/subprojects/robotpy-wpilib/semiwrap/shuffleboard/ShuffleboardTab.yml similarity index 91% rename from subprojects/robotpy-wpilib/gen/shuffleboard/ShuffleboardTab.yml rename to subprojects/robotpy-wpilib/semiwrap/shuffleboard/ShuffleboardTab.yml index 0b5273643..1fd20318a 100644 --- a/subprojects/robotpy-wpilib/gen/shuffleboard/ShuffleboardTab.yml +++ b/subprojects/robotpy-wpilib/semiwrap/shuffleboard/ShuffleboardTab.yml @@ -1,10 +1,9 @@ ---- extra_includes: - frc/shuffleboard/ShuffleboardRoot.h classes: - ShuffleboardTab: + frc::ShuffleboardTab: # virtual base issue: robotpy-build/166 force_no_trampoline: true methods: diff --git a/subprojects/robotpy-wpilib/gen/shuffleboard/ShuffleboardValue.yml b/subprojects/robotpy-wpilib/semiwrap/shuffleboard/ShuffleboardValue.yml similarity index 89% rename from subprojects/robotpy-wpilib/gen/shuffleboard/ShuffleboardValue.yml rename to subprojects/robotpy-wpilib/semiwrap/shuffleboard/ShuffleboardValue.yml index b8b73a6aa..99e1e2466 100644 --- a/subprojects/robotpy-wpilib/gen/shuffleboard/ShuffleboardValue.yml +++ b/subprojects/robotpy-wpilib/semiwrap/shuffleboard/ShuffleboardValue.yml @@ -1,7 +1,6 @@ ---- classes: - ShuffleboardValue: + frc::ShuffleboardValue: # virtual base issue: robotpy-build/166 force_no_trampoline: true methods: diff --git a/subprojects/robotpy-wpilib/gen/shuffleboard/ShuffleboardWidget.yml b/subprojects/robotpy-wpilib/semiwrap/shuffleboard/ShuffleboardWidget.yml similarity index 98% rename from subprojects/robotpy-wpilib/gen/shuffleboard/ShuffleboardWidget.yml rename to subprojects/robotpy-wpilib/semiwrap/shuffleboard/ShuffleboardWidget.yml index 468415cfc..3683843e8 100644 --- a/subprojects/robotpy-wpilib/gen/shuffleboard/ShuffleboardWidget.yml +++ b/subprojects/robotpy-wpilib/semiwrap/shuffleboard/ShuffleboardWidget.yml @@ -1,4 +1,3 @@ ---- extra_includes: - frc/shuffleboard/ShuffleboardContainer.h @@ -7,7 +6,7 @@ functions: GetStringForWidgetType: rename: _getStringForWidgetType classes: - ShuffleboardWidget: + frc::ShuffleboardWidget: # virtual base issue: robotpy-build/166 force_no_trampoline: true template_params: @@ -78,4 +77,3 @@ templates: qualname: frc::ShuffleboardWidget params: - frc::SuppliedValueWidget> - \ No newline at end of file diff --git a/subprojects/robotpy-wpilib/gen/shuffleboard/SimpleWidget.yml b/subprojects/robotpy-wpilib/semiwrap/shuffleboard/SimpleWidget.yml similarity index 91% rename from subprojects/robotpy-wpilib/gen/shuffleboard/SimpleWidget.yml rename to subprojects/robotpy-wpilib/semiwrap/shuffleboard/SimpleWidget.yml index 5141a23f1..32d061770 100644 --- a/subprojects/robotpy-wpilib/gen/shuffleboard/SimpleWidget.yml +++ b/subprojects/robotpy-wpilib/semiwrap/shuffleboard/SimpleWidget.yml @@ -1,17 +1,16 @@ ---- extra_includes: - frc/shuffleboard/ShuffleboardContainer.h classes: - SimpleWidget: + frc::SimpleWidget: # virtual base issue: robotpy-build/166 force_no_trampoline: true methods: SimpleWidget: GetEntry: overloads: - "": + '': return_value_policy: reference_internal std::string_view: return_value_policy: reference_internal diff --git a/subprojects/robotpy-wpilib/gen/shuffleboard/SuppliedValueWidget.yml b/subprojects/robotpy-wpilib/semiwrap/shuffleboard/SuppliedValueWidget.yml similarity index 97% rename from subprojects/robotpy-wpilib/gen/shuffleboard/SuppliedValueWidget.yml rename to subprojects/robotpy-wpilib/semiwrap/shuffleboard/SuppliedValueWidget.yml index 9d09e2b49..9792610f1 100644 --- a/subprojects/robotpy-wpilib/gen/shuffleboard/SuppliedValueWidget.yml +++ b/subprojects/robotpy-wpilib/semiwrap/shuffleboard/SuppliedValueWidget.yml @@ -1,7 +1,6 @@ ---- classes: - SuppliedValueWidget: + frc::SuppliedValueWidget: # virtual base issue: robotpy-build/166 force_no_trampoline: true template_params: diff --git a/subprojects/robotpy-wpilib/gen/shuffleboard/WidgetType.yml b/subprojects/robotpy-wpilib/semiwrap/shuffleboard/WidgetType.yml similarity index 76% rename from subprojects/robotpy-wpilib/gen/shuffleboard/WidgetType.yml rename to subprojects/robotpy-wpilib/semiwrap/shuffleboard/WidgetType.yml index 88cc46e58..63e5b6ce3 100644 --- a/subprojects/robotpy-wpilib/gen/shuffleboard/WidgetType.yml +++ b/subprojects/robotpy-wpilib/semiwrap/shuffleboard/WidgetType.yml @@ -1,7 +1,6 @@ ---- classes: - WidgetType: + frc::WidgetType: methods: WidgetType: GetWidgetName: diff --git a/subprojects/robotpy-wpilib/gen/simulation/ADIS16448_IMUSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/ADIS16448_IMUSim.yml similarity index 89% rename from subprojects/robotpy-wpilib/gen/simulation/ADIS16448_IMUSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/ADIS16448_IMUSim.yml index 06ae849f1..23197e765 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/ADIS16448_IMUSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/ADIS16448_IMUSim.yml @@ -1,10 +1,9 @@ ---- extra_includes: - frc/ADIS16448_IMU.h classes: - ADIS16448_IMUSim: + frc::sim::ADIS16448_IMUSim: methods: ADIS16448_IMUSim: SetGyroAngleX: diff --git a/subprojects/robotpy-wpilib/gen/simulation/ADIS16470_IMUSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/ADIS16470_IMUSim.yml similarity index 89% rename from subprojects/robotpy-wpilib/gen/simulation/ADIS16470_IMUSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/ADIS16470_IMUSim.yml index e20814259..a8b3fc00b 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/ADIS16470_IMUSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/ADIS16470_IMUSim.yml @@ -1,10 +1,9 @@ ---- extra_includes: - frc/ADIS16470_IMU.h classes: - ADIS16470_IMUSim: + frc::sim::ADIS16470_IMUSim: methods: ADIS16470_IMUSim: SetGyroAngleX: diff --git a/subprojects/robotpy-wpilib/gen/simulation/ADXL345Sim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/ADXL345Sim.yml similarity index 89% rename from subprojects/robotpy-wpilib/gen/simulation/ADXL345Sim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/ADXL345Sim.yml index 2acf1115b..d80b04f69 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/ADXL345Sim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/ADXL345Sim.yml @@ -1,11 +1,10 @@ ---- extra_includes: - frc/ADXL345_I2C.h - frc/ADXL345_SPI.h classes: - ADXL345Sim: + frc::sim::ADXL345Sim: methods: ADXL345Sim: overloads: diff --git a/subprojects/robotpy-wpilib/gen/simulation/ADXL362Sim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/ADXL362Sim.yml similarity index 82% rename from subprojects/robotpy-wpilib/gen/simulation/ADXL362Sim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/ADXL362Sim.yml index 4da69d64a..f212896cc 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/ADXL362Sim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/ADXL362Sim.yml @@ -1,10 +1,9 @@ ---- extra_includes: - frc/ADXL362.h classes: - ADXL362Sim: + frc::sim::ADXL362Sim: methods: ADXL362Sim: SetX: diff --git a/subprojects/robotpy-wpilib/gen/simulation/ADXRS450_GyroSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/ADXRS450_GyroSim.yml similarity index 71% rename from subprojects/robotpy-wpilib/gen/simulation/ADXRS450_GyroSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/ADXRS450_GyroSim.yml index 31eb000ff..b32049290 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/ADXRS450_GyroSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/ADXRS450_GyroSim.yml @@ -1,11 +1,8 @@ ---- - extra_includes: - frc/ADXRS450_Gyro.h classes: - ADXRS450_GyroSim: - shared_ptr: true + frc::sim::ADXRS450_GyroSim: methods: ADXRS450_GyroSim: SetAngle: diff --git a/subprojects/robotpy-wpilib/gen/simulation/AddressableLEDSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/AddressableLEDSim.yml similarity index 90% rename from subprojects/robotpy-wpilib/gen/simulation/AddressableLEDSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/AddressableLEDSim.yml index a8f840fea..8c33cefe7 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/AddressableLEDSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/AddressableLEDSim.yml @@ -1,17 +1,14 @@ ---- - extra_includes: - frc/AddressableLED.h classes: - AddressableLEDSim: - shared_ptr: true + frc::sim::AddressableLEDSim: force_type_casters: - std::function methods: AddressableLEDSim: overloads: - "": + '': const AddressableLED&: CreateForChannel: CreateForIndex: diff --git a/subprojects/robotpy-wpilib/gen/simulation/AnalogEncoderSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/AnalogEncoderSim.yml similarity index 82% rename from subprojects/robotpy-wpilib/gen/simulation/AnalogEncoderSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/AnalogEncoderSim.yml index 2934deb2f..03141661d 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/AnalogEncoderSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/AnalogEncoderSim.yml @@ -1,11 +1,8 @@ ---- - extra_includes: - frc/AnalogEncoder.h classes: - AnalogEncoderSim: - shared_ptr: true + frc::sim::AnalogEncoderSim: force_type_casters: - std::function methods: diff --git a/subprojects/robotpy-wpilib/gen/simulation/AnalogGyroSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/AnalogGyroSim.yml similarity index 90% rename from subprojects/robotpy-wpilib/gen/simulation/AnalogGyroSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/AnalogGyroSim.yml index b523209c6..5a10c8bf2 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/AnalogGyroSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/AnalogGyroSim.yml @@ -1,11 +1,8 @@ ---- - extra_includes: - frc/AnalogGyro.h classes: - AnalogGyroSim: - shared_ptr: true + frc::sim::AnalogGyroSim: force_type_casters: - std::function methods: diff --git a/subprojects/robotpy-wpilib/gen/simulation/AnalogInputSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/AnalogInputSim.yml similarity index 95% rename from subprojects/robotpy-wpilib/gen/simulation/AnalogInputSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/AnalogInputSim.yml index effd16046..26864f2e3 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/AnalogInputSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/AnalogInputSim.yml @@ -1,11 +1,8 @@ ---- - extra_includes: - frc/AnalogInput.h classes: - AnalogInputSim: - shared_ptr: true + frc::sim::AnalogInputSim: force_type_casters: - std::function methods: diff --git a/subprojects/robotpy-wpilib/gen/simulation/AnalogOutputSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/AnalogOutputSim.yml similarity index 88% rename from subprojects/robotpy-wpilib/gen/simulation/AnalogOutputSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/AnalogOutputSim.yml index cc2469f3b..2f0e46f4c 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/AnalogOutputSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/AnalogOutputSim.yml @@ -1,11 +1,8 @@ ---- - extra_includes: - frc/AnalogOutput.h classes: - AnalogOutputSim: - shared_ptr: true + frc::sim::AnalogOutputSim: force_type_casters: - std::function methods: diff --git a/subprojects/robotpy-wpilib/gen/simulation/AnalogTriggerSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/AnalogTriggerSim.yml similarity index 91% rename from subprojects/robotpy-wpilib/gen/simulation/AnalogTriggerSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/AnalogTriggerSim.yml index c9b94ac65..79f459a68 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/AnalogTriggerSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/AnalogTriggerSim.yml @@ -1,11 +1,8 @@ ---- - extra_includes: - frc/AnalogTrigger.h classes: - AnalogTriggerSim: - shared_ptr: true + frc::sim::AnalogTriggerSim: force_type_casters: - std::function methods: diff --git a/subprojects/robotpy-wpilib/gen/simulation/BatterySim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/BatterySim.yml similarity index 90% rename from subprojects/robotpy-wpilib/gen/simulation/BatterySim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/BatterySim.yml index d09c82da0..e840ddf7f 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/BatterySim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/BatterySim.yml @@ -1,8 +1,5 @@ ---- - classes: - BatterySim: - shared_ptr: false + frc::sim::BatterySim: force_type_casters: - units::ampere_t methods: diff --git a/subprojects/robotpy-wpilib/gen/simulation/BuiltInAccelerometerSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/BuiltInAccelerometerSim.yml similarity index 87% rename from subprojects/robotpy-wpilib/gen/simulation/BuiltInAccelerometerSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/BuiltInAccelerometerSim.yml index 40e32f138..93470a728 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/BuiltInAccelerometerSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/BuiltInAccelerometerSim.yml @@ -1,17 +1,14 @@ ---- - extra_includes: - frc/BuiltInAccelerometer.h classes: - BuiltInAccelerometerSim: - shared_ptr: true + frc::sim::BuiltInAccelerometerSim: force_type_casters: - std::function methods: BuiltInAccelerometerSim: overloads: - "": + '': const BuiltInAccelerometer&: RegisterActiveCallback: GetActive: diff --git a/subprojects/robotpy-wpilib/gen/simulation/CTREPCMSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/CTREPCMSim.yml similarity index 91% rename from subprojects/robotpy-wpilib/gen/simulation/CTREPCMSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/CTREPCMSim.yml index 600003aa1..2f8c2c454 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/CTREPCMSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/CTREPCMSim.yml @@ -1,10 +1,9 @@ ---- extra_includes: - frc/Compressor.h classes: - CTREPCMSim: + frc::sim::CTREPCMSim: typealias: - frc::PneumaticsBase force_type_casters: @@ -12,9 +11,9 @@ classes: methods: CTREPCMSim: overloads: - "": + '': int: - const PneumaticsBase&: + const PneumaticsBase&: RegisterInitializedCallback: GetInitialized: SetInitialized: diff --git a/subprojects/robotpy-wpilib/gen/simulation/CallbackStore.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/CallbackStore.yml similarity index 95% rename from subprojects/robotpy-wpilib/gen/simulation/CallbackStore.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/CallbackStore.yml index f2a9ce787..ddf81762c 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/CallbackStore.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/CallbackStore.yml @@ -1,13 +1,10 @@ ---- - functions: CallbackStoreThunk: ignore: true ConstBufferCallbackStoreThunk: ignore: true classes: - CallbackStore: - shared_ptr: true + frc::sim::CallbackStore: force_type_casters: - std::function methods: @@ -27,7 +24,6 @@ classes: int32_t, int32_t, int32_t, ConstBufferCallback, CancelCallbackChannelFunc: ignore: true SetUid: - CallbackStoreThunk: ignore: true ConstBufferCallbackStoreThunk: diff --git a/subprojects/robotpy-wpilib/gen/simulation/DCMotorSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/DCMotorSim.yml similarity index 97% rename from subprojects/robotpy-wpilib/gen/simulation/DCMotorSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/DCMotorSim.yml index 9122c6270..9a4608d8b 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/DCMotorSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/DCMotorSim.yml @@ -1,7 +1,6 @@ ---- classes: - DCMotorSim: + frc::sim::DCMotorSim: typealias: - frc::DCMotor methods: diff --git a/subprojects/robotpy-wpilib/gen/simulation/DIOSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/DIOSim.yml similarity index 94% rename from subprojects/robotpy-wpilib/gen/simulation/DIOSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/DIOSim.yml index 944284361..12fd33aa6 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/DIOSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/DIOSim.yml @@ -1,12 +1,9 @@ ---- - extra_includes: - frc/DigitalInput.h - frc/DigitalOutput.h classes: - DIOSim: - shared_ptr: true + frc::sim::DIOSim: force_type_casters: - std::function methods: diff --git a/subprojects/robotpy-wpilib/gen/simulation/DifferentialDrivetrainSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/DifferentialDrivetrainSim.yml similarity index 88% rename from subprojects/robotpy-wpilib/gen/simulation/DifferentialDrivetrainSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/DifferentialDrivetrainSim.yml index d87dce749..7571a04c9 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/DifferentialDrivetrainSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/DifferentialDrivetrainSim.yml @@ -1,8 +1,5 @@ ---- - classes: - DifferentialDrivetrainSim: - shared_ptr: true + frc::sim::DifferentialDrivetrainSim: typealias: - frc::DCMotor - template using LinearSystem = frc::LinearSystem @@ -15,8 +12,7 @@ classes: default: std::array{} ? frc::DCMotor, double, units::kilogram_square_meter_t, units::kilogram_t, units::meter_t, units::meter_t, const std::array& - : - param_override: + : param_override: measurementStdDevs: default: std::array{} ClampInput: @@ -46,8 +42,7 @@ classes: param_override: measurementStdDevs: default: std::array{} - DifferentialDrivetrainSim::State: - shared_ptr: true + frc::sim::DifferentialDrivetrainSim::State: attributes: kX: kY: @@ -56,16 +51,14 @@ classes: kRightVelocity: kLeftPosition: kRightPosition: - DifferentialDrivetrainSim::KitbotGearing: - shared_ptr: true + frc::sim::DifferentialDrivetrainSim::KitbotGearing: attributes: k12p75: k10p71: k8p45: k7p31: k5p95: - DifferentialDrivetrainSim::KitbotMotor: - shared_ptr: true + frc::sim::DifferentialDrivetrainSim::KitbotMotor: attributes: SingleCIMPerSide: DualCIMPerSide: @@ -75,14 +68,13 @@ classes: DualFalcon500PerSide: SingleNEOPerSide: DualNEOPerSide: - DifferentialDrivetrainSim::KitbotWheelSize: - shared_ptr: true + frc::sim::DifferentialDrivetrainSim::KitbotWheelSize: attributes: kSixInch: kEightInch: kTenInch: -inline_code: | +inline_code: |- cls_DifferentialDrivetrainSim .def("getLeftPositionFeet", [](DifferentialDrivetrainSim * self) -> units::foot_t { return self->GetLeftPosition(); @@ -102,4 +94,4 @@ inline_code: | .def("getRightVelocityFps", [](DifferentialDrivetrainSim * self) -> units::feet_per_second_t { return self->GetRightVelocity(); }) - ; \ No newline at end of file + ; diff --git a/subprojects/robotpy-wpilib/gen/simulation/DigitalPWMSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/DigitalPWMSim.yml similarity index 91% rename from subprojects/robotpy-wpilib/gen/simulation/DigitalPWMSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/DigitalPWMSim.yml index 82044614c..e770d5c51 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/DigitalPWMSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/DigitalPWMSim.yml @@ -1,11 +1,8 @@ ---- - extra_includes: - frc/DigitalOutput.h classes: - DigitalPWMSim: - shared_ptr: true + frc::sim::DigitalPWMSim: force_type_casters: - std::function methods: diff --git a/subprojects/robotpy-wpilib/gen/simulation/DoubleSolenoidSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/DoubleSolenoidSim.yml similarity index 90% rename from subprojects/robotpy-wpilib/gen/simulation/DoubleSolenoidSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/DoubleSolenoidSim.yml index 533049616..94a386711 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/DoubleSolenoidSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/DoubleSolenoidSim.yml @@ -1,7 +1,6 @@ ---- classes: - DoubleSolenoidSim: + frc::sim::DoubleSolenoidSim: typealias: - frc::PneumaticsModuleType methods: diff --git a/subprojects/robotpy-wpilib/gen/simulation/DriverStationSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/DriverStationSim.yml similarity index 96% rename from subprojects/robotpy-wpilib/gen/simulation/DriverStationSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/DriverStationSim.yml index f1bb49089..a32a50777 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/DriverStationSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/DriverStationSim.yml @@ -1,8 +1,5 @@ ---- - classes: - DriverStationSim: - shared_ptr: true + frc::sim::DriverStationSim: force_type_casters: - std::function methods: diff --git a/subprojects/robotpy-wpilib/gen/simulation/DutyCycleEncoderSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/DutyCycleEncoderSim.yml similarity index 87% rename from subprojects/robotpy-wpilib/gen/simulation/DutyCycleEncoderSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/DutyCycleEncoderSim.yml index 1766b5698..d9ebc21bb 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/DutyCycleEncoderSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/DutyCycleEncoderSim.yml @@ -1,11 +1,8 @@ ---- - extra_includes: - frc/DutyCycleEncoder.h classes: - DutyCycleEncoderSim: - shared_ptr: true + frc::sim::DutyCycleEncoderSim: methods: DutyCycleEncoderSim: overloads: diff --git a/subprojects/robotpy-wpilib/gen/simulation/DutyCycleSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/DutyCycleSim.yml similarity index 91% rename from subprojects/robotpy-wpilib/gen/simulation/DutyCycleSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/DutyCycleSim.yml index dd264c55f..1d9a1bef4 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/DutyCycleSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/DutyCycleSim.yml @@ -1,11 +1,8 @@ ---- - extra_includes: - frc/DutyCycle.h classes: - DutyCycleSim: - shared_ptr: true + frc::sim::DutyCycleSim: force_type_casters: - std::function methods: diff --git a/subprojects/robotpy-wpilib/gen/simulation/ElevatorSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/ElevatorSim.yml similarity index 88% rename from subprojects/robotpy-wpilib/gen/simulation/ElevatorSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/ElevatorSim.yml index 2614084a8..27ad94ed8 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/ElevatorSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/ElevatorSim.yml @@ -1,32 +1,27 @@ ---- - classes: - ElevatorSim: - shared_ptr: true + frc::sim::ElevatorSim: typealias: - frc::DCMotor - - template using LinearSystem = frc::LinearSystem + - template using LinearSystem = frc::LinearSystem - template using Vectord = frc::Vectord methods: ElevatorSim: overloads: ? const LinearSystem<2, 1, 2>&, const DCMotor&, units::meter_t, units::meter_t, bool, units::meter_t, const std::array& - : - param_override: + : param_override: measurementStdDevs: default: std::array{0.0, 0.0} ? const DCMotor&, double, units::kilogram_t, units::meter_t, units::meter_t, units::meter_t, bool, units::meter_t, const std::array& - : - param_override: + : param_override: measurementStdDevs: default: std::array{0.0} ? decltype(1_V/Velocity_t (1)), decltype(1_V/Acceleration_t (1)), const DCMotor&, units::meter_t, units::meter_t, bool, units::meter_t, const std::array& - : - ignore: true + : ignore: true SetState: WouldHitLowerLimit: WouldHitUpperLimit: @@ -38,7 +33,7 @@ classes: SetInputVoltage: UpdateX: -inline_code: | +inline_code: |- cls_ElevatorSim .def("getPositionFeet", [](ElevatorSim * self) -> units::foot_t { return self->GetPosition(); @@ -49,4 +44,4 @@ inline_code: | .def("getVelocityFps", [](ElevatorSim * self) -> units::feet_per_second_t { return self->GetVelocity(); }) - ; \ No newline at end of file + ; diff --git a/subprojects/robotpy-wpilib/gen/simulation/EncoderSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/EncoderSim.yml similarity index 96% rename from subprojects/robotpy-wpilib/gen/simulation/EncoderSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/EncoderSim.yml index 6bc083c51..1bc697ff5 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/EncoderSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/EncoderSim.yml @@ -1,11 +1,8 @@ ---- - extra_includes: - frc/Encoder.h classes: - EncoderSim: - shared_ptr: true + frc::sim::EncoderSim: force_type_casters: - std::function methods: diff --git a/subprojects/robotpy-wpilib/gen/simulation/FlywheelSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/FlywheelSim.yml similarity index 92% rename from subprojects/robotpy-wpilib/gen/simulation/FlywheelSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/FlywheelSim.yml index 9c03f427e..6f2dc699d 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/FlywheelSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/FlywheelSim.yml @@ -1,11 +1,9 @@ ---- - classes: - FlywheelSim: - shared_ptr: true + frc::sim::FlywheelSim: typealias: - frc::DCMotor - - template using LinearSystem = frc::LinearSystem + - template using LinearSystem = frc::LinearSystem methods: FlywheelSim: overloads: diff --git a/subprojects/robotpy-wpilib/gen/simulation/GenericHIDSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/GenericHIDSim.yml similarity index 90% rename from subprojects/robotpy-wpilib/gen/simulation/GenericHIDSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/GenericHIDSim.yml index 649f07cdd..6eade0e20 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/GenericHIDSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/GenericHIDSim.yml @@ -1,8 +1,5 @@ ---- - classes: - GenericHIDSim: - shared_ptr: true + frc::sim::GenericHIDSim: methods: GenericHIDSim: overloads: diff --git a/subprojects/robotpy-wpilib/gen/simulation/JoystickSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/JoystickSim.yml similarity index 86% rename from subprojects/robotpy-wpilib/gen/simulation/JoystickSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/JoystickSim.yml index 1de7955f9..a4b9680b5 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/JoystickSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/JoystickSim.yml @@ -1,11 +1,8 @@ ---- - extra_includes: - frc/Joystick.h classes: - JoystickSim: - shared_ptr: true + frc::sim::JoystickSim: force_no_trampoline: true methods: JoystickSim: diff --git a/subprojects/robotpy-wpilib/gen/simulation/LinearSystemSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/LinearSystemSim.yml similarity index 95% rename from subprojects/robotpy-wpilib/gen/simulation/LinearSystemSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/LinearSystemSim.yml index a72bcf150..7500b5a33 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/LinearSystemSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/LinearSystemSim.yml @@ -1,10 +1,8 @@ ---- - classes: - LinearSystemSim: - shared_ptr: true + frc::sim::LinearSystemSim: typealias: - - template using LinearSystem = frc::LinearSystem + - template using LinearSystem = frc::LinearSystem - template using Vectord = frc::Vectord template_params: - int States @@ -76,4 +74,4 @@ templates: params: - 2 - 2 - - 2 \ No newline at end of file + - 2 diff --git a/subprojects/robotpy-wpilib/gen/simulation/Mechanism2D.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/Mechanism2D.yml similarity index 68% rename from subprojects/robotpy-wpilib/gen/simulation/Mechanism2D.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/Mechanism2D.yml index 73ba861da..d3b8d2582 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/Mechanism2D.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/Mechanism2D.yml @@ -1,8 +1,5 @@ ---- - classes: - Mechanism2D: - shared_ptr: true + frc::sim::Mechanism2D: methods: Mechanism2D: SetLigamentAngle: diff --git a/subprojects/robotpy-wpilib/gen/simulation/PCMSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/PCMSim.yml similarity index 94% rename from subprojects/robotpy-wpilib/gen/simulation/PCMSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/PCMSim.yml index 0a597161e..9395aa6d1 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/PCMSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/PCMSim.yml @@ -1,17 +1,14 @@ ---- - extra_includes: - frc/Compressor.h classes: - PCMSim: - shared_ptr: true + frc::sim::PCMSim: force_type_casters: - std::function methods: PCMSim: overloads: - "": + '': int: frc::Compressor&: RegisterSolenoidInitializedCallback: diff --git a/subprojects/robotpy-wpilib/gen/simulation/PDPSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/PDPSim.yml similarity index 93% rename from subprojects/robotpy-wpilib/gen/simulation/PDPSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/PDPSim.yml index f7681a391..69d63de9e 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/PDPSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/PDPSim.yml @@ -1,11 +1,8 @@ ---- - extra_includes: - frc/PowerDistributionPanel.h classes: - PDPSim: - shared_ptr: true + frc::sim::PDPSim: force_type_casters: - std::function methods: diff --git a/subprojects/robotpy-wpilib/gen/simulation/PS4ControllerSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/PS4ControllerSim.yml similarity index 95% rename from subprojects/robotpy-wpilib/gen/simulation/PS4ControllerSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/PS4ControllerSim.yml index c1bcd635e..5a0c78eb5 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/PS4ControllerSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/PS4ControllerSim.yml @@ -1,10 +1,9 @@ ---- extra_includes: - frc/PS4Controller.h classes: - PS4ControllerSim: + frc::sim::PS4ControllerSim: force_no_trampoline: true methods: PS4ControllerSim: diff --git a/subprojects/robotpy-wpilib/gen/simulation/PS5ControllerSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/PS5ControllerSim.yml similarity index 91% rename from subprojects/robotpy-wpilib/gen/simulation/PS5ControllerSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/PS5ControllerSim.yml index fe5374540..b7d4c22d1 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/PS5ControllerSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/PS5ControllerSim.yml @@ -1,10 +1,9 @@ ---- extra_includes: - frc/PS5Controller.h classes: - PS5ControllerSim: + frc::sim::PS5ControllerSim: force_no_trampoline: true methods: PS5ControllerSim: @@ -32,4 +31,4 @@ classes: SetPSButton: SetTouchpad: ignore: true - SetTouchpadButton: \ No newline at end of file + SetTouchpadButton: diff --git a/subprojects/robotpy-wpilib/gen/simulation/PWMSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/PWMSim.yml similarity index 95% rename from subprojects/robotpy-wpilib/gen/simulation/PWMSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/PWMSim.yml index d294230d0..1498b5df2 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/PWMSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/PWMSim.yml @@ -1,12 +1,9 @@ ---- - extra_includes: - frc/PWM.h - frc/motorcontrol/PWMMotorController.h classes: - PWMSim: - shared_ptr: true + frc::sim::PWMSim: force_type_casters: - std::function methods: diff --git a/subprojects/robotpy-wpilib/gen/simulation/PneumaticsBaseSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/PneumaticsBaseSim.yml similarity index 96% rename from subprojects/robotpy-wpilib/gen/simulation/PneumaticsBaseSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/PneumaticsBaseSim.yml index 9a5dbb047..0f997494c 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/PneumaticsBaseSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/PneumaticsBaseSim.yml @@ -1,7 +1,6 @@ ---- classes: - PneumaticsBaseSim: + frc::sim::PneumaticsBaseSim: typealias: - frc::PneumaticsBase attributes: diff --git a/subprojects/robotpy-wpilib/gen/simulation/PowerDistributionSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/PowerDistributionSim.yml similarity index 94% rename from subprojects/robotpy-wpilib/gen/simulation/PowerDistributionSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/PowerDistributionSim.yml index dcd566f9d..380aaefb0 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/PowerDistributionSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/PowerDistributionSim.yml @@ -1,10 +1,9 @@ ---- extra_includes: - frc/PowerDistribution.h classes: - PowerDistributionSim: + frc::sim::PowerDistributionSim: force_type_casters: - std::function methods: diff --git a/subprojects/robotpy-wpilib/gen/simulation/REVPHSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/REVPHSim.yml similarity index 95% rename from subprojects/robotpy-wpilib/gen/simulation/REVPHSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/REVPHSim.yml index 0d569c8ab..84b62062e 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/REVPHSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/REVPHSim.yml @@ -1,10 +1,9 @@ ---- extra_includes: - frc/Compressor.h classes: - REVPHSim: + frc::sim::REVPHSim: typealias: - frc::PneumaticsBase force_type_casters: @@ -12,7 +11,7 @@ classes: methods: REVPHSim: overloads: - "": + '': int: const PneumaticsBase&: RegisterInitializedCallback: diff --git a/subprojects/robotpy-wpilib/gen/simulation/RelaySim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/RelaySim.yml similarity index 93% rename from subprojects/robotpy-wpilib/gen/simulation/RelaySim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/RelaySim.yml index 77492eced..fa6086351 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/RelaySim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/RelaySim.yml @@ -1,11 +1,8 @@ ---- - extra_includes: - frc/Relay.h classes: - RelaySim: - shared_ptr: true + frc::sim::RelaySim: force_type_casters: - std::function methods: diff --git a/subprojects/robotpy-wpilib/gen/simulation/RoboRioSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/RoboRioSim.yml similarity index 97% rename from subprojects/robotpy-wpilib/gen/simulation/RoboRioSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/RoboRioSim.yml index 6cd61d3e6..765a6b7da 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/RoboRioSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/RoboRioSim.yml @@ -1,8 +1,5 @@ ---- - classes: - RoboRioSim: - shared_ptr: true + frc::sim::RoboRioSim: force_type_casters: - std::function methods: diff --git a/subprojects/robotpy-wpilib/gen/simulation/SPIAccelerometerSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/SPIAccelerometerSim.yml similarity index 88% rename from subprojects/robotpy-wpilib/gen/simulation/SPIAccelerometerSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/SPIAccelerometerSim.yml index f1b12c2dd..3dd2e7a9a 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/SPIAccelerometerSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/SPIAccelerometerSim.yml @@ -1,8 +1,5 @@ ---- - classes: - SPIAccelerometerSim: - shared_ptr: true + frc::sim::SPIAccelerometerSim: force_type_casters: - std::function methods: diff --git a/subprojects/robotpy-wpilib/gen/simulation/SendableChooserSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/SendableChooserSim.yml similarity index 84% rename from subprojects/robotpy-wpilib/gen/simulation/SendableChooserSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/SendableChooserSim.yml index 8303133a8..472a54ef1 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/SendableChooserSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/SendableChooserSim.yml @@ -1,7 +1,6 @@ ---- classes: - SendableChooserSim: + frc::sim::SendableChooserSim: methods: SendableChooserSim: overloads: diff --git a/subprojects/robotpy-wpilib/gen/simulation/SharpIRSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/SharpIRSim.yml similarity index 86% rename from subprojects/robotpy-wpilib/gen/simulation/SharpIRSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/SharpIRSim.yml index 7d7c6c6d5..75ea7be5d 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/SharpIRSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/SharpIRSim.yml @@ -1,7 +1,6 @@ ---- classes: - SharpIRSim: + frc::SharpIRSim: methods: SharpIRSim: overloads: diff --git a/subprojects/robotpy-wpilib/gen/simulation/SimDeviceSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/SimDeviceSim.yml similarity index 98% rename from subprojects/robotpy-wpilib/gen/simulation/SimDeviceSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/SimDeviceSim.yml index 64c65a640..8be1e5942 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/SimDeviceSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/SimDeviceSim.yml @@ -1,10 +1,8 @@ ---- - extra_includes: - pybind11/stl.h classes: - SimDeviceSim: + frc::sim::SimDeviceSim: doc: | Interact with a generic simulated device @@ -27,7 +25,6 @@ classes: .. note:: WPILib has simulation support for all of its devices. Some vendors may only have limited support for simulation -- read the vendor's documentation or contact them for more information. - shared_ptr: false force_type_casters: - std::function - std::string_view diff --git a/subprojects/robotpy-wpilib/gen/simulation/SimHooks.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/SimHooks.yml similarity index 97% rename from subprojects/robotpy-wpilib/gen/simulation/SimHooks.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/SimHooks.yml index 62d180336..eb5e8b75a 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/SimHooks.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/SimHooks.yml @@ -1,4 +1,3 @@ ---- functions: SetRuntimeType: diff --git a/subprojects/robotpy-wpilib/gen/simulation/SingleJointedArmSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/SingleJointedArmSim.yml similarity index 88% rename from subprojects/robotpy-wpilib/gen/simulation/SingleJointedArmSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/SingleJointedArmSim.yml index 38ba432f0..7975f32d3 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/SingleJointedArmSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/SingleJointedArmSim.yml @@ -1,11 +1,9 @@ ---- - classes: - SingleJointedArmSim: - shared_ptr: true + frc::sim::SingleJointedArmSim: typealias: - frc::DCMotor - - template using LinearSystem = frc::LinearSystem + - template using LinearSystem = frc::LinearSystem - template using Vectord = frc::Vectord methods: SingleJointedArmSim: @@ -13,15 +11,13 @@ classes: ? const LinearSystem<2, 1, 2>&, const DCMotor&, double, units::meter_t, units::radian_t, units::radian_t, bool, units::radian_t, const std::array& - : - param_override: + : param_override: measurementStdDevs: default: std::array{0.0, 0.0} ? const DCMotor&, double, units::kilogram_square_meter_t, units::meter_t, units::radian_t, units::radian_t, bool, units::radian_t, const std::array& - : - param_override: + : param_override: measurementStdDevs: default: std::array{0.0, 0.0} SetState: @@ -36,7 +32,7 @@ classes: EstimateMOI: UpdateX: -inline_code: | +inline_code: |- cls_SingleJointedArmSim .def("getAngleDegrees", [](SingleJointedArmSim * self) -> units::degree_t { return self->GetAngle(); @@ -44,4 +40,4 @@ inline_code: | .def("getVelocityDps", [](SingleJointedArmSim * self) -> units::degrees_per_second_t { return self->GetVelocity(); }) - ; \ No newline at end of file + ; diff --git a/subprojects/robotpy-wpilib/gen/simulation/SolenoidSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/SolenoidSim.yml similarity index 89% rename from subprojects/robotpy-wpilib/gen/simulation/SolenoidSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/SolenoidSim.yml index 2647c59af..8cee1025a 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/SolenoidSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/SolenoidSim.yml @@ -1,8 +1,5 @@ ---- - classes: - SolenoidSim: - shared_ptr: false + frc::sim::SolenoidSim: force_type_casters: - std::function typealias: diff --git a/subprojects/robotpy-wpilib/gen/simulation/StadiaControllerSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/StadiaControllerSim.yml similarity index 94% rename from subprojects/robotpy-wpilib/gen/simulation/StadiaControllerSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/StadiaControllerSim.yml index a85bd2773..d1798ceb4 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/StadiaControllerSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/StadiaControllerSim.yml @@ -1,10 +1,9 @@ ---- extra_includes: - frc/StadiaController.h classes: - StadiaControllerSim: + frc::sim::StadiaControllerSim: force_no_trampoline: true methods: StadiaControllerSim: diff --git a/subprojects/robotpy-wpilib/gen/simulation/UltrasonicSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/UltrasonicSim.yml similarity index 89% rename from subprojects/robotpy-wpilib/gen/simulation/UltrasonicSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/UltrasonicSim.yml index 073ad7582..f2a24c704 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/UltrasonicSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/UltrasonicSim.yml @@ -1,10 +1,9 @@ ---- extra_includes: - frc/Ultrasonic.h classes: - UltrasonicSim: + frc::sim::UltrasonicSim: typealias: - frc::Ultrasonic methods: diff --git a/subprojects/robotpy-wpilib/gen/simulation/XboxControllerSim.yml b/subprojects/robotpy-wpilib/semiwrap/simulation/XboxControllerSim.yml similarity index 96% rename from subprojects/robotpy-wpilib/gen/simulation/XboxControllerSim.yml rename to subprojects/robotpy-wpilib/semiwrap/simulation/XboxControllerSim.yml index def08f499..deb3d7734 100644 --- a/subprojects/robotpy-wpilib/gen/simulation/XboxControllerSim.yml +++ b/subprojects/robotpy-wpilib/semiwrap/simulation/XboxControllerSim.yml @@ -1,10 +1,9 @@ ---- extra_includes: - frc/XboxController.h classes: - XboxControllerSim: + frc::sim::XboxControllerSim: force_no_trampoline: true typealias: - frc::XboxController diff --git a/subprojects/robotpy-wpilib/setup.py b/subprojects/robotpy-wpilib/setup.py deleted file mode 100644 index 3542d0c9a..000000000 --- a/subprojects/robotpy-wpilib/setup.py +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env python3 - -from robotpy_build.setup import setup - -setup() diff --git a/subprojects/robotpy-wpilib/wpilib/__init__.py b/subprojects/robotpy-wpilib/wpilib/__init__.py index 9ee20f8d9..fd50fc34f 100644 --- a/subprojects/robotpy-wpilib/wpilib/__init__.py +++ b/subprojects/robotpy-wpilib/wpilib/__init__.py @@ -1,9 +1,9 @@ -from . import _init_wpilib +from . import _init__wpilib # TODO: robotpy-build subpackage bug from wpimath._controls._controls import trajectory as _ -# autogenerated by 'robotpy-build create-imports wpilib wpilib._wpilib' +# autogenerated by 'semiwrap create-imports wpilib wpilib._wpilib' from ._wpilib import ( ADIS16448_IMU, ADIS16470_IMU, @@ -229,7 +229,7 @@ __all__ += ["reportError", "reportWarning"] -del _init_wpilib +del _init__wpilib from .cameraserver import CameraServer from .deployinfo import getDeployData diff --git a/subprojects/robotpy-wpilib/wpilib/_impl/__init__.py b/subprojects/robotpy-wpilib/wpilib/_impl/__init__.py index 0fb2cee33..e69de29bb 100644 --- a/subprojects/robotpy-wpilib/wpilib/_impl/__init__.py +++ b/subprojects/robotpy-wpilib/wpilib/_impl/__init__.py @@ -1 +0,0 @@ -from . import _init_wpilibc diff --git a/subprojects/robotpy-wpilib/wpilib/counter/__init__.py b/subprojects/robotpy-wpilib/wpilib/counter/__init__.py index b0563ab40..eddbdaa65 100644 --- a/subprojects/robotpy-wpilib/wpilib/counter/__init__.py +++ b/subprojects/robotpy-wpilib/wpilib/counter/__init__.py @@ -1,6 +1,6 @@ -from . import _init_counter +from . import _init__counter -# autogenerated by 'robotpy-build create-imports wpilib.counter wpilib.counter._counter' +# autogenerated by 'semiwrap create-imports wpilib.counter wpilib.counter._counter' from ._counter import ( EdgeConfiguration, ExternalDirectionCounter, diff --git a/subprojects/robotpy-wpilib/wpilib/counter/counter.cpp b/subprojects/robotpy-wpilib/wpilib/counter/counter.cpp index 956ee7fab..7dbe6e455 100644 --- a/subprojects/robotpy-wpilib/wpilib/counter/counter.cpp +++ b/subprojects/robotpy-wpilib/wpilib/counter/counter.cpp @@ -1,7 +1,7 @@ -#include "rpygen_wrapper.hpp" +#include "semiwrap_init.wpilib.counter._counter.hpp" -RPYBUILD_PYBIND11_MODULE(m) +SEMIWRAP_PYBIND11_MODULE(m) { initWrapper(m); } diff --git a/subprojects/robotpy-wpilib/wpilib/drive/__init__.py b/subprojects/robotpy-wpilib/wpilib/drive/__init__.py index 372de1f23..5c9b913e8 100644 --- a/subprojects/robotpy-wpilib/wpilib/drive/__init__.py +++ b/subprojects/robotpy-wpilib/wpilib/drive/__init__.py @@ -1,8 +1,8 @@ -from . import _init_drive +from . import _init__drive -# autogenerated by 'robotpy-build create-imports wpilib.drive wpilib.drive._drive' +# autogenerated by 'semiwrap create-imports wpilib.drive wpilib.drive._drive' from ._drive import DifferentialDrive, MecanumDrive, RobotDriveBase __all__ = ["DifferentialDrive", "MecanumDrive", "RobotDriveBase"] -del _init_drive +del _init__drive diff --git a/subprojects/robotpy-wpilib/wpilib/drive/drive.cpp b/subprojects/robotpy-wpilib/wpilib/drive/drive.cpp index 956ee7fab..2ef4e0efd 100644 --- a/subprojects/robotpy-wpilib/wpilib/drive/drive.cpp +++ b/subprojects/robotpy-wpilib/wpilib/drive/drive.cpp @@ -1,7 +1,7 @@ -#include "rpygen_wrapper.hpp" +#include "semiwrap_init.wpilib.drive._drive.hpp" -RPYBUILD_PYBIND11_MODULE(m) +SEMIWRAP_PYBIND11_MODULE(m) { initWrapper(m); } diff --git a/subprojects/robotpy-wpilib/wpilib/event/__init__.py b/subprojects/robotpy-wpilib/wpilib/event/__init__.py index 31d3f82aa..3bef5e230 100644 --- a/subprojects/robotpy-wpilib/wpilib/event/__init__.py +++ b/subprojects/robotpy-wpilib/wpilib/event/__init__.py @@ -1,6 +1,6 @@ -from . import _init_event +from . import _init__event -# autogenerated by 'robotpy-build create-imports wpilib.event wpilib.event._event' +# autogenerated by 'semiwrap create-imports wpilib.event wpilib.event._event' from ._event import BooleanEvent, EventLoop, NetworkBooleanEvent __all__ = ["BooleanEvent", "EventLoop", "NetworkBooleanEvent"] diff --git a/subprojects/robotpy-wpilib/wpilib/event/event.cpp b/subprojects/robotpy-wpilib/wpilib/event/event.cpp index 956ee7fab..2a317e39c 100644 --- a/subprojects/robotpy-wpilib/wpilib/event/event.cpp +++ b/subprojects/robotpy-wpilib/wpilib/event/event.cpp @@ -1,7 +1,7 @@ -#include "rpygen_wrapper.hpp" +#include "semiwrap_init.wpilib.event._event.hpp" -RPYBUILD_PYBIND11_MODULE(m) +SEMIWRAP_PYBIND11_MODULE(m) { initWrapper(m); } diff --git a/subprojects/robotpy-wpilib/wpilib/interfaces/__init__.py b/subprojects/robotpy-wpilib/wpilib/interfaces/__init__.py index 965f072ae..15fcac2cc 100644 --- a/subprojects/robotpy-wpilib/wpilib/interfaces/__init__.py +++ b/subprojects/robotpy-wpilib/wpilib/interfaces/__init__.py @@ -1,8 +1,8 @@ -from . import _init_interfaces +from . import _init__interfaces -# autogenerated by 'robotpy-build create-imports wpilib.interfaces wpilib.interfaces._interfaces' +# autogenerated by 'semiwrap create-imports wpilib.interfaces wpilib.interfaces._interfaces' from ._interfaces import CounterBase, GenericHID, MotorController __all__ = ["CounterBase", "GenericHID", "MotorController"] -del _init_interfaces +del _init__interfaces diff --git a/subprojects/robotpy-wpilib/wpilib/interfaces/interfaces.cpp b/subprojects/robotpy-wpilib/wpilib/interfaces/interfaces.cpp index 956ee7fab..caf51ef8a 100644 --- a/subprojects/robotpy-wpilib/wpilib/interfaces/interfaces.cpp +++ b/subprojects/robotpy-wpilib/wpilib/interfaces/interfaces.cpp @@ -1,7 +1,7 @@ -#include "rpygen_wrapper.hpp" +#include "semiwrap_init.wpilib.interfaces._interfaces.hpp" -RPYBUILD_PYBIND11_MODULE(m) +SEMIWRAP_PYBIND11_MODULE(m) { initWrapper(m); } diff --git a/subprojects/robotpy-wpilib/wpilib/py.typed b/subprojects/robotpy-wpilib/wpilib/py.typed new file mode 100644 index 000000000..e69de29bb diff --git a/subprojects/robotpy-wpilib/wpilib/shuffleboard/ShuffleboardData.h b/subprojects/robotpy-wpilib/wpilib/shuffleboard/ShuffleboardData.h index ce5392ed8..df17d3651 100644 --- a/subprojects/robotpy-wpilib/wpilib/shuffleboard/ShuffleboardData.h +++ b/subprojects/robotpy-wpilib/wpilib/shuffleboard/ShuffleboardData.h @@ -2,7 +2,7 @@ #pragma once #include -#include +#include namespace rpy { diff --git a/subprojects/robotpy-wpilib/wpilib/shuffleboard/__init__.py b/subprojects/robotpy-wpilib/wpilib/shuffleboard/__init__.py index 3d7aeb06f..deac6153c 100644 --- a/subprojects/robotpy-wpilib/wpilib/shuffleboard/__init__.py +++ b/subprojects/robotpy-wpilib/wpilib/shuffleboard/__init__.py @@ -1,6 +1,6 @@ -from . import _init_shuffleboard +from . import _init__shuffleboard -# autogenerated by 'robotpy-build create-imports wpilib.shuffleboard wpilib.shuffleboard._shuffleboard' +# autogenerated by 'semiwrap create-imports wpilib.shuffleboard wpilib.shuffleboard._shuffleboard' from ._shuffleboard import ( BuiltInLayouts, BuiltInWidgets, @@ -57,4 +57,4 @@ "shuffleboardEventImportanceName", ] -del _init_shuffleboard +del _init__shuffleboard diff --git a/subprojects/robotpy-wpilib/wpilib/shuffleboard/shuffleboard.cpp b/subprojects/robotpy-wpilib/wpilib/shuffleboard/shuffleboard.cpp index 89765d7e0..bb9884768 100644 --- a/subprojects/robotpy-wpilib/wpilib/shuffleboard/shuffleboard.cpp +++ b/subprojects/robotpy-wpilib/wpilib/shuffleboard/shuffleboard.cpp @@ -1,8 +1,8 @@ -#include "rpygen_wrapper.hpp" +#include "semiwrap_init.wpilib.shuffleboard._shuffleboard.hpp" #include "ShuffleboardData.h" -RPYBUILD_PYBIND11_MODULE(m) +SEMIWRAP_PYBIND11_MODULE(m) { initWrapper(m); diff --git a/subprojects/robotpy-wpilib/wpilib/simulation/__init__.py b/subprojects/robotpy-wpilib/wpilib/simulation/__init__.py index e60490068..1c1b6c5c2 100644 --- a/subprojects/robotpy-wpilib/wpilib/simulation/__init__.py +++ b/subprojects/robotpy-wpilib/wpilib/simulation/__init__.py @@ -1,9 +1,9 @@ -from . import _init_simulation +from . import _init__simulation # needed for dcmotor return value, TODO fix in robotpy-build from wpimath._controls._controls import plant as _ -# autogenerated by 'robotpy-build create-imports wpilib.simulation wpilib.simulation._simulation' +# autogenerated by 'semiwrap create-imports wpilib.simulation wpilib.simulation._simulation' from ._simulation import ( ADIS16448_IMUSim, ADIS16470_IMUSim, @@ -132,4 +132,4 @@ "waitForProgramStart", ] -del _init_simulation +del _init__simulation diff --git a/subprojects/robotpy-wpilib/wpilib/simulation/simulation.cpp b/subprojects/robotpy-wpilib/wpilib/simulation/simulation.cpp index f8ea2ff15..9d5a7d097 100644 --- a/subprojects/robotpy-wpilib/wpilib/simulation/simulation.cpp +++ b/subprojects/robotpy-wpilib/wpilib/simulation/simulation.cpp @@ -1,5 +1,5 @@ -#include "rpygen_wrapper.hpp" +#include "semiwrap_init.wpilib.simulation._simulation.hpp" #ifndef __FRC_ROBORIO__ @@ -31,7 +31,7 @@ void resetWpilibSimulationData() {} void resetMotorSafety() {} #endif -RPYBUILD_PYBIND11_MODULE(m) { +SEMIWRAP_PYBIND11_MODULE(m) { initWrapper(m); m.def("_resetWpilibSimulationData", &resetWpilibSimulationData, diff --git a/subprojects/robotpy-wpilib/wpilib/src/main.cpp b/subprojects/robotpy-wpilib/wpilib/src/main.cpp index c734f989f..ea7f80316 100644 --- a/subprojects/robotpy-wpilib/wpilib/src/main.cpp +++ b/subprojects/robotpy-wpilib/wpilib/src/main.cpp @@ -1,4 +1,4 @@ -#include "rpygen_wrapper.hpp" +#include "semiwrap_init.wpilib._wpilib.hpp" -RPYBUILD_PYBIND11_MODULE(m) { initWrapper(m); } +SEMIWRAP_PYBIND11_MODULE(m) { initWrapper(m); } diff --git a/subprojects/robotpy-wpilib/wpilib/src/rpy/Filesystem.inc b/subprojects/robotpy-wpilib/wpilib/src/rpy/Filesystem.inc index 72d8bfe6c..067b829a1 100644 --- a/subprojects/robotpy-wpilib/wpilib/src/rpy/Filesystem.inc +++ b/subprojects/robotpy-wpilib/wpilib/src/rpy/Filesystem.inc @@ -2,7 +2,7 @@ // TODO: this should be in a shared library, but robotpy-build does not support that #include -#include +#include namespace robotpy::filesystem { diff --git a/subprojects/robotpy-wpilib/wpilib/src/rpy/Notifier.h b/subprojects/robotpy-wpilib/wpilib/src/rpy/Notifier.h index c05a40882..0e48165dc 100644 --- a/subprojects/robotpy-wpilib/wpilib/src/rpy/Notifier.h +++ b/subprojects/robotpy-wpilib/wpilib/src/rpy/Notifier.h @@ -17,7 +17,7 @@ #include #include -#include +#include namespace frc { diff --git a/subprojects/robotpy-wpilib/wpilib/src/rpy/SmartDashboardData.h b/subprojects/robotpy-wpilib/wpilib/src/rpy/SmartDashboardData.h index 7e4c5055f..8323ebd11 100644 --- a/subprojects/robotpy-wpilib/wpilib/src/rpy/SmartDashboardData.h +++ b/subprojects/robotpy-wpilib/wpilib/src/rpy/SmartDashboardData.h @@ -2,7 +2,7 @@ #pragma once #include -#include +#include namespace rpy { diff --git a/subprojects/robotpy-wpilib/wpilib/sysid/__init__.py b/subprojects/robotpy-wpilib/wpilib/sysid/__init__.py index 8e9dda37c..476248e28 100644 --- a/subprojects/robotpy-wpilib/wpilib/sysid/__init__.py +++ b/subprojects/robotpy-wpilib/wpilib/sysid/__init__.py @@ -1,4 +1,4 @@ -# autogenerated by 'robotpy-build create-imports wpilib.sysid wpilib._wpilib.sysid' +# autogenerated by 'semiwrap create-imports wpilib.sysid wpilib._wpilib.sysid' from .._wpilib.sysid import State, SysIdRoutineLog __all__ = ["State", "SysIdRoutineLog"] From 23cebdda2ec2377345f971782f79028fbc0a3454 Mon Sep 17 00:00:00 2001 From: Dustin Spicuzza Date: Sat, 19 Apr 2025 18:19:08 -0400 Subject: [PATCH 13/20] Update robotpy-romi to semiwrap --- subprojects/robotpy-romi/.gitignore | 7 +- subprojects/robotpy-romi/meson.build | 11 +++ subprojects/robotpy-romi/pyproject.toml | 67 +++++++++++-------- subprojects/robotpy-romi/romi/__init__.py | 6 +- subprojects/robotpy-romi/romi/py.typed | 0 subprojects/robotpy-romi/romi/src/main.cpp | 4 +- subprojects/robotpy-romi/semiwrap/.gitignore | 3 + .../{gen => semiwrap}/OnBoardIO.yml | 3 +- .../{gen => semiwrap}/RomiGyro.yml | 3 +- .../{gen => semiwrap}/RomiMotor.yml | 3 +- subprojects/robotpy-romi/setup.py | 5 -- 11 files changed, 64 insertions(+), 48 deletions(-) create mode 100644 subprojects/robotpy-romi/meson.build create mode 100644 subprojects/robotpy-romi/romi/py.typed create mode 100644 subprojects/robotpy-romi/semiwrap/.gitignore rename subprojects/robotpy-romi/{gen => semiwrap}/OnBoardIO.yml (93%) rename subprojects/robotpy-romi/{gen => semiwrap}/RomiGyro.yml (92%) rename subprojects/robotpy-romi/{gen => semiwrap}/RomiMotor.yml (68%) delete mode 100644 subprojects/robotpy-romi/setup.py diff --git a/subprojects/robotpy-romi/.gitignore b/subprojects/robotpy-romi/.gitignore index 0c2facbea..9eabdb790 100644 --- a/subprojects/robotpy-romi/.gitignore +++ b/subprojects/robotpy-romi/.gitignore @@ -5,8 +5,7 @@ /build -/romi/include -/romi/lib -/romi/_init_romi.py -/romi/pkgcfg.py +/romi/trampolines +/romi/_init__romi.py +/romi/romi.pc /romi/version.py \ No newline at end of file diff --git a/subprojects/robotpy-romi/meson.build b/subprojects/robotpy-romi/meson.build new file mode 100644 index 000000000..50179cc2a --- /dev/null +++ b/subprojects/robotpy-romi/meson.build @@ -0,0 +1,11 @@ +project('robotpy-romi', ['cpp'], + default_options: ['warning_level=1', 'cpp_std=c++20', + 'b_colorout=auto', 'optimization=2', 'b_pie=true']) + +subdir('semiwrap') + +romi_sources += files( + 'romi/src/main.cpp', +) + +subdir('semiwrap/modules') diff --git a/subprojects/robotpy-romi/pyproject.toml b/subprojects/robotpy-romi/pyproject.toml index 47e536d38..43e11ef5b 100644 --- a/subprojects/robotpy-romi/pyproject.toml +++ b/subprojects/robotpy-romi/pyproject.toml @@ -1,43 +1,54 @@ -[tool.robotpy-build.metadata] +[build-system] +build-backend = "hatchling.build" +requires = [ + "semiwrap~=0.1", + "hatch-meson~=0.1.0b2", + "hatch-robotpy~=0.2", + "hatchling", + "robotpy-native-romi==2025.3.2", + "wpilib==2025.3.2.2", +] + + +[project] name = "robotpy-romi" +version = "2025.3.2.2" description = "Binary wrapper for WPILib Romi Vendor library" -author = "RobotPy Development Team" -author_email = "robotpy@googlegroups.com" -url = "https://github.com/robotpy/mostrobotpy" +authors = [ + {name = "RobotPy Development Team", email = "robotpy@googlegroups.com"}, +] license = "BSD-3-Clause" -install_requires = [ - "wpilib==THIS_VERSION" +dependencies = [ + "wpilib==2025.3.2.2" ] -[build-system] -requires = [ - "robotpy-build~=2025.1.0", - "wpilib~=2025.3.2" -] +[project.urls] +"Source code" = "https://github.com/robotpy/mostrobotpy" + + +[tool.hatch.build.hooks.robotpy] +version_file = "romi/version.py" + +[tool.hatch.build.hooks.semiwrap] -[tool.robotpy-build] -base_package = "romi" +[tool.hatch.build.hooks.meson] -[tool.robotpy-build.wrappers."romi"] +[tool.hatch.build.targets.wheel] +packages = ["romi"] + + +[tool.semiwrap] +update_init = ["romi"] + +[tool.semiwrap.extension_modules."romi._romi"] name = "romi" -sources = ["romi/src/main.cpp"] -generation_data = "gen" +wraps = ["robotpy-native-romi"] depends = [ - "wpilib_core", "wpilibc_interfaces", "wpilibc", - "wpimath_cpp", "wpimath_geometry", - "wpiHal", "wpiutil", "ntcore", + "wpilib", "wpimath_geometry" ] -[tool.robotpy-build.wrappers."romi".autogen_headers] +[tool.semiwrap.extension_modules."romi._romi".headers] # frc/romi OnBoardIO = "frc/romi/OnBoardIO.h" RomiGyro = "frc/romi/RomiGyro.h" RomiMotor = "frc/romi/RomiMotor.h" - -[tool.robotpy-build.wrappers."romi".maven_lib_download] -artifact_id = "romiVendordep-cpp" -group_id = "edu.wpi.first.romiVendordep" -# repo_url = "https://frcmaven.wpi.edu/artifactory/release" -repo_url = "https://frcmaven.wpi.edu/artifactory/release" -version = "2025.3.2" -libs = ["romiVendordep"] diff --git a/subprojects/robotpy-romi/romi/__init__.py b/subprojects/robotpy-romi/romi/__init__.py index e9ce0fe96..be1981eb5 100644 --- a/subprojects/robotpy-romi/romi/__init__.py +++ b/subprojects/robotpy-romi/romi/__init__.py @@ -1,8 +1,8 @@ -from . import _init_romi +from . import _init__romi -# autogenerated by 'robotpy-build create-imports romi' +# autogenerated by 'semiwrap create-imports romi romi._romi' from ._romi import OnBoardIO, RomiGyro, RomiMotor __all__ = ["OnBoardIO", "RomiGyro", "RomiMotor"] -del _init_romi +del _init__romi diff --git a/subprojects/robotpy-romi/romi/py.typed b/subprojects/robotpy-romi/romi/py.typed new file mode 100644 index 000000000..e69de29bb diff --git a/subprojects/robotpy-romi/romi/src/main.cpp b/subprojects/robotpy-romi/romi/src/main.cpp index 52548d816..9d713e6bc 100644 --- a/subprojects/robotpy-romi/romi/src/main.cpp +++ b/subprojects/robotpy-romi/romi/src/main.cpp @@ -1,6 +1,6 @@ -#include +#include -RPYBUILD_PYBIND11_MODULE(m) { +SEMIWRAP_PYBIND11_MODULE(m) { initWrapper(m); } \ No newline at end of file diff --git a/subprojects/robotpy-romi/semiwrap/.gitignore b/subprojects/robotpy-romi/semiwrap/.gitignore new file mode 100644 index 000000000..6cdce1027 --- /dev/null +++ b/subprojects/robotpy-romi/semiwrap/.gitignore @@ -0,0 +1,3 @@ +/meson.build +/modules/meson.build +/trampolines/meson.build diff --git a/subprojects/robotpy-romi/gen/OnBoardIO.yml b/subprojects/robotpy-romi/semiwrap/OnBoardIO.yml similarity index 93% rename from subprojects/robotpy-romi/gen/OnBoardIO.yml rename to subprojects/robotpy-romi/semiwrap/OnBoardIO.yml index 3f5a2b608..7e8ed5674 100644 --- a/subprojects/robotpy-romi/gen/OnBoardIO.yml +++ b/subprojects/robotpy-romi/semiwrap/OnBoardIO.yml @@ -1,7 +1,6 @@ ---- classes: - OnBoardIO: + frc::OnBoardIO: attributes: kMessageInterval: m_nextMessageTime: diff --git a/subprojects/robotpy-romi/gen/RomiGyro.yml b/subprojects/robotpy-romi/semiwrap/RomiGyro.yml similarity index 92% rename from subprojects/robotpy-romi/gen/RomiGyro.yml rename to subprojects/robotpy-romi/semiwrap/RomiGyro.yml index 1a3bfde79..285a11455 100644 --- a/subprojects/robotpy-romi/gen/RomiGyro.yml +++ b/subprojects/robotpy-romi/semiwrap/RomiGyro.yml @@ -1,7 +1,6 @@ ---- classes: - RomiGyro: + frc::RomiGyro: methods: RomiGyro: GetAngle: diff --git a/subprojects/robotpy-romi/gen/RomiMotor.yml b/subprojects/robotpy-romi/semiwrap/RomiMotor.yml similarity index 68% rename from subprojects/robotpy-romi/gen/RomiMotor.yml rename to subprojects/robotpy-romi/semiwrap/RomiMotor.yml index 9a9a283e7..6421641bf 100644 --- a/subprojects/robotpy-romi/gen/RomiMotor.yml +++ b/subprojects/robotpy-romi/semiwrap/RomiMotor.yml @@ -1,6 +1,5 @@ ---- classes: - RomiMotor: + frc::RomiMotor: methods: RomiMotor: diff --git a/subprojects/robotpy-romi/setup.py b/subprojects/robotpy-romi/setup.py deleted file mode 100644 index 3542d0c9a..000000000 --- a/subprojects/robotpy-romi/setup.py +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env python3 - -from robotpy_build.setup import setup - -setup() From ee7e54b8cbb1427529d8eea7284bd58f122c2d3f Mon Sep 17 00:00:00 2001 From: Dustin Spicuzza Date: Sat, 19 Apr 2025 23:38:33 -0400 Subject: [PATCH 14/20] Update robotpy-xrp to semiwrap --- subprojects/robotpy-xrp/.gitignore | 10 +- subprojects/robotpy-xrp/meson.build | 11 +++ subprojects/robotpy-xrp/pyproject.toml | 96 +++++++++---------- subprojects/robotpy-xrp/semiwrap/.gitignore | 3 + .../robotpy-xrp/{gen => semiwrap}/XRPGyro.yml | 3 +- .../{gen => semiwrap}/XRPMotor.yml | 3 +- .../{gen => semiwrap}/XRPOnBoardIO.yml | 3 +- .../{gen => semiwrap}/XRPRangefinder.yml | 3 +- .../XRPReflectanceSensor.yml | 3 +- .../{gen => semiwrap}/XRPServo.yml | 3 +- subprojects/robotpy-xrp/setup.py | 5 - subprojects/robotpy-xrp/xrp/__init__.py | 6 +- subprojects/robotpy-xrp/xrp/py.typed | 0 subprojects/robotpy-xrp/xrp/src/main.cpp | 4 +- subprojects/robotpy-xrp/xrp/xrp.pc | 9 ++ 15 files changed, 86 insertions(+), 76 deletions(-) create mode 100644 subprojects/robotpy-xrp/meson.build create mode 100644 subprojects/robotpy-xrp/semiwrap/.gitignore rename subprojects/robotpy-xrp/{gen => semiwrap}/XRPGyro.yml (91%) rename subprojects/robotpy-xrp/{gen => semiwrap}/XRPMotor.yml (90%) rename subprojects/robotpy-xrp/{gen => semiwrap}/XRPOnBoardIO.yml (88%) rename subprojects/robotpy-xrp/{gen => semiwrap}/XRPRangefinder.yml (64%) rename subprojects/robotpy-xrp/{gen => semiwrap}/XRPReflectanceSensor.yml (74%) rename subprojects/robotpy-xrp/{gen => semiwrap}/XRPServo.yml (86%) delete mode 100644 subprojects/robotpy-xrp/setup.py create mode 100644 subprojects/robotpy-xrp/xrp/py.typed create mode 100644 subprojects/robotpy-xrp/xrp/xrp.pc diff --git a/subprojects/robotpy-xrp/.gitignore b/subprojects/robotpy-xrp/.gitignore index 5d85e7eea..0525b6e66 100644 --- a/subprojects/robotpy-xrp/.gitignore +++ b/subprojects/robotpy-xrp/.gitignore @@ -4,12 +4,10 @@ *.egg-info /build +/dist -/xrp/include -/xrp/lib -/xrp/_init_xrp.py +/xrp/_init__xrp.py /xrp/pkgcfg.py /xrp/version.py -/xrp/extension/_init_xrp_ext.py -/xrp/extension/include -/xrp/extension/pkgcfg.py \ No newline at end of file +/xrp/extension/lib +/xrp/trampolines \ No newline at end of file diff --git a/subprojects/robotpy-xrp/meson.build b/subprojects/robotpy-xrp/meson.build new file mode 100644 index 000000000..3f2b8c993 --- /dev/null +++ b/subprojects/robotpy-xrp/meson.build @@ -0,0 +1,11 @@ +project('robotpy-xrp', ['cpp'], + default_options: ['warning_level=1', 'cpp_std=c++20', + 'b_colorout=auto', 'optimization=2', 'b_pie=true']) + +subdir('semiwrap') + +xrp_sources += files( + 'xrp/src/main.cpp', +) + +subdir('semiwrap/modules') diff --git a/subprojects/robotpy-xrp/pyproject.toml b/subprojects/robotpy-xrp/pyproject.toml index 420dd1338..6b6e0c741 100644 --- a/subprojects/robotpy-xrp/pyproject.toml +++ b/subprojects/robotpy-xrp/pyproject.toml @@ -1,39 +1,61 @@ -[tool.robotpy-build.metadata] +[build-system] +build-backend = "hatchling.build" +requires = [ + "semiwrap~=0.1", + "hatch-meson~=0.1.0b2", + "hatch-robotpy~=0.2", + "hatchling", + "robotpy-native-xrp==2025.3.2", + "wpilib==2025.3.2.2", +] + + +[project] name = "robotpy-xrp" +version = "2025.3.2.2" description = "Binary wrapper for WPILib XRP Vendor library" -author = "RobotPy Development Team" -author_email = "robotpy@googlegroups.com" -url = "https://github.com/robotpy/mostrobotpy" +authors = [ + {name = "RobotPy Development Team", email = "robotpy@googlegroups.com"}, +] license = "BSD-3-Clause" -install_requires = [ - "wpilib==THIS_VERSION" +dependencies = [ + "wpilib==2025.3.2.2" ] -[tool.robotpy-build.metadata.entry_points] -robotpysimext = [ - "xrp = xrp.extension", -] +[project.entry-points.robotpysimext] +xrp = "xrp.extension" -[build-system] -requires = [ - "robotpy-build~=2025.1.0", - "wpilib~=2025.3.2" -] -[tool.robotpy-build] -base_package = "xrp" +[tool.hatch.build.hooks.robotpy] +version_file = "xrp/version.py" + +[[tool.hatch.build.hooks.robotpy.maven_lib_download]] +artifact_id = "halsim_xrp" +group_id = "edu.wpi.first.halsim" +repo_url = "https://frcmaven.wpi.edu/artifactory/release" +version = "2025.3.2" +use_headers = false + +extract_to = "xrp/extension" +libs = ["halsim_xrp"] + +[tool.hatch.build.hooks.semiwrap] -[tool.robotpy-build.wrappers."xrp"] +[tool.hatch.build.hooks.meson] + +[tool.hatch.build.targets.wheel] +packages = ["xrp"] + + +[tool.semiwrap] +update_init = ["xrp"] + +[tool.semiwrap.extension_modules."xrp._xrp"] name = "xrp" -sources = ["xrp/src/main.cpp"] -generation_data = "gen" -depends = [ - "wpilib_core", "wpilibc_interfaces", "wpilibc", - "wpimath_cpp", "wpimath_geometry", - "wpiHal", "wpiutil", "ntcore", -] +wraps = ["robotpy-native-xrp"] +depends = ["wpilib", "wpimath_geometry"] -[tool.robotpy-build.wrappers."xrp".autogen_headers] +[tool.semiwrap.extension_modules."xrp._xrp".headers] # frc/xrp XRPGyro = "frc/xrp/XRPGyro.h" XRPMotor = "frc/xrp/XRPMotor.h" @@ -41,25 +63,3 @@ XRPOnBoardIO = "frc/xrp/XRPOnBoardIO.h" XRPRangefinder = "frc/xrp/XRPRangefinder.h" XRPReflectanceSensor = "frc/xrp/XRPReflectanceSensor.h" XRPServo = "frc/xrp/XRPServo.h" - - -[tool.robotpy-build.wrappers."xrp".maven_lib_download] -artifact_id = "xrpVendordep-cpp" -group_id = "edu.wpi.first.xrpVendordep" -# repo_url = "https://frcmaven.wpi.edu/artifactory/release" -repo_url = "https://frcmaven.wpi.edu/artifactory/release" -version = "2025.3.2" -libs = ["xrpVendordep"] - -[tool.robotpy-build.wrappers."xrp.extension".maven_lib_download] -artifact_id = "halsim_xrp" -group_id = "edu.wpi.first.halsim" -# repo_url = "https://frcmaven.wpi.edu/artifactory/release" -repo_url = "https://frcmaven.wpi.edu/artifactory/release" -version = "2025.3.2" - -dlopenlibs = ["halsim_xrp"] - -[tool.robotpy-build.wrappers."xrp.extension"] -name = "xrp_ext" -depends = ["wpiHal", "wpinet"] \ No newline at end of file diff --git a/subprojects/robotpy-xrp/semiwrap/.gitignore b/subprojects/robotpy-xrp/semiwrap/.gitignore new file mode 100644 index 000000000..6cdce1027 --- /dev/null +++ b/subprojects/robotpy-xrp/semiwrap/.gitignore @@ -0,0 +1,3 @@ +/meson.build +/modules/meson.build +/trampolines/meson.build diff --git a/subprojects/robotpy-xrp/gen/XRPGyro.yml b/subprojects/robotpy-xrp/semiwrap/XRPGyro.yml similarity index 91% rename from subprojects/robotpy-xrp/gen/XRPGyro.yml rename to subprojects/robotpy-xrp/semiwrap/XRPGyro.yml index efaf441c1..8ce75a88c 100644 --- a/subprojects/robotpy-xrp/gen/XRPGyro.yml +++ b/subprojects/robotpy-xrp/semiwrap/XRPGyro.yml @@ -1,7 +1,6 @@ ---- classes: - XRPGyro: + frc::XRPGyro: methods: XRPGyro: GetAngle: diff --git a/subprojects/robotpy-xrp/gen/XRPMotor.yml b/subprojects/robotpy-xrp/semiwrap/XRPMotor.yml similarity index 90% rename from subprojects/robotpy-xrp/gen/XRPMotor.yml rename to subprojects/robotpy-xrp/semiwrap/XRPMotor.yml index e607adc52..64b55611f 100644 --- a/subprojects/robotpy-xrp/gen/XRPMotor.yml +++ b/subprojects/robotpy-xrp/semiwrap/XRPMotor.yml @@ -1,7 +1,6 @@ ---- classes: - XRPMotor: + frc::XRPMotor: methods: XRPMotor: Set: diff --git a/subprojects/robotpy-xrp/gen/XRPOnBoardIO.yml b/subprojects/robotpy-xrp/semiwrap/XRPOnBoardIO.yml similarity index 88% rename from subprojects/robotpy-xrp/gen/XRPOnBoardIO.yml rename to subprojects/robotpy-xrp/semiwrap/XRPOnBoardIO.yml index b7966a440..ed0706bf8 100644 --- a/subprojects/robotpy-xrp/gen/XRPOnBoardIO.yml +++ b/subprojects/robotpy-xrp/semiwrap/XRPOnBoardIO.yml @@ -1,7 +1,6 @@ ---- classes: - XRPOnBoardIO: + frc::XRPOnBoardIO: attributes: kMessageInterval: m_nextMessageTime: diff --git a/subprojects/robotpy-xrp/gen/XRPRangefinder.yml b/subprojects/robotpy-xrp/semiwrap/XRPRangefinder.yml similarity index 64% rename from subprojects/robotpy-xrp/gen/XRPRangefinder.yml rename to subprojects/robotpy-xrp/semiwrap/XRPRangefinder.yml index 407812203..93f93b207 100644 --- a/subprojects/robotpy-xrp/gen/XRPRangefinder.yml +++ b/subprojects/robotpy-xrp/semiwrap/XRPRangefinder.yml @@ -1,6 +1,5 @@ ---- classes: - XRPRangefinder: + frc::XRPRangefinder: methods: GetDistance: diff --git a/subprojects/robotpy-xrp/gen/XRPReflectanceSensor.yml b/subprojects/robotpy-xrp/semiwrap/XRPReflectanceSensor.yml similarity index 74% rename from subprojects/robotpy-xrp/gen/XRPReflectanceSensor.yml rename to subprojects/robotpy-xrp/semiwrap/XRPReflectanceSensor.yml index 746b68429..9ff3167bf 100644 --- a/subprojects/robotpy-xrp/gen/XRPReflectanceSensor.yml +++ b/subprojects/robotpy-xrp/semiwrap/XRPReflectanceSensor.yml @@ -1,7 +1,6 @@ ---- classes: - XRPReflectanceSensor: + frc::XRPReflectanceSensor: methods: GetLeftReflectanceValue: GetRightReflectanceValue: diff --git a/subprojects/robotpy-xrp/gen/XRPServo.yml b/subprojects/robotpy-xrp/semiwrap/XRPServo.yml similarity index 86% rename from subprojects/robotpy-xrp/gen/XRPServo.yml rename to subprojects/robotpy-xrp/semiwrap/XRPServo.yml index 0f59b49fc..946d35a1e 100644 --- a/subprojects/robotpy-xrp/gen/XRPServo.yml +++ b/subprojects/robotpy-xrp/semiwrap/XRPServo.yml @@ -1,7 +1,6 @@ ---- classes: - XRPServo: + frc::XRPServo: methods: XRPServo: SetAngle: diff --git a/subprojects/robotpy-xrp/setup.py b/subprojects/robotpy-xrp/setup.py deleted file mode 100644 index 3542d0c9a..000000000 --- a/subprojects/robotpy-xrp/setup.py +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env python3 - -from robotpy_build.setup import setup - -setup() diff --git a/subprojects/robotpy-xrp/xrp/__init__.py b/subprojects/robotpy-xrp/xrp/__init__.py index 3afe5275c..2f14efc2e 100644 --- a/subprojects/robotpy-xrp/xrp/__init__.py +++ b/subprojects/robotpy-xrp/xrp/__init__.py @@ -1,6 +1,6 @@ -from . import _init_xrp +from . import _init__xrp -# autogenerated by 'robotpy-build create-imports xrp' +# autogenerated by 'semiwrap create-imports xrp xrp._xrp' from ._xrp import ( XRPGyro, XRPMotor, @@ -19,4 +19,4 @@ "XRPServo", ] -del _init_xrp +del _init__xrp diff --git a/subprojects/robotpy-xrp/xrp/py.typed b/subprojects/robotpy-xrp/xrp/py.typed new file mode 100644 index 000000000..e69de29bb diff --git a/subprojects/robotpy-xrp/xrp/src/main.cpp b/subprojects/robotpy-xrp/xrp/src/main.cpp index 52548d816..002441a18 100644 --- a/subprojects/robotpy-xrp/xrp/src/main.cpp +++ b/subprojects/robotpy-xrp/xrp/src/main.cpp @@ -1,6 +1,6 @@ -#include +#include -RPYBUILD_PYBIND11_MODULE(m) { +SEMIWRAP_PYBIND11_MODULE(m) { initWrapper(m); } \ No newline at end of file diff --git a/subprojects/robotpy-xrp/xrp/xrp.pc b/subprojects/robotpy-xrp/xrp/xrp.pc new file mode 100644 index 000000000..a1896bdc4 --- /dev/null +++ b/subprojects/robotpy-xrp/xrp/xrp.pc @@ -0,0 +1,9 @@ +# automatically generated by semiwrap.cmd_gen_pkgconf +prefix=${pcfiledir} +pkgconf_pypi_initpy=xrp._init__xrp + +Name: xrp +Description: semiwrap pybind11 module +Version: +Cflags: -I${prefix} +Requires: robotpy-native-xrp wpilib wpimath_geometry From c39cdb85f91b9b0161de163debd864bdc92340a0 Mon Sep 17 00:00:00 2001 From: Dustin Spicuzza Date: Sat, 19 Apr 2025 23:51:53 -0400 Subject: [PATCH 15/20] Update robotpy-halsim-ds-socket to use hatch-robotpy --- .../robotpy-halsim-ds-socket/.gitignore | 3 -- .../halsim_ds_socket/py.typed | 0 .../robotpy-halsim-ds-socket/pyproject.toml | 49 ++++++++++--------- subprojects/robotpy-halsim-ds-socket/setup.py | 5 -- .../tests/test_halsim_ds_socket.py | 18 +++++-- 5 files changed, 40 insertions(+), 35 deletions(-) create mode 100644 subprojects/robotpy-halsim-ds-socket/halsim_ds_socket/py.typed delete mode 100644 subprojects/robotpy-halsim-ds-socket/setup.py diff --git a/subprojects/robotpy-halsim-ds-socket/.gitignore b/subprojects/robotpy-halsim-ds-socket/.gitignore index 537ab1a5e..65f7550a6 100644 --- a/subprojects/robotpy-halsim-ds-socket/.gitignore +++ b/subprojects/robotpy-halsim-ds-socket/.gitignore @@ -12,8 +12,5 @@ /dist *.egg-info -/halsim_ds_socket/_init_halsim_ds_socket.py -/halsim_ds_socket/pkgcfg.py /halsim_ds_socket/version.py -/halsim_ds_socket/include /halsim_ds_socket/lib diff --git a/subprojects/robotpy-halsim-ds-socket/halsim_ds_socket/py.typed b/subprojects/robotpy-halsim-ds-socket/halsim_ds_socket/py.typed new file mode 100644 index 000000000..e69de29bb diff --git a/subprojects/robotpy-halsim-ds-socket/pyproject.toml b/subprojects/robotpy-halsim-ds-socket/pyproject.toml index 4bea932e1..32ccd891f 100644 --- a/subprojects/robotpy-halsim-ds-socket/pyproject.toml +++ b/subprojects/robotpy-halsim-ds-socket/pyproject.toml @@ -1,39 +1,40 @@ -[tool.robotpy-build.metadata] +[build-system] +build-backend = "hatchling.build" +requires = [ + "hatchling", + "hatch-robotpy~=0.2", +] + +[project] name = "robotpy-halsim-ds-socket" +version = "2025.3.2.2" description = "WPILib simulator DS Socket Extension" -author = "RobotPy Development Team" -author_email = "robotpy@googlegroups.com" -url = "https://github.com/robotpy/robotpy-halsim-gui" +authors = [ + {name = "RobotPy Development Team", email = "robotpy@googlegroups.com"}, +] license = "BSD-3-Clause" -install_requires = [ - "robotpy-hal==THIS_VERSION", - "robotpy-wpinet==THIS_VERSION", +dependencies = [ + "robotpy-native-wpihal==2025.3.2", + "robotpy-native-wpinet==2025.3.2", ] -[tool.robotpy-build.metadata.entry_points] -robotpysimext = ["ds-socket = halsim_ds_socket"] +[project.entry-points.robotpysimext] +ds-socket = "halsim_ds_socket" -[build-system] -requires = [ - "robotpy-build~=2025.1.0", - "robotpy-hal~=2025.3.2", - "robotpy-wpinet~=2025.3.2", -] -[tool.robotpy-build] -base_package = "halsim_ds_socket" +[tool.hatch.build.hooks.robotpy] +version_file = "halsim_ds_socket/version.py" -[tool.robotpy-build.wrappers."halsim_ds_socket".maven_lib_download] +[[tool.hatch.build.hooks.robotpy.maven_lib_download]] artifact_id = "halsim_ds_socket" group_id = "edu.wpi.first.halsim" -# repo_url = "https://frcmaven.wpi.edu/artifactory/release" repo_url = "https://frcmaven.wpi.edu/artifactory/release" version = "2025.3.2" +use_headers = false -dlopenlibs = ["halsim_ds_socket"] - -[tool.robotpy-build.wrappers."halsim_ds_socket"] -name = "halsim_ds_socket" -depends = ["wpiHal", "wpinet"] +extract_to = "halsim_ds_socket" +libs = ["halsim_ds_socket"] +[tool.hatch.build.targets.wheel] +packages = ["halsim_ds_socket"] \ No newline at end of file diff --git a/subprojects/robotpy-halsim-ds-socket/setup.py b/subprojects/robotpy-halsim-ds-socket/setup.py deleted file mode 100644 index 3542d0c9a..000000000 --- a/subprojects/robotpy-halsim-ds-socket/setup.py +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env python3 - -from robotpy_build.setup import setup - -setup() diff --git a/subprojects/robotpy-halsim-ds-socket/tests/test_halsim_ds_socket.py b/subprojects/robotpy-halsim-ds-socket/tests/test_halsim_ds_socket.py index de2fd0def..33dc5254d 100644 --- a/subprojects/robotpy-halsim-ds-socket/tests/test_halsim_ds_socket.py +++ b/subprojects/robotpy-halsim-ds-socket/tests/test_halsim_ds_socket.py @@ -1,6 +1,18 @@ -# tests the internals -import halsim_ds_socket._init_halsim_ds_socket +import ctypes +import pathlib def test_halsim_ds_socket(): - pass + # dependencies + import native.wpihal._init_robotpy_native_wpihal + import native.wpinet._init_robotpy_native_wpinet + + import halsim_ds_socket as base + + loaded = 0 + for fname in (pathlib.Path(base.__file__).parent / "lib").iterdir(): + if fname.is_file() and fname.suffix in (".dll", ".dylib", ".so"): + ctypes.CDLL(str(fname)) + loaded += 1 + + assert loaded From 34ab1c3302a8dfab9ec779a11fdae6d2fdab332b Mon Sep 17 00:00:00 2001 From: Dustin Spicuzza Date: Sun, 20 Apr 2025 00:00:45 -0400 Subject: [PATCH 16/20] Update robotpy-halsim-ws to use hatch-robotpy --- subprojects/robotpy-halsim-ws/.gitignore | 8 --- .../robotpy-halsim-ws/halsim_ws/py.typed | 0 subprojects/robotpy-halsim-ws/pyproject.toml | 66 +++++++++---------- subprojects/robotpy-halsim-ws/setup.py | 5 -- .../tests/test_halsim_ws_client.py | 18 ++++- .../tests/test_halsim_ws_server.py | 18 ++++- 6 files changed, 63 insertions(+), 52 deletions(-) create mode 100644 subprojects/robotpy-halsim-ws/halsim_ws/py.typed delete mode 100644 subprojects/robotpy-halsim-ws/setup.py diff --git a/subprojects/robotpy-halsim-ws/.gitignore b/subprojects/robotpy-halsim-ws/.gitignore index 3d2616a0d..c385d798b 100644 --- a/subprojects/robotpy-halsim-ws/.gitignore +++ b/subprojects/robotpy-halsim-ws/.gitignore @@ -13,13 +13,5 @@ *.egg-info /halsim_ws/version.py - -/halsim_ws/server/_init_server.py -/halsim_ws/server/pkgcfg.py -/halsim_ws/server/include /halsim_ws/server/lib - -/halsim_ws/client/_init_client.py -/halsim_ws/client/pkgcfg.py -/halsim_ws/client/include /halsim_ws/client/lib diff --git a/subprojects/robotpy-halsim-ws/halsim_ws/py.typed b/subprojects/robotpy-halsim-ws/halsim_ws/py.typed new file mode 100644 index 000000000..e69de29bb diff --git a/subprojects/robotpy-halsim-ws/pyproject.toml b/subprojects/robotpy-halsim-ws/pyproject.toml index 17c9bd887..1dd5a23df 100644 --- a/subprojects/robotpy-halsim-ws/pyproject.toml +++ b/subprojects/robotpy-halsim-ws/pyproject.toml @@ -1,55 +1,55 @@ -[tool.robotpy-build.metadata] +[build-system] +build-backend = "hatchling.build" +requires = [ + "hatchling", + "hatch-robotpy~=0.2", +] + +[project] name = "robotpy-halsim-ws" +version = "2025.3.2.2" description = "WPILib simulator websim Extensions" -author = "RobotPy Development Team" -author_email = "robotpy@googlegroups.com" -url = "https://github.com/robotpy/robotpy-halsim-gui" +authors = [ + {name = "RobotPy Development Team", email = "robotpy@googlegroups.com"}, +] license = "BSD-3-Clause" -install_requires = [ - "robotpy-hal==THIS_VERSION", - "robotpy-wpinet==THIS_VERSION", +dependencies = [ + "robotpy-native-wpihal==2025.3.2", + "robotpy-native-wpinet==2025.3.2", ] -[tool.robotpy-build.metadata.entry_points] -robotpysimext = [ - "ws-server = halsim_ws.server", - "ws-client = halsim_ws.client", -] +[project.entry-points.robotpysimext] +ws-server = "halsim_ws.server" +ws-client = "halsim_ws.client" +[project.urls] +"Source code" = "https://github.com/robotpy/mostrobotpy" -[build-system] -requires = [ - "robotpy-build~=2025.1.0", - "robotpy-hal~=2025.3.2", - "robotpy-wpinet~=2025.3.2", -] -[tool.robotpy-build] -base_package = "halsim_ws" +[tool.hatch.build.hooks.robotpy] +version_file = "halsim_ws/version.py" -[tool.robotpy-build.wrappers."halsim_ws.server".maven_lib_download] + +[[tool.hatch.build.hooks.robotpy.maven_lib_download]] artifact_id = "halsim_ws_server" group_id = "edu.wpi.first.halsim" -# repo_url = "https://frcmaven.wpi.edu/artifactory/release" repo_url = "https://frcmaven.wpi.edu/artifactory/release" version = "2025.3.2" +use_headers = false -dlopenlibs = ["halsim_ws_server"] - -[tool.robotpy-build.wrappers."halsim_ws.server"] -name = "server" -depends = ["wpiHal", "wpinet"] +extract_to = "halsim_ws/server" +libs = ["halsim_ws_server"] -[tool.robotpy-build.wrappers."halsim_ws.client".maven_lib_download] +[[tool.hatch.build.hooks.robotpy.maven_lib_download]] artifact_id = "halsim_ws_client" group_id = "edu.wpi.first.halsim" -# repo_url = "https://frcmaven.wpi.edu/artifactory/release" repo_url = "https://frcmaven.wpi.edu/artifactory/release" version = "2025.3.2" +use_headers = false -dlopenlibs = ["halsim_ws_client"] +extract_to = "halsim_ws/client" +libs = ["halsim_ws_client"] -[tool.robotpy-build.wrappers."halsim_ws.client"] -name = "client" -depends = ["wpiHal", "wpinet", "wpiutil"] +[tool.hatch.build.targets.wheel] +packages = ["halsim_ws"] diff --git a/subprojects/robotpy-halsim-ws/setup.py b/subprojects/robotpy-halsim-ws/setup.py deleted file mode 100644 index 3542d0c9a..000000000 --- a/subprojects/robotpy-halsim-ws/setup.py +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env python3 - -from robotpy_build.setup import setup - -setup() diff --git a/subprojects/robotpy-halsim-ws/tests/test_halsim_ws_client.py b/subprojects/robotpy-halsim-ws/tests/test_halsim_ws_client.py index 13e562331..1d9975005 100644 --- a/subprojects/robotpy-halsim-ws/tests/test_halsim_ws_client.py +++ b/subprojects/robotpy-halsim-ws/tests/test_halsim_ws_client.py @@ -1,6 +1,18 @@ -# tests the internals -import halsim_ws.client._init_client +import ctypes +import pathlib def test_halsim_ws_client(): - pass + # dependencies + import native.wpihal._init_robotpy_native_wpihal + import native.wpinet._init_robotpy_native_wpinet + + import halsim_ws.client as base + + loaded = 0 + for fname in (pathlib.Path(base.__file__).parent / "lib").iterdir(): + if fname.is_file() and fname.suffix in (".dll", ".dylib", ".so"): + ctypes.CDLL(str(fname)) + loaded += 1 + + assert loaded diff --git a/subprojects/robotpy-halsim-ws/tests/test_halsim_ws_server.py b/subprojects/robotpy-halsim-ws/tests/test_halsim_ws_server.py index 9fb3ba5eb..4be822dab 100644 --- a/subprojects/robotpy-halsim-ws/tests/test_halsim_ws_server.py +++ b/subprojects/robotpy-halsim-ws/tests/test_halsim_ws_server.py @@ -1,6 +1,18 @@ -# tests the internals -import halsim_ws.server._init_server +import ctypes +import pathlib def test_halsim_ws_server(): - pass + # dependencies + import native.wpihal._init_robotpy_native_wpihal + import native.wpinet._init_robotpy_native_wpinet + + import halsim_ws.server as base + + loaded = 0 + for fname in (pathlib.Path(base.__file__).parent / "lib").iterdir(): + if fname.is_file() and fname.suffix in (".dll", ".dylib", ".so"): + ctypes.CDLL(str(fname)) + loaded += 1 + + assert loaded From 7317311a9bf6e6499f7f7e5f0557f8487845306f Mon Sep 17 00:00:00 2001 From: Dustin Spicuzza Date: Sun, 20 Apr 2025 00:39:36 -0400 Subject: [PATCH 17/20] Update robotpy-halsim-gui to semiwrap --- subprojects/robotpy-halsim-gui/.gitignore | 10 +-- .../halsim_gui/_ext/__init__.py | 2 +- .../halsim_gui/_ext/main.cpp | 6 +- .../robotpy-halsim-gui/halsim_gui/py.typed | 0 subprojects/robotpy-halsim-gui/meson.build | 16 ++++ subprojects/robotpy-halsim-gui/pyproject.toml | 74 +++++++++++-------- .../robotpy-halsim-gui/semiwrap/.gitignore | 3 + subprojects/robotpy-halsim-gui/setup.py | 5 -- .../tests/test_halsim_gui.py | 21 +++++- 9 files changed, 86 insertions(+), 51 deletions(-) create mode 100644 subprojects/robotpy-halsim-gui/halsim_gui/py.typed create mode 100644 subprojects/robotpy-halsim-gui/meson.build create mode 100644 subprojects/robotpy-halsim-gui/semiwrap/.gitignore delete mode 100644 subprojects/robotpy-halsim-gui/setup.py diff --git a/subprojects/robotpy-halsim-gui/.gitignore b/subprojects/robotpy-halsim-gui/.gitignore index 7a08f380e..19722acd2 100644 --- a/subprojects/robotpy-halsim-gui/.gitignore +++ b/subprojects/robotpy-halsim-gui/.gitignore @@ -12,13 +12,9 @@ /dist *.egg-info -/halsim_gui/_init_halsim_gui.py -/halsim_gui/pkgcfg.py /halsim_gui/version.py -/halsim_gui/include /halsim_gui/lib +/halsim_gui/include -/halsim_gui/_ext/_halsim_gui_ext -/halsim_gui/_ext/_init_halsim_gui_ext.py -/halsim_gui/_ext/pkgcfg.py -/halsim_gui/py.typed \ No newline at end of file +/halsim_gui/_ext/_init__halsim_gui_ext.py +/halsim_gui/_ext/halsim_gui_ext.pc diff --git a/subprojects/robotpy-halsim-gui/halsim_gui/_ext/__init__.py b/subprojects/robotpy-halsim-gui/halsim_gui/_ext/__init__.py index d55debcbf..c3ad7249c 100644 --- a/subprojects/robotpy-halsim-gui/halsim_gui/_ext/__init__.py +++ b/subprojects/robotpy-halsim-gui/halsim_gui/_ext/__init__.py @@ -1 +1 @@ -from . import _init_halsim_gui_ext +from . import _init__halsim_gui_ext diff --git a/subprojects/robotpy-halsim-gui/halsim_gui/_ext/main.cpp b/subprojects/robotpy-halsim-gui/halsim_gui/_ext/main.cpp index 7a98186f4..0bd2bb437 100644 --- a/subprojects/robotpy-halsim-gui/halsim_gui/_ext/main.cpp +++ b/subprojects/robotpy-halsim-gui/halsim_gui/_ext/main.cpp @@ -1,10 +1,12 @@ -#include +#include #include #include -RPYBUILD_PYBIND11_MODULE(m) { +SEMIWRAP_PYBIND11_MODULE(m) { + + initWrapper(m); m.def("_kill_on_signal", []() { HAL_RegisterExtensionListener( diff --git a/subprojects/robotpy-halsim-gui/halsim_gui/py.typed b/subprojects/robotpy-halsim-gui/halsim_gui/py.typed new file mode 100644 index 000000000..e69de29bb diff --git a/subprojects/robotpy-halsim-gui/meson.build b/subprojects/robotpy-halsim-gui/meson.build new file mode 100644 index 000000000..7b6dd95db --- /dev/null +++ b/subprojects/robotpy-halsim-gui/meson.build @@ -0,0 +1,16 @@ +project('halsim-gui', ['cpp'], + default_options: ['warning_level=1', 'cpp_std=c++20', + 'b_colorout=auto', 'optimization=2', 'b_pie=true']) + +subdir('semiwrap') + +halsim_gui_ext_sources += files( + 'halsim_gui/_ext/main.cpp', +) +halsim_gui_ext_deps += [ + declare_dependency( + include_directories: ['halsim_gui/include'] + ) +] + +subdir('semiwrap/modules') diff --git a/subprojects/robotpy-halsim-gui/pyproject.toml b/subprojects/robotpy-halsim-gui/pyproject.toml index 121846802..8f8cec51f 100644 --- a/subprojects/robotpy-halsim-gui/pyproject.toml +++ b/subprojects/robotpy-halsim-gui/pyproject.toml @@ -1,47 +1,57 @@ -[tool.robotpy-build.metadata] +[build-system] +build-backend = "hatchling.build" +requires = [ + "semiwrap~=0.1", + "hatch-meson~=0.1.0b2", + "hatch-robotpy~=0.2", + "hatchling", + "robotpy-wpiutil==2025.3.2.2", + "robotpy-wpimath==2025.3.2.2", + "robotpy-hal==2025.3.2.2", + "pyntcore==2025.3.2.2", +] + +[project] name = "robotpy-halsim-gui" -description = "WPILib command framework" -author = "RobotPy Development Team" -author_email = "robotpy@googlegroups.com" -url = "https://github.com/robotpy/robotpy-halsim-gui" +version = "2025.3.2.2" +description = "WPILib simulation GUI" +authors = [ + {name = "RobotPy Development Team", email = "robotpy@googlegroups.com"}, +] license = "BSD-3-Clause" -install_requires = [ - "robotpy-wpiutil==THIS_VERSION", - "robotpy-wpimath==THIS_VERSION", - "robotpy-hal==THIS_VERSION", - "pyntcore==THIS_VERSION", +dependencies = [ + "robotpy-wpiutil==2025.3.2.2", + "robotpy-wpimath==2025.3.2.2", + "robotpy-hal==2025.3.2.2", + "pyntcore==2025.3.2.2", ] -[build-system] -requires = [ - "robotpy-build~=2025.1.0", - "robotpy-wpiutil~=2025.3.2", - "robotpy-wpimath~=2025.3.2", - "robotpy-hal~=2025.3.2", - "pyntcore~=2025.3.2", -] +[project.urls] +"Source code" = "https://github.com/robotpy/mostrobotpy" -[tool.robotpy-build] -base_package = "halsim_gui" +[tool.hatch.build.hooks.robotpy] +version_file = "halsim_gui/version.py" -[tool.robotpy-build.wrappers."halsim_gui".maven_lib_download] +[[tool.hatch.build.hooks.robotpy.maven_lib_download]] artifact_id = "halsim_gui" group_id = "edu.wpi.first.halsim" -# repo_url = "https://frcmaven.wpi.edu/artifactory/release" repo_url = "https://frcmaven.wpi.edu/artifactory/release" version = "2025.3.2" +use_headers = true + +libs = ["halsim_gui"] +extract_to = "halsim_gui" -dlopenlibs = ["halsim_gui"] +[tool.hatch.build.hooks.semiwrap] -# TODO: make this a namespace package? -[tool.robotpy-build.wrappers."halsim_gui"] -name = "halsim_gui" -depends = ["wpiutil", "wpiHal", "ntcore", "wpimath_cpp"] +[tool.hatch.build.hooks.meson] -[tool.robotpy-build.wrappers."halsim_gui._ext"] +[tool.hatch.build.targets.wheel] +packages = ["halsim_gui"] + + +[tool.semiwrap] +[tool.semiwrap.extension_modules."halsim_gui._ext._halsim_gui_ext"] name = "halsim_gui_ext" -sources = [ - "halsim_gui/_ext/main.cpp" -] -depends = ["wpiutil", "wpiHal", "ntcore", "wpimath_cpp", "halsim_gui"] +depends = ["wpihal", "wpimath", "ntcore"] diff --git a/subprojects/robotpy-halsim-gui/semiwrap/.gitignore b/subprojects/robotpy-halsim-gui/semiwrap/.gitignore new file mode 100644 index 000000000..6cdce1027 --- /dev/null +++ b/subprojects/robotpy-halsim-gui/semiwrap/.gitignore @@ -0,0 +1,3 @@ +/meson.build +/modules/meson.build +/trampolines/meson.build diff --git a/subprojects/robotpy-halsim-gui/setup.py b/subprojects/robotpy-halsim-gui/setup.py deleted file mode 100644 index 3542d0c9a..000000000 --- a/subprojects/robotpy-halsim-gui/setup.py +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env python3 - -from robotpy_build.setup import setup - -setup() diff --git a/subprojects/robotpy-halsim-gui/tests/test_halsim_gui.py b/subprojects/robotpy-halsim-gui/tests/test_halsim_gui.py index c12c199b0..65d40386b 100644 --- a/subprojects/robotpy-halsim-gui/tests/test_halsim_gui.py +++ b/subprojects/robotpy-halsim-gui/tests/test_halsim_gui.py @@ -1,7 +1,20 @@ -# tests the internals -import halsim_gui._init_halsim_gui -import halsim_gui._ext +import ctypes +import pathlib def test_halsim_gui(): - pass + # dependencies + import wpinet + import hal + import wpimath + import ntcore + + import halsim_gui as base + + loaded = 0 + for fname in (pathlib.Path(base.__file__).parent / "lib").iterdir(): + if fname.is_file() and fname.suffix in (".dll", ".dylib", ".so"): + ctypes.CDLL(str(fname)) + loaded += 1 + + assert loaded From c8f6e82a2643ce63512fae2faad76c01c43aec89 Mon Sep 17 00:00:00 2001 From: Dustin Spicuzza Date: Sun, 18 May 2025 23:52:02 -0400 Subject: [PATCH 18/20] Update CI --- .github/workflows/dist.yml | 261 +++++++++++++++++++++++++------------ 1 file changed, 176 insertions(+), 85 deletions(-) diff --git a/.github/workflows/dist.yml b/.github/workflows/dist.yml index f0b33ce04..211cd56fa 100644 --- a/.github/workflows/dist.yml +++ b/.github/workflows/dist.yml @@ -62,32 +62,115 @@ jobs: # - # Build native wheels + # Build other wheels first (OS-specific, not python specific) # - build: + build-other: runs-on: ${{ matrix.os }} needs: [setup_concurrency] strategy: max-parallel: ${{ fromJSON(needs.setup_concurrency.outputs.max-parallel).v }} fail-fast: true matrix: - os: ["ubuntu-22.04", "macos-14", "windows-2022"] + os: ["ubuntu-22.04", "ubuntu-22.04-arm", "macos-14", "windows-2022"] + include: + - os: ubuntu-22.04-arm + container: python:3.13-bookworm + + container: ${{ matrix.container }} + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install python + if: matrix.os != 'ubuntu-22.04-arm' + uses: actions/setup-python@v5 + with: + python-version: '3.13' + + - name: Install deps + shell: bash + run: | + python -m pip --disable-pip-version-check install -r rdev_requirements.txt + + - name: Build + test wheels + shell: bash + run: | + ./rdev.sh ci build-other-wheels + + - uses: actions/upload-artifact@v4 + with: + name: "pypi-other-${{ runner.os }}-${{ runner.arch }}" + path: dist + + # + # Build meson wheels + # + + build-meson: + runs-on: ${{ matrix.os }} + needs: [setup_concurrency, build-other] + strategy: + max-parallel: ${{ fromJSON(needs.setup_concurrency.outputs.max-parallel).v }} + fail-fast: true + matrix: + os: + - "ubuntu-22.04" + - "macos-13" # x86_64 + - "macos-14" # arm64 + - "windows-2022" python_version: - '3.9' - '3.10' - '3.11' - '3.12' - '3.13' + include: + - os: ubuntu-22.04-arm + python_version: '3.11' + container: python:3.11-bookworm + - os: ubuntu-22.04-arm + python_version: '3.12' + container: python:3.12-bookworm + - os: ubuntu-22.04-arm + python_version: '3.13' + container: python:3.13-bookworm + + container: ${{ matrix.container }} steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/setup-python@v5 + + - name: Install python + if: matrix.os != 'ubuntu-22.04-arm' + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python_version }} + - uses: actions/download-artifact@v4 + with: + pattern: "pypi-other-${{ runner.os }}-*" + path: dist-other + merge-multiple: true + + # + # Platform specific setup + # + + - name: Install libgl + run: apt-get update && apt-get install -y libgl1 + if: matrix.os == 'ubuntu-22.04-arm' + + - name: Setup MSVC + uses: bus1/cabuild/action/msdevshell@e22aba57d6e74891d059d66501b6b5aed8123c4d # v1 + with: + architecture: x64 + if: runner.os == 'Windows' + # # Setup build caching # @@ -106,108 +189,87 @@ jobs: uses: mozilla-actions/sccache-action@v0.0.7 - name: Install deps - shell: bash run: | python -m pip --disable-pip-version-check install -r rdev_requirements.txt - name: Install numpy (needed for stubgen but broken in raspbian CI) - shell: bash run: | python -m pip --disable-pip-version-check install numpy - name: Build + test wheels - shell: bash run: | - ./rdev.sh ci run + python -m devtools ci build-meson-wheels env: - RPYBUILD_STRIP_LIBPYTHON: "1" - RPYBUILD_CC_LAUNCHER: sccache SCCACHE_WEBDAV_USERNAME: ${{ secrets.WPI_ARTIFACTORY_USERNAME }} SCCACHE_WEBDAV_PASSWORD: ${{ secrets.WPI_ARTIFACTORY_TOKEN }} - uses: actions/upload-artifact@v4 with: - name: "pypi-${{ runner.os }}-${{ matrix.python_version }}" + name: "pypi-meson-${{ runner.os }}-${{ runner.arch }}-${{ matrix.python_version }}" path: dist - build-arm: - runs-on: ubuntu-22.04-arm + # + # Build roboRIO/raspbian wheels + # + + cross-other: + runs-on: ubuntu-latest needs: [setup_concurrency] strategy: max-parallel: ${{ fromJSON(needs.setup_concurrency.outputs.max-parallel).v }} - fail-fast: true matrix: - python_version: - - '3.11' - - '3.12' - - '3.13' - container: python:${{ matrix.python_version }}-bookworm + os: + - container: wpilib/roborio-cross-ubuntu:2025-22.04-py313 + name: roborio + - container: wpilib/raspbian-cross-ubuntu:2025-bookworm-22.04-py313 + name: raspbian - steps: - - run: apt-get update && apt-get install -y libgl1 + container: + image: "${{ matrix.os.container }}" + steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - # - # Setup build caching - # - - - name: Setup sccache - uses: mozilla-actions/sccache-action@v0.0.7 - - # See https://github.com/pypa/setuptools_scm/issues/784 - - name: Set git directory as safe to allow setuptools-scm to work - shell: bash - run: | - /usr/bin/git config --global --add safe.directory $PWD + - name: Setup cross environment for meson + uses: robotpy/build-actions/setup-cross-meson@semiwrap - name: Install deps shell: bash run: | - python -m pip --disable-pip-version-check install -r rdev_requirements.txt - - - name: Install numpy (needed for stubgen) - shell: bash - run: | - python -m pip --disable-pip-version-check install numpy + /build/venv/bin/cross-pip --disable-pip-version-check install -r rdev_requirements.txt - name: Build + test wheels shell: bash run: | - ./rdev.sh ci run - env: - RPYBUILD_STRIP_LIBPYTHON: "1" - RPYBUILD_CC_LAUNCHER: sccache - SCCACHE_WEBDAV_USERNAME: ${{ secrets.WPI_ARTIFACTORY_USERNAME }} - SCCACHE_WEBDAV_PASSWORD: ${{ secrets.WPI_ARTIFACTORY_TOKEN }} + /build/venv/bin/cross-python -m devtools ci build-other-wheels --no-test - uses: actions/upload-artifact@v4 with: - name: "pypi-${{ runner.os }}-arm-${{ matrix.python_version }}" + name: cross-other-${{ matrix.os.name }} path: dist - # - # Build roboRIO/raspbian wheels - # - - cross-build: + cross-meson: runs-on: ubuntu-latest - needs: [setup_concurrency] + needs: [setup_concurrency, cross-other] strategy: max-parallel: ${{ fromJSON(needs.setup_concurrency.outputs.max-parallel).v }} matrix: os: - container: wpilib/roborio-cross-ubuntu:2025-22.04-py313 name: roborio + base: roborio - container: wpilib/raspbian-cross-ubuntu:2025-bookworm-22.04-py311 name: raspbian-py311 + base: raspbian - container: wpilib/raspbian-cross-ubuntu:2025-bookworm-22.04-py312 name: raspbian-py312 + base: raspbian - container: wpilib/raspbian-cross-ubuntu:2025-bookworm-22.04-py313 name: raspbian-py313 + base: raspbian container: image: "${{ matrix.os.container }}" @@ -217,6 +279,14 @@ jobs: with: fetch-depth: 0 + - uses: actions/download-artifact@v4 + with: + name: "cross-other-${{ matrix.os.base }}" + path: dist-other + + - name: Setup cross environment for meson + uses: robotpy/build-actions/setup-cross-meson@semiwrap + - run: apt-get update - name: Setup ccache uses: hendrikmuhs/ccache-action@v1.2 @@ -224,42 +294,20 @@ jobs: key: ${{ matrix.os.container }} variant: ccache - - name: Install setuptools + wheel - run: | - /build/venv/bin/build-pip --disable-pip-version-check install -U "setuptools==63.4.3; python_version < '3.12'" - /build/venv/bin/build-pip --disable-pip-version-check install -U wheel - /build/venv/bin/cross-pip --disable-pip-version-check install -U "setuptools==63.4.3; python_version < '3.12'" - /build/venv/bin/cross-pip --disable-pip-version-check install -U wheel - - # See https://github.com/pypa/setuptools_scm/issues/784 - - name: Set git directory as safe to allow setuptools-scm to work - shell: bash - run: | - pwd - /usr/bin/git config --global --add safe.directory $(pwd) - - # See https://github.com/pallets/markupsafe/issues/475 - - name: Install MarkupSafe - shell: bash - run: | - /build/venv/bin/cross-pip install --no-build-isolation "markupsafe; python_version < '3.12'" - - name: Install deps shell: bash run: | - /build/venv/bin/cross-pip --disable-pip-version-check install -r rdev_requirements.txt + /build/venv/bin/cross-pip --disable-pip-version-check install -r rdev_requirements.txt - - name: Build + test wheels + - name: Build wheels shell: bash run: | - /build/venv/bin/cross-python -m devtools ci run --no-test - env: - RPYBUILD_STRIP_LIBPYTHON: "1" - RPYBUILD_CC_LAUNCHER: ccache + /build/venv/bin/cross-python -m devtools ci build-meson-wheels --no-test --cross=cross.txt + - uses: actions/upload-artifact@v4 with: - name: cross-${{ matrix.os.name }} + name: cross-meson-${{ matrix.os.name }} path: dist # @@ -268,13 +316,13 @@ jobs: publish-rpyrepo: runs-on: ubuntu-latest - needs: [check, build, build-arm, cross-build] + needs: [check, build-meson, cross-meson] if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') steps: - uses: actions/download-artifact@v4 with: - pattern: cross-* + pattern: cross-meson-* path: dist/ merge-multiple: true @@ -285,10 +333,52 @@ jobs: password: ${{ secrets.WPI_ARTIFACTORY_TOKEN }} repository-url: https://wpilib.jfrog.io/artifactory/api/pypi/wpilib-python-release-2025-local + publish-rpyrepo-other: + runs-on: ubuntu-latest + needs: [check, build-meson, cross-meson] + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') + + steps: + - uses: actions/download-artifact@v4 + with: + pattern: cross-other-* + path: dist/ + merge-multiple: true + + - uses: pypa/gh-action-pypi-publish@release/v1 + with: + verify-metadata: false + skip-existing: true # native packages can be uploaded multiple times + user: ${{ secrets.WPI_ARTIFACTORY_USERNAME }} + password: ${{ secrets.WPI_ARTIFACTORY_TOKEN }} + repository-url: https://wpilib.jfrog.io/artifactory/api/pypi/wpilib-python-release-2025-local publish-pypi: runs-on: ubuntu-latest - needs: [check, build, build-arm, cross-build] + needs: [check, build-meson, cross-meson] + permissions: + id-token: write + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: actions/download-artifact@v4 + with: + pattern: pypi-meson-* + path: dist/ + merge-multiple: true + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + verify-metadata: false + + publish-pypi-other: + runs-on: ubuntu-latest + needs: [check, build-meson, cross-meson] permissions: id-token: write if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') @@ -300,7 +390,7 @@ jobs: - uses: actions/download-artifact@v4 with: - pattern: pypi-* + pattern: pypi-other-* path: dist/ merge-multiple: true @@ -308,10 +398,11 @@ jobs: uses: pypa/gh-action-pypi-publish@release/v1 with: verify-metadata: false + skip-existing: true # native packages can be uploaded multiple times ping-rtd: runs-on: ubuntu-latest - needs: [check, build, cross-build] + needs: [check, build-meson, cross-meson] if: | github.event_name == 'push' && (startsWith(github.event.ref, 'refs/tags') || github.event.ref == 'refs/heads/main') @@ -327,7 +418,7 @@ jobs: ping-meta: runs-on: ubuntu-latest - needs: [publish-rpyrepo, publish-pypi] + needs: [publish-rpyrepo, publish-rpyrepo-other, publish-pypi, publish-pypi-other] if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') steps: From 4b6ceb98654354790e1769da8318e7942b7fd746 Mon Sep 17 00:00:00 2001 From: Dustin Spicuzza Date: Sun, 18 May 2025 23:52:20 -0400 Subject: [PATCH 19/20] Update development tooling to work with semiwrap et al --- .gitignore | 3 +- devtools/__main__.py | 37 +++++++++++-- devtools/ci.py | 73 +++++++++++++++++++----- devtools/config.py | 34 ++++++------ devtools/ctx.py | 60 +++++++++++++++++++- devtools/subproject.py | 104 +++++++++++++++++------------------ devtools/update_pyproject.py | 79 +++++++++++++++----------- devtools/util.py | 53 ++++++++++++++++++ rdev.toml | 98 ++++++++++++++++++++++++--------- rdev_requirements.txt | 10 ++-- 10 files changed, 394 insertions(+), 157 deletions(-) create mode 100644 devtools/util.py diff --git a/.gitignore b/.gitignore index bc79fdc6a..0b7312372 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,8 @@ *.py[ciod] /dist +/dist-other +/cache rpy-include -py.typed .venv/ diff --git a/devtools/__main__.py b/devtools/__main__.py index 849540319..c67f7d416 100644 --- a/devtools/__main__.py +++ b/devtools/__main__.py @@ -1,4 +1,5 @@ import os +import pathlib import sys import click @@ -11,8 +12,12 @@ # Environment variables for configuring the builds # -# Always run robotpy-build in parallel -os.environ["RPYBUILD_PARALLEL"] = "1" +# cache downloaded files by default +if "HATCH_ROBOTPY_CACHE" not in os.environ: + os.environ["HATCH_ROBOTPY_CACHE"] = str( + (pathlib.Path(__file__).parent.parent / "cache").resolve() + ) + # MACOSX_DEPLOYMENT_TARGET is required for linking to WPILib if sys.platform == "darwin": @@ -20,10 +25,11 @@ @click.group() +@click.option("-v", "--verbose", default=False, is_flag=True) @click.pass_context -def main(ctx: click.Context): +def main(ctx: click.Context, verbose: bool): """RobotPy development tool""" - ctx.obj = Context() + ctx.obj = Context(verbose) main.add_command(ci.ci) @@ -35,7 +41,7 @@ def main(ctx: click.Context): def info(ctx: Context): """Display information""" for project in ctx.subprojects.values(): - print(project.name, project.requires) + print(project.name, project.build_requires) @main.command() @@ -55,12 +61,31 @@ def develop(ctx: Context, package: str): project.develop() +@main.command +@click.argument("package", required=False) +@click.pass_obj +def uninstall(ctx: Context, package: str): + """Uninstall robotpy packages""" + if package: + for project in ctx.subprojects.values(): + if project.name == package: + project.uninstall() + break + else: + raise click.BadParameter(f"invalid package {package}") + else: + for project in ctx.subprojects.values(): + project.uninstall() + + @main.command() @click.pass_obj def update_init(ctx: Context): """Update __init__.py in all projects""" for project in ctx.subprojects.values(): - project.update_init() + if project.is_semiwrap_project(): + with ctx.handle_exception(f"update-init {project.name}"): + project.update_init() @main.command() diff --git a/devtools/ci.py b/devtools/ci.py index e6c34fbd8..653c92ec8 100644 --- a/devtools/ci.py +++ b/devtools/ci.py @@ -2,11 +2,12 @@ # CI commands # +import pathlib import sys +import typing as T import click from packaging.requirements import Requirement -import setuptools_scm from .ctx import Context from .update_pyproject import ProjectUpdater @@ -39,24 +40,68 @@ def check_pyproject(ctx: Context): @ci.command() @click.option("--no-test", default=False, is_flag=True) @click.pass_obj -def run(ctx: Context, no_test: bool): +def build_other_wheels(ctx: Context, no_test: bool): """ - Builds wheels, runs tests + Builds wheels that don't use meson, runs tests """ - # Get the current build version - version = setuptools_scm.get_version() + for project in ctx.subprojects.values(): + if project.is_meson_project(): + continue + + with ctx.handle_exception(project.name): + ctx.install_build_deps(subproject=project) + + project.build_wheel( + wheel_path=ctx.wheel_path, + other_wheel_path=ctx.other_wheel_path, + install=True, + config_settings=[], + ) + if not no_test: + project.test(install_requirements=True) + + +@ci.command() +@click.option("--no-test", default=False, is_flag=True) +@click.option( + "--cross", + help="meson cross.txt file (installed at ~/.local/share/meson/cross/FILENAME)", +) +@click.pass_obj +def build_meson_wheels(ctx: Context, no_test: bool, cross: T.Optional[str]): + """ + Builds wheels that use meson, runs tests. + + Needs wheels that are in the non-meson builds + """ # Fix build dependencies to be == what we are building # - install_requires already has this via ==THIS_VERSION in robotpy-build - for project in ctx.subprojects.values(): - for i in range(len(project.requires)): - req = project.requires[i] - if req.name in ctx.subprojects: - project.requires[i] = Requirement(f"{req.name}=={version}") + # for project in ctx.subprojects.values(): + # for i in range(len(project.build_requires)): + # req = project.build_requires[i] + # if req.name in ctx.subprojects: + # project.build_requires[i] = Requirement(f"{req.name}=={version}") + + # Check that the build dependencies match the versions of the projects + # that we're building + + config_settings = [] + if cross: + config_settings.append(f"setup-args=--cross-file={cross}") for project in ctx.subprojects.values(): - project.install_build_deps(wheel_path=ctx.wheel_path) - project.bdist_wheel(wheel_path=ctx.wheel_path, install=True) - if not no_test: - project.test(install_requirements=True) + if not project.is_meson_project(): + continue + + with ctx.handle_exception(project.name): + ctx.install_build_deps(subproject=project) + project.build_wheel( + wheel_path=ctx.wheel_path, + other_wheel_path=ctx.other_wheel_path, + install=True, + config_settings=config_settings, + ) + if not no_test: + project.test(install_requirements=True) diff --git a/devtools/config.py b/devtools/config.py index 10150b504..bf8c9373d 100644 --- a/devtools/config.py +++ b/devtools/config.py @@ -1,38 +1,38 @@ -import pydantic +import dataclasses import tomlkit -import typing +import typing as T +from .util import parse_input -class Model(pydantic.BaseModel): - class Config: - extra = "forbid" - -class SubprojectConfig(Model): - #: If any managed project has one of these as a dependency, the - #: minimum version should be this - min_version: str +@dataclasses.dataclass +class SubprojectConfig: + #: The key in `py_versions` to set the project version from + py_version: str #: Whether this should be built on roborio or not roborio: bool -class Parameters(Model): +@dataclasses.dataclass +class Parameters: wpilib_bin_version: str wpilib_bin_url: str - robotpy_build_req: str + exclude_artifacts: T.Set[str] - exclude_artifacts: typing.Set[str] + requirements: T.Dict[str, str] -class UpdateConfig(Model): +@dataclasses.dataclass +class UpdateConfig: + py_versions: T.Dict[str, str] params: Parameters - subprojects: typing.Dict[str, SubprojectConfig] + subprojects: T.Dict[str, SubprojectConfig] -def load(fname) -> typing.Tuple[UpdateConfig, tomlkit.TOMLDocument]: +def load(fname) -> T.Tuple[UpdateConfig, tomlkit.TOMLDocument]: with open(fname) as fp: cfgdata = tomlkit.parse(fp.read()) - return UpdateConfig(**cfgdata), cfgdata + return parse_input(cfgdata, UpdateConfig, fname), cfgdata diff --git a/devtools/ctx.py b/devtools/ctx.py index f18dcc33c..9abfde1be 100644 --- a/devtools/ctx.py +++ b/devtools/ctx.py @@ -1,5 +1,7 @@ +import contextlib import pathlib import subprocess +import sys import sysconfig import typing @@ -7,12 +9,14 @@ from . import config from .subproject import Subproject +from .util import run_pip class Context: """Global context used by all rdev commands""" - def __init__(self) -> None: + def __init__(self, verbose: bool) -> None: + self.verbose = verbose self.root_path = pathlib.Path(__file__).parent.parent self.subprojects_path = self.root_path / "subprojects" self.cfgpath = self.root_path / "rdev.toml" @@ -21,6 +25,7 @@ def __init__(self) -> None: self.is_roborio = sysconfig.get_platform() == "linux-roborio" self.wheel_path = self.root_path / "dist" + self.other_wheel_path = self.root_path / "dist-other" subprojects: typing.List[Subproject] = [] for project, cfg in self.cfg.subprojects.items(): @@ -33,7 +38,7 @@ def __init__(self) -> None: # Create a sorted dictionary of subprojects ordered by build order si = {p.pyproject_name: i for i, p in enumerate(subprojects)} ti = { - i: [si[r.name] for r in p.requires if r.name in si] + i: [si[r.name] for r in p.build_requires + p.dependencies if r.name in si] for i, p in enumerate(subprojects) } @@ -61,3 +66,54 @@ def git_is_file_dirty(self, relpath: str) -> bool: ["git", "status", "--porcelain", relpath], cwd=self.root_path ).decode("utf-8") return output != "" + + @contextlib.contextmanager + def handle_exception(self, msg: str): + try: + yield + except Exception as e: + if self.verbose: + raise + + print(f"ERROR: {msg}: {e}", file=sys.stderr) + sys.exit(1) + + @property + def internal_pyprojects(self): + if not hasattr(self, "_internal_pyprojects"): + self._internal_pyprojects = [ + s.pyproject_name for s in self.subprojects.values() + ] + return self._internal_pyprojects + + def install_build_deps( + self, + *, + subproject: Subproject, + ): + # separate requirements into internal and external + internal = [] + external = [] + + for req in subproject.build_requires: + if req.name in self.internal_pyprojects: + internal.append(req) + else: + external.append(req) + + if external: + run_pip( + "install", + *[str(req) for req in external], + ) + + if internal: + run_pip( + "install", + "--no-index", + "--find-links", + str(self.wheel_path), + "--find-links", + str(self.other_wheel_path), + *[str(req) for req in internal], + ) diff --git a/devtools/subproject.py b/devtools/subproject.py index de845193e..6aca0346a 100644 --- a/devtools/subproject.py +++ b/devtools/subproject.py @@ -1,14 +1,14 @@ import pathlib -import subprocess -import shlex import shutil import sys import tempfile +import typing as T from packaging.requirements import Requirement import tomli from .config import SubprojectConfig +from .util import run_cmd, run_pip class Subproject: @@ -22,84 +22,85 @@ def __init__(self, cfg: SubprojectConfig, path: pathlib.Path) -> None: with open(self.pyproject_path, "rb") as fp: self.pyproject_data = tomli.load(fp) - self.requires = [ + self.build_requires = [ Requirement(req) for req in self.pyproject_data["build-system"]["requires"] ] - self.pyproject_name: str = self.pyproject_data["tool"]["robotpy-build"][ - "metadata" - ]["name"] + self.dependencies = [ + Requirement(req) for req in self.pyproject_data["project"]["dependencies"] + ] + + self.pyproject_name: str = self.pyproject_data["project"]["name"] + + def is_semiwrap_project(self) -> bool: + return self.pyproject_data.get("tool", {}).get("semiwrap", None) is not None + + def is_meson_project(self) -> bool: + return (self.path / "meson.build").exists() # # Tasks # - def _cmd(self, *args: str, cwd=None): - print("+", shlex.join(args)) - subprocess.check_call(args, cwd=cwd) - - def install_build_deps(self, *, wheel_path: pathlib.Path): - self._cmd( - sys.executable, - "-m", - "pip", - "install", - "--disable-pip-version-check", - "--find-links", - str(wheel_path), - *[str(req) for req in self.requires], - ) - def develop(self): - self._cmd( - sys.executable, - "setup.py", - "develop", - "-N", - cwd=self.path, - ) + run_pip("install", "-v", "-e", ".", "--no-build-isolation", cwd=self.path) + + def uninstall(self): + run_pip("uninstall", "-y", self.pyproject_name) def update_init(self): - self._cmd( + run_cmd( sys.executable, - "setup.py", - "update_init", + "-m", + "semiwrap", + "update-init", cwd=self.path, ) def test(self, *, install_requirements=False): tests_path = self.path / "tests" + if not tests_path.exists(): + return + if install_requirements: requirements = tests_path / "requirements.txt" if requirements.exists(): - self._cmd( - sys.executable, - "-m", - "pip", - "--disable-pip-version-check", + run_pip( "install", "-r", str(requirements), ) - self._cmd( + run_cmd( sys.executable, "run_tests.py", cwd=tests_path, ) - def bdist_wheel(self, *, wheel_path: pathlib.Path, install: bool): + def build_wheel( + self, + *, + wheel_path: pathlib.Path, + other_wheel_path: pathlib.Path, + install: bool, + config_settings: T.List[str], + ): wheel_path.mkdir(parents=True, exist_ok=True) + config_args = [f"--config-setting={setting}" for setting in config_settings] + + # TODO: eventually it would be nice to use build isolation + with tempfile.TemporaryDirectory() as td: - # Use bdist_wheel here instead of other solutions because it - # allows using ccache - self._cmd( + # I wonder if we should use hatch build instead? + run_cmd( sys.executable, - "setup.py", - "bdist_wheel", - "-d", + "-m", + "build", + "--no-isolation", + "--outdir", td, + *config_args, cwd=self.path, ) @@ -108,21 +109,14 @@ def bdist_wheel(self, *, wheel_path: pathlib.Path, install: bool): dst_whl = wheel_path / self._fix_wheel_name(twhl.name) shutil.move(twhl, dst_whl) - # Setuptools is dumb - for p in self.path.glob("*.egg-info"): - shutil.rmtree(p) - if install: # Install the wheel - self._cmd( - sys.executable, - "-m", - "pip", - "--disable-pip-version-check", + run_pip( "install", - "--force-reinstall", "--find-links", str(wheel_path), + "--find-links", + str(other_wheel_path), str(dst_whl), ) diff --git a/devtools/update_pyproject.py b/devtools/update_pyproject.py index 760903491..74229ade9 100644 --- a/devtools/update_pyproject.py +++ b/devtools/update_pyproject.py @@ -8,12 +8,14 @@ from packaging.version import Version import tomlkit +from .config import SubprojectConfig from .ctx import Context @dataclasses.dataclass class ProjectInfo: pyproject_toml: pathlib.Path + cfg: SubprojectConfig data: tomlkit.TOMLDocument changed: bool = False @@ -32,15 +34,8 @@ def __init__(self, ctx: Context) -> None: # The required versions for everything # - in theory projects could have different requirements, but in # practice this is simpler and we haven't had issues - # - .. and to make life easier, we only use this for build-system.requires, - # which we happen to override in CI anyways self.version_specs: typing.Dict[str, SpecifierSet] = {} - # robotpy-build is special - self.version_specs["robotpy-build"] = SpecifierSet( - self.cfg.params.robotpy_build_req - ) - # load all the pyproject.toml using tomlkit so we can make changes # and retain all the comments self.subprojects: typing.Dict[str, ProjectInfo] = {} @@ -49,12 +44,17 @@ def __init__(self, ctx: Context) -> None: data = tomlkit.load(fp) self.subprojects[name] = ProjectInfo( - pyproject_toml=project.pyproject_path, data=data + pyproject_toml=project.pyproject_path, + data=data, + cfg=self.cfg.subprojects[name], ) - self.version_specs[project.pyproject_name] = SpecifierSet( - f"~={project.cfg.min_version}" - ) + version = self.cfg.py_versions[project.cfg.py_version] + + self.version_specs[project.pyproject_name] = SpecifierSet(f"=={version}") + + for name, spec in self.cfg.params.requirements.items(): + self.version_specs[name] = SpecifierSet(spec) @property def changed(self) -> bool: @@ -105,7 +105,10 @@ def _update_requirements( def update_requirements(self): for info in self.subprojects.values(): data = info.data - pypi_name = data["tool"]["robotpy-build"]["metadata"]["name"] + pypi_name = data["project"]["name"] + + # update project.version + self._update_pyversion(info) # update build-system self._update_requirements( @@ -115,57 +118,69 @@ def update_requirements(self): data["build-system"]["requires"], ) - # update tool.robotpy-build.metadata: install_requires + # project.dependencies self._update_requirements( info, pypi_name, - "metadata.install_requires", - data["tool"]["robotpy-build"]["metadata"]["install_requires"], + "project.dependencies", + data["project"]["dependencies"], ) def _update_maven(self, info: ProjectInfo): data = info.data - iter = list(data["tool"]["robotpy-build"]["wrappers"].items()) - if "static_libs" in data["tool"]["robotpy-build"]: - iter += list(data["tool"]["robotpy-build"]["static_libs"].items()) - for pkg, wrapper in iter: - if ( - "maven_lib_download" not in wrapper - or wrapper["maven_lib_download"]["artifact_id"] - in self.cfg.params.exclude_artifacts - ): + iter = ( + data["tool"]["hatch"]["build"]["hooks"] + .get("robotpy", {}) + .get("maven_lib_download", []) + ) + + for dl in iter: + + if dl["artifact_id"] in self.cfg.params.exclude_artifacts: continue - if wrapper["maven_lib_download"]["repo_url"] != self.wpilib_bin_url: + artifact_id = dl["artifact_id"] + + if dl["repo_url"] != self.wpilib_bin_url: print( "* ", - pkg, + artifact_id, "repo url:", - wrapper["maven_lib_download"]["repo_url"], + dl["repo_url"], "=>", self.wpilib_bin_url, ) self.commit_changes.add(f"repo updated to {self.wpilib_bin_url}") info.changed = True - wrapper["maven_lib_download"]["repo_url"] = self.wpilib_bin_url + dl["repo_url"] = self.wpilib_bin_url - if wrapper["maven_lib_download"]["version"] != self.wpilib_bin_version: + if dl["version"] != self.wpilib_bin_version: print( "* ", - pkg, + artifact_id, "so version:", - wrapper["maven_lib_download"]["version"], + dl["version"], "=>", self.wpilib_bin_version, ) self.commit_changes.add(f"lib updated to {self.wpilib_bin_version}") info.changed = True - wrapper["maven_lib_download"]["version"] = self.wpilib_bin_version + dl["version"] = self.wpilib_bin_version def update_maven(self): for data in self.subprojects.values(): self._update_maven(data) + def _update_pyversion(self, info: ProjectInfo): + current_version = info.data["project"]["version"] + version = self.cfg.py_versions[info.cfg.py_version] + + if current_version != version: + name = info.data["project"]["name"] + print(f"* {name} {current_version!r} => {version!r}") + self.commit_changes.add(f"{name} updated to {version}") + info.changed = True + def update(self): self.update_maven() self.update_requirements() diff --git a/devtools/util.py b/devtools/util.py new file mode 100644 index 000000000..c08ba555c --- /dev/null +++ b/devtools/util.py @@ -0,0 +1,53 @@ +import shlex +import subprocess +import sys +import typing + +from validobj import errors +import validobj.validation + +T = typing.TypeVar("T") + + +class ValidationError(Exception): + pass + + +def _convert_validation_error(fname, ve: errors.ValidationError) -> ValidationError: + locs = [] + msg = [] + + e = ve + while e is not None: + + if isinstance(e, errors.WrongFieldError): + locs.append(f".{e.wrong_field}") + elif isinstance(e, errors.WrongListItemError): + locs.append(f"[{e.wrong_index}]") + else: + msg.append(str(e)) + + e = e.__cause__ + + loc = "".join(locs) + if loc.startswith("."): + loc = loc[1:] + msg = "\n ".join(msg) + vmsg = f"{fname}: {loc}:\n {msg}" + return ValidationError(vmsg) + + +def parse_input(value: typing.Any, spec: typing.Type[T], fname) -> T: + try: + return validobj.validation.parse_input(value, spec) + except errors.ValidationError as ve: + raise _convert_validation_error(fname, ve) from None + + +def run_cmd(*args: str, cwd=None): + print("+", shlex.join(args)) + subprocess.check_call(args, cwd=cwd) + + +def run_pip(*args: str, cwd=None): + run_cmd(sys.executable, "-m", "pip", "--disable-pip-version-check", *args, cwd=cwd) diff --git a/rdev.toml b/rdev.toml index dcc61f9a2..90f9f03ab 100644 --- a/rdev.toml +++ b/rdev.toml @@ -1,6 +1,23 @@ # # This is used by ./rdev.sh to manage the various robotpy packages # +# allwpilib-based python wheel versioning is xxxx.x.x.y: +# - x is the upstream version +# - y are specific robotpy patches when we release out of band +# +# Beta releases are always YEAR.0.0bX[.postX] +# + +[py_versions] + +# Usually the same as wpilib_bin_version +native = "2025.3.2" + +# Will eventually sync with native +halsim_native = "2025.3.2.2" + +# Usually similar to native, but subminor version is bumped for bugfixes +wrapper = "2025.3.2.2" [params] @@ -8,71 +25,102 @@ wpilib_bin_url = "https://frcmaven.wpi.edu/artifactory/release" wpilib_bin_version = "2025.3.2" #wpilib_bin_url = "https://frcmaven.wpi.edu/artifactory/development" -# Don't update these artifacts +# Don't update these maven artifacts exclude_artifacts = [ "opencv-cpp" ] -robotpy_build_req = "~=2025.1.0" +[params.requirements] +semiwrap = "~=0.1" +hatch-meson = "~=0.1.0b2" +hatch-nativelib = "~=0.2.0" +hatch-robotpy = "~=0.2" -# -# Subproject configuration -# -# allwpilib-based package versioning is xxxx.x.x.y: -# - x is the upstream version -# - y are specific robotpy patches when we release out of band -# -# Beta releases are always YEAR.0.0bX[.postX] -# + +[subprojects."robotpy-native-wpiutil"] +py_version = "native" +roborio = true + +[subprojects."robotpy-native-wpinet"] +py_version = "native" +roborio = true + +[subprojects."robotpy-native-ntcore"] +py_version = "native" +roborio = true + +[subprojects."robotpy-native-wpihal"] +py_version = "native" +roborio = true + +[subprojects."robotpy-native-wpimath"] +py_version = "native" +roborio = true + +[subprojects."robotpy-native-apriltag"] +py_version = "native" +roborio = true + +[subprojects."robotpy-native-wpilib"] +py_version = "native" +roborio = true + +[subprojects."robotpy-native-romi"] +py_version = "native" +roborio = false + +[subprojects."robotpy-native-xrp"] +py_version = "native" +roborio = false [subprojects."robotpy-wpiutil"] -min_version = "2025.3.2" +py_version = "wrapper" roborio = true [subprojects."robotpy-wpinet"] -min_version = "2025.3.2" +py_version = "wrapper" roborio = true -[subprojects.pyntcore] -min_version = "2025.3.2" +[subprojects."pyntcore"] +py_version = "wrapper" roborio = true [subprojects."robotpy-hal"] -min_version = "2025.3.2" +py_version = "wrapper" roborio = true [subprojects."robotpy-wpimath"] -min_version = "2025.3.2" +py_version = "wrapper" roborio = true [subprojects."robotpy-cscore"] -min_version = "2025.3.2" +py_version = "wrapper" roborio = true [subprojects."robotpy-apriltag"] -min_version = "2025.3.2" +py_version = "wrapper" roborio = true [subprojects."robotpy-wpilib"] -min_version = "2025.3.2" +py_version = "wrapper" roborio = true [subprojects."robotpy-halsim-ds-socket"] -min_version = "2025.3.2" +py_version = "halsim_native" roborio = false [subprojects."robotpy-halsim-ws"] -min_version = "2025.3.2" +py_version = "halsim_native" roborio = false [subprojects."robotpy-halsim-gui"] -min_version = "2025.3.2" +py_version = "wrapper" roborio = false [subprojects."robotpy-romi"] -min_version = "2025.3.2" +py_version = "wrapper" roborio = false [subprojects."robotpy-xrp"] -min_version = "2025.3.2" +py_version = "wrapper" roborio = false diff --git a/rdev_requirements.txt b/rdev_requirements.txt index 47fa22662..b429745b9 100644 --- a/rdev_requirements.txt +++ b/rdev_requirements.txt @@ -1,12 +1,12 @@ black +build click packaging -pydantic<2,!=1.10.20 pytest -requests -setuptools -setuptools_scm >= 6.2, < 8 tomlkit tomli toposort -wheel +validobj~=1.2 + +ninja +msvc-runtime>=14.42.34433; platform_system == 'Windows' From 5a61a3f208df9fb1ca3e172f84ce465544a5fdcb Mon Sep 17 00:00:00 2001 From: Dustin Spicuzza Date: Tue, 20 May 2025 22:14:13 -0400 Subject: [PATCH 20/20] Fix RTD --- .readthedocs.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index c7b2283e5..505d10819 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -9,7 +9,8 @@ build: python: "3.11" jobs: post_install: - - python -m robotpy_sphinx.download_and_install robotpy mostrobotpy main dist pypi-Linux-3.11 + - python -m robotpy_sphinx.download_and_install robotpy mostrobotpy main dist pypi-other-X64-3.11 + - python -m robotpy_sphinx.download_and_install robotpy mostrobotpy main dist pypi-Linux-X64-3.11 post_build: - mkdir --parents _readthedocs/htmlzip - cp --recursive _readthedocs/html _readthedocs/$READTHEDOCS_PROJECT