Support variable-size input to scan_update()

This commit is contained in:
simondlevy
2018-07-04 15:26:45 -04:00
parent b4567062ad
commit 0fe7b2243d
6 changed files with 11 additions and 7 deletions

View File

@@ -434,6 +434,7 @@ scan_update(
scan_t * scan,
float * lidar_angles_deg,
int * lidar_distances_mm,
int scan_size,
double hole_width_mm,
double velocities_dxy_mm,
double velocities_dtheta_degrees)

View File

@@ -135,6 +135,7 @@ scan_update(
scan_t * scan,
float * lidar_angles_deg,
int * lidar_distances_mm,
int scan_size,
double hole_width_mm,
double velocities_dxy_mm,
double velocities_dtheta_degrees);

View File

@@ -82,6 +82,7 @@ Scan::update(
this->scan,
NULL, // no support for angles/interpolation yet
scanvals_mm,
this->scan->size,// no support for angles/interpolation yet
hole_width_millimeters,
poseChange.dxy_mm,
poseChange.dtheta_degrees);

View File

@@ -127,7 +127,7 @@ JNIEXPORT void JNICALL Java_edu_wlu_cs_levy_breezyslam_components_Scan_update (J
jint * lidar_mm_c = (*env)->GetIntArrayElements(env, lidar_mm, 0);
// no support for angles/interpolation yet
scan_update(scan, NULL, lidar_mm_c, hole_width_mm, velocities_dxy_mm, velocities_dtheta_degrees);
scan_update(scan, NULL, lidar_mm_c, scan->size, hole_width_mm, velocities_dxy_mm, velocities_dtheta_degrees);
(*env)->ReleaseIntArrayElements(env, lidar_mm, lidar_mm_c, 0);
}

View File

@@ -192,7 +192,7 @@ static void _scan_update(const mxArray * prhs[])
double * velocities = mxGetPr(prhs[4]);
/* no support for angles/interpolation yet */
scan_update(scan, NULL, lidar_mm, hole_width_mm, velocities[0], velocities[1]);
scan_update(scan, NULL, lidar_mm, scan->size, hole_width_mm, velocities[0], velocities[1]);
}
static void _randomizer_init(mxArray *plhs[], const mxArray * prhs[])

View File

@@ -349,6 +349,7 @@ Scan_update(Scan *self, PyObject *args, PyObject *kwds)
&self->scan,
NULL,
self->lidar_distances_mm,
PyList_Size(py_lidar),
hole_width_mm,
dxy_mm,
dtheta_degrees);