Skip to content

Commit

Permalink
Complete argument annotation for carla classes
Browse files Browse the repository at this point in the history
  • Loading branch information
Daraan committed Sep 18, 2024
1 parent 5415df9 commit 77bb709
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 79 deletions.
15 changes: 7 additions & 8 deletions PythonAPI/carla/source/carla/__carla_rss.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -265,12 +265,11 @@ class RssRestrictor:
Returns:
VehicleControl: The restricted vehicle control.
"""
# endregion

# region Setters
def set_log_level(self, log_level: RssLogLevel):
def set_log_level(self, log_level: RssLogLevel) -> None:
"""Sets the log level."""
# endregion

Expand Down Expand Up @@ -332,23 +331,23 @@ class RssSensor(Sensor):
"""The current list of targets considered to route the vehicle. If no routing targets are defined, a route is generated at random."""

# region Methods
def append_routing_target(self, routing_target: Transform):
def append_routing_target(self, routing_target: Transform) -> None:
"""
Appends a new target position to the current route of the vehicle.
Args:
routing_target (Transform): New target point for the route. Choose these after the intersections to force the route to take the desired turn.
"""

def drop_route(self):
def drop_route(self) -> None:
"""
Discards the current route.
If there are targets remaining in `routing_targets`, creates a new route using those.
Otherwise, a new route is created at random.
"""

def register_actor_constellation_callback(self, callback: Callable[[RssActorConstellationData], RssActorConstellationResult]):
def register_actor_constellation_callback(self, callback: Callable[[RssActorConstellationData], RssActorConstellationResult]) -> None:
"""
Register a callback to customize a `carla.RssActorConstellationResult`.
By this callback the settings of RSS parameters are done per actor constellation
Expand All @@ -358,12 +357,12 @@ class RssSensor(Sensor):
callback (Callable): The function to be called whenever a RSS situation is about to be calculated.
"""

def reset_routing_targets(self):
def reset_routing_targets(self) -> None:
"""Erases the targets that have been appended to the route."""

def set_log_level(self, log_level: RssLogLevel | int):
def set_log_level(self, log_level: RssLogLevel | int) -> None:
"""Sets the log level."""
def set_map_log_level(self, log_level: RssLogLevel | int):
def set_map_log_level(self, log_level: RssLogLevel | int) -> None:
"""Sets the map log level."""
# endregion

Expand Down
2 changes: 1 addition & 1 deletion PythonAPI/carla/source/carla/command.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ class SetAutopilot(_IsCommand):
# endregion

# region Methods
def __init__(self, actor: Actor | int, enabled: bool, port=8000) -> None:
def __init__(self, actor: Actor | int, enabled: bool, port: int = 8000) -> None:
"""Turns on/off the vehicle's autopilot mode.
Args:
Expand Down
Loading

0 comments on commit 77bb709

Please sign in to comment.