yostlabs 2025.1.9__py3-none-any.whl → 2025.1.10__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,7 +6,7 @@ class ThreespaceInputStream:
6
6
  Reads specified number of bytes.
7
7
  If that many bytes are not available after timeout, less data will be returned
8
8
  """
9
- def read(self, num_bytes) -> bytes:
9
+ def read(self, num_bytes: int) -> bytes:
10
10
  raise NotImplementedError()
11
11
 
12
12
  def read_all(self):
@@ -16,16 +16,16 @@ class ThreespaceInputStream:
16
16
  raise NotImplementedError()
17
17
 
18
18
  """Allows reading without removing the data from the buffer"""
19
- def peek(self, num_bytes) -> bytes:
19
+ def peek(self, num_bytes: int) -> bytes:
20
20
  raise NotImplementedError()
21
21
 
22
- def peek_until(self, expected: bytes, max_length=None) -> bytes:
22
+ def peek_until(self, expected: bytes, max_length: int = None) -> bytes:
23
23
  raise NotImplementedError()
24
24
 
25
25
  def readline(self) -> bytes:
26
26
  return self.read_until(b"\n")
27
27
 
28
- def peekline(self, max_length=None) -> bytes:
28
+ def peekline(self, max_length: int = None) -> bytes:
29
29
  return self.peek_until(b"\n", max_length=max_length)
30
30
 
31
31
  @property
@@ -6,7 +6,7 @@ import serial.tools.list_ports
6
6
  class ThreespaceSerialComClass(ThreespaceComClass):
7
7
 
8
8
  PID_V3_MASK = 0x3000
9
- PID_BOOTLOADER = 0x1000 #We should really change this to 0x3000
9
+ PID_BOOTLOADER = 0x1000
10
10
 
11
11
  VID = 0x2476
12
12
 
@@ -26,10 +26,10 @@ class ThreespaceSerialComClass(ThreespaceComClass):
26
26
  self.peek_buffer = bytearray()
27
27
  self.peek_length = 0
28
28
 
29
- def write(self, bytes):
29
+ def write(self, bytes: bytes):
30
30
  self.ser.write(bytes)
31
31
 
32
- def read(self, num_bytes):
32
+ def read(self, num_bytes: int):
33
33
  if self.peek_length >= num_bytes:
34
34
  result = self.peek_buffer[:num_bytes]
35
35
  self.peek_length -= num_bytes
@@ -40,7 +40,7 @@ class ThreespaceSerialComClass(ThreespaceComClass):
40
40
  self.peek_length = 0
41
41
  return result
42
42
 
43
- def peek(self, num_bytes):
43
+ def peek(self, num_bytes: int):
44
44
  if self.peek_length >= num_bytes:
45
45
  return self.peek_buffer[:num_bytes]
46
46
  else:
@@ -61,7 +61,7 @@ class ThreespaceSerialComClass(ThreespaceComClass):
61
61
  self.peek_length = 0
62
62
  return result
63
63
 
64
- def peek_until(self, expected: bytes, max_length=None) -> bytes:
64
+ def peek_until(self, expected: bytes, max_length: int = None) -> bytes:
65
65
  if expected in self.peek_buffer:
66
66
  length = self.peek_buffer.index(expected) + len(expected)
67
67
  if max_length is not None and length > max_length:
@@ -127,7 +127,7 @@ class ThreespaceSerialComClass(ThreespaceComClass):
127
127
  yield port
128
128
 
129
129
  @staticmethod
130
- def auto_detect(default_timeout=2, default_baudrate=115200) -> Generator["ThreespaceSerialComClass", None, None]:
130
+ def auto_detect(default_timeout: float = 2, default_baudrate: int = 115200) -> Generator["ThreespaceSerialComClass", None, None]:
131
131
  """
132
132
  Returns a list of com classes of the same type called on nearby.
133
133
  These ports will start unopened. This allows the caller to get a list of ports without having to connect.
@@ -0,0 +1,48 @@
1
+ Metadata-Version: 2.4
2
+ Name: yostlabs
3
+ Version: 2025.1.10
4
+ Summary: Python resources and API for 3Space sensors from Yost Labs Inc.
5
+ Project-URL: Homepage, https://yostlabs.com/
6
+ Author-email: "Yost Labs Inc." <techsupport@yostlabs.com>, Andy Riedlinger <techsupport@yostlabs.com>
7
+ License-File: LICENSE
8
+ Keywords: 3space,threespace,yost
9
+ Classifier: Development Status :: 4 - Beta
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Programming Language :: Python :: 3
13
+ Requires-Python: >=3.10
14
+ Requires-Dist: numpy
15
+ Requires-Dist: pyserial
16
+ Description-Content-Type: text/markdown
17
+
18
+ <center><h4>API and Resources for Yost Labs 3.0 Threespace sensors.</h4></center>
19
+
20
+ ## Installation
21
+
22
+ `python -m pip install yostlabs`
23
+
24
+ ## Basic Usage
25
+
26
+ ```Python
27
+ from yostlabs.tss3.api import ThreespaceSensor
28
+
29
+ #Will auto detect a 3-Space sensor connected to the machine via a USB connection
30
+ sensor = ThreespaceSensor()
31
+
32
+ result = sensor.getPrimaryCorrectedAccelVec()
33
+ print(result)
34
+
35
+ sensor.cleanup()
36
+ ```
37
+
38
+ Click [here](https://github.com/YostLabs/3SpacePythonPackage/tree/main/Examples) for more examples.
39
+
40
+ ## Communication
41
+
42
+ The ThreespaceSensor class utilizes a ThreespaceComClass to define the hardware communication interface between the device utlizing this API and the Threespace Sensor. Currently only the ThreespaceSerialComClass is available for use with the API. New ComClasses for different interfaces will be added to the [communication package](https://github.com/YostLabs/3SpacePythonPackage/tree/main/src/yostlabs/communication) in the future.
43
+
44
+ To create your own ThreespaceComClass, take a look at the necessary interface definitions [here](https://github.com/YostLabs/3SpacePythonPackage/blob/main/src/yostlabs/communication/base.py) and the Serial implementation [here](https://github.com/YostLabs/3SpacePythonPackage/blob/main/src/yostlabs/communication/serial.py).
45
+
46
+ ## Documentation
47
+
48
+ WIP. Please review the example scripts. For further assistance contact techsupport@yostlabs.com.
@@ -1,7 +1,7 @@
1
1
  yostlabs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  yostlabs/communication/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- yostlabs/communication/base.py,sha256=oKTcXJtJv4-NLS52Rs29ZXt-nwvo9W_hhamzH_PNF40,2783
4
- yostlabs/communication/serial.py,sha256=oLXGUf3Os7Hxv2o1ORo8_8KIKLMfksSL4Lge_JDZZbE,5514
3
+ yostlabs/communication/base.py,sha256=i82t4Kq3B8CpPqGNpGc737rXFul4dTkutXt5N5OYuQg,2807
4
+ yostlabs/communication/serial.py,sha256=cOv3CxloQo7sCjdAEUzkfZuZieqy-JbsW2Zwavc9LT8,5514
5
5
  yostlabs/math/__init__.py,sha256=JFzsPQ4AbsX1AH1brBpn1c_Pa_ItF43__D3mlPvA2a4,34
6
6
  yostlabs/math/quaternion.py,sha256=YyvbSrTPXGS8BsQJCn2tjdzIZ9WeDzfUe7dIDKeWsAM,4989
7
7
  yostlabs/math/vector.py,sha256=CPtIxJXelCidGxTBrz6vZwLv-qXlccpAlYODaKJnWNw,991
@@ -14,7 +14,7 @@ yostlabs/tss3/utils/calibration.py,sha256=42jCEzfTXoHuPZ4e-30N1ijOhkz9ld4PQnhX6A
14
14
  yostlabs/tss3/utils/parser.py,sha256=thM5s70CZvehM5qP3AGVgHs6woeQM-wmA7hIcRO3MlY,11332
15
15
  yostlabs/tss3/utils/streaming.py,sha256=218U29LmsLel42kd6g63Hi9XnovRqFVMofO0GEOAAA0,18990
16
16
  yostlabs/tss3/utils/version.py,sha256=NT2H9l-oIRCYhV_yjf5UjkadoJQ0IN4eLl8y__pyTPc,3001
17
- yostlabs-2025.1.9.dist-info/METADATA,sha256=6j6eTivS7ZDZJ6tJUMZUM6lidm0_1j4sgk7F4e-9Ung,645
18
- yostlabs-2025.1.9.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
19
- yostlabs-2025.1.9.dist-info/licenses/LICENSE,sha256=PtF8EXRlVhm1_ve52_3GHixSPwMn0tGajFxF3xKS-j0,1090
20
- yostlabs-2025.1.9.dist-info/RECORD,,
17
+ yostlabs-2025.1.10.dist-info/METADATA,sha256=blS23q-7CZUlk_sCM-zMibCyYpv-qfBAb--3er14geY,2025
18
+ yostlabs-2025.1.10.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
19
+ yostlabs-2025.1.10.dist-info/licenses/LICENSE,sha256=PtF8EXRlVhm1_ve52_3GHixSPwMn0tGajFxF3xKS-j0,1090
20
+ yostlabs-2025.1.10.dist-info/RECORD,,
@@ -1,18 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: yostlabs
3
- Version: 2025.1.9
4
- Summary: Python resources and API for 3Space sensors from Yost Labs Inc.
5
- Project-URL: Homepage, https://yostlabs.com/
6
- Author-email: "Yost Labs Inc." <techsupport@yostlabs.com>, Andy Riedlinger <techsupport@yostlabs.com>
7
- License-File: LICENSE
8
- Keywords: 3space,threespace,yost
9
- Classifier: Development Status :: 4 - Beta
10
- Classifier: License :: OSI Approved :: MIT License
11
- Classifier: Operating System :: OS Independent
12
- Classifier: Programming Language :: Python :: 3
13
- Requires-Python: >=3.10
14
- Requires-Dist: numpy
15
- Requires-Dist: pyserial
16
- Description-Content-Type: text/markdown
17
-
18
- Work In Progress