Added missing function
This commit is contained in:
parent
18494b799d
commit
8a877315a9
|
@ -406,3 +406,16 @@ class BehaviorAgent(BasicAgent):
|
|||
control = self._local_planner.run_step(debug=debug)
|
||||
|
||||
return control
|
||||
|
||||
def emergency_stop(self):
|
||||
"""
|
||||
Overwrites the throttle a brake values of a control to perform an emergency stop.
|
||||
The steering is kept the same to avoid going out of the lane when stopping during turns
|
||||
|
||||
:param speed (carl.VehicleControl): control to be modified
|
||||
"""
|
||||
control = carla.VehicleControl()
|
||||
control.throttle = 0.0
|
||||
control.brake = self._max_brake
|
||||
control.hand_brake = False
|
||||
return control
|
Loading…
Reference in New Issue