Exposed Python agents' offset
This commit is contained in:
parent
f66fd8e7c7
commit
f507d837f0
|
@ -229,6 +229,10 @@ class BasicAgent(object):
|
|||
"""(De)activates the checks for stop signs"""
|
||||
self._ignore_vehicles = active
|
||||
|
||||
def set_offset(self, offset):
|
||||
"""Sets an offset for the vehicle"""
|
||||
self._local_planner.set_offset(offset)
|
||||
|
||||
def lane_change(self, direction, same_lane_time=0, other_lane_time=0, lane_change_time=2):
|
||||
"""
|
||||
Changes the path so that the vehicle performs a lane change.
|
||||
|
|
|
@ -100,6 +100,10 @@ class VehiclePIDController():
|
|||
"""Changes the parameters of the PIDLateralController"""
|
||||
self._lat_controller.change_parameters(**args_lateral)
|
||||
|
||||
def set_offset(self, offset):
|
||||
"""Changes the offset"""
|
||||
self._lat_controller.set_offset(offset)
|
||||
|
||||
|
||||
class PIDLongitudinalController():
|
||||
"""
|
||||
|
@ -204,6 +208,10 @@ class PIDLateralController():
|
|||
"""
|
||||
return self._pid_control(waypoint, self._vehicle.get_transform())
|
||||
|
||||
def set_offset(self, offset):
|
||||
"""Changes the offset"""
|
||||
self._offset = offset
|
||||
|
||||
def _pid_control(self, waypoint, vehicle_transform):
|
||||
"""
|
||||
Estimate the steering angle of the vehicle based on the PID equations
|
||||
|
|
|
@ -216,6 +216,10 @@ class LocalPlanner(object):
|
|||
|
||||
self._stop_waypoint_creation = stop_waypoint_creation
|
||||
|
||||
def set_offset(self, offset):
|
||||
"""Sets an offset for the vehicle"""
|
||||
self._vehicle_controller.set_offset(offset)
|
||||
|
||||
def run_step(self, debug=False):
|
||||
"""
|
||||
Execute one step of local planning which involves running the longitudinal and lateral PID controllers to
|
||||
|
|
Loading…
Reference in New Issue