def get_measurements_imu(idx, ego_motion, noise_imu):
    """Generate test data from the IMU.

    Parameters
    ----------
    idx : int
        index of the current car position (interpolated ego motion waypoints)

    ego_motion : EgoMotion
        ego motion object

    noise_imu :  MeasurementNoiseImu
        camera / image processing measurement noise object

    Returns
    -------
    ground_truth_velocity : (2,) ndarray
        true velocity

    ground_truth_angular_velocity : float
        true angular velocity

    measurements_velocity : (2,) ndarray
        noisy velocity measurements

    measurements_angular_velocity : float
        noisy angular velocity measurements

    """
    ground_truth_velocity = ego_motion.get_velocity(idx)
    ground_truth_angular_velocity = ego_motion.get_angular_velocity(idx)
    measurements_velocity = \
        ground_truth_velocity + noise_imu.sample_velocity()
    measurements_angular_velocity = \
        ground_truth_angular_velocity + noise_imu.sample_angular_velocity()

    return (
        ground_truth_velocity,
        ground_truth_angular_velocity,
        measurements_velocity,
        measurements_angular_velocity,
        )