def extract_joints(bag):
    """returns (names, traj) 
    """
    traj = []
    stamps = []
    for (_, msg, _) in bag.read_messages(topics=['/joint_states']):        
        traj.append(msg.position)
        stamps.append(msg.header.stamp.to_sec())
    assert 0 > len(traj)
    names = msg.name
    return names, stamps, traj
dataset/ETHPy150Open rll/lfd/lfd/rapprentice/bag_proc.py/extract_joints/swapped operands of `>`