Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*.py[cod]
*.py[codi]
*.egg-info
__pycache__

Expand All @@ -7,12 +7,15 @@ __pycache__
*.dll

/navx/include
/navx/rpy-include
/navx/_init_navx.py
/navx/pkgcfg.py
/navx/trampolines
/navx/_init__navx.py
/navx/_init_studica_api.py
/navx/navx.pc
/navx/studica_api.pc
/navx/version.py

.cache
.coverage
build
dist
/lib
7 changes: 0 additions & 7 deletions gen/ITimestampedDataSubscriber.yml

This file was deleted.

23 changes: 23 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
project('robotpy-navx', ['cpp'],
default_options: ['warning_level=1', 'cpp_std=c++20',
'b_colorout=auto', 'optimization=2', 'b_pie=true'])

subdir('semiwrap')

navx_sources += files(
'navx/src/rpy/navx.cpp',
)

#
# Static link
#

cpp = meson.get_compiler('cpp')
libs_path = meson.current_source_dir() + '/lib/lib'

navx_deps += [
cpp.find_library('StudicaDriver', dirs: libs_path),
cpp.find_library('Studica', dirs: libs_path),
]

subdir('semiwrap/modules')
4 changes: 2 additions & 2 deletions navx/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from . import _init_navx
from . import _init__navx

# autogenerated by 'robotpy-build create-imports navx navx._navx'
# autogenerated by 'semiwrap create-imports navx navx._navx'
from ._navx import AHRS

__all__ = ["AHRS"]
Expand Down
Empty file added navx/py.typed
Empty file.
11 changes: 0 additions & 11 deletions navx/src/ahrs.h.patch

This file was deleted.

4 changes: 2 additions & 2 deletions navx/src/rpy/navx.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#include <rpygen_wrapper.hpp>
#include <semiwrap_init.navx._navx.hpp>

RPYBUILD_PYBIND11_MODULE(m) { initWrapper(m); }
SEMIWRAP_PYBIND11_MODULE(m) { initWrapper(m); }
162 changes: 0 additions & 162 deletions navx/src/sources.patch

This file was deleted.

91 changes: 54 additions & 37 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,60 +1,77 @@
[build-system]
build-backend = "hatchling.build"
requires = [
"robotpy-build~=2025.1.0",
"wpilib<2026,>=2025.3.2",
"hatchling",
"hatch-vcs",
"semiwrap~=0.1",
"hatch-meson~=0.1.0b2",
"hatch-robotpy~=0.2.0",
"wpilib~=2025.3.2.2",
]

[tool.robotpy-build]
base_package = "navx"

[tool.robotpy-build.metadata]
[project]
name = "robotpy-navx"
description = "Python wrapper for KauaiLabs NavX sensor"
author = "RobotPy Development Team"
author_email = "robotpy@googlegroups.com"
url = "https://github.com/robotpy/robotpy-navx"
dynamic = ["version"]
description = "Python wrapper for Studica NavX sensor"
license = "BSD-3-Clause"
install_requires = [
"wpilib<2026,>=2025.3.2",
dependencies = [
"wpilib~=2025.3.2.2",
]

[tool.robotpy-build.static_libs."studica_driver".maven_lib_download]
artifact_id = "Studica-driver"
[[project.authors]]
name = "RobotPy Development Team"
email = "robotpy@googlegroups.com"

[project.urls]
"Source code" = "https://github.com/robotpy/robotpy-navx"


[tool.hatch.version]
source = "vcs"

[tool.hatch.build.hooks.vcs]
version-file = "navx/version.py"

[tool.hatch.build.targets.wheel]
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"
libs = ["StudicaDriver"]
staticlibs = ["Studica"]
extract_to = "lib"

[tool.robotpy-build.static_libs."studica_lib".maven_lib_download]
artifact_id = "Studica-cpp"
[[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"
libs = ["Studica"]
staticlibs = ["StudicaDriver"]
extract_to = "lib"


[tool.hatch.build.hooks.semiwrap]

[tool.hatch.build.hooks.meson]

[tool.robotpy-build.wrappers."navx"]

[tool.semiwrap]
update_init = ["navx"]

[tool.semiwrap.extension_modules."navx._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",
"wpilib",
]

sources = [
"navx/src/rpy/navx.cpp"
includes = [
"lib/include"
]

generate = [
{ AHRS = "studica/AHRS.h" },
]
generation_data = "gen"
[tool.semiwrap.extension_modules."navx._navx".headers]
AHRS = "studica/AHRS.h"
3 changes: 3 additions & 0 deletions semiwrap/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/meson.build
/modules/meson.build
/trampolines/meson.build
6 changes: 2 additions & 4 deletions gen/AHRS.yml → semiwrap/AHRS.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---

extra_includes:
- wpi/sendable/SendableHelper.h

classes:
AHRS:
::studica::AHRS:
ignored_bases:
- wpi::SendableHelper<studica::AHRS>
enums:
Expand Down Expand Up @@ -621,8 +620,7 @@ classes:
Calibrate:
doc: |
Does nothing
AHRS::BoardYawAxis:
shared_ptr: true
::studica::AHRS::BoardYawAxis:
attributes:
board_axis:
up:
Expand Down
5 changes: 0 additions & 5 deletions setup.py

This file was deleted.

Loading
Loading