Skip to content

Commit

Permalink
Renamed breaking_distance for more semantics
Browse files Browse the repository at this point in the history
  • Loading branch information
Daraan committed Mar 5, 2024
1 parent 8610bb0 commit e4a60d3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion PythonAPI/carla/agents/conf/agent_settings_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ class BehaviorAgentDistanceSettings(BasicAgentDistanceSettings):
min_proximity_threshold : float = 10
"""Range in which cars are detected. NOTE: Speed limit overwrites"""

braking_distance : float = 5
emergency_braking_distance : float = 5
"""Emergency Stop Distance Trigger"""


Expand Down
6 changes: 3 additions & 3 deletions PythonAPI/carla/agents/conf/behavior_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Cautious(SimpleBehaviorAgentSettings):
speed_decrease = 12
safety_time = 3
min_proximity_threshold = 12
braking_distance = 6
emergency_braking_distance = 6
avoid_tailgators = True

@dataclass
Expand All @@ -25,7 +25,7 @@ class Normal(SimpleBehaviorAgentSettings):
speed_decrease = 10
safety_time = 3
min_proximity_threshold = 10
braking_distance = 5
emergency_braking_distance = 5
avoid_tailgators = True

@dataclass
Expand All @@ -36,5 +36,5 @@ class Aggressive(SimpleBehaviorAgentSettings):
speed_decrease = 8
safety_time = 3
min_proximity_threshold = 8
braking_distance = 4
emergency_braking_distance = 4
avoid_tailgators = False
4 changes: 2 additions & 2 deletions PythonAPI/carla/agents/navigation/behavior_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def run_step(self, debug=False):
self._vehicle.bounding_box.extent.y, self._vehicle.bounding_box.extent.x)

# Emergency brake if the car is very close.
if distance < self.config.distance.braking_distance:
if distance < self.config.distance.emergency_braking_distance:
return self.emergency_stop()

# 2.2: Car following behaviors
Expand All @@ -298,7 +298,7 @@ def run_step(self, debug=False):
self._vehicle.bounding_box.extent.y, self._vehicle.bounding_box.extent.x)

# Emergency brake if the car is very close.
if distance < self.config.distance.braking_distance:
if distance < self.config.distance.emergency_braking_distance:
return self.emergency_stop()
else:
control = self.car_following_manager(vehicle, distance)
Expand Down

0 comments on commit e4a60d3

Please sign in to comment.