def _get_3d_annotation(self, label, sample_id, sensor_name):
        """Convert KITTI annotation data frame to 3D bounding box annotations.
        Labels are provided in the reference frame of camera_2.
        NOTE: Annotations are returned in the reference of the requested sensor
        """
        height, width, length = label[8:11]
        x, y, z = label[11:14]
        rotation = label[14]

        # We modify the KITTI annotation axes to our convention  of x-length, y-width, z-height.
        # Additionally, KITTI3D refers to the center of the bottom face of the cuboid, and our convention
        # refers to the center of the 3d cuboid which is offset by height/2. To get a bounding box
        # back in KITTI coordinates, i.e. for evaluation, see `self.convert_to_kitti`.
        box_pose = Pose(
            wxyz=Quaternion(axis=[1, 0, 0], radians=np.pi / 2) * Quaternion(axis=[0, 0, 1], radians=-rotation),
            tvec=np.float64([x, y - height / 2, z])
        )

        if sensor_name != "camera_2":  # "camera_3" or "velodyne"
            _, pose_0S = self.calibration_table[(sample_id, sensor_name)]
            _, pose_02 = self.calibration_table[(sample_id, "camera_2")]
            box_pose = pose_0S * pose_02.inverse() * box_pose

        box3d = GenericBoxes3D(box_pose.quat.elements, box_pose.tvec, [width, length, height])
        vec = box3d.vectorize().tolist()[0]
        distance = float(np.linalg.norm(vec[4:7]))

        return OrderedDict([('bbox3d', vec), ('distance', distance)])
Convert KITTI annotation data frame to 3D bounding box annotations.
        Labels are provided in the reference frame of camera_2.
        NOTE: Annotations are returned in the reference of the requested sensor
        
tridet/data/datasets/kitti_3d/build.py