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

spawn_point for CarlaDataProvider.request_new_actor should be optional when using random_location. #1113

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion srunner/scenariomanager/carla_data_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -759,12 +759,16 @@ def spawn_actor(bp, spawn_point, must_spawn=False, track_physics=None, attach_to
return actor

@staticmethod
def request_new_actor(model, spawn_point, rolename='scenario', autopilot=False,
def request_new_actor(model, spawn_point=None, rolename='scenario', autopilot=False,
random_location=False, color=None, actor_category="car",
attribute_filter=None, tick=True):
"""
This method tries to create a new actor, returning it if successful (None otherwise).
"""
if not spawn_point and not random_location:
raise ValueError("Either spawn_point or random_location must be set")
elif spawn_point and random_location:
print("INFO: request_new_actor : Both spawn_point and random_location are set. Omitting spawn_point.")
blueprint = CarlaDataProvider.create_blueprint(model, rolename, color, actor_category, attribute_filter)

if random_location:
Expand Down
Loading