Skip to content

Commit ee73d15

Browse files
committed
Tested in sim. Substitute values instead of creating new variable in the function.
1 parent 22d57b2 commit ee73d15

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

elevation_mapping_cupy/script/custom_kernels.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,11 @@ def map_utils(resolution, width, height, sensor_noise_factor, min_valid_distance
1414
return max(min(x, max_x), min_x);
1515
}
1616
__device__ int get_x_idx(float16 x, float16 center) {
17-
const float resolution = ${resolution};
18-
const float width = ${width};
19-
int i = (x - center) / resolution + 0.5 * width;
17+
int i = (x - center) / ${resolution} + 0.5 * ${width};
2018
return i;
2119
}
2220
__device__ int get_y_idx(float16 y, float16 center) {
23-
const float resolution = ${resolution};
24-
const float height = ${height};
25-
int i = (y - center) / resolution + 0.5 * height;
21+
int i = (y - center) / ${resolution} + 0.5 * ${height};
2622
return i;
2723
}
2824
__device__ bool is_inside(int idx) {

0 commit comments

Comments
 (0)