diff --git a/gen/AHRS.yml b/gen/AHRS.yml index 327603a..a385865 100644 --- a/gen/AHRS.yml +++ b/gen/AHRS.yml @@ -3,27 +3,20 @@ extra_includes: - wpi/sendable/SendableHelper.h -inline_code: | - #include - classes: AHRS: - shared_ptr: true ignored_bases: - - wpi::SendableHelper + - wpi::SendableHelper enums: BoardAxis: + NavXComType: + NavXUpdateRate: SerialDataType: methods: AHRS: overloads: - frc::SPI::Port: - frc::I2C::Port: - frc::SerialPort::Port: - frc::SPI::Port, uint8_t: - frc::SPI::Port, uint32_t, uint8_t: - frc::I2C::Port, uint8_t: - frc::SerialPort::Port, AHRS::SerialDataType, uint8_t: + NavXComType: + NavXComType, NavXUpdateRate: GetPitch: doc: | Returns the current pitch value (in degrees, from -180 to 180) @@ -633,3 +626,10 @@ classes: attributes: board_axis: up: + +inline_code: | + cls_AHRS.def_static("create_spi", []() { + return std::make_shared(studica::AHRS::NavXComType::kMXP_SPI); + }, release_gil(), + "Constructs the AHRS class using SPI communication and default settings.\n" + "Use the constructor if you need more customization."); diff --git a/navx/src/rpy/AHRS.cpp.inl b/navx/src/rpy/AHRS.cpp.inl deleted file mode 100644 index 59b6887..0000000 --- a/navx/src/rpy/AHRS.cpp.inl +++ /dev/null @@ -1,38 +0,0 @@ -cls_AHRS.def_static("create_spi", []( - frc::SPI::Port port, - uint32_t bitrate, - uint8_t update_rate_hz - ) -> std::shared_ptr { - return std::make_shared(port, bitrate, update_rate_hz); - }, - py::arg("port") = frc::SPI::Port::kMXP, - py::arg("bitrate") =500000, // DEFAULT_SPI_BITRATE in AHRS.cpp - py::arg("update_rate_hz") = 60, // NAVX_DEFAULT_UPDATE_RATE_HZ - release_gil(), - "Constructs the AHRS class using SPI communication, overriding the\n" - "default update rate with a custom rate which may be from 4 to 100,\n" - "representing the number of updates per second sent by the sensor.\n\n" - "This constructor allows the specification of a custom SPI bitrate, in bits/second.\n\n" - ".. note:: Increasing the update rate may increase the CPU utilization.\n\n" - ":param port: SPI Port to use\n" - ":type port: :class:`.SPI.Port`\n" - ":param spi_bitrate: SPI bitrate (Maximum: 2,000,000)\n" - ":param update_rate_hz: Custom Update Rate (Hz)"); - -cls_AHRS.def_static("create_i2c", []( - frc::I2C::Port port, - uint8_t update_rate_hz - ) -> std::shared_ptr { - return std::make_shared(port, update_rate_hz); - }, - py::arg("port") = frc::I2C::Port::kMXP, - py::arg("update_rate_hz") = 60, // NAVX_DEFAULT_UPDATE_RATE_HZ - release_gil(), - "Constructs the AHRS class using I2C communication, overriding the " - "default update rate with a custom rate which may be from 4 to 100, " - "representing the number of updates per second sent by the sensor.\n\n" - "This constructor should be used if communicating via I2C.\n\n" - ".. note:: Increasing the update rate may increase the CPU utilization.\n\n" - ":param port: I2C Port to use\n" - ":type port: :class:`.I2C.Port` " - ":param update_rate_hz: Custom Update Rate (Hz)\n"); \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 01f868d..65b0543 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,9 +1,9 @@ [build-system] requires = [ "robotpy-build<2025.0.0b1,~=2025.0.0a1", - "robotpy-wpiutil~=2025.0.0b1", - "robotpy-wpimath~=2025.0.0b1", - "wpilib~=2025.0.0b1", + "robotpy-wpiutil~=2025.0.0b2", + "robotpy-wpimath~=2025.0.0b2", + "wpilib~=2025.0.0b2", ] [tool.robotpy-build] @@ -17,48 +17,41 @@ author_email = "robotpy@googlegroups.com" url = "https://github.com/robotpy/robotpy-navx" license = "BSD-3-Clause" install_requires = [ - "robotpy-wpiutil~=2025.0.0b1", - "robotpy-wpimath~=2025.0.0b1", - "wpilib~=2025.0.0b1", + "robotpy-wpiutil~=2025.0.0b2", + "robotpy-wpimath~=2025.0.0b2", + "wpilib~=2025.0.0b2", ] -[tool.robotpy-build.wrappers."navx".maven_lib_download] -artifact_id = "navx_frc-cpp" -group_id = "com.kauailabs.navx.frc" +[tool.robotpy-build.static_libs."studica_driver".maven_lib_download] +artifact_id = "Studica-driver" +group_id = "com.studica.frc" repo_url = "https://dev.studica.com/maven/release/2025" -version = "2025.1.1-beta-1" -use_sources = true -sources = [ - "AHRS.cpp", - "ContinuousAngleTracker.cpp", - "InertialDataIntegrator.cpp", - "OffsetTracker.cpp", - "RegisterIO.cpp", - "RegisterIOI2C.cpp", - "RegisterIOMau.cpp", - "RegisterIOSPI.cpp", - "SerialIO.cpp", - "SimIO.cpp", - "Tracer.cpp" -] +version = "2025.1.1-beta-3" +libs = ["StudicaDriver"] -[[tool.robotpy-build.wrappers."navx".maven_lib_download.patches]] -patch = "navx/src/sources.patch" -strip = 1 - -[[tool.robotpy-build.wrappers."navx".maven_lib_download.header_patches]] -patch = "navx/src/ahrs.h.patch" -strip = 2 +[tool.robotpy-build.static_libs."studica_lib".maven_lib_download] +artifact_id = "Studica-cpp" +group_id = "com.studica.frc" +repo_url = "https://dev.studica.com/maven/release/2025" +version = "2025.1.1-beta-3" +libs = ["Studica"] [tool.robotpy-build.wrappers."navx"] name = "navx" depends = [ + "wpilib_core", + "wpimath_cpp", + "wpimath_geometry", + "wpiHal", "wpilibc", "wpilib_core", "wpimath_cpp", "wpimath_geometry", "wpiHal", + "ntcore", "wpiutil", + "studica_driver", + "studica_lib", ] sources = [ @@ -66,7 +59,6 @@ sources = [ ] generate = [ - { AHRS = "AHRS.h" }, - # { ITimestampedDataSubscriber = "ITimestampedDataSubscriber.h" }, + { AHRS = "studica/AHRS.h" }, ] generation_data = "gen"