From e62c308cf6acbe2bc41220700fa1d5cff1105e3a Mon Sep 17 00:00:00 2001 From: simondlevy Date: Wed, 4 Jul 2018 15:01:33 -0400 Subject: [PATCH] Cast lidar distances as int during extraction from Python --- python/pybreezyslam.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/python/pybreezyslam.c b/python/pybreezyslam.c index 6860fe4..95b0424 100644 --- a/python/pybreezyslam.c +++ b/python/pybreezyslam.c @@ -304,9 +304,6 @@ Scan_update(Scan *self, PyObject *args, PyObject *kwds) return null_on_raise_argument_exception_with_details("Scan", "update", "number of scan angles must equal number of scan distances"); } - - printf("Interpolate!\n"); - Py_RETURN_NONE; } // No scan angles provided; lidar-list size must match scan size @@ -339,10 +336,9 @@ Scan_update(Scan *self, PyObject *args, PyObject *kwds) } // Extract LIDAR values from argument - int k = 0; - for (k=0; kscan.size; ++k) + for (int k=0; kscan.size; ++k) { - self->lidar_mm[k] = PyFloat_AsDouble(PyList_GetItem(py_lidar, k)); + self->lidar_mm[k] = (int)PyFloat_AsDouble(PyList_GetItem(py_lidar, k)); } // Update the scan @@ -354,7 +350,8 @@ Scan_update(Scan *self, PyObject *args, PyObject *kwds) dtheta_degrees); Py_RETURN_NONE; -} + +} // Scan_update static PyMethodDef Scan_methods[] =