Skip to content

Commit 315c318

Browse files
committed
Complete argument annotation for carla classes
1 parent 27d8409 commit 315c318

File tree

3 files changed

+88
-91
lines changed

3 files changed

+88
-91
lines changed

PythonAPI/carla/source/carla/__carla_rss.pyi

+17-20
Original file line numberDiff line numberDiff line change
@@ -65,47 +65,45 @@ class RssActorConstellationResult:
6565
@property
6666
def rss_calculation_mode(self) -> ad.rss.map.RssMode:
6767
"""The calculation mode to be applied with the actor."""
68-
...
68+
6969
@rss_calculation_mode.setter
7070
def rss_calculation_mode(self, value: ad.rss.map.RssMode) -> None:
7171
"""Setter for rss_calculation_mode property."""
72-
...
72+
7373

7474
@property
7575
def restrict_speed_limit_mode(self) -> ad.rss.map.RssSceneCreation.RestrictSpeedLimitMode:
7676
"""The mode for restricting speed limit."""
77-
...
77+
7878
@restrict_speed_limit_mode.setter
7979
def restrict_speed_limit_mode(self, value: ad.rss.map.RssSceneCreation.RestrictSpeedLimitMode) -> None:
8080
"""Setter for restrict_speed_limit_mode property."""
81-
...
81+
8282

8383
@property
84-
def ego_vehicle_dynamics(self) -> ad.rss.world.RssDynamics:
85-
"""The RSS dynamics to be applied for the ego vehicle."""
86-
...
84+
def ego_vehicle_dynamics(self) -> ad.rss.world.RssDynamics: ...
85+
8786
@ego_vehicle_dynamics.setter
8887
def ego_vehicle_dynamics(self, value: ad.rss.world.RssDynamics) -> None:
8988
"""Setter for ego_vehicle_dynamics property."""
90-
...
9189

9290
@property
9391
def actor_object_type(self) -> ad.rss.world.ObjectType:
9492
"""The RSS object type to be used for the actor."""
95-
...
93+
9694
@actor_object_type.setter
9795
def actor_object_type(self, value: ad.rss.world.ObjectType) -> None:
9896
"""Setter for actor_object_type property."""
99-
...
97+
10098

10199
@property
102100
def actor_dynamics(self) -> ad.rss.world.RssDynamics:
103101
"""The RSS dynamics to be applied for the actor."""
104-
...
102+
105103
@actor_dynamics.setter
106104
def actor_dynamics(self, value: ad.rss.world.RssDynamics) -> None:
107105
"""Setter for actor_dynamics property."""
108-
...
106+
109107
# endregion
110108

111109
# region Dunder Methods
@@ -265,12 +263,11 @@ class RssRestrictor:
265263
266264
Returns:
267265
VehicleControl: The restricted vehicle control.
268-
269266
"""
270267
# endregion
271268

272269
# region Setters
273-
def set_log_level(self, log_level: RssLogLevel):
270+
def set_log_level(self, log_level: RssLogLevel) -> None:
274271
"""Sets the log level."""
275272
# endregion
276273

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

334331
# region Methods
335-
def append_routing_target(self, routing_target: Transform):
332+
def append_routing_target(self, routing_target: Transform) -> None:
336333
"""
337334
Appends a new target position to the current route of the vehicle.
338335
339336
Args:
340337
routing_target (Transform): New target point for the route. Choose these after the intersections to force the route to take the desired turn.
341338
"""
342339

343-
def drop_route(self):
340+
def drop_route(self) -> None:
344341
"""
345342
Discards the current route.
346343
347344
If there are targets remaining in `routing_targets`, creates a new route using those.
348345
Otherwise, a new route is created at random.
349346
"""
350347

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

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

364-
def set_log_level(self, log_level: RssLogLevel | int):
361+
def set_log_level(self, log_level: RssLogLevel | int) -> None:
365362
"""Sets the log level."""
366-
def set_map_log_level(self, log_level: RssLogLevel | int):
363+
def set_map_log_level(self, log_level: RssLogLevel | int) -> None:
367364
"""Sets the map log level."""
368365
# endregion
369366

PythonAPI/carla/source/carla/command.pyi

+1-1
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ class SetAutopilot(_IsCommand):
383383
# endregion
384384

385385
# region Methods
386-
def __init__(self, actor: Actor | int, enabled: bool, port=8000) -> None:
386+
def __init__(self, actor: Actor | int, enabled: bool, port: int = 8000) -> None:
387387
"""Turns on/off the vehicle's autopilot mode.
388388
389389
Args:

0 commit comments

Comments
 (0)