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

[Feature] Blueprint-based spawn_actor function for CarlaDataProvider #1071

Merged
merged 6 commits into from
Apr 30, 2024

Conversation

Daraan
Copy link
Contributor

@Daraan Daraan commented Apr 12, 2024

Description

Currently when one wants to spawn an Actor from a blueprint this is only possibly via the World object.
There is no addition to the hidden CarlaDataProvider._carla_actor_pool and CarlaDataProvider.register_actor must be called manually.

This PR adds an analogue version, which always adds the actor to the pool for cleanup and if not specified otherwise calls register_actor on Vehicles and Walkers.

def spawn_actor(bp, spawn_point, must_spawn=False, track_physics=None, attach_to=None, attachment_type=carla.AttachmentType.Rigid)

Where has this been tested?

  • Platform(s): Ubuntu 22.04
  • Python version(s): Python 3.10
  • Unreal Engine version(s): ...
  • CARLA version: ...

Possible Drawbacks

Possible Changes

Possibly favor a second .try_spawn_actor instead of must_spawn=False.


This change is Reviewable

@Daraan Daraan marked this pull request as ready for review April 19, 2024 22:14
Copy link
Contributor

@glopezdiest glopezdiest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @Daraan)

@glopezdiest
Copy link
Contributor

Everything looks good for this PR. A simple yet useful new way to spawn actors that doesn't break anything. Approved

@glopezdiest glopezdiest merged commit a6a9a31 into carla-simulator:master Apr 30, 2024
1 of 4 checks passed
@Daraan Daraan deleted the spawn_actor-analogue branch April 30, 2024 11:53
@Daraan Daraan restored the spawn_actor-analogue branch April 30, 2024 15:57
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.

2 participants