diff --git a/.github/workflows/dist.yml b/.github/workflows/dist.yml index beb210a..ed4fc2c 100644 --- a/.github/workflows/dist.yml +++ b/.github/workflows/dist.yml @@ -11,7 +11,7 @@ on: jobs: ci: - uses: robotpy/build-actions/.github/workflows/package-ci.yml@v2025 + uses: robotpy/build-actions/.github/workflows/package-ci.yml@v2026 with: artifactory_repo_type: vendor secrets: diff --git a/meson.build b/meson.build index cf42444..ad8a5d9 100644 --- a/meson.build +++ b/meson.build @@ -17,7 +17,9 @@ libs_path = meson.current_source_dir() + '/lib/lib' navx_deps += [ cpp.find_library('StudicaDriver', dirs: libs_path), + cpp.find_library('StudicaLibDriver', dirs: libs_path), cpp.find_library('Studica', dirs: libs_path), + cpp.find_library('StudicaLib', dirs: libs_path), ] subdir('semiwrap/modules') diff --git a/navx/__init__.py b/navx/__init__.py index 16eaf1b..612d023 100644 --- a/navx/__init__.py +++ b/navx/__init__.py @@ -1,8 +1,8 @@ from . import _init__navx # autogenerated by 'semiwrap create-imports navx navx._navx' -from ._navx import AHRS +from ._navx import AHRS, Navx -__all__ = ["AHRS"] +__all__ = ["AHRS", "Navx"] from .version import version as __version__ diff --git a/pyproject.toml b/pyproject.toml index 99bc504..68b002a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ requires = [ "semiwrap~=0.1", "hatch-meson~=0.1.0b2", "hatch-robotpy~=0.2.0", - "wpilib~=2025.3.2.2", + "wpilib~=2026.1.1b1", ] @@ -16,7 +16,7 @@ dynamic = ["version"] description = "Python wrapper for Studica NavX sensor" license = "BSD-3-Clause" dependencies = [ - "wpilib~=2025.3.2.2", + "wpilib~=2026.1.1b1", ] [[project.authors]] @@ -40,19 +40,35 @@ packages = ["navx"] [[tool.hatch.build.hooks.robotpy.maven_lib_download]] artifact_id = "Studica-cpp" group_id = "com.studica.frc" -repo_url = "https://dev.studica.com/maven/release/2025" -version = "2025.0.1" +repo_url = "https://dev.studica.com/maven/release/2026" +version = "2026.0.0-beta" staticlibs = ["Studica"] extract_to = "lib" [[tool.hatch.build.hooks.robotpy.maven_lib_download]] artifact_id = "Studica-driver" group_id = "com.studica.frc" -repo_url = "https://dev.studica.com/maven/release/2025" -version = "2025.0.1" +repo_url = "https://dev.studica.com/maven/release/2026" +version = "2026.0.0-beta" staticlibs = ["StudicaDriver"] extract_to = "lib" +[[tool.hatch.build.hooks.robotpy.maven_lib_download]] +artifact_id = "StudicaLib-cpp" +group_id = "com.studica.frc" +repo_url = "https://dev.studica.com/maven/release/2026" +version = "2026.0.1-beta" +staticlibs = ["StudicaLib"] +extract_to = "lib" + +[[tool.hatch.build.hooks.robotpy.maven_lib_download]] +artifact_id = "StudicaLib-driver" +group_id = "com.studica.frc" +repo_url = "https://dev.studica.com/maven/release/2026" +version = "2026.0.1-beta" +staticlibs = ["StudicaLibDriver"] +extract_to = "lib" + [tool.hatch.build.hooks.semiwrap] @@ -61,6 +77,8 @@ extract_to = "lib" [tool.semiwrap] update_init = ["navx"] +scan_headers_ignore = ["*"] + [tool.semiwrap.extension_modules."navx._navx"] name = "navx" @@ -75,3 +93,4 @@ includes = [ [tool.semiwrap.extension_modules."navx._navx".headers] AHRS = "studica/AHRS.h" +NavX = "studica/Navx.h" diff --git a/semiwrap/AHRS.yml b/semiwrap/AHRS.yml index afaf691..bae67b4 100644 --- a/semiwrap/AHRS.yml +++ b/semiwrap/AHRS.yml @@ -1,4 +1,3 @@ - extra_includes: - wpi/sendable/SendableHelper.h @@ -10,12 +9,12 @@ classes: BoardAxis: NavXComType: NavXUpdateRate: - SerialDataType: methods: AHRS: overloads: NavXComType: NavXComType, NavXUpdateRate: + NavXComType, uint8_t: GetPitch: doc: | Returns the current pitch value (in degrees, from -180 to 180) @@ -102,24 +101,6 @@ classes: :returns: Returns true if a valid update has been recently received from the sensor. - GetByteCount: - doc: | - Returns the count in bytes of data received from the - sensor. This could can be useful for diagnosing - connectivity issues. - - If the byte count is increasing, but the update count - (see :meth:`getUpdateCount`) is not, this indicates a software - misconfiguration. - - :returns: The number of bytes received from the sensor. - GetUpdateCount: - doc: | - Returns the count of valid updates which have - been received from the sensor. This count should increase - at the same rate indicated by the configured update rate. - - :returns: The number of valid updates received from the sensor. GetLastSensorTimestamp: doc: | Returns the sensor timestamp corresponding to the @@ -165,22 +146,6 @@ classes: body (e.g., the robot) on which the sensor is mounted. :returns: Current world linear acceleration in the Z-axis (in G). - IsMoving: - doc: | - Indicates if the sensor is currently detecting motion, - based upon the X and Y-axis world linear acceleration values. - If the sum of the absolute values of the X and Y axis exceed - a "motion threshold", the motion state is indicated. - - :returns: Returns true if the sensor is currently detecting motion. - IsRotating: - doc: | - Indicates if the sensor is currently detecting motion, - based upon the X and Y-axis world linear acceleration values. - If the sum of the absolute values of the X and Y axis exceed - a "motion threshold", the motion state is indicated. - - :returns: Returns true if the sensor is currently detecting motion. GetBarometricPressure: doc: | Returns the current barometric pressure, based upon calibrated readings @@ -513,22 +478,6 @@ classes: via the :meth:`getCompassHeading` method. :returns: Returns the mag field strength (in uTesla). - GetPressure: - doc: | - Returns the current barometric pressure (in millibar) [navX Aero only]. - - This value is valid only if a barometric pressure sensor is onboard. - - :returns: Returns the current barometric pressure (in millibar). - GetTempC: - doc: | - Returns the current temperature (in degrees centigrade) reported by - the sensor's gyro/accelerometer circuit. - - This value may be useful in order to perform advanced temperature- - correction of raw gyroscope and accelerometer values. - - :returns: The current temperature (in degrees centigrade). GetBoardYawAxis: doc: | Returns information regarding which sensor board axis (X,Y or Z) and @@ -551,10 +500,6 @@ classes: http://navx-mxp.kauailabs.com/navx-mxp/support/updating-firmware/ :returns: The firmware version in the format [MajorVersion].[MinorVersion] - RegisterCallback: - ignore: true - DeregisterCallback: - ignore: true GetActualUpdateRate: doc: | Returns the navX-Model device's currently configured update @@ -617,9 +562,12 @@ classes: of the X, Y and X-axis accelerometers. :returns: accelerometer full scale range in G. - Calibrate: - doc: | - Does nothing + GetPort: + ConfigureVelocity: + GetRobotCentricVelocityX: + GetRobotCentricVelocityY: + GetRobotCentricVelocityZ: + InitSendable: ::studica::AHRS::BoardYawAxis: attributes: board_axis: diff --git a/semiwrap/NavX.yml b/semiwrap/NavX.yml new file mode 100644 index 0000000..fae5163 --- /dev/null +++ b/semiwrap/NavX.yml @@ -0,0 +1,22 @@ +classes: + ::studica::Navx: + methods: + Navx: + overloads: + int: + int, int: + GetYaw: + GetPitch: + GetRoll: + GetAlgoStates: + EnableOptionalMessages: + GetQuat6D: + GetQuat9D: + GetAngularVel: + GetLinearAccel: + GetCompass: + SelfTest: + SetODRHz: + Start: + GetSensorUUID: + GetTemperature: diff --git a/tests/test_navx.py b/tests/test_navx.py index 6dfada8..51e9ab7 100644 --- a/tests/test_navx.py +++ b/tests/test_navx.py @@ -19,3 +19,8 @@ def test_get_board_yaw_axis(): def test_get_velocity_x(): imu = navx.AHRS.create_spi() imu.getVelocityX() + + +def test_navx_get_yaw(): + imu = navx.Navx(0) + imu.getYaw()