import collections


def getDictFromAngles(angles):
    """
        Converts angles of a JointState() to a dictionary
        :param angles (sensor_msgs.msg.JointState): angles to be converted
        :return (dict): dictionary with angles 
    """
    
    d=dict(zip(angles.name,angles.position))
    return collections.OrderedDict(sorted( d.items() ))