Skip to content

Commit

Permalink
Merge pull request #56 from jvavrek/add-python-tests
Browse files Browse the repository at this point in the history
WIP: add basic python test
  • Loading branch information
jianboqi authored Mar 17, 2024
2 parents 449c7ba + b1bce4b commit 5527b59
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions python/tests/csf_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# basic CSF python tests

import CSF
import numpy as np


def test_csf_from_numpy():
"""Test CSF+numpy with a flat ground plane."""
x = np.random.uniform(-100, 100, size=10_000)
y = np.random.uniform(-100, 100, size=10_000)
z = np.random.uniform(-0.1, -0.1, size=10_000)

csf = CSF.CSF()
csf.setPointCloud(np.c_[x, y, z])

ground, non_ground = CSF.VecInt(), CSF.VecInt()

csf.do_filtering(ground, non_ground)
assert len(ground) > 0
assert len(non_ground) == 0

0 comments on commit 5527b59

Please sign in to comment.