eris/script/ferdian.py
def clean_line(line, names):
    """
    Cleans a single line of recorded joint positions

    @param line: the line described in a list to process
    @param names: joint name keys
    """
    #convert the line of strings to a float or None
    line = [try_float(x) for x in line.rstrip().split(',')]
    #zip the values with the joint names
    combined = zip(names[1:], line[1:])
    #take out any tuples that have a none value
    cleaned = [x for x in combined if x[1] is not None]
    #convert it to a dictionary with only valid commands
    command = dict(cleaned)
    left_command = dict((key, command[key]) for key in command.keys()
                        if key[:-2] == 'left_')
    right_command = dict((key, command[key]) for key in command.keys()
                         if key[:-2] == 'right_')
    return (command, left_command, right_command, line)

    Cleans a single line of recorded joint positions

    @param line: the line described in a list to process
    @param names: joint name keys
    
Cleans a single line of recorded joint positions
Cleans a single line of recorded joint positions
def clean_line(line, names):
    line = [try_float(x) for x in line.rstrip().split(',')]
    combined = zip(names[1:], line[1:])
    cleaned = [x for x in combined if x[1] is not None]
    command = dict(cleaned)
    left_command = dict((key, command[key]) for key in command.keys()
                        if key[:-2] == 'left_')
    right_command = dict((key, command[key]) for key in command.keys()
                         if key[:-2] == 'right_')
    return (command, left_command, right_command, line)
def clean_line ( line , names ) : line = [ try_float ( x ) for x in line . rstrip ( ) . split ( ',' ) ] combined = zip ( names [ 1 : ] , line [ 1 : ] ) cleaned = [ x for x in combined if x [ 1 ] is not None ] command = dict ( cleaned ) left_command = dict ( ( key , command [ key ] ) for key in command . keys ( ) if key [ : - 2 ] == 'left_' ) right_command = dict ( ( key , command [ key ] ) for key in command . keys ( ) if key [ : - 2 ] == 'right_' ) return ( command , left_command , right_command , line )
Cleans a single line of recorded joint positions
Cleans a single line of recorded joint positions
"""
    Cleans a single line of recorded joint positions

    @param line: the line described in a list to process
    @param names: joint name keys
    """ #convert the line of strings to a float or None #zip the values with the joint names #take out any tuples that have a none value #convert it to a dictionary with only valid commands
line
the line described in a list to process
the line described in a list to process
names
joint name keys
joint name keys