import struct


def generate_v2v_bsm(latitude: float, longitude: float, elevation: float, speed: float, heading: float) -> bytes:
    """Create a BSM bytearray reporting vehicle position and motion data

    :param latitude: latitude of the vehicle position in degrees
    :type latitude: float
    :param longitude: longitude of the vehicle position in degrees
    :type longitude: float
    :param elevation: elevation of the vehicle in meters
    :type elevation: float
    :param speed: the speed of the vehicle in meters per second
    :type speed: float
    :param heading: the direction of travel measured in degrees
    :type heading: float

    :return: a BSM reporting vehicle position and motion
    :rtype: bytes
    """
    return struct.pack("!fffff", latitude, longitude, elevation, speed, heading)