paparazzi / pprzlink

Message and communication library for the Paparazzi UAV system
Other
24 stars 55 forks source link

String conversion problem fix #58

Closed kevindehecker closed 6 years ago

kevindehecker commented 6 years ago

There is a in the size, e.g. 1281, which could not be directly converted to an int

flixr commented 6 years ago

I think a more generic solution would be something like

def eval_int(expr):
    import ast
    return int(eval(compile(ast.parse(expr, mode='eval'), '<string>', 'eval')))

and then using this: offset += eval_int(f.length)

kevindehecker commented 6 years ago

Yes, it is. Done