Esempio n. 1
0
    def __init__(
        self,
        vehicle,
        dt=0.03,
        break_prop=0.1,
        coeff=PIDCoefficients(K_P=1.0, K_I=0.0, K_D=0.0),
    ):
        """Constructor method.

        Parameters
        ==========
        vehicle : carla.Vehicle
            Actor to apply to local planner logic onto
        dt : float
            Time differential in seconds
        coeff : PIDCoefficients
            Throttle/break PID coefficients.
        """
        self.__vehicle = vehicle
        self.__coeff = coeff
        self.__dt = dt
        self.__break_prop = break_prop
        self.__clip = util.Clip(low=-1, high=1)
        self.__error_buffer = collections.deque(maxlen=8_000)
        self.__stats = util.AttrDict(pe=0., ie=0., de=0.)
        self.__should_hotfix_mpc = False
Esempio n. 2
0
    def __init__(self,
                 vehicle,
                 max_steering=1.0,
                 K_P=1.0,
                 K_I=0.0,
                 K_D=0.0,
                 dt=0.03):
        """Constructor method.

        Parameters
        ==========
        vehicle : carla.Vehicle
            Actor to apply to local planner logic onto
        max_steering : float
            The maximum steering angle in radians. For CARLA version 0.9 the Audi A2
            can steer a maximum of 57.5 degrees, 1.00 radians (average of two wheels).
        K_P : float
            Proportional term
        K_I : float
            Integral term
        K_D : float
            Differential term
        dt : float
            Time differential in seconds
        """
        self.__vehicle = vehicle
        self.__max_steering = max_steering
        self.__k_p = K_P
        self.__k_i = K_I
        self.__k_d = K_D
        self.__dt = dt
        self.__clip = util.Clip(low=-1, high=1)
        self.__error_buffer = collections.deque(maxlen=8_000)
        self.__stats = util.AttrDict(pe=0., ie=0., de=0.)
Esempio n. 3
0
    def __init__(
        self,
        vehicle,
        max_steering=1.0,
        dt=0.03,
        coeff=PIDCoefficients(K_P=1.0, K_I=0.0, K_D=0.0),
    ):
        """Constructor method.

        Parameters
        ==========
        vehicle : carla.Vehicle
            Actor to apply to local planner logic onto
        max_steering : float
            The maximum steering angle in radians. For CARLA version 0.9 the Audi A2
            can steer a maximum of 57.5 degrees, 1.00 radians (average of two wheels).
        dt : float
            Time differential in seconds
        coeff : PIDCoefficients
            PID coefficients.
        """
        self.__vehicle = vehicle
        self.__max_steering = max_steering
        self.__coeff = coeff
        self.__dt = dt
        self.__clip = util.Clip(low=-1, high=1)
        self.__error_buffer = collections.deque(maxlen=8_000)
        self.__stats = util.AttrDict(pe=0., ie=0., de=0.)
        self.__should_hotfix_mpc = False
Esempio n. 4
0
    def __init__(self, vehicle, K_P=1.0, K_D=0.0, K_I=0.0, dt=0.03):
        """Constructor method.

        Parameters
        ==========
        vehicle : carla.Vehicle
            Actor to apply to local planner logic onto
        K_P : float
            Proportional term
        K_I : float
            Integral term
        K_D : float
            Differential term
        dt : float
            Time differential in seconds
        """
        self.__vehicle = vehicle
        self.__k_p = K_P
        self.__k_d = K_D
        self.__k_i = K_I
        self.__dt = dt
        self.__clip = util.Clip(low=-1, high=1)
        self.__error_buffer = collections.deque(maxlen=8_000)