Skip to content

fix: GridPoseSampler crashes on empty freespace block - #62

Open
andrewwhitecdw wants to merge 1 commit into
NVlabs:mainfrom
andrewwhitecdw:bugfix/pose-samplers-b4b371b0
Open

fix: GridPoseSampler crashes on empty freespace block#62
andrewwhitecdw wants to merge 1 commit into
NVlabs:mainfrom
andrewwhitecdw:bugfix/pose-samplers-b4b371b0

Conversation

@andrewwhitecdw

Copy link
Copy Markdown

This PR addresses the following issue in exts/omni.ext.mobility_gen/omni/ext/mobility_gen/pose_samplers.py: GridPoseSampler crashes on empty freespace block.

Changes

  • exts/omni.ext.mobility_gen/omni/ext/mobility_gen/pose_samplers.py: GridPoseSampler crashes on empty freespace block.

Details

Before:

        coords = np.argwhere(net_mask)
        random_index = np.random.randint(0, len(coords))
        pixel = coords[random_index]

After:

        coords = np.argwhere(net_mask)
        if len(coords) == 0:
            raise ValueError("Selected grid block contains no freespace pixels")
        random_index = np.random.randint(0, len(coords))
        pixel = coords[random_index]

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