Exemplo n.º 1
0
    def __init__(self,
                 CP,
                 steer_ratio,
                 stiffness_factor,
                 angle_offset,
                 P_initial=None):
        self.kf = CarKalman(GENERATED_DIR, steer_ratio, stiffness_factor,
                            angle_offset, P_initial)

        self.kf.filter.set_global("mass", CP.mass)
        self.kf.filter.set_global("rotational_inertia", CP.rotationalInertia)
        self.kf.filter.set_global("center_to_front", CP.centerToFront)
        self.kf.filter.set_global("center_to_rear",
                                  CP.wheelbase - CP.centerToFront)
        self.kf.filter.set_global("stiffness_front", CP.tireStiffnessFront)
        self.kf.filter.set_global("stiffness_rear", CP.tireStiffnessRear)

        self.active = False

        self.speed = 0.0
        self.roll = 0.0
        self.steering_pressed = False
        self.steering_angle = 0.0

        self.valid = True
Exemplo n.º 2
0
    def __init__(self, CP, steer_ratio, stiffness_factor, angle_offset):
        self.kf = CarKalman(GENERATED_DIR, steer_ratio, stiffness_factor,
                            angle_offset)

        self.kf.filter.set_mass(CP.mass)  # pylint: disable=no-member
        self.kf.filter.set_rotational_inertia(CP.rotationalInertia)  # pylint: disable=no-member
        self.kf.filter.set_center_to_front(CP.centerToFront)  # pylint: disable=no-member
        self.kf.filter.set_center_to_rear(CP.wheelbase - CP.centerToFront)  # pylint: disable=no-member
        self.kf.filter.set_stiffness_front(CP.tireStiffnessFront)  # pylint: disable=no-member
        self.kf.filter.set_stiffness_rear(CP.tireStiffnessRear)  # pylint: disable=no-member

        self.active = False

        self.speed = 0
        self.steering_pressed = False
        self.steering_angle = 0
        self.carstate_counter = 0