A very lightweight and easy to use mavlink library designed for reusability. The goal is an interface that allows you to quickly setup a mavlink connection and in only a few lines of code immediately begin sending and receiveing mavlink messages.
To just build the library and not install it
make
To build the library and install it at /usr/local
sudo make install
To build the examples you must first install the library
make examples
-
Register a message handler for a given mavlink message ID. The message handler function callbacks are executed in the receiving thread context. This means the callbacks must be thread safe and non-blocking. You should use locks to modify shared data or leverage the included ThreadSafeQueue class if you want to queue messages for processing later.
-
Send any
mavlink_message_t
viamavlink->send_message(msg)
. This function pushes the message into a threadsafe queue where the sending thread will access it for asynchronous sending. -
Register function callbacks for PARAM_REQUEST_LIST and PARAM_SET. This allows decoupling of your applications parameter implementation.
void enable_parameters(std::function<std::vector<Parameter>(void)> request_list_cb,
std::function<bool(Parameter*)> set_cb);
-
Automatically emit heartbeats at 1Hz if the
emit_heartbeat
flag is set in the constructorMavlinkSettings
parameter. -
Specify the target sysid/compid to connect to.