Giter VIP home page Giter VIP logo

libevents's Introduction

Build Status

MAVLink

MAVLink -- Micro Air Vehicle Message Marshalling Library.

MAVLink is a very lightweight, header-only message library for communication between drones and/or ground control stations. It consists primarily of message-set specifications for different systems ("dialects") defined in XML files, and Python tools that convert these into appropriate source code for supported languages. There are additional Python scripts providing examples and utilities for working with MAVLink data.

Tip MAVLink is very well suited for applications with very limited communication bandwidth. Its reference implementation in C is highly optimized for resource-constrained systems with limited RAM and flash memory. It is field-proven and deployed in many products where it serves as interoperability interface between components of different manufacturers.

Quick start

Generate C headers

To install the minimal MAVLink environment on Ubuntu LTS 20.04 or 22.04, enter the following on a terminal:

# Dependencies
sudo apt install python3-pip

# Clone mavlink into the directory of your choice
git clone https://github.com/mavlink/mavlink.git --recursive
cd mavlink

python3 -m pip install -r pymavlink/requirements.txt

You can then build the MAVLink2 C-library for message_definitions/v1.0/common.xml from the /mavlink directory as shown:

python3 -m pymavlink.tools.mavgen --lang=C --wire-protocol=2.0 --output=generated/include/mavlink/v2.0 message_definitions/v1.0/common.xml

Use from cmake

To include the headers in cmake, install them locally, e.g. into the directory install:

cmake -Bbuild -H. -DCMAKE_INSTALL_PREFIX=install -DMAVLINK_DIALECT=common -DMAVLINK_VERSION=2.0
cmake --build build --target install

Then use find_package to get the dependency in CMakeLists.txt:

find_package(MAVLink REQUIRED)

add_executable(my_program my_program.c)

target_link_libraries(my_program PRIVATE MAVLink::mavlink)

And pass the local install directory to cmake (adapt to your directory structure):

cd ../my_program
cmake -Bbuild -H. -DCMAKE_PREFIX_PATH=../mavlink/install

For a full example, check examples/c.

Note: even though we use target_link_libraries in cmake, it doesn't actually "link" to MAVLink as it's just a header-only library.

Other instructions

Instructions for using the C libraries are then covered in Using C MAVLink Libraries (mavgen).

Note: Installing the MAVLink Toolchain explains how to install MAVLink on other Ubuntu platforms and Windows, while Generating MAVLink Libraries explains how to build MAVLink for the other programming languages supported by the project. The sub-topics of Using MAVLink Libraries explain how to use the generated libraries.

Key Links

libevents's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

libevents's Issues

Q: Prearm events for components which are not the autopilot

hey @bkueng

I am pondering over using the events to report the prearm status of the STorM32 gimbal controllers, but have some points I can't figure out and don't understand, but don't know where to ask for clarification, hence this issue here. I hope you find this appropriate.
(I read up as much of the available info as I could find, below, mavlink docs, PX4 docs).

The available docs mention specifically health and arming as use case, as well as it's not only for the autopilots but also components, and that events can be specific to an implementation. So, this makes me hopeful, but I don't yet get it.

The STorM32 gimbal controller represents a mavlink gimbal component, and I currently am using a device specific message https://github.com/mavlink/mavlink/blob/master/message_definitions/v1.0/storm32.xml#L560-L567, which I wonder if it can be replaced with device-specific events.

There are two questions however, spurred by comments in the docs

  • "Each namespace has a name and an 8 bit component ID (typically matching the MAVLink component ID). Within a namespace, each event has a unique name and sub ID (24 bits). The event ID is the combined component ID with sub ID" (this repo)
  • "from that name, a 24 bit event ID is derived using a hash function." (PX4 docs)
  • "A UI should not display unkown groups." (this repo)

Obviously, the STorM32 controller would need to send the event with an ID. I don't understand how to decide on this ID. The docs imply that I somehow can create an implementation-specific ID, but I can't see how this possibly could work without having to register this ID with the mavlink project. I mean, to me it looks like it needs to be GUID.

Moreover, gimbals like any component can have whatever component ID they want, so how can there ever be a somewhat generically defined event, and be it only generic for all STorM32 gimbals? I.e., the "component ID" part of the ID spec does not make any sense to me, but just creates problems.

So, what ID shall I use for "my" STorM32 prearm event?

Second, how can device-specifi/implementation-specific events, which obviously will be in their own group, ever be of any use if a UI should not display unkown groups? Again, I conclude that it all only ever could work out if one registers the event with the mavlink project.

Many thx in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.