-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #57 from robotpy/romi-xrp
Add ROMI and XRP to mostrobotpy
- Loading branch information
Showing
30 changed files
with
345 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
*.py[cod] | ||
*.so | ||
*.dll | ||
*.egg-info | ||
|
||
/build | ||
|
||
/romi/include | ||
/romi/lib | ||
/romi/_init_romi.py | ||
/romi/pkgcfg.py | ||
/romi/version.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
robotpy-romi | ||
============ | ||
|
||
RobotPy support for the WPILib ROMI vendor library. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
|
||
classes: | ||
OnBoardIO: | ||
attributes: | ||
kMessageInterval: | ||
m_nextMessageTime: | ||
enums: | ||
ChannelMode: | ||
methods: | ||
OnBoardIO: | ||
GetButtonAPressed: | ||
GetButtonBPressed: | ||
GetButtonCPressed: | ||
SetGreenLed: | ||
SetRedLed: | ||
SetYellowLed: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
|
||
classes: | ||
RomiGyro: | ||
methods: | ||
RomiGyro: | ||
GetAngle: | ||
GetRate: | ||
Calibrate: | ||
GetRateX: | ||
GetRateY: | ||
GetRateZ: | ||
GetAngleX: | ||
GetAngleY: | ||
GetAngleZ: | ||
Reset: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
|
||
classes: | ||
RomiMotor: | ||
methods: | ||
RomiMotor: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
[tool.robotpy-build.metadata] | ||
name = "robotpy-romi" | ||
description = "Binary wrapper for WPILib Romi Vendor library" | ||
author = "RobotPy Development Team" | ||
author_email = "robotpy@googlegroups.com" | ||
url = "https://github.com/robotpy/mostrobotpy" | ||
license = "BSD-3-Clause" | ||
install_requires = [ | ||
"wpilib==THIS_VERSION" | ||
] | ||
|
||
[build-system] | ||
requires = [ | ||
"robotpy-build<2025.0.0,~=2024.0.0", | ||
"wpilib~=2024.1.1" | ||
] | ||
|
||
[tool.robotpy-build] | ||
base_package = "romi" | ||
|
||
[tool.robotpy-build.wrappers."romi"] | ||
name = "romi" | ||
sources = ["romi/src/main.cpp"] | ||
generation_data = "gen" | ||
depends = [ | ||
"wpilib_core", "wpilibc_interfaces", "wpilibc", | ||
"wpimath_cpp", "wpimath_geometry", | ||
"wpiHal", "wpiutil", "ntcore", | ||
] | ||
|
||
[tool.robotpy-build.wrappers."romi".autogen_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 = "2024.1.1" | ||
libs = ["romiVendordep"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from . import _init_romi | ||
|
||
# autogenerated by 'robotpy-build create-imports romi' | ||
from ._romi import OnBoardIO, RomiGyro, RomiMotor | ||
|
||
__all__ = ["OnBoardIO", "RomiGyro", "RomiMotor"] | ||
|
||
del _init_romi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
#include <rpygen_wrapper.hpp> | ||
|
||
RPYBUILD_PYBIND11_MODULE(m) { | ||
initWrapper(m); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env python3 | ||
|
||
from robotpy_build.setup import setup | ||
|
||
setup() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import os | ||
from os.path import abspath, dirname | ||
import sys | ||
import subprocess | ||
|
||
if __name__ == "__main__": | ||
root = abspath(dirname(__file__)) | ||
os.chdir(root) | ||
|
||
subprocess.check_call([sys.executable, "-m", "pytest"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import romi | ||
|
||
|
||
def test_romi(): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
*.py[cod] | ||
*.so | ||
*.dll | ||
*.egg-info | ||
|
||
/build | ||
|
||
/xrp/include | ||
/xrp/lib | ||
/xrp/_init_xrp.py | ||
/xrp/pkgcfg.py | ||
/xrp/version.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
robotpy-xrp | ||
============ | ||
|
||
RobotPy support for the WPILib XRP vendor library. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
|
||
classes: | ||
XRPGyro: | ||
methods: | ||
XRPGyro: | ||
GetAngle: | ||
GetRate: | ||
GetRateX: | ||
GetRateY: | ||
GetRateZ: | ||
GetAngleX: | ||
GetAngleY: | ||
GetAngleZ: | ||
Reset: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
|
||
classes: | ||
XRPMotor: | ||
methods: | ||
XRPMotor: | ||
Set: | ||
Get: | ||
SetInverted: | ||
GetInverted: | ||
Disable: | ||
StopMotor: | ||
GetDescription: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
|
||
classes: | ||
XRPOnBoardIO: | ||
attributes: | ||
kMessageInterval: | ||
m_nextMessageTime: | ||
methods: | ||
XRPOnBoardIO: | ||
GetUserButtonPressed: | ||
SetLed: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
|
||
classes: | ||
XRPRangefinder: | ||
methods: | ||
GetDistance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
|
||
classes: | ||
XRPReflectanceSensor: | ||
methods: | ||
GetLeftReflectanceValue: | ||
GetRightReflectanceValue: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
|
||
classes: | ||
XRPServo: | ||
methods: | ||
XRPServo: | ||
SetAngle: | ||
GetAngle: | ||
SetPosition: | ||
GetPosition: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
[tool.robotpy-build.metadata] | ||
name = "robotpy-xrp" | ||
description = "Binary wrapper for WPILib XRP Vendor library" | ||
author = "RobotPy Development Team" | ||
author_email = "robotpy@googlegroups.com" | ||
url = "https://github.com/robotpy/mostrobotpy" | ||
license = "BSD-3-Clause" | ||
install_requires = [ | ||
"wpilib==THIS_VERSION" | ||
] | ||
|
||
[build-system] | ||
requires = [ | ||
"robotpy-build<2025.0.0,~=2024.0.0", | ||
"wpilib~=2024.1.1" | ||
] | ||
|
||
[tool.robotpy-build] | ||
base_package = "xrp" | ||
|
||
[tool.robotpy-build.wrappers."xrp"] | ||
name = "xrp" | ||
sources = ["xrp/src/main.cpp"] | ||
generation_data = "gen" | ||
depends = [ | ||
"wpilib_core", "wpilibc_interfaces", "wpilibc", | ||
"wpimath_cpp", "wpimath_geometry", | ||
"wpiHal", "wpiutil", "ntcore", | ||
] | ||
|
||
[tool.robotpy-build.wrappers."xrp".autogen_headers] | ||
# frc/xrp | ||
XRPGyro = "frc/xrp/XRPGyro.h" | ||
XRPMotor = "frc/xrp/XRPMotor.h" | ||
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 = "2024.1.1" | ||
libs = ["xrpVendordep"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env python3 | ||
|
||
from robotpy_build.setup import setup | ||
|
||
setup() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import os | ||
from os.path import abspath, dirname | ||
import sys | ||
import subprocess | ||
|
||
if __name__ == "__main__": | ||
root = abspath(dirname(__file__)) | ||
os.chdir(root) | ||
|
||
subprocess.check_call([sys.executable, "-m", "pytest"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import xrp | ||
|
||
|
||
def test_xrp(): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from . import _init_xrp | ||
|
||
# autogenerated by 'robotpy-build create-imports xrp' | ||
from ._xrp import ( | ||
XRPGyro, | ||
XRPMotor, | ||
XRPOnBoardIO, | ||
XRPRangefinder, | ||
XRPReflectanceSensor, | ||
XRPServo, | ||
) | ||
|
||
__all__ = [ | ||
"XRPGyro", | ||
"XRPMotor", | ||
"XRPOnBoardIO", | ||
"XRPRangefinder", | ||
"XRPReflectanceSensor", | ||
"XRPServo", | ||
] | ||
|
||
del _init_xrp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
#include <rpygen_wrapper.hpp> | ||
|
||
RPYBUILD_PYBIND11_MODULE(m) { | ||
initWrapper(m); | ||
} |