Utility functions

pyardrone.utils.repack_to_int(value)[source]

Converts the passed in float value to interger as ieee754 specification.

Same as *(int*)&value in C, or reinterpret_cast<int>value in C++.

pyardrone.utils.bits(*args)[source]
>>> bits(7)
128
>>> bits(1, 3, 5) == 0b101010
True
pyardrone.utils.noop(obj)[source]

Returns the passed in argument.

>>> noop(10)
10
>>> noop(list)
<class 'list'>
pyardrone.utils.every(secs)[source]

Generator that yields for every secs seconds.

Example:

>>> for _ in every(0.1):
...     print('Hello')

You get Hello output every 0.1 seconds.

pyardrone.utils.get_free_udp_port()[source]

Get a free UDP port.

Note this is vlunerable to race conditions.