diff --git a/LICENSE b/LICENSE index 9b7a889..2006542 100644 --- a/LICENSE +++ b/LICENSE @@ -1 +1 @@ -Copyright Cepton Technologies 2020-2021. All rights reserved. +Copyright Cepton Technologies 2020-2025. All rights reserved. diff --git a/README.md b/README.md index 9595bae..ef3d2cc 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -# Cepton Python SDK3 wrapper +# Cepton Python SDK3 \ No newline at end of file diff --git a/cepton_sdk3/__init__.py b/cepton_sdk3/__init__.py index 4e0062e..c7996a7 100644 --- a/cepton_sdk3/__init__.py +++ b/cepton_sdk3/__init__.py @@ -1,2 +1,2 @@ from .sdk import * -from .frame import Frame \ No newline at end of file +from .frame import Frame diff --git a/cepton_sdk3/c.py b/cepton_sdk3/c.py index 1d3cbdc..6e22da3 100644 --- a/cepton_sdk3/c.py +++ b/cepton_sdk3/c.py @@ -32,7 +32,7 @@ def c_struct_to_dict(c_obj, excludes): def _load_sdk(): - name = "cepton_sdk2" # FIXME: the SDK build still calls this sdk2 + name = "cepton_sdk3" # Find platform mach = platform.machine() diff --git a/cepton_sdk3/frame.py b/cepton_sdk3/frame.py index 1807860..3a82a51 100644 --- a/cepton_sdk3/frame.py +++ b/cepton_sdk3/frame.py @@ -2,268 +2,6 @@ from .soa import StructureOfArrays -reflectivity_LUT = np.array( - [ # reflectivity look up table - 0.000, - 0.010, - 0.020, - 0.030, - 0.040, - 0.050, - 0.060, - 0.070, - 0.080, - 0.090, - 0.100, - 0.110, - 0.120, - 0.130, - 0.140, - 0.150, - 0.160, - 0.170, - 0.180, - 0.190, - 0.200, - 0.210, - 0.220, - 0.230, - 0.240, - 0.250, - 0.260, - 0.270, - 0.280, - 0.290, - 0.300, - 0.310, - 0.320, - 0.330, - 0.340, - 0.350, - 0.360, - 0.370, - 0.380, - 0.390, - 0.400, - 0.410, - 0.420, - 0.430, - 0.440, - 0.450, - 0.460, - 0.470, - 0.480, - 0.490, - 0.500, - 0.510, - 0.520, - 0.530, - 0.540, - 0.550, - 0.560, - 0.570, - 0.580, - 0.590, - 0.600, - 0.610, - 0.620, - 0.630, - 0.640, - 0.650, - 0.660, - 0.670, - 0.680, - 0.690, - 0.700, - 0.710, - 0.720, - 0.730, - 0.740, - 0.750, - 0.760, - 0.770, - 0.780, - 0.790, - 0.800, - 0.810, - 0.820, - 0.830, - 0.840, - 0.850, - 0.860, - 0.870, - 0.880, - 0.890, - 0.900, - 0.910, - 0.920, - 0.930, - 0.940, - 0.950, - 0.960, - 0.970, - 0.980, - 0.990, - 1.000, - 1.010, - 1.020, - 1.030, - 1.040, - 1.050, - 1.060, - 1.070, - 1.080, - 1.090, - 1.100, - 1.110, - 1.120, - 1.130, - 1.140, - 1.150, - 1.160, - 1.170, - 1.180, - 1.190, - 1.200, - 1.210, - 1.220, - 1.230, - 1.240, - 1.250, - 1.260, - 1.270, - 1.307, - 1.345, - 1.384, - 1.424, - 1.466, - 1.509, - 1.553, - 1.598, - 1.644, - 1.692, - 1.741, - 1.792, - 1.844, - 1.898, - 1.953, - 2.010, - 2.069, - 2.129, - 2.191, - 2.254, - 2.320, - 2.388, - 2.457, - 2.529, - 2.602, - 2.678, - 2.756, - 2.836, - 2.919, - 3.004, - 3.091, - 3.181, - 3.274, - 3.369, - 3.467, - 3.568, - 3.672, - 3.779, - 3.889, - 4.002, - 4.119, - 4.239, - 4.362, - 4.489, - 4.620, - 4.754, - 4.892, - 5.035, - 5.181, - 5.332, - 5.488, - 5.647, - 5.812, - 5.981, - 6.155, - 6.334, - 6.519, - 6.708, - 6.904, - 7.105, - 7.311, - 7.524, - 7.743, - 7.969, - 8.201, - 8.439, - 8.685, - 8.938, - 9.198, - 9.466, - 9.741, - 10.025, - 10.317, - 10.617, - 10.926, - 11.244, - 11.572, - 11.909, - 12.255, - 12.612, - 12.979, - 13.357, - 13.746, - 14.146, - 14.558, - 14.982, - 15.418, - 15.866, - 16.328, - 16.804, - 17.293, - 17.796, - 18.314, - 18.848, - 19.396, - 19.961, - 20.542, - 21.140, - 21.755, - 22.389, - 23.040, - 23.711, - 24.401, - 25.112, - 25.843, - 26.595, - 27.369, - 28.166, - 28.986, - 29.830, - 30.698, - 31.592, - 32.511, - 33.458, - 34.432, - 35.434, - 36.466, - 37.527, - 38.620, - 39.744, - 40.901, - 42.092, - 43.317, - 44.578, - 45.876, - 47.211, - 48.586, - 50.000, - ], - dtype=np.float32, -) - # SDK position units -> meters conversion UNITS_TO_METERS = 1.0 / 65536.0 diff --git a/cepton_sdk3/lib/linux-arm64/libcepton_sdk2.so b/cepton_sdk3/lib/linux-arm64/libcepton_sdk3.so similarity index 56% rename from cepton_sdk3/lib/linux-arm64/libcepton_sdk2.so rename to cepton_sdk3/lib/linux-arm64/libcepton_sdk3.so index a9b20fa..0bc4afc 100755 Binary files a/cepton_sdk3/lib/linux-arm64/libcepton_sdk2.so and b/cepton_sdk3/lib/linux-arm64/libcepton_sdk3.so differ diff --git a/cepton_sdk3/lib/linux-x64/libcepton_sdk2.so b/cepton_sdk3/lib/linux-x64/libcepton_sdk3.so similarity index 54% rename from cepton_sdk3/lib/linux-x64/libcepton_sdk2.so rename to cepton_sdk3/lib/linux-x64/libcepton_sdk3.so index 620465e..b09c1af 100755 Binary files a/cepton_sdk3/lib/linux-x64/libcepton_sdk2.so and b/cepton_sdk3/lib/linux-x64/libcepton_sdk3.so differ diff --git a/cepton_sdk3/lib/win-x64/cepton_sdk2.dll b/cepton_sdk3/lib/win-x64/cepton_sdk3.dll similarity index 56% rename from cepton_sdk3/lib/win-x64/cepton_sdk2.dll rename to cepton_sdk3/lib/win-x64/cepton_sdk3.dll index 2fd83f5..49499e3 100644 Binary files a/cepton_sdk3/lib/win-x64/cepton_sdk2.dll and b/cepton_sdk3/lib/win-x64/cepton_sdk3.dll differ diff --git a/cepton_sdk3/lib/win-x64/cepton_sdk2.dll.lib b/cepton_sdk3/lib/win-x64/cepton_sdk3.dll.lib similarity index 50% rename from cepton_sdk3/lib/win-x64/cepton_sdk2.dll.lib rename to cepton_sdk3/lib/win-x64/cepton_sdk3.dll.lib index 7d46bf5..913ecad 100644 Binary files a/cepton_sdk3/lib/win-x64/cepton_sdk2.dll.lib and b/cepton_sdk3/lib/win-x64/cepton_sdk3.dll.lib differ diff --git a/cepton_sdk3/soa.py b/cepton_sdk3/soa.py index 5bd7861..0979e26 100644 --- a/cepton_sdk3/soa.py +++ b/cepton_sdk3/soa.py @@ -1,5 +1,6 @@ import numpy + class StructureOfArrays: """ Group multiple arrays together and allow operations on all arrays @@ -47,14 +48,16 @@ def __setattr__(self, name, value): if name not in self._get_array_member_names(): # Check member raise AttributeError( - "Member `" + name + "` not listed in `_get_array_member_names`!") + "Member `" + name + "` not listed in `_get_array_member_names`!" + ) return super().__setattr__(name, value) @classmethod def get_common_names(cls, other): """Returns array member names common to both classes.""" - return list(set(cls._get_array_member_names()) & - set(other._get_array_member_names())) + return list( + set(cls._get_array_member_names()) & set(other._get_array_member_names()) + ) def update(self, other, names=None): """Copy fields from other.""" @@ -77,7 +80,7 @@ def _get_indices(self, key): def __getitem__(self, key): """Supports numpy style indexing as if object were 1-d array.""" - assert (not isinstance(key, tuple)), "Key must be 1-d." + assert not isinstance(key, tuple), "Key must be 1-d." cls = type(self) result = cls(numpy.arange(len(self))[key].size) @@ -88,7 +91,7 @@ def __getitem__(self, key): def __setitem__(self, key, other): """Supports numpy style assignment as if object were 1-d array.""" - assert (not isinstance(key, tuple)), "Key must be 1-d." + assert not isinstance(key, tuple), "Key must be 1-d." names = self.get_common_names(other) for name in names: @@ -99,8 +102,8 @@ def assign(self, key, other, other_key): Equivalent to self[key] = other[other_key] """ - assert (not isinstance(key, tuple)), "Key must be 1-d." - assert (not isinstance(other_key, tuple)), "Key must be 1-d." + assert not isinstance(key, tuple), "Key must be 1-d." + assert not isinstance(other_key, tuple), "Key must be 1-d." names = self.get_common_names(other) for name in names: @@ -120,7 +123,6 @@ def combine(cls, other_list): offset = 0 for i in range(len(other_list)): other = other_list[i] - self[offset:offset + len(other)] = other + self[offset : offset + len(other)] = other offset += len(other) return self - diff --git a/pyproject.toml b/pyproject.toml index 73a7fd1..bd1b981 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,22 @@ [build-system] -requires = ["setuptools>=40.8.0", "wheel"] -build-backend = "setuptools.build_meta" \ No newline at end of file +requires = ["hatchling >= 1.26"] +build-backend = "hatchling.build" + + +[project] +name = "cepton-sdk3" +version = "3.0.17.14" + +dependencies = ["numpy>=1.21"] +authors = [ + { name = "Will Lauer", email = "will.lauer@cepton.com" }, + { name = "Dongyi Liao", email = "dongyi.liao@cepton.com" }, +] + +maintainers = [{ name = "Will Lauer", email = "will.lauer@cepton.com" }] + +description = "Cepton SDK3" +readme = "README.md" + +license = "MIT" +license-files = ["LICENSE"] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index e05cbcb..0000000 --- a/setup.cfg +++ /dev/null @@ -1,6 +0,0 @@ -[metadata] -# This includes the license file(s) in the wheel. -# https://wheel.readthedocs.io/en/stable/user_guide.html#including-license-files-in-the-generated-wheel-file -license_files = LICENSE -long_description = file: README.md -long_description_content_type = text/markdown \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 0d2dca9..0000000 --- a/setup.py +++ /dev/null @@ -1,20 +0,0 @@ -import setuptools - -setuptools.setup( - name="cepton_sdk3", - version="3.0.0.0", - description="Cepton SDK3 Python3 bindings", - url="https://www.cepton.com", - author="Cepton Technologies, Inc.", - author_email="dongyi.liao@cepton.com", - license="MIT", - classifiers=[ - "Programming Language :: Python :: 3", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - ], - include_package_data=True, - packages=["cepton_sdk3"], - install_requires=["numpy"], - zip_safe=True, -) diff --git a/tests/test_basic.py b/tests/test_basic.py index 6b57aef..0cd877b 100644 --- a/tests/test_basic.py +++ b/tests/test_basic.py @@ -24,6 +24,7 @@ def test_replay(self): frame = sdk.frame_fifo_get_frame(2000) frame_counts.append(frame.positions.shape[0]) + self.assertGreater(len(frame_counts), 0) self.assertTrue(all(count > 0 for count in frame_counts)) sdk.deinitialize()