import torch


def convert_polar2xyt(poses):
    """
    poses - (bs, 3) torch Tensor of (r, phi, theta) poses
    converts to (x, y, theta)
    """
    r, phi, theta = poses[:, 0], poses[:, 1], poses[:, 2]
    x = r * torch.cos(phi)
    y = r * torch.sin(phi)
    poses_xyz = torch.stack([x, y, theta], dim=1)
    return poses_xyz