Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix data shape for MaxHeightImage construction #56

Open
wants to merge 1 commit into
base: dev/noetic
Choose a base branch
from

Conversation

nickswalker
Copy link

I'm seeing crashes when doing anything with funmap in simulation:

[ERROR] [1641864272.638119, 711.336000]: Error processing request: Failed in nopython mode pipeline (step: nopython frontend)
No implementation of function Function(<built-in function round>) found for signature:

>>> round(array(float64, 1d, C))

There are 2 candidate implementations:
   - Of which 2 did not match due to:
   Type Restricted Function in function 'round': File: unknown: Line unknown.
     With argument(s): '(array(float64, 1d, C))':
    No match for registered cases:
     * (float32,) -> int64
     * (float64,) -> int64
     * (float32, int64) -> float32
     * (float64, int64) -> float64
During: resolving callee type: Function(<built-in function round>)
During: typing of call at /home/nick/workspaces/hello_ws/src/stretch_ros/stretch_funmap/src/stretch_funmap/numba_height_image.py (385)
File "../stretch_funmap/src/stretch_funmap/numba_height_image.py", line 385:
def numba_max_height_and_rgb_images_int(points_to_image_mat, rgb_points,
   <source elided>
       if (x > min_x) and (x < max_x) and (y > min_y) and (y < max_y) and (z > min_z) and (z < max_z):
           x_index = int(round(x / m_per_pix))
           ^

ros_numpy will set the shape of the points buffer from a PCL message to the image dimensions (W,H), but this causes the underlying numba implementation to blow up when it tries to iterate over the points as though they were in a flat array:

This patch ensures that a flat view of the data is passed through.

I'm not sure what would let others avoid this issue in the past. Maybe the real camera doesn't set the size fields on the message? It does not appear that this extra shape information is used by the rest of the code so the iteration would be the only place where differences would become apparent.

ros_numpy will set the shape of the points buffer from a PCL message to the image dimensions (W,H), but this causes the underlying numba implementation to blow up when it tries to iterate over the points as though they were in a flat array. This change ensures that a flat view of the data is passed through. It does not appear that this extra shape information is used for anything anyway
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant