Skip to content

Commit

Permalink
Update to latest API
Browse files Browse the repository at this point in the history
  • Loading branch information
virtuald committed Feb 26, 2020
1 parent d9482be commit d19c4b3
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 91 deletions.
3 changes: 3 additions & 0 deletions gen/AHRS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,9 @@ classes:
of the X, Y and X-axis accelerometers.
:returns: accelerometer full scale range in G.
Calibrate:
doc: |
Does nothing
AHRS::BoardYawAxis:
shared_ptr: true
attributes:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ base_package = "navx"
artifact_id = "navx-cpp"
group_id = "com.kauailabs.navx.frc"
repo_url = "https://repo1.maven.org/maven2"
version = "3.1.403"
version = "3.1.409"
use_sources = true
sources = [
"AHRS.cpp",
Expand Down
52 changes: 0 additions & 52 deletions tests/conftest.py

This file was deleted.

1 change: 1 addition & 0 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytest
13 changes: 13 additions & 0 deletions tests/run_tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/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", "py.test"])
17 changes: 0 additions & 17 deletions tests/run_tests.sh

This file was deleted.

24 changes: 3 additions & 21 deletions tests/test_navx.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,5 @@
from navx._impl import AHRSProtocol
import navx


def test_decoding():

data = [0] * 4

AHRSProtocol.encodeBinaryUint16(42, data, 0)
assert AHRSProtocol.decodeBinaryUint16(data, 0) == 42

AHRSProtocol.encodeBinaryUint16(40000, data, 0)
assert AHRSProtocol.decodeBinaryUint16(data, 0) == 40000

AHRSProtocol.encodeBinaryInt16(-42, data, 0)
assert AHRSProtocol.decodeBinaryInt16(data, 0) == -42

AHRSProtocol.encodeBinaryInt16(42, data, 0)
assert AHRSProtocol.decodeBinaryInt16(data, 0) == 42

AHRSProtocol.encodeProtocolSignedThousandthsFloat(32.0, data, 0)
assert (
abs(AHRSProtocol.decodeProtocolSignedThousandthsFloat(data, 0) - 32.0) < 0.001
)
def test_navx():
pass

0 comments on commit d19c4b3

Please sign in to comment.