Skip to content

Commit f6bb133

Browse files
committed
No unnecessary inheritance from object and empty class brackets & other
Removed empty variables formatting
1 parent 0664c4d commit f6bb133

File tree

6 files changed

+18
-16
lines changed

6 files changed

+18
-16
lines changed

PythonAPI/carla/agents/navigation/basic_agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from agents.tools.hints import ObstacleDetectionResult, TrafficLightDetectionResult
2121

2222

23-
class BasicAgent(object):
23+
class BasicAgent:
2424
"""
2525
BasicAgent implements an agent that navigates the scene.
2626
This agent respects traffic lights and other vehicles, but ignores stop signs.

PythonAPI/carla/agents/navigation/behavior_agent.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
waypoints and avoiding other vehicles. The agent also responds to traffic lights,
99
traffic signs, and has different possible configurations. """
1010

11-
import random
1211
import numpy as np
1312
import carla
1413
from agents.navigation.basic_agent import BasicAgent

PythonAPI/carla/agents/navigation/behavior_types.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
""" This module contains the different parameters sets for each behavior. """
55

66

7-
class Cautious(object):
7+
class Cautious:
88
"""Class for Cautious agent."""
99
max_speed = 40
1010
speed_lim_dist = 6
@@ -15,7 +15,7 @@ class Cautious(object):
1515
tailgate_counter = 0
1616

1717

18-
class Normal(object):
18+
class Normal:
1919
"""Class for Normal agent."""
2020
max_speed = 50
2121
speed_lim_dist = 3
@@ -26,7 +26,7 @@ class Normal(object):
2626
tailgate_counter = 0
2727

2828

29-
class Aggressive(object):
29+
class Aggressive:
3030
"""Class for Aggressive agent."""
3131
max_speed = 70
3232
speed_lim_dist = 1

PythonAPI/carla/agents/navigation/controller.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from agents.tools.misc import get_speed
1313

1414

15-
class VehiclePIDController():
15+
class VehiclePIDController:
1616
"""
1717
VehiclePIDController is the combination of two PID controllers
1818
(lateral and longitudinal) to perform the
@@ -105,7 +105,7 @@ def set_offset(self, offset):
105105
self._lat_controller.set_offset(offset)
106106

107107

108-
class PIDLongitudinalController():
108+
class PIDLongitudinalController:
109109
"""
110110
PIDLongitudinalController implements longitudinal control using a PID.
111111
"""
@@ -171,7 +171,7 @@ def change_parameters(self, K_P, K_I, K_D, dt):
171171
self._dt = dt
172172

173173

174-
class PIDLateralController():
174+
class PIDLateralController:
175175
"""
176176
PIDLateralController implements lateral control using a PID.
177177
"""

PythonAPI/carla/agents/navigation/global_route_planner.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,14 @@
2727
else:
2828
from typing_extensions import TypedDict, NotRequired
2929

30-
TopologyDict = TypedDict('TopologyDict', {'entry': carla.Waypoint,
31-
'exit': carla.Waypoint,
32-
'entryxyz': tuple[float, float, float],
33-
'exitxyz': tuple[float, float, float],
34-
'path': list[carla.Waypoint]})
30+
TopologyDict = TypedDict('TopologyDict',
31+
{
32+
'entry': carla.Waypoint,
33+
'exit': carla.Waypoint,
34+
'entryxyz': tuple[float, float, float],
35+
'exitxyz': tuple[float, float, float],
36+
'path': list[carla.Waypoint]
37+
})
3538

3639
EdgeDict = TypedDict('EdgeDict',
3740
{
@@ -47,7 +50,7 @@
4750
'change_waypoint': NotRequired[carla.Waypoint]
4851
})
4952

50-
class GlobalRoutePlanner(object):
53+
class GlobalRoutePlanner:
5154
"""
5255
This class provides a very high level route plan.
5356
"""

PythonAPI/carla/agents/navigation/local_planner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class RoadOption(IntEnum):
2828
CHANGELANERIGHT = 6
2929

3030

31-
class LocalPlanner(object):
31+
class LocalPlanner:
3232
"""
3333
LocalPlanner implements the basic behavior of following a
3434
trajectory of waypoints that is generated on-the-fly.
@@ -287,7 +287,7 @@ def get_incoming_waypoint_and_direction(self, steps=3):
287287
try:
288288
wpt, direction = self._waypoints_queue[-1]
289289
return wpt, direction
290-
except IndexError as i:
290+
except IndexError:
291291
return None, RoadOption.VOID
292292

293293
def get_plan(self):

0 commit comments

Comments
 (0)