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

Pedestrians with WalkerAIController causes crash #21

Open
Qi-Zha0 opened this issue Aug 6, 2023 · 2 comments
Open

Pedestrians with WalkerAIController causes crash #21

Qi-Zha0 opened this issue Aug 6, 2023 · 2 comments

Comments

@Qi-Zha0
Copy link

Qi-Zha0 commented Aug 6, 2023

If there are pedestrians spawned with AI controllers, this line will return a bounding box with x and y being -Inf for the AI controllers and causes an cannot convert float NaN to integer error. Seems like it's because the segregated pedestrian actors group contain a mix of carla.libcarla.WalkerAIController and carla.libcarla.Walker.

@Morphlng
Copy link

This can be solved by changing the following to check their type_id:

def pedestrians_mask(self, pedestrians: List[carla.Actor]) -> Mask:
canvas = self.make_empty_mask()
for ped in pedestrians:
if not hasattr(ped, "bounding_box"):
continue

I.e.:

if "controller" in ped.type_id:
    continue

This problem is probably due to the change of carla's api. I think a more robust way is to filter out pedestrians with more accurate blueprints.

@Qi-Zha0
Copy link
Author

Qi-Zha0 commented Sep 3, 2023

That solves the problem. I also tried checking for NaN values, which works too. Thank you!

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

No branches or pull requests

2 participants