Added missing function

This commit is contained in:
Guillermo 2021-07-29 11:40:25 +02:00 committed by bernat
parent 18494b799d
commit 8a877315a9
1 changed files with 13 additions and 0 deletions

View File

@ -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