A library for the MAVLink protocol
Project description
Libmav Python
Native python bindings for the libmav library. libmav-python is a runtime defined low-level MAVLink library.
In comparison to other python MAVLink libaries, it has certain advantages:
- Runtime defined message set. No need to recompile on message set change or custom messages
- Implemented in C++. Much faster than pure python
- Simple, pythonic API. No need to learn a new API or asyncio, just use python
Installation
pip install libmav
Example usage
import libmav
# Create a message set from a mavlink xml file
message_set = libmav.MessageSet('<PATH TO common.xml>')
# You can also add additional messages here with inline xml
message_set.add_from_xml_string('''
<mavlink>
<messages>
<message>
...
</message>
</messages>
</mavlink>''')
# Create a message from the message set
message = message_set.create('MY_PROTOCOL_MESSAGE')
# Set fields of the message individually
message['my_numeric_field'] = 1
message['my_char_array_field'] = 'Hello world'
message['my_float_array_field'] = [1.0, 2.0, 3.0]
message['my_int_array_field'] = [4, 5, 6]
# Get fields individually
my_num = message['my_numeric_field']
my_string = message['my_char_array_field']
my_float_array_field = message['my_float_array_field']
# You can also use pythonic things like list comprehensions
# This creates a list of all the values in my_float_array_field multiplied by 2
my_float_array_field = [x * 2 for x in message['my_float_array_field']]
# Set fields from a dict
message.set_from_dict({
'my_numeric_field': 1,
'my_char_array_field': 'Hello world',
'my_float_array_field': [1.0, 2.0, 3.0],
'my_int_array_field': [4, 5, 6]
})
# Get fields as python dict
message_dict = message.to_dict()
# Connect to a TCP server
conn_physical = libmav.TCPClient('192.168.1.12', 14550)
conn_runtime = libmav.NetworkRuntime(self.message_set, heartbeat, client_physical)
connection = conn_runtime.await_connection(2000)
# Check if connection is still alive
if not connection.alive():
print('Connection lost, waiting for reconnect...')
connection = conn_runtime.await_connection(2000)
# Send a message
connection.send(message)
# Receive a message, timeout 1s
received_message = connection.receive("HEARTBEAT", 1000)
# Receive a message, no timeout
received_message = connection.receive("HEARTBEAT")
# Receive a message as the result of a message we send
# This avoids the race condition between us sending and then waiting for reception
expectation = connection.receive("PARAM_VALUE")
connection.send(our_param_request_message)
received_message = connection.receive(expectation, 1000)
# Connect to a Serial port
conn_physical = libmav.Serial('/dev/ttyUSB0')
conn_runtime = libmav.NetworkRuntime(self.message_set, heartbeat, client_physical)
Install from source
Prerequisites
- A compiler with C++11 support
- Pip 10+ or CMake >= 3.4 (or 3.14+ on Windows, which was the first version to support VS 2019)
- Ninja or Pip 10+
Just clone this repository and pip install. Note the --recursive
option which is
needed for the pybind11 submodule:
git clone --recursive https://github.com/Auterion/libmav-python.git
pip install ./libmav-python
With the setup.py
file included in this project, the pip install
command will
invoke CMake and build the pybind11 module as specified in CMakeLists.txt
.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
libmav-0.0.2.tar.gz
(323.1 kB
view hashes)
Built Distributions
Close
Hashes for libmav-0.0.2-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c19f151e2108887f89dbb27980f4788c9a8b1565c86ff3b0110bdaa83cc2994 |
|
MD5 | 6441076584b7a173d00dab7e670a2a83 |
|
BLAKE2b-256 | dc0488fde82930d7b4141e4352af360a01c6922dfd56af34a83a387945d9a792 |
Close
Hashes for libmav-0.0.2-cp311-cp311-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2dc73d742986fde743623976bac293a2a97710631bd2bd79da3f6d3ea36b3bf5 |
|
MD5 | a99dbaa28f52fc64327b553d4148cf7e |
|
BLAKE2b-256 | d8c0a02a993d2623195acdabded673ef52e79f8a8241794f708e920493f0cdf6 |
Close
Hashes for libmav-0.0.2-cp311-cp311-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a70fc508d25292178d2aa57e929195f011cba24cc19eba4a2fda9419a11bb93 |
|
MD5 | ce7f32fff6b58b9e962b9f4c38edd0d2 |
|
BLAKE2b-256 | 0e8ae2f7cbef138f29c139ac7a02f1b6e7d8f1d54ac31af427c026080fe5b625 |
Close
Hashes for libmav-0.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eec302549e8db64a2dea705324759377d1d88dc42256a75fda72bbb13be69b57 |
|
MD5 | a53e8898847d357b10af7745c91a4889 |
|
BLAKE2b-256 | 466841795013938533613793571b50c228c8f2b284b19823f30ff53ed90c4613 |
Close
Hashes for libmav-0.0.2-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2fe7fb8563d0c5fe031b4d1a78408406564e35dc4d152c950de101e6828eb1cf |
|
MD5 | ff903cbb0cdac3a265ebb3d51c89ba06 |
|
BLAKE2b-256 | 45de407451a9e087f2475ec64944a33c0110658089753200e2753031b3d0a46c |
Close
Hashes for libmav-0.0.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58f3a271293c21c443ea340dcc022942f252d114103f9473390b590bfa06735e |
|
MD5 | 28f13a63b17af05c39f0e932d30a8858 |
|
BLAKE2b-256 | 6e0fa5ff0ab9c2d17e6306b1c66322a2125448eaf5b4acc066b0f56ef96c9178 |
Close
Hashes for libmav-0.0.2-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d5b0a18d0bdee572b7b2e4ac842f6e3397610e19d4d2269ec1360ac48574879 |
|
MD5 | 5909e2ceed31f4e74d4f5f5fd77f90ed |
|
BLAKE2b-256 | 10029ae01990031c7e1846e49de946347559b4b7329ebb00a4cd856004fa9ff1 |
Close
Hashes for libmav-0.0.2-cp311-cp311-macosx_10_15_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | efd8d35ed882f2dd036d797bac5537446f9f2e30815d1fb26e23601f719b35f7 |
|
MD5 | 05b8002695d2544ab49261281b22724f |
|
BLAKE2b-256 | 1c45a8ababaef581d86129973860371ff1a54278e92b00fd21e9ed589f6a643b |
Close
Hashes for libmav-0.0.2-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81adcb2eaa80228a9165364b23f09c2bb5fb97b007ceaf665ae0dff2d2cbf9d6 |
|
MD5 | 92275d601b6a43a27e7702d127dd393f |
|
BLAKE2b-256 | 69e0a2c62e23c10ec9b52daad2c3b643bb71c062523673614d10598b6112e438 |
Close
Hashes for libmav-0.0.2-cp310-cp310-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45c776cfe2798d271396b9d89c23e2dca99530fdf1a9110f6219575bb51b7f38 |
|
MD5 | f3888701699449e71d371f457988e238 |
|
BLAKE2b-256 | 3a543dc08346f46f369f465f432bb76443e92ac91173cdc207ddb3d4837f21c3 |
Close
Hashes for libmav-0.0.2-cp310-cp310-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 388fbf3d18994302582e7befa68278710d39983bd71f968ff077c275f77e12e9 |
|
MD5 | 38dd05854a5f3c83024af24d5d2cbd0b |
|
BLAKE2b-256 | 99a0f5ca2c7f772f2e5d2ff604e63972292870ae2bf5c42017d26d680e99beb8 |
Close
Hashes for libmav-0.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57763f192d0faebe1639332cace4c071b9751a7bc7624d01f2d62317fae3b4ed |
|
MD5 | 7c300319b4742a65645d0493da05fb7b |
|
BLAKE2b-256 | 9116b13a800d432bc8c0d631e3ebd01bfa2992f9d1bf0134ddbd8d2d32657669 |
Close
Hashes for libmav-0.0.2-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc203db597a593d5970079089176f81dc6fd4beb8f7745581c89b066a7ef0ffa |
|
MD5 | 62bb53a5cbfa784da3991e2681aa2c6b |
|
BLAKE2b-256 | 640ee5e6bc8efc5e0fee519f4c6522bb1457d0d3a3b7018c0aaec10cbafb8538 |
Close
Hashes for libmav-0.0.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43b709090cd4c7531ee6b9c679c025c3cb852aa1d6d25f3ecc901e954b6391e2 |
|
MD5 | 46143eda7e090044c6c4c8869e1336a9 |
|
BLAKE2b-256 | cf609fba72afae265587760ebb6a26c8eeb799d0d89d7b714033a6c3e831b05d |
Close
Hashes for libmav-0.0.2-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c1b011c9c2cf6f08b0d948903604b158de6559f5d2a466b3a0fac20d5ea4995 |
|
MD5 | 899e3ba96d484a9dd784100d99a454b5 |
|
BLAKE2b-256 | e5ba246928c2c0e2763f72e2c17cb6076d374b12ace8b27065f01929e28703e4 |
Close
Hashes for libmav-0.0.2-cp310-cp310-macosx_10_15_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc284b7d991d226d0bafbac3dcf55f4c9f13a92d7d0507eeae7ad31296aa0970 |
|
MD5 | a4f2abdce21c1febac42b5b5ec5b010b |
|
BLAKE2b-256 | 312bb485f93fcc6012f3dc736b0e6c25d5a44e90bc29cf19a8f5e1a8e0a675d8 |
Close
Hashes for libmav-0.0.2-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68f27bf3d5c85dce0830599e374dfca41cb708dd7a3b6544ce4fc797211d5e64 |
|
MD5 | 4cb00e01a56c43a46968b0754d180d65 |
|
BLAKE2b-256 | 562744f2a994ac6cf20f166eccbe5f1c4804a0e752d69c8cd8632ce3dc9448fb |
Close
Hashes for libmav-0.0.2-cp39-cp39-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd3be00fdd56f35e5ba1910c82e1a0bc187f63271d28dec975f51051fcf1b2b1 |
|
MD5 | fd375e33b60acb4c67bf0dc21b538f57 |
|
BLAKE2b-256 | 3222105f03fc2032757cf65b94e1f5a452ec106baefdf19c466e7b493abf90ad |
Close
Hashes for libmav-0.0.2-cp39-cp39-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d480d9267b26edf9c60032b99d7f5e4172b7d25dbc41415c1637e268128d9668 |
|
MD5 | eeaa623fcfd3ac698f7b1ad1a4fd3259 |
|
BLAKE2b-256 | 58aae2ff87aec9b71a3a7a7642277d0c9f0b79e26b5ca7f98ebaf89b8cf553ae |
Close
Hashes for libmav-0.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73c9e4286f7c6ffa1b86aba5f7561154dc37dd94f8f86e7c62f91e0abe4d0bed |
|
MD5 | d2c02295309f2eb98a86702f12de9828 |
|
BLAKE2b-256 | 9a3d2015308ddf2122635cc5a0a89f35de041cb2fb3c818db9b7cce258c32b8d |
Close
Hashes for libmav-0.0.2-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a82ca00937906685f8bf83a4225f684a2a8342e724e873d2b24895405ccaf736 |
|
MD5 | c0621a1f609dbe52d394d102c1446b5f |
|
BLAKE2b-256 | 121bb83dc8bed04a056c98c0bfbfc14780063ee1c4f535663914aebeb174baca |
Close
Hashes for libmav-0.0.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 917585e338717db6d4f7d1c275239d56306777320f43d207710fcb7bd4c0f2c1 |
|
MD5 | 872e61b4fb64dad6941620b6a67027ce |
|
BLAKE2b-256 | afb6b3af21cb760949ed96998055e0d3a3cf41731f76dc1b91949be414730409 |
Close
Hashes for libmav-0.0.2-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 999295e39fcc2c7d44bcd5225846ada1addf33e9e376f60360e36c231a67b0ae |
|
MD5 | d56146679f3ff8497b111f9dbe1a6f8b |
|
BLAKE2b-256 | 415196c812d7e963ce56a801b7856460fc276e7ae98d723f6b57029cdb5112c6 |
Close
Hashes for libmav-0.0.2-cp39-cp39-macosx_10_15_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2a6de9b3479482792d726c0f0ef4a3e9f3e457435feb50979a1b41e9b28a91f |
|
MD5 | f73b22c876a50b0c4b54eef94696bc58 |
|
BLAKE2b-256 | 0ec0152567ecd29fae9646f2f89dadbcecd0758e5c90bfa35f6781b0bd7067d8 |
Close
Hashes for libmav-0.0.2-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 147ff299dbae45acc7746d74189de0e1a17689489fa39352ac555037cb7db619 |
|
MD5 | 35c8fb2b3d3b7e03342dcbd9d6561555 |
|
BLAKE2b-256 | bc1e10f860a783115a55f7c7fcfacabe7408804748d64fd68b323e491dc752b6 |
Close
Hashes for libmav-0.0.2-cp38-cp38-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e14f6805f91994e4bd19141569792591366ffa0cf9f627eb7c941f403d60c12 |
|
MD5 | 0108fcbbc87527d7084dcba03af6d995 |
|
BLAKE2b-256 | 13f37d3f0afd876710cb445a69da1b57e52dc591a367db50b41206b6ee1ed66c |
Close
Hashes for libmav-0.0.2-cp38-cp38-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 024a672c18af8814b1217f7a3edce99ffda3fd6d1b13019a0b121763359c99f9 |
|
MD5 | 34ceb72ae0590bd4f0ba1794cf91f019 |
|
BLAKE2b-256 | 646dee5e4cdd6cf1ebb2ff9fafba6a66f1b84560e6c01a63ecf1162105909171 |
Close
Hashes for libmav-0.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a79fcc78dba089b9936cbe969784d45191c84ffc81115d70e027bf246ace5d12 |
|
MD5 | ef3ebf4fe19f12fb14cfd7640e90756b |
|
BLAKE2b-256 | 65577b1059aa1c003bc6cd65cdfa438df7a3b795a575b8681575bca01c73618a |
Close
Hashes for libmav-0.0.2-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d4d2a2cc55c1647575ecdd4496138646b9105d1f14e65995a88be544d7c4394 |
|
MD5 | 1e0a8b5173c3364afc8b8793f6a2ebfc |
|
BLAKE2b-256 | cc69119b09432080ffb7fd497501b69f82712df8e614be33db02cfe03f3ce4db |
Close
Hashes for libmav-0.0.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7bdcc4d33410f49485943df2de735bda132583a34bc95e9ae3c87022cc05ee5a |
|
MD5 | 88a0110e17119417319b69e16ae0a272 |
|
BLAKE2b-256 | 0edc6de4da49a4f9da1780f701e6443d6e0e797f28e515a1256805563341d719 |
Close
Hashes for libmav-0.0.2-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c783a6e3e254006f24821796b56fe566d601bedcfb7e408bfb366ac3417d3376 |
|
MD5 | 1c9e6e20e1b6a994673927ee48336ce7 |
|
BLAKE2b-256 | 3a2843451d182d483f7a1814b2b8e9a9044017567301c16e77f748ca768602db |
Close
Hashes for libmav-0.0.2-cp38-cp38-macosx_10_15_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3152bce7b3de2e0744eb6646af50df203f0bd7fcff3427dd502127a47ffc8220 |
|
MD5 | a05736fc16ed23cccac3abda25f67a66 |
|
BLAKE2b-256 | 31ae5117c70bc00e099375b6d28364ea5d87746fe7235ad86441d1d3d55bbd37 |
Close
Hashes for libmav-0.0.2-cp37-cp37m-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 794f17bf9a929b132897f8fef465c97d13bb1f98681c808782f656b6cb8cf9a0 |
|
MD5 | 672b2a87de501bb68a336ec54c0562fe |
|
BLAKE2b-256 | 49509ee1127e02f3148a7eda494261946a313c5637807159fa1c0a7da86f1da1 |
Close
Hashes for libmav-0.0.2-cp37-cp37m-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83d8d370af52f122dc34329e29580cb8f4a5e59d125067926cc516afbbe5c3da |
|
MD5 | 3cca8e2c001b2392fb24369f7b41046b |
|
BLAKE2b-256 | 44f31125b7e15d04996bfa9fa3652102874a5a989a34b6b984794af8add493bf |
Close
Hashes for libmav-0.0.2-cp37-cp37m-musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44ef0feb649a534a5dd0e93ca63080f358f88e5228b1ec8189b1233065ead1d0 |
|
MD5 | b4a5b97dd04a4a901fc08aa86e44e0f1 |
|
BLAKE2b-256 | 3de5143a003da13cafb1c963f4097c322efa0158fec62243deab345cd175674f |
Close
Hashes for libmav-0.0.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4823035c1d17f3a323b388b2c923b40ef9636b27111b661dc35d63efb3d0dd2d |
|
MD5 | 0a8bb205956b8b2038aa32a2765cf382 |
|
BLAKE2b-256 | f089ef3d8806c307519082904d0b05e81639fc64ea753ee85d3eed5c9cd804b0 |
Close
Hashes for libmav-0.0.2-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b898e63e0b0e5da40d25ab3aa0bddeffe9fcf37271a534d4d6ac4cbfce99f3d4 |
|
MD5 | 8d8d165bdc3b5103e55a7865b659976d |
|
BLAKE2b-256 | 3b39464a7ce1579355da8ca8af51998cf170cc33573723f9679330a837fdabd7 |
Close
Hashes for libmav-0.0.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17eabb032d50e3ac8cdacd139bcb3b6d07e37e18c5364226a45df8d18b4e0b58 |
|
MD5 | 80a9342466d5636e725759f7b701cdb0 |
|
BLAKE2b-256 | d2790716dcb30ec37a38d85fe28b41dee006ca47b398f0b64e4d7ebafb55f688 |
Close
Hashes for libmav-0.0.2-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7782a78afe19a6b7d31fbb330dd40cd585d77012e86ee0c0fd0048286df55076 |
|
MD5 | fd85297cb9d5ff6b85fdb27f577f2682 |
|
BLAKE2b-256 | 59b9140f791386d8a4c5dc8c575653270738dd2f23b69dec0675f7b6e9980cd8 |