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
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Copyright Cepton Technologies 2020-2021. All rights reserved.
Copyright Cepton Technologies 2020-2025. All rights reserved.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# Cepton Python SDK3 wrapper
# Cepton Python SDK3
2 changes: 1 addition & 1 deletion cepton_sdk3/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from .sdk import *
from .frame import Frame
from .frame import Frame
2 changes: 1 addition & 1 deletion cepton_sdk3/c.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
262 changes: 0 additions & 262 deletions cepton_sdk3/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
20 changes: 11 additions & 9 deletions cepton_sdk3/soa.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import numpy


class StructureOfArrays:
"""
Group multiple arrays together and allow operations on all arrays
Expand Down Expand Up @@ -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."""
Expand All @@ -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)
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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

23 changes: 21 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
[build-system]
requires = ["setuptools>=40.8.0", "wheel"]
build-backend = "setuptools.build_meta"
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"]
6 changes: 0 additions & 6 deletions setup.cfg

This file was deleted.

Loading