Skip to content

Commit

Permalink
Whitespace and other E,W fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Daraan committed Oct 28, 2024
1 parent 9dc569b commit d27b890
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions srunner/scenariomanager/carla_data_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ def update_light_states(ego_light, annotations, states, freeze=False, timeout=10
"""
Update traffic light states
"""
reset_params = [] # type: list[dict]
reset_params = [] # type: list[dict]

for state in states:
relevant_lights = []
Expand Down Expand Up @@ -720,31 +720,31 @@ def spawn_actor(
"""
The method will spawn and return an actor.
The actor will need an available blueprint to be created.
It can also be attached to a parent with a certain attachment type.
It can also be attached to a parent with a certain attachment type.
Args:
bp (carla.ActorBlueprint): The blueprint of the actor to spawn.
spawn_point (carla.Transform): The spawn point of the actor.
must_spawn (bool, optional):
must_spawn (bool, optional):
If True, the actor will be spawned or an exception will be raised.
If False, the function returns None if the actor could not be spawned.
Defaults to False.
track_physics (bool | None, optional):
If True, `get_location`, `get_transform` and `get_velocity`
track_physics (bool | None, optional):
If True, `get_location`, `get_transform` and `get_velocity`
can be used for this actor.
If None, the actor will be tracked if it is a Vehicle or Walker.
Defaults to None.
attach_to (carla.Actor | None, optional):
The parent object that the spawned actor will follow around.
attach_to (carla.Actor | None, optional):
The parent object that the spawned actor will follow around.
Defaults to None.
attachment_type (carla.AttachmentType, optional):
Determines how fixed and rigorous should be the changes in position
attachment_type (carla.AttachmentType, optional):
Determines how fixed and rigorous should be the changes in position
according to its parent object.
Defaults to carla.AttachmentType.Rigid.
Returns:
carla.Actor | None: The spawned actor if successful, None otherwise.
Raises:
RuntimeError: if `must_spawn` is True and the actor could not be spawned.
"""
Expand Down Expand Up @@ -1013,7 +1013,7 @@ def remove_actor_by_id(actor_id):
"""
if actor_id in CarlaDataProvider._carla_actor_pool:
CarlaDataProvider._carla_actor_pool[actor_id].destroy()
CarlaDataProvider._carla_actor_pool[actor_id] = None # type: ignore
CarlaDataProvider._carla_actor_pool[actor_id] = None # type: ignore
CarlaDataProvider._carla_actor_pool.pop(actor_id)
else:
print("Trying to remove a non-existing actor id {}".format(actor_id))
Expand Down Expand Up @@ -1104,4 +1104,3 @@ def cleanup():
@property
def world(self):
return self._world

0 comments on commit d27b890

Please sign in to comment.