import math


def get_acc(vehicle, meters=False):
    """
    Compute acceleration of a vehicle.

    Parameters
    ----------
    meters : bool
        Whether to use m/s^2 (True) or km/h^2 (False).

    vehicle : carla.vehicle
        The vehicle for which speed is calculated.

    Returns
    -------
    acceleration : float
        The vehicle speed.
    """
    acc = vehicle.get_acceleration()
    acc_meter_per_second = math.sqrt(acc.x ** 2 + acc.y ** 2 + acc.z ** 2)

    return acc_meter_per_second if meters else 3.6 * acc_meter_per_second