Skip to content

shamuproject/mavtables

Repository files navigation

mavtables {#readme}

Build Status Coverage Status

A MAVLink router and firewall. It can connect 2 or more MAVLink endpoints such as autopilots, ground control software, loggers, image capture systems, etc over serial and UDP. MAVLink packets will be routed to specific components when they have a destination address. Any packet, targeted or broadcasted, can be filtered based on source system/component, destination system/component and message type. The filter can also apply a priority to packets allowing more important packets to take priority over lower priority packets when an endpoint is choked.

Links

Compilation and Installation

In order to compile you will need the following packages:

Clang is recommended when contributing to mavtables as it's warnings are more comprehensive. However, GCC must be used when generating code coverage reports.

The following packages are only needed for development work:

  • Artistic Style (used for checking/fixing the code style)
  • Gcovr (coverage report)
  • LCOV (detailed coverage html report)
  • socat (for testing serial port communications)

mavtables can be easily installed using the standard procedure of

$ make
# make install

The installation prefix is /usr/local by default but can be changed with

$ make
# make PREFIX=/desired/install/path install

The makefile will download and use the default MAVLink implementation with the ArduPilot dialect. This can be overridden by setting the MDIR environment variable to the library path (containing the DIALECT) and/or the DIALECT environment variable to the MAVLink dialect to use. For instance the default value of DIALECT is ardupilotmega.

Running

To run mavtables and begin routing packets

$ mavtables

This will use the first configuration file it finds in the configuration file priority order given in the next section. To force a specific configuration file the --config flag may be used.

$ mavtables --config <path/to/config>

The inbuilt help may be accessed with the -h or --help flags.

$ mavtalbes --help
usage: mavtables:
  -h [ --help ]         print this message
  --config arg          specify configuration file
  --ast                 print AST of configuration file (do not run)
  --version             print version and license information
  --loglevel arg        level of logging, between 0 and 3

Configuration File

Both interfaces and filter rules are defined in a configuration file. The format of this configuration file is documented in doc/configuration.md and an example is located at examples/mavtables.conf which is the same file that is installed at /etc/mavtables.conf when using make install. The configuration file used is the first one found in the following order:

  1. The target of the MAVTABLES_CONFIG_PATH environment variable.
  2. .mavtablesrc in the current directory.
  3. .mavtablesrc at $HOME/.mavtablesrc.
  4. The main configuration file at /etc/mavtables.conf.

If the --config flag is given then mavtables will only look for the given configuration file.

Contributing

Before contributing read the CONTRIBUTING.md file which gives guidelines that must be followed by all developers working on mavtables.