diff --git a/mwp_support/index.html b/mwp_support/index.html index ceaf0925..4e018548 100644 --- a/mwp_support/index.html +++ b/mwp_support/index.html @@ -367,6 +367,21 @@ + +
#off-topic
)master
version.RELEASE
Sweet dreams and flying machines1
mwp (originally \"multi-wii planner\") is a mission planner, ground control station and flight logger for MSP (Multiwiii Serial Protocol) compatible flight controller firmware (INAV and Multiwii at least).
From its MultiWii origins mwp has evolved to support navigation capabilities in INAV.
INAV is now the main development target, however MultiWii mission planning and ground control remains a supported function.
"},{"location":"#features","title":"Features","text":"mwp supports the following telemetry protocols :
mwp also supports the real-time display of adjacent aircraft using:
mwp supports replay of:
.bin
) logLog replay requires tools from the flightlog2x project.
"},{"location":"#platforms-and-os","title":"Platforms and OS","text":"The tools are designed to be portable and as far as possible platform and architecture agnostic. The suite is developed on Arch Linux and is tested on Debian (Trixie / Sid), Alpine (Edge), Fedora (current) and FreeBSD (current release). Being able to satisfy the required dependencies is more important than the actual distro / OS / platform. mwptools also runs on proprietary OS such as MacOS and Windows.
"},{"location":"#build-and-installation","title":"Build and installation","text":"Build and installation is described in the following sections:
If you are migrating from the legacy (Gtk+-3.0) version to the extant (Gtk 4) version, you are advised to read the migration guide first.
James Taylor, Fire and Rain. Full line is 'sweet dreams and flying machines in pieces on the ground', you may skip the final part.\u00a0\u21a9
mwp provides a pseudo-map proxy that just gives you a black map (or user specified tile). This may be useful for a number of use-cases:
This proxy is not build by default, it is necessary to build, install and configure the proxy manually.
cd mwptools/qproxy\nmake bproxy\n# copy bproxy somewhere on the PATH\ncp bproxy ~/.local/bin/\n# or\nsudo cp broxy /usr/local/bin\n# or\nsudo cp broxy /usr/bin\n
"},{"location":"Black-Ops/#configuration","title":"Configuration","text":"That was the easy bit! Now it is necessary to tell mwp where to find the proxy. This involves a setting and a configuration file.
First of all, ensure that the map-sources
setting is enabled:
$ gsettings get org.stronnag.mwp map-sources\n'sources.json'\n# here this set to a file sources.json (in the configuraion directory ~/.config/mwp/ / $LOCALAPPDATA/mwp)\n
if this is not set, then set it:
$ gsettings set org.stronnag.mwp map-sources 'sources.json'\n
Now we need to edit the configuration file sources.json
, there is a sample file in mwptools/samples/sources.json
. you file needs a stanza like:
{\n \"id\": \"Black\",\n \"name\": \"Black Tiles\",\n \"license\": \"(c) jh \",\n \"license_uri\": \"http://daria.co.uk/\",\n \"min_zoom\": 0,\n \"max_zoom\": 20,\n \"tile_size\": 256,\n \"projection\": \"MERCATOR\",\n \"spawn\" : \"bproxy\",\n}\n
So a minimal sources.json
looks like:
{\n \"sources\" : [\n {\n \"id\": \"Black\",\n \"name\": \"Black Tiles\",\n \"license\": \"(c) jh \",\n \"license_uri\": \"http://daria.co.uk/\",\n \"min_zoom\": 0,\n \"max_zoom\": 20,\n \"tile_size\": 256,\n \"projection\": \"MERCATOR\",\n \"spawn\" : \"bproxy\",\n }\n ]\n}\n
On starting mwp you should see a new map option \"Black Tiles\".
"},{"location":"Black-Ops/#custom-tile","title":"Custom Tile","text":"It's also possible to have a custom tile (which does not have to be black). The tile must be:
The full path is provided in the environment variable MWP_BLACK_TILE
, e.g.
# put this in e.g. ~/.bashrc to make it permanent\nexport MWP_BLACK_TILE=~/.config/mwp/mytile.png\n
The environment variable may instead be added to cmdopts
.
For example:
"},{"location":"Building-with-meson-and-ninja/","title":"Build / install mwp (Generic)","text":""},{"location":"Building-with-meson-and-ninja/#overview","title":"Overview","text":"If you just want to install mwp on a Debian /derivative, x64_64, then you can install the reasonably recent binary .deb
package from the Release Area.
For Arch Linux, you can install the AUR package mwptools-git
. This tracks master
.
Otherwise, if you're using a different (not Debian based) distribution, just curious about building mwptools, you want to explore other tools and scripts in the repository or you're using a different architecture (ia32, Arm7, aarch64, riscv64, ppc etc.), or you want the most recent code, then you can build from source. This is the recommended installation method.
The mwptools suite is built using the meson and ninja toolchain. For most users these will be automatically provided by a build-essentials
type of package.
For Debian and derivatives there is a \"one stop\" installation script, as well as a x86_64 \"Release\" .deb
archive.
For Fedora, the is a also a documented list of packages.
For Arch, the PKGBLD
lists the required packages.
For MacOS, use Homebrew to install required packages, having evinced the names from one of the Linux guides.
For Windows (MSys2), see Github discussion #182 for dependencies and workarounds).
For any other distribution / platform / OS, any of the above documents should give you an idea of the packages required, typically:
Numbers is parenthesis indicate a minimum version. Modern OS should be able to satisfy these requirements.
"},{"location":"Building-with-meson-and-ninja/#usage","title":"Usage","text":""},{"location":"Building-with-meson-and-ninja/#normative-guide","title":"Normative guide","text":"Note that the normative build reference is the INSTALL
file in the source tree. This is most current documentation.
Set up the meson
build system from the top level. Note that _build
is a directory that is created by meson setup
; you can use what ever name you wish, and can have multiple build directories for different options (e.g _build
for local and _sysbuild
for system wide installations.
meson setup _build --buildtype=release --strip [--prefix $HOME/.local]\n
--prefix $HOME/.local
$HOME/.local/bin
, which should be added to $PATH
as required.--prefix /usr
--prefix
as the default (/usr/local
) is suitableUnless you need a multi-user setup, a local install is preferable, as you don't need sudo
to install, and you'll not risk messing up build permissions.
chmod +x deb-install.sh
./deb-install.sh -y
~/.local/bin
. Ensure this exists on $PATH
; modern distros should do this for you.ninja -C _build\n# for a local install\nninja -C _build install\n# for system install\nninja -C _build\nsudo ninja -C _build install\n
"},{"location":"Building-with-meson-and-ninja/#accessing-the-serial-port","title":"Accessing the serial port","text":"The user needs to have read / write permissions on the serial port in order to communicate with a flight controller. This is done by adding the user to a group:
sudo usermod -aG uucp $USER
sudo usermod -aG dialout $USER
All Linux with systemd
: In you log in via systemd
's loginctl
, then you can create a udev
rule that does not rquire the user being a member of a particular group:
#less /etc/udev/rules.d/45-stm32.rules\nSUBSYSTEMS==\"usb\", ATTRS{idVendor}==\"0483\", ATTRS{idProduct}==\"5740\", MODE=\"0660\", TAG+=\"uaccess\", ENV{ID_MM_DEVICE_IGNORE}=\"1\", ENV{ID_MM_CANDIDATE}=\"0\"\nSUBSYSTEMS==\"usb\", ATTRS{idVendor}==\"0483\", ATTRS{idProduct}==\"df11\", MODE=\"0660\", TAG+=\"uaccess\"\n
FreeBSD: sudo pw group mod dialer -m $USER
mwp
Mission planner, GCS, log replay etc. mwp-plot-elevations
1 Mission elevation / terrain analysis cliterm
Interact with the CLI fc-get
, fc-set
2 Backup / restore CLI diff inav_states.rb
Summarise BBL state changes, also installed inav_states_data.rb
fcflash
FC flashing tool, requires dfu-util
and / or stmflash32
flashgo
Tools to examine, download logs and erase from dataflash bproxy
Black maps tiles, for those covert operations"},{"location":"Building-with-meson-and-ninja/#libraries","title":"Libraries","text":"$prefix/lib/libmwpclib.*so.x.0.0\n$prefix/lib/libmwpclib.a\n$prefix/lib/libmwpvlib.*so.x.0.0\n$prefix/lib/libmwpclib.a\n
Notes:
1. This may either be the new Go executable or the legacy, less functional Ruby script.
2. fc-set
is a hard link to fc-get
These are only built by explicit target name; they will be installed if built.
# one of more of the following targets\nninja ublox-cli\nsudo ninja install\n
Application Usage ublox-cli
Ublox GPS tool gmproxy
Proxy for certain commercial TMS"},{"location":"Building-with-meson-and-ninja/#troubleshooting-and-hints","title":"Troubleshooting and Hints","text":""},{"location":"Building-with-meson-and-ninja/#migrate-from-a-system-install-to-a-user-install","title":"Migrate from a system install to a user install","text":"Either use separate build directories, or reconfigure.
cd _build\nsudo ninja uninstall\nmeson --reconfigure --prefix=$HOME/.local\nninja install\n
"},{"location":"Building-with-meson-and-ninja/#fixing-build-permissions","title":"Fixing build permissions","text":"If you install to system locations, it is possible that sudo ninja install
will write as root
to some of the install files, and they become non-writable to the normal user.
build
directory, run sudo chown -R $USER .
If you used the deb-install.sh
script, then it installed everything into $HOME/.local/bin
(and other folders under ~/.local
). This is nice because:
sudo
to install it.Linux (like most other OS) has the concept of a PATH
, a list of places where it looks for executable files). You can see this from a terminal:
## a colon separated list\necho $PATH\n
So check that $HOME/.local/bin
is on $PATH
; preferably near the front.
If it is, then the problem may be that the older mwp also exists elsewhere on the PATH, and the system will not re-evaluate the possible chain of locations if it previously found the file it wants.
So, maybe you have an old install. You didn't remove it (alas); so the system thinks that mwp is /usr/bin/mwp
; in fact it's now $HOME/.local/bin/mwp
If $HOME/.local/bin
is on the PATH before /usr/bin
, the you have two choices:
# reset the path search\nhash -r\n# mwp, where art thou? Hopefully now is ~/.local/bin\nwhich mwp\n# From **this terminal** executing mwp will run the location reported by `which mwp`\n
or
Log out, log in. The PATH will be re-evaluated.
If $HOME/.local/bin
is not on PATH. then it needs to be added to a login file (.profile
, .bashrc
, .bash_profile
etc.). Modern distros do this for you, however if you've updated an older install you may have to add it yourself.
# set PATH so it includes user's private bin if it exists\nif [ -d \"$HOME/bin\" ] ; then\n PATH=\"$HOME/bin:$PATH\"\nfi\n\n# set PATH so it includes user's private bin if it exists\nif [ -d \"$HOME/.local/bin\" ] ; then\n PATH=\"$HOME/.local/bin:$PATH\"\nfi\n
If an older (perhaps Makefile generated) mwp exists; then you should remove all evidence of an earlier system install.
find /usr -iname \\*mwp\\*\n
review the list and as root, delete the old files. Do similar for blackbox-decode.
If you're content with the list, then (caveat emptor):
sudo find /usr -iname \\*mwp\\* -delete\n
You'll still have to remove non-empty directories manually.
"},{"location":"Building-with-meson-and-ninja/#ninja-error-loading-buildninja-no-such-file-or-directory","title":"\"ninja: error: loading 'build.ninja': No such file or directory","text":"Something, or persons unknown has removed this file.
cd mwptools\nmeson setup --reconfigure _build --prefix ~/.local\ncd _build\nninja install\n
"},{"location":"Building-with-meson-and-ninja/#error-dependency-not-found-tried-pkgconfig","title":"ERROR: Dependency \"?????\" not found, tried pkgconfig","text":"mwp requires a new dependency. This ~~will~~ should be documented in the wiki Recent Changes document.
src/common/mwp_icon.svg
$prefix/share/icons/hicolor/scalable/apps/
Desktop icon src/mwp/org.stronnag.mwp.gschema.xml
$prefix/share/glib-2.0/schemas/
Settings schema src/mwp/volts.css
$prefix/share/mwp/
Colours used by battery widget src/mwp/beep-sound.ogg
$prefix/share/mwp/
Alert sound src/mwp/bleet.ogg
$prefix/share/mwp/
Alert sound src/mwp/menubar.ui
$prefix/share/mwp/
Menu definition src/mwp/mwp.ui
$prefix/share/mwp/
UI definition src/mwp/orange.ogg
$prefix/share/mwp/
Alert sound src/mwp/sat_alert.ogg
$prefix/share/mwp/
Alert sound src/mwp/mwp.desktop
$prefix/share/applications/
Desktop launcher src/mwp/mwp_complete.sh
$prefix/share/bash-completion/completions/
bash completion for mwp
src/mwp/pixmaps
$prefix/share/mwp/pixmaps/
UI Icons docs/debian-ubuntu-dependencies.txt
$prefix/share/doc/mwp/
Debian / Ubuntu dependencies docs/fedora.txt
$prefix/share/doc/mwp/
Fedora dependencies"},{"location":"Fly-By-Home-waypoints-%28inav-4-new-feature%29/","title":"Fly By Home Waypoints","text":""},{"location":"Fly-By-Home-waypoints-%28inav-4-new-feature%29/#introduction","title":"Introduction","text":"For INAV 4.0, there is a \"FlyBy Home\" (FBH) waypoint modifier.
This will set waypoints of types WAYPOINT, POSHOLD_TIME and LAND to execute at the arming home location (any safehome is ignored).
The flight controller applies FBH behaviour to waypoints having one (or both) of the following characteristics:
flag
field is set to 0x48 (72 decimal, 'H')In this case, the waypoint position is determined at run time (when the WP is actually used) and is set to the arming location. Note that the arming location must be set with a valid GPS fix.
As the waypoint location is determined during execution, it is not stored; so downloading a completed mission will return the original locations, not the locations used during the mission.
mwp will perform the following checks when importing WAYPOINT, POSHOLD_TIME and LAND points:
This will ensure, as far as possible, that when such a mission is exported, it is safe on earlier INAV firmware. Note that this excludes using exactly 0,0 as an actual waypoint location (but 0.00001,0.00001 would be OK); in practical terms this is only likely to affect 007 villains.
"},{"location":"Fly-By-Home-waypoints-%28inav-4-new-feature%29/#implications-for-a-graphical-mission-planner","title":"Implications for a graphical mission planner","text":"INAV (and mwp) do not require a planned homed location, so providing graphical support for waypoints whose location is indeterminate prior to mission execution is an interesting challenge. mwp incorporates a number of new features to support FBH.
flag
attribute has been added the XML mission file schema.The practical results being:
flag
set. This means they will behave predictably when uploaded to older firmware.A waypoint may set set to FBH (or have FBH removed) from either the right mouse popup or the MiWP List menu.
Legacy Images
The images this section are from legacy mwp, however the capability is the same.
In the first image, no FBH waypoints have been set. We can see the planned home (the brown icon, which was read from the extant mission file), and the popup menu and mission editor. Note: the popup entry has since been renamed 'Fly By Home' for consistency.
1. Initial state, no FBHIn the second image, WP2 has been made a FBH WP; we can see that it is now attached the home icon (and slightly faded). The home icon can be dragged, the attached FBH waypoint is no longer independently draggable.
2. WP2 set as FBHIn the third image, the planned home has been moved slightly north, WP2 has moved with it.
3. Home moved, WP2 moved as FBHIn the forth image, a second waypoint (WP14) has been set as FBH; it is also now locked to the planned home location.
4. Add WP14 as FBHIn the fifth image, the FBH attribute as been cleared on WP2; it has been independently dragged to a new location.
5. Remove FBH from WP2"},{"location":"Fly-By-Home-waypoints-%28inav-4-new-feature%29/#mwp-ground-control-station-and-replay-modes","title":"mwp Ground Control Station and Replay modes","text":"If a mission is loaded when mwp is used as ground control station or for log replay, and the mission contains FBH waypoints, then the mission will be redrawn with the actual home location when the home location is established.
"},{"location":"Mission-Elevation-Plot-and-Terrain-Analysis/","title":"Mission Elevations","text":""},{"location":"Mission-Elevation-Plot-and-Terrain-Analysis/#overview","title":"Overview","text":"Prior to INAV 3.0, mission altitudes are relative to the HOME (arming) location, which is not part of a mission definition. As a result, the pilot has to be ensure by some other means that the mission will clear any raised elevations on the mission path. For INAV 3.0, missions may be either relative to home or absolute (above a datum, see below).
mwp includes a mwp-plot-elevations
tool that performs mission and terrain analysis. This tool is platform independent and can be used without mwp for mission terrain analysis.
mwp-plot-elevations
can rewrite the mission file with new elevations to provide a specified ground clearance.
Legacy Images
The images this section are from legacy mwp, however the capability is the same.
"},{"location":"Mission-Elevation-Plot-and-Terrain-Analysis/#video-tutorial-ui-integration","title":"Video Tutorial & UI integration","text":"From of 2018-12-06, mwp-plot-elevations
is integrated into the mwp
application.
There is a video tutorial.
Obsolescence Note
The video uses the older ruby application, but that doesn't really affect basic functionality.
"},{"location":"Mission-Elevation-Plot-and-Terrain-Analysis/#sample-output","title":"Sample output","text":"Given the mission shown below:
and knowing that the land rises to the north and west, we can check that we do indeed have adequate clearance with the planned route and elevations:
# for decimal '.' locales\n $ mwp-plot-elevations -- home 50.9104826,-1.5350745 --plotfile profile.svg west_field.mission\n # for decimal ',' locales\n $ mwp-plot-elevations --home \"50,9104826 -1,5350745\" --plotfile profile.svg west_field.mission\n
where:
west_field.mission
is the MW-XML mission file (via mwp, INAV configurator, [ezgui, mission planner for INAV] or impload)--home lat,lon
option defines the home position (which may also be set by the environment variable MWP_HOME
), the command line having preference. Note that for modern mwp generated mission files, this information is provided in the mission file.profile.svg
, via the --plotfile
option.The result from this command is an SVG file, which can be displayed with common image tools (eog
, ImageMagick display
et al). It can also be converted to a raster image using e.g. rsvg-convert
); a sample is shown below:
The red line represents the planned mission altitudes (which are defined relative to the estimated home location), and the green area represents the terrain. As we can see, we clear the hill (and other terrain), but cannot guarantee that we have LOS to lowest point of the mission, or that we're clear of the trees.
We can also specify a \"clearance\" option, in the image below this was set to 16m. Where the blue line is above the red line, one should review that the mission elevations are adequate.
"},{"location":"Mission-Elevation-Plot-and-Terrain-Analysis/#creating-a-new-mission-file","title":"Creating a new mission file","text":"It is also possible (see command line options below) to write out a new mission that takes into account the clearance (margin
parameter). If we then plot this new mission file, we can see that we are at least margin
(in this example 16m) distance clear of the terrain.
Note that the original mission elevations are still taken into account. We can also ignore these, so we end up the absolute clearance distance above the terrain.
$ mwp-plot-elevations nm_west_field.mission --output /tmp/p1.mission --no-mission-alts\n
"},{"location":"Mission-Elevation-Plot-and-Terrain-Analysis/#dependencies","title":"Dependencies","text":"The mwp-plot-elevations
has NO dependency on mwp or Linux / FreeBSD, it can just as easily be run on MacOS or MS Windows. It does however has some dependencies:
Go compiler (1.18 or later)
gnuplot
gnuplot
is easily provided (by your distro or from a binary download).
On all operating systems, the terrain graph is also plotted interactively, regardless of whether the -p
(save SVG plot) option has been specified. The following shows the UI on Windows (it's pretty much the same on other OS).
Digital elevation services can use the WGS84 Ellipsoid or \"sea level\"; survey maps typically use AMSL (Above Mean Sea Level); GPS can report either or both of WGS Ellipsoid and above MSL (mean sea level). INAV and mwp both use AMSL.
There may be a difference between ASML, \"sea level\", WGS84 Ellipsoid and Survey heights, for example, for a test point of 54.149461 -4.669315 (summit of South Barrule, Isle of Man):
Note that while OpenTopo appears to be an accurate web service, it has significant issues that mean it is unacceptable as a reliable data source:
For these reasons, mwp used locally hosted Mapzen DEMs.
There is a more detailed analysis of the available DEMs on the wiki.
"},{"location":"Mission-Elevation-Plot-and-Terrain-Analysis/#so-whos-right","title":"So who's right?","text":"Many years ago, I took a GPS up South Barrule.
It reads 485m, this pretty much agrees with the OS (Survey) height (AMSL). So the real issue is with the DEM available online (either Bing or Google). The 'sea-level\" height DEM reports for this location is c. 13m below Ordnance Survey AMSL value whilst the WGS84 ellipsoid value is 43m above the OS AMSL value.
"},{"location":"Mission-Elevation-Plot-and-Terrain-Analysis/#command-line-help-and-options","title":"Command line help and options","text":"$ mwp-plot-elevations --help\n -dump\n Dump internal data, exit\n -force-alt int\n Force Altitude Mode (-1=from mission, 0=Relative, 1=Absolute (default -1)\n -home string\n home as DD.dddd,DDD.dddd\n -keep\n Keep intermediate plt files\n -margin int\n Clearance margin (m)\n -no-graph\n No interactive plot\n -no-mission-alts\n Ignore extant mission altitudes\n -output string\n Revised mission file\n -rth-alt int\n RTH altitude (m)\n -svg string\n SVG graph file\n -upland\n Update landing elevation offset\n
Note that Go considers -foo
and --foo
to the equivalent. The ruby script requires the --
notation.
As well as specifying options such as home location, clearance margin and RTH altitude on the command line (or as an environment variable), some or all of these options may be set in a configuration file.
mwp-plot-elevations
looks for options in one of the following (in order) ./.elev-plot.rc
(i.e. current directory), $HOME/.config/mwp/elev-plot
, and $HOME/.elev-plot.rc
. The configuration file is a plain text file containing key=value
pairs. Blank lines and lines beginning with #
are ignored; the following example illustrates the recognised keys. Note that $HOME/.config/mwp/elev-plot
is the preferred location, as this is also used by mwp
to populate its graphical dialogue to launch the analysis tool.
# settings for mwp-plot-elevations\nmargin = 16\nhome = 50.910476,-1.535038\n# for ',' locales\n# home = 50,910476 -1,535038\nrth-alt=25\n# 'sanity' is the home -> WP1 distance check; default if not set here is 100m\nsanity = 200\n
"},{"location":"Mission-Elevation-Plot-and-Terrain-Analysis/#usage-examples","title":"Usage Examples","text":"# Interactive plot, using the above configuration file:\n$ mwp-plot-elevations nm_west_field.mission\n\n# Interactive plot. save SVG file\n$ mwp-plot-elevations --plotfile /tmp/mission.svg nm_west_field.mission\n\n# Interactive plot. save SVG file, rewrite mission file\n$ mwp-plot-elevations --plotfile /tmp/mission.svg --output new_west_field.mission nm_west_field.mission\n\n# Interactive plot. save SVG file, rewrite mission file, override clearance margin (20m)\n$ mwp-plot-elevationsb --plotfile /tmp/mission.svg --outout new_west_field.mission --margin 20 nm_west_field.mission\n\n# Interactive plot. save SVG file, rewrite mission file,\n# override clearance margin (20m), reduce RTH altitude (22m)\n$ mwp-plot-elevations --plotfile /tmp/mission.svg --output new_west_field.mission --margin 20 --rth-alt 22 nm_west_field.mission\n
Another contrived example ... create a mission in Google Earth (tied to ground), save as KMZ, convert to MWXML mission file with impload (0 altitude). Use mwp-plot-elevations.rb
to calculate a safe mission.
# convert the saved KMZ file to a MWXML mission file\n$ impload convert /tmp/IOM.kmz /tmp/perwick.mission\n\n# Verify the elevations and clearance with plot-elevations.rb\n$ mwp-plot-elevations.rb -h 54.068826,-4.735472 -m 40 /tmp/perwick.mission\n
Looks OK (well, apart from the flying through the hill, due to impload's default altitude of 20m).
If we specify that a new mission file be generated (--output
), the updated mission is also plotted, and we can see that this clears the hill.
mwp-plot-elevations --home 54.068826,-4.735472 --margin 40 --output /tmp/perwick-ok.mission /tmp/perwick.mission\n
It's not yet perfect, we could be more aggressive in reaching just the clearance altitude, but we clear the hill!.
"},{"location":"Mission-Elevation-Plot-and-Terrain-Analysis/#climb-and-dive-angle-report","title":"Climb and Dive Angle Report","text":"Mission used for climb /dive exampleAs of 2021-06, it's also possible to get climb and dive angles for the calculated mission. Before I added the WP12 => WP7 jump in the mission shown below, it was almost OK; below the desired clearance in a couple of places and just failing to clear the hill at WP15. After adding the JUMP, it hits the terrain pretty conclusively between WP12 and WP7. The modified mission is interesting, as it has to adjust the WPs within the JUMP for the worst case (so the WP7, the second pass is definitive).
The final result:
We also get a climb / dive report, currently to STDOUT and $TMP/mwpmission-angles.txt
(tab separated for easy analysis).
$ mwp-plot-elevations --margin 25 -no-mission-alts --output /tmp/n.mission \\\n --home 54.125205,-4.730322 -rth-alt 40 mwp/missions/IoM/barrule-jump.mission\nHOME - WP1 21.3\u00b0 (climb)\n WP1 - WP2 -13.9\u00b0 (dive)\n WP2 - WP3 16.2\u00b0 (climb)\n WP3 - WP4 -8.1\u00b0 (dive)\n WP4 - WP5 11.4\u00b0 (climb)\n WP5 - WP6 4.9\u00b0 (climb)\n WP6 - WP7 -6.6\u00b0 (dive)\n WP7 - WP8 -8.9\u00b0 (dive)\n WP8 - WP9 1.3\u00b0 (climb)\n WP9 - WP10 7.0\u00b0 (climb)\nWP10 - WP11 4.4\u00b0 (climb)\nWP11 - WP12 -11.9\u00b0 (dive)\nWP12 - WP7 0.3\u00b0 (climb)\n WP7 - WP8 -8.9\u00b0 (dive)\n WP8 - WP9 1.3\u00b0 (climb)\n WP9 - WP10 7.0\u00b0 (climb)\nWP10 - WP11 4.4\u00b0 (climb)\nWP11 - WP12 -11.9\u00b0 (dive)\nWP12 - WP14 2.5\u00b0 (climb)\nWP14 - WP15 -5.2\u00b0 (dive)\nWP15 - RTH -3.6\u00b0 (dive)\n
If you run mwp-plot-elevations via mwp, the information is presented in a separate window.
mwp can also highlight any legs that exceed user-defined (not 0) climb and dive angle limits. However, it's up to you to work out the best solution.
The steep hill and valley at the start are just too much here; best to reroute.
"},{"location":"Replaying-Ardupilot-logs/","title":"Ardupilot log replay","text":""},{"location":"Replaying-Ardupilot-logs/#requirements","title":"Requirements","text":"It is possible to replay Ardupilot logs in the same way as one can replay blackbox, OpenTX / EdgeTX and BulletGCCS logs. This also requires flightlog2x tools 1.0.24 or more recent.
As the author does not have any (useful) AP logs, contributions are welcome.
"},{"location":"Support-for-inav-3.0-WP-features/","title":"mwp and INAV 3.0 Mission Updates","text":""},{"location":"Support-for-inav-3.0-WP-features/#overview","title":"Overview","text":"INAV 3.0 adds a couple of changes to INAV mission planning:
For Multiwii and INAV prior to 3.0, waypoint altitudes were always relative to the arming location. If you always fly in a flat area, or always arm at the same point, this wasn't really an issue; you could always use mwp's terrain analysis to check that you'd clear any obstructions.
However, if you armed some (vertical) distance from the arming point assumed when the plan was created, the absolute, (AMSL) elevation of the WP would differ by the ground difference between the assumed arming point at planning time and the actual arming point at take off. In the worst case (arming at an 'zero' absolute elevation well below the 'assumed at planning time' location), this could result in automated flight into terrain, which is generally undesirable.
Absolute mission altitudes addresses this issue, as the AMSL elevation of the WP is fixed and does not depend on arming location.
"},{"location":"Support-for-inav-3.0-WP-features/#land-wp-ground-elevation-setting","title":"Land WP ground elevation setting","text":"A similar issue existed prior to INAV 3.0 for the LAND WP; the initial implementation assumed that the LAND WP site ground elevation was at approximately the same ground elevation as the arming location. INAV computes landing behaviour based on relative altitude from home; if the actual LAND site was lower than home, then the descent would be slow; if it was higher, then slowdown might not occur and there would be a hard landing (for MR). For FW the final approach and motor-off would be sub-optimal.
The required land elevation uses the P2
WP parameter, in metres.
mwp supports the new feature in the WP Editor and Terrain Analysis.
"},{"location":"Support-for-inav-3.0-WP-features/#terrain-analysis","title":"Terrain Analysis","text":"mwp's terrain analysis function has been upgraded to handle INAV 3.0 features (Relative / Absolute Elevations, Land Ground Elevation). The mwp terrain analysis article describes the new analysis tool.
In the image below, the dialogue has been enhanced to allow selection of the altitude mode and adjustment of LAND elevation. The orange graph line shows the generated mission with a 40m clearance of all obstacles.
The user can select the following altitude modes:
The INAV wiki describes WP mission parameters in some detail.
Discussion of the meaning of \"sea level\". It's confusing.
"},{"location":"dock/","title":"Side Bar Concepts and Usage","text":""},{"location":"dock/#side-bar-overview","title":"Side Bar Overview","text":"The Side Bar, items 4 and 6 in the main window guide provides an area for optional widgets.
The main dock controls are shown below. Please note these images are from the legacy version of mwp.:
"},{"location":"dock/#side-bar-items-dockets","title":"Side Bar Items (Dockets)","text":"The following items are provided.
"},{"location":"dock/#artificial-horizon","title":"Artificial Horizon","text":""},{"location":"dock/#direction-view","title":"Direction View","text":""},{"location":"dock/#flight-view","title":"Flight View","text":""},{"location":"dock/#rssi-lq-status","title":"RSSI / LQ Status","text":""},{"location":"dock/#battery-monitor","title":"Battery Monitor","text":""},{"location":"dock/#vario-view","title":"Vario View","text":""},{"location":"dock/#side-bar-configuration","title":"Side Bar Configuration","text":"A very simple, bespoke panel comprising embedded resizeable panes has been implemented. The configuration may be user defined by a simple text file ~/.config/mwp/panel.conf
.
Each entry is defined by a comma separated line defining the panel widget name, the row (0-3) and the column (0-2) and an optional minimum size (only required for the artificial horizon). The default panel is defined (in the absence of a configuration file) as:
# default widgets\nahi,0,1,100\nrssi, 1, 0\ndirn, 1, 1\nflight, 2, 0\nvolts, 3, 0\n
Which appears as:
The available panel widgets are named as:
Name Usageahi
Artificial horizon dirn
Direction comparison flight
\"Flight View\" Position / Velocity / Satellites etc, volts
Battery information vario
Vario indicator No other legacy widgets have been migrated.
So using the following ~/.config/mwp/panel.conf
# default + vario widgets\nahi,0,1,100\nvario,0,2\nrssi, 1, 0\ndirn, 1, 1\nflight, 2, 0\nvolts, 3, 0\n
would appear as:
"},{"location":"gcs-features/","title":"Ground Control Station Features","text":""},{"location":"gcs-features/#gcs-usage","title":"GCS Usage","text":""},{"location":"gcs-features/#basic-functionality","title":"Basic functionality","text":"When flying waypoints, if the mission is also loaded into mwp, mwp can display some limited \"OSD\" information.
Various settings (colour, items displayed etc.) are defined by settings.
"},{"location":"gcs-features/#gcs-location-icon","title":"GCS Location Icon","text":"A icon representing the GCS location can be activated from the View/GCS Location\" menu option.
By default, it will display a tasteful yellow / blue icon which one may drag around. It has a few other purposes beyond showing some user specified location (but see below).
If you don't like the icon, you can override it by creating your own icon.
If gpsd
is detected (on localhost
), then the position will be driven by gpsd
, as long as it has a 3D fix.
The one usage is when inav-radar is active; if the GCS icon is enabled (either by manual location or driven by gpsd
), then rather than being a passive 'GCS' node, mwp will masquerade as an 'INAV' node and advertise the GCS (icon) location to other nodes. This implies that you have sufficient LoRa slots to support this node usage.
gpsd
.Note: The images in this section are from the legacy version, however the concepts are the same.
In INAV 4.0, the FC supports \"multi-missions\", that is allowing the user to upload and store multiple missions.
The mission to be executed may be set when the mission set is uploaded, or selected by OSD command (or stick command).
"},{"location":"inav-4.0-multi-missions/#mwp-support","title":"mwp support","text":"The means by which this function is provided by the FC is a little inconvenient (for the planner) but expedient; it's hard to see how else it could have been implemented.
In general and in summary, the functionality allows multiple missions to exist in a single \"mission file\" and either one or all of those mission can be uploaded to the FC.
When a \"multi-mission\" set is downloaded from the FC, mwp will set the active mission to that set as active in the FC.
When a \"multi-mission\" set is uploaded to the FC, mwp will set the active FC mission to its active mission.
"},{"location":"inav-4.0-multi-missions/#mwp-changes","title":"mwp changes","text":""},{"location":"inav-4.0-multi-missions/#top-bar","title":"Top Bar","text":"The top bar how includes an \"Active Mission\" item. This always has mission 1 (the legacy mission) and offers \"New\", allowing multiple missions to be maintained in one mwp session.
"},{"location":"inav-4.0-multi-missions/#open-mission-file","title":"Open Mission file","text":"The file open dialog has a preview pane that displays the missions in a multi-mission file. The user can select the mission to be the active mission.
"},{"location":"inav-4.0-multi-missions/#append-mission-file","title":"Append Mission File","text":"It is now possible to append an existing mission file (which may hold multiple missions) into a multi-mission set. This uses same dialog as Open Mission File.
"},{"location":"inav-4.0-multi-missions/#save-as-mission-file","title":"Save As Mission file","text":"The file \"Save as\" dialog has an option to exclude specific segments from a multi-mission (via the Remove Segments from file button in the following image). Note that \"Save\" will always save all mission segments.
In this case, only segment 1 of the multi-mission would be saved.
"},{"location":"inav-4.0-multi-missions/#upload-download-menu-options","title":"Upload / Download Menu Options","text":"The menu options reflect the new capability to upload all or the active mission. The \"Save to EEPROM\" option may also change to this pattern in future.
"},{"location":"inav-4.0-multi-missions/#multi-mission-manager","title":"Multi-Mission Manager","text":"The Edit menu has a Multi Mission Manager option. This allows the user to delete one or more missions from a multi-mission scenario.
"},{"location":"inav-4.0-multi-missions/#fc-limits","title":"FC Limits","text":"INAV 4.0 limits the total number of waypoints to 120 and the number of mission segments within a multi-mission scenario to 9.
mwp will allow the user to exceed these limits while creating / editing multi-mission scenarios, but enforces the limits for upload. So it would be possible to open / append files containing a total of (for example) 11 mission segments and 150 WPs. It would be necessary to reduce the mission set to the FC limits before it could be uploaded.
"},{"location":"inav-4.0-multi-missions/#legacy","title":"Legacy","text":"mwp still supports prior FC firmware, including MW. It is a bug if this is not the case. However, the user needs to be aware of the capabilities of the FC firmware.
"},{"location":"inav-4.0-multi-missions/#caveats","title":"Caveats","text":"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<mission>\n <!--mw planner 0.01-->\n <version value=\"42\"></version>\n <mwp save-date=\"2021-11-11T07:22:43+0000\" zoom=\"14\" cx=\"-3.2627249\" cy=\"54.5710168\" home-x=\"-3.2989342\" home-y=\"54.5707123\" generator=\"mwp (mwptools)\"><details><distance units=\"m\" value=\"3130\"></distance><nav-speed units=\"m/s\" value=\"10\"></nav-speed><fly-time units=\"s\" value=\"319\"></fly-time><loiter-time units=\"s\" value=\"0\"></loiter-time></details></mwp>\n <missionitem no=\"1\" action=\"WAYPOINT\" lat=\"54.5722109\" lon=\"-3.2869291\" alt=\"660\" parameter1=\"0\" parameter2=\"0\" parameter3=\"0\" flag=\"0\"></missionitem>\n <missionitem no=\"2\" action=\"WAYPOINT\" lat=\"54.5708178\" lon=\"-3.2642698\" alt=\"755\" parameter1=\"0\" parameter2=\"0\" parameter3=\"0\" flag=\"0\"></missionitem>\n <missionitem no=\"3\" action=\"WAYPOINT\" lat=\"54.5698227\" lon=\"-3.2385206\" alt=\"513\" parameter1=\"0\" parameter2=\"0\" parameter3=\"0\" flag=\"165\"></missionitem>\n <mwp save-date=\"2021-11-11T07:22:43+0000\" zoom=\"15\" cx=\"-3.2778311\" cy=\"54.5568837\" home-x=\"-3.2983737\" home-y=\"54.5622331\" generator=\"mwp (mwptools)\"><details><distance units=\"m\" value=\"9029\"></distance><nav-speed units=\"m/s\" value=\"10\"></nav-speed><fly-time units=\"s\" value=\"929\"></fly-time><loiter-time units=\"s\" value=\"0\"></loiter-time></details></mwp>\n <missionitem no=\"1\" action=\"WAYPOINT\" lat=\"54.5599696\" lon=\"-3.2958555\" alt=\"236\" parameter1=\"0\" parameter2=\"0\" parameter3=\"0\" flag=\"0\"></missionitem>\n <missionitem no=\"2\" action=\"WAYPOINT\" lat=\"54.5537978\" lon=\"-3.2958555\" alt=\"136\" parameter1=\"0\" parameter2=\"0\" parameter3=\"0\" flag=\"0\"></missionitem>\n <missionitem no=\"3\" action=\"WAYPOINT\" lat=\"54.5547933\" lon=\"-3.2864141\" alt=\"238\" parameter1=\"0\" parameter2=\"0\" parameter3=\"0\" flag=\"0\"></missionitem>\n <missionitem no=\"4\" action=\"WAYPOINT\" lat=\"54.5597705\" lon=\"-3.2695913\" alt=\"570\" parameter1=\"0\" parameter2=\"0\" parameter3=\"0\" flag=\"0\"></missionitem>\n <missionitem no=\"5\" action=\"WAYPOINT\" lat=\"54.5552910\" lon=\"-3.2598066\" alt=\"502\" parameter1=\"0\" parameter2=\"0\" parameter3=\"0\" flag=\"0\"></missionitem>\n <missionitem no=\"6\" action=\"JUMP\" lat=\"0.0000000\" lon=\"0.0000000\" alt=\"0\" parameter1=\"1\" parameter2=\"1\" parameter3=\"0\" flag=\"165\"></missionitem>\n <mwp save-date=\"2021-11-11T07:22:43+0000\" zoom=\"20\" cx=\"-3.2501935\" cy=\"54.5714148\" generator=\"mwp (mwptools)\"><details><distance units=\"m\" value=\"0\"></distance></details></mwp>\n <missionitem no=\"1\" action=\"WAYPOINT\" lat=\"54.5714148\" lon=\"-3.2501935\" alt=\"50\" parameter1=\"0\" parameter2=\"0\" parameter3=\"0\" flag=\"165\"></missionitem>\n</mission>\n
Download sample mission
"},{"location":"licence-misc-info/","title":"Licence and Alternative Tools","text":"GPL v3 or later. (c) Jonathan Hudson and contributors.
"},{"location":"licence-misc-info/#alternative-tools","title":"Alternative Tools","text":"In addition to mwp, the following INAV mission planners (and GCS in some cases) exist, in various states of usefulness, at least:
The following alternatives exist for mwp's survey / area planner :
The \"Edit > Preferences\" menu provides a UI for some gsetting
/ dconf
settings. The settings here are applied immediately if 'Apply' is clicked.
Unit preferences should be instantly reflected in the UI when 'Apply' is clicked.
"},{"location":"misc-ui-elements/#favourite-places","title":"Favourite Places","text":"mwp maintains a list of favourite places, from \"View > Centre on Location\" menu item.
The \"Place\" combo menu holds all places defined in ~/.config/mwp/places
(see the configuration reference).
For convenience, clicking the 'Editor ...' button will load the \"Places Editor\".
Locations can be edited clicking the \"Document Edit\" icon at the end of the row.
The context (right mouse button) menu:
~/.config/mwp/places
In the image, we are measuring the distance between the take off home (brown icon) and the landing home (orange icon); the distance markers are the black/white circles. Ctrl-D has been pressed a second time to display the result.
The following chapters provide specific information for advanced INAV capability topics:
Please note that some of the images in this chapter are from the legacy version of mwp.
"},{"location":"mission-editor/#map-features","title":"Map Features","text":"Missions may be added on the map by enabling mission add mode:
This will:
WPs have a context popup menu via right click on a WP icon
Almost all functions are available here, however some advanced functions, acting on multiple WP, etc. requires the tabular mission editor.
"},{"location":"mission-editor/#edit-waypoint","title":"Edit Waypoint","text":"The Edit Waypoint option opens an edit form for the current waypoint. The items displayed depend on the type of waypoint.
In this image, note:
WAYPOINT
.LAND
WP types.Multiple attributes may be set.
If the AMSL button is toggled, and a valid planned home location is set, then the altitude will be adjusted. For the above example, if the AMSL box is cleared, the dialogue shows:
Note that the Altitude box has an orange border to show that the altitude has been automatically updated.
If there is no planned home location, and the AMSL box is toggled, then the Altitude box assumes a red border to indicate to the user that manual intervention is required.
In the above image, a relative altitude of 16m has been toggled to absolute; there is no home position, so the altitude entry has a red border, as this is now below the absolute altitude of the terrain.
Note also that this example has multiple option set (SET HEAD and JUMP).
For a LAND
WP, the FW Approach parameters are available.
The Mission WP List may be invoked from the WP context menu.
It provides the following functions:
There is a right mouse context menu, the availability of items depending on whether zero, one or multiple items are selected.
The param3
value is presented as:
R
: Relative AltitudeA
: Absolute (AMSL) Altitude[1234]
: User action setThe flags
values are presented as:
EoM
: End of mission markerFBH
: Fly By Home (FBH) waypointMany of the operations described below are shown in the videos, which probably provide a clearer explanation that any textual description could. Note also that many of these (images and videos) are legacy, but the concepts are still valid.
"},{"location":"mission-editor/#add-shape","title":"Add Shape","text":"If a SET POI point is added to the mission, (there may also be other extant way-points), this option will display a dialogue to enter the number of points in a shape, the radial distance (from the SET POI to each point), an offset angle and the direction of rotation. i.e this defines a polygon around the POI.
SET_POI
point may be deleted, unless you really want SET_POI
functionality.Bulk location updates may be applied to selected waypoints.
If an item if left black (or 0), then no adjustment is applied to that axis. Offsets are in metres, regardless of the user's preference distance unit.
"},{"location":"mission-editor/#speed-and-altitude-updates","title":"Speed and Altitude updates","text":"Bulk speed and altitude updates may be applied to selected waypoints. The altitude update allows either relative (to home) to absolute (ASL) altitudes.
"},{"location":"mission-editor/#preview-mission","title":"Preview Mission","text":"\"Flys\" an aircraft icon around the mission; this may be useful for predicting the behaviour of multiple embedded JUMPs.
"},{"location":"mission-editor/#clear-mission","title":"Clear Mission","text":"The Clear Mission option clears the mission. There is no confirmation, so be sure you really want to do this.
"},{"location":"mission-editor/#uncommitted-changes","title":"Uncommitted Changes","text":"If mwp detects uncommitted changes when opening a new mission / downloading from the FC / cleanly exiting the application, then the user is presented with the following dialogue.
Video example setting up JUMP, POSHOLD TIMED and LAND waypoints.
"},{"location":"mission-editor/#set_poi-set_head-as-mission-elements","title":"SET_POI, SET_HEAD as mission elements","text":"Video example SET_POI and SET_HEAD (real mission usage).
"},{"location":"mission-editor/#mission-preview","title":"Mission Preview","text":"Video example of preview for a complex (multiple jumps, timed POSHOLD) mission (preview from the first video).
"},{"location":"mqtt---bulletgcss-telemetry/","title":"BulletGCSS Telemetry","text":""},{"location":"mqtt---bulletgcss-telemetry/#mwp-requirements","title":"mwp requirements","text":"mwp works with the web-based Ground Control Station BulletGCSS MQTT protocol, tested with both a fl2mqtt
simulation and a recorded live session.
The MQTT component is build if either paho-mqtt
or mosquitto
libraries are detected; paho-mtqq
is preferred.
## Arch ##\nyay -S paho-mqtt-c-git ## or you favourite AUR helper\n# or #\nsudo pacman -S mosquitto\n\n## Debian and derivatives ##\n### Debian testing / Ubuntu 20.10 + for paho ###\nsudo apt install libpaho-mqtt-dev\n# or #\nsudo apt install libmosquitto-dev\n\n## Fedora ##\ndnf install paho-c-devel\n# or #\ndnf install mosquitto-devel\n\n## FreeBSD ##\n## paho-mqtt\n# Clone github repo and build from source. Configure with cmake -DPAHO_WITH_SSL=true ..\ngit clone https://github.com/eclipse/paho.mqtt.c.git\ncd paho.mqtt.c\nmkdir build\ncd build\ncmake -DPAHO_WITH_SSL=true ..\nmake && sudo make install\n\n# or #\nsudo pkg install mosquitto\n
If you have both paho-mqtt
and mosquitto
installed, then paho-mqtt
is preferred.
Once mwp is built with a MQTT library, you can use an MQTT URL as a device name, for example for the demo that runs every other hour (00:00, 02:00 .. 22:00) UTC on broker.emqx.io
with topic org/mwptools/mqtt/otxplayer
, the mqtt URI for mwp would be:
mqtt://broker.emqx.io/org/mwptools/mqtt/otxplayer\n
Or in general:
mqtt://[user[:pass]@]broker[:port]/topic[?cafile=file]\n
Note:
The scheme part (mqtt://
) in the example is interpreted as:
ws://
- Websocket (vice TCP socket), ensure the websocket port is also specified, requires 'paho-mqtt' as the provider.wss://
- Encrypted websocket, ensure the TLS websocket port is also specified. TLS validation is performed using the operating system. Not supported by mosquitto
; requires paho-mqtt
1.39 or later.mqtts://
,ssl://
- Secure (TLS) TCP connection. Ensure the TLS port is specified. TLS validation is performed using the operating system, unless cafile
is provided.mqtt://
- TCP connection. If ?cafile=file
is specified, then that is used for TLS validation (and the TLS port should be specified).MQTT looks like an incredibly elegant solution to long range telemetry.
More information on the BulletGCSS website and BulletGCSS wiki
See also fl2mqtt, a tool to replay Blackbox and OpenTx logs as MQTT and BulletGCSS mosquitto hosting guide for hosting your own MQTT broker.
"},{"location":"mwp-Configuration/","title":"mwp Configuration","text":""},{"location":"mwp-Configuration/#overview","title":"Overview","text":"mwp stores configuration in a number of places, to some degree at the developer's whim, but also in accordance with the data item's volatility.
Each type is further discussed below.
"},{"location":"mwp-Configuration/#command-line-options","title":"Command line options","text":"Command line options provide a 'per instantiation' means to control mwp behaviour; the current set of command line options may be viewed by running mwp from the command line with the single option --help
:
$ mwp --help\n
Where it is required to give permanence to command line options, they can be added to the configuration file $HOME/.config/mwp/cmdopts
(on Windows $LOCALAPPDATA/mwp/cmdopts
), which is described in more detail in the following section.
Note that the documentation will habitually refer to the configuration base directory as ~/.config
as that is where it is found on the majority of OS; if you're using Windows, please adjust as necessary.
You can also use a system-wide \"cmdopts\" file, /etc/default/mwp
. If this flie exists, it will read before the user's file.
--radar-device
, definitions will be additive.The --debug-flags
option takes a numeric value defines areas where additional debug information may be output.
Values may be ORd together (so 4095 means all).
"},{"location":"mwp-Configuration/#configuration-files","title":"Configuration Files","text":"mwp configuration files are stored in a standard directory $HOME/.config/mwp
. This directory is created on first invocation if it does not exist.
$XDG_CONFIG_HOME
)$HOME/.config
$LOCALAPPDATA
/ %LOCALAPPDATA%
/ $Env:LOCALAPPDATA
The following files may be found in the mwp
directory:
cmdopts
","text":"The file cmdopts
contains command line options that the user wishes to apply permanently (and conveniently when run from a launcher icon rather than the command line).
The file contains CLI options exactly as would be issued from the terminal. Options may be on separate lines, and blank lines and line prefixed with a hash '#' are ignored. For example:
In addition to options (--
), the file may also contain environment variables e.g. FOO=BAR
.
# Default options for mwp\n--rings 50,20\n#--voice-command \"spd-say -t female2 -e\"\n#--debug-flags=2\n--dont-maximise\n#-S 8192\n# set the anonymous tile file.\nMWP_BLACK_TILE=/home/jrh/.config/mwp/mars.png\n
So here the only current, valid options are --rings 50,20 --dont-maximise
, and the environment variable MWP_BLACK_TILE is set (for anonymous maps).
The environment is set before any GTK / UI calls are made.
"},{"location":"mwp-Configuration/#map-sources","title":"Map Sources","text":"mwp provides by default:
In preparation for the announced removal of the Bing Maps service, mwp
adds a MapBox
entry where the user has acquired a Mapbox API key.
This key may be either stored in the Desktop keyring (managed by libsecret
) or as a plain text string in the gsettings
database.
Add to the keyring using secret-tool
with the following attributes:
secret-tool store --label=\"Mapbox API\" name mapbox-api-key domain org.stronnag.mwp\nPassword: *************************************************\n
"},{"location":"mwp-Configuration/#gsettings","title":"Gsettings","text":"Alternatively, the key can be added to the gsettings
database:
gsettings set org.stronnag.mwp mapbox-apikey 'pk.xxxxxxx'\n # where 'pk.xxxxxxx' is your MapBox API Key\n
Note that sadly libshumate
creates a cache directory name from which the MapBox access token may be recovered, so there is little security / privacy gain by using the secret key-ring, alas. See Gitlab issue.
sources.json
","text":"sources.json
facilitates adding non-standard map sources to mwp. See the anonymous maps section and comments in the source files in the qproxy
directory.
Here is an example mwptools/src/samples/sources.json
.
{\n \"sources\" : [\n {\n \"id\": \"OpenTopoMP\",\n \"name\": \"OpenTopo\",\n \"license\": \"(c) OSM\",\n \"license_uri\": \"http://www.openstreetmap.org/copyright\",\n \"min_zoom\": 0,\n \"max_zoom\": 19,\n \"tile_size\": 256,\n \"projection\": \"MERCATOR\",\n \"uri_format\": \"http://map-proxy/mapproxy/tiles/1.0.0/opentopo/EPSG3857/{z}/{x}/{y}.png\"\n },\n {\n \"id\": \"LandscapeMP\",\n \"name\": \"Landscape\",\n \"license\": \"(c) OSM\",\n \"license_uri\": \"http://www.openstreetmap.org/copyright\",\n \"min_zoom\": 0,\n \"max_zoom\": 19,\n \"tile_size\": 256,\n \"projection\": \"MERCATOR\",\n \"uri_format\": \"http://map-proxy/mapproxy/tiles/1.0.0/landscape/EPSG3857/{z}/{x}/{y}.png\"\n },\n {\n \"id\": \"CyclemapMP\",\n \"name\": \"Cyclemap\",\n \"license\": \"(c) OSM\",\n \"license_uri\": \"http://www.openstreetmap.org/copyright\",\n \"min_zoom\": 0,\n \"max_zoom\": 19,\n \"tile_size\": 256,\n \"projection\": \"MERCATOR\",\n \"uri_format\": \"http://map-proxy/mapproxy/tiles/1.0.0/cyclemap/EPSG3857/{z}/{x}/{y}.png\"\n },\n {\n \"id\": \"Black\",\n \"name\": \"Black Tiles\",\n \"license\": \"(c) jh \",\n \"license_uri\": \"http://daria.co.uk/\",\n \"min_zoom\": 0,\n \"max_zoom\": 20,\n \"tile_size\": 256,\n \"projection\": \"MERCATOR\",\n \"spawn\" : \"bproxy\"\n }\n ]\n}\n
See also anonymous maps to customise the \"black tile\". The spawn
stanza uses a proxy for non-TMS formats (see mwptools/src/qproxy
for some examples).
volts.css
","text":"vol.css
contains alternate CSS themeing for the battery voltage dock item that may work better on dark desktop themes. An example file is provided as mwp/vcol.css
which can be copied into .config/mwp/
.
places
","text":"The places
(~/.config/mwp/places
) file is a delimited (CSV) file that defines a list of \"shortcut\" home locations used by the \"View / Centre on Position ...\" menu item. It consists of a Name, Latitude, Longitude and optionally zoom level, separated by a TAB
,|
,:
or ;
. Note that positions may be localised in the file and thus .
is no longer recognised as a field separator.
Example places
# mwp places name,lat,lon [,zoom]\nBeaulieu|50.8047104|-1.4942621|17\nJurby:54.353974:-4.523600:-1\n
The user may maintain these files manually if used, or use the graphic places editor. The command line option --centre
accepts a place name as well as a geographic coordinates.
The underlying infrastructure used by mwp has a facility for storing configuration items in a registry like store. This is used extensively by mwp. The items can viewed and modified using a number of tools:
dconf-editor
graphical settings editorgsettings
toolFor gsettings
and dconf-editor
, the name-space is org.stronnag.mwp
, so to view the list of items:
$ gsettings list-recursively org.stronnag.mwp\n
and to list then get / set a single item:
$ gsettings get org.stronnag.mwp log-save-path\n..\n$ gsettings set org.stronnag.mwp log-save-path ~/flight-logs/\n
"},{"location":"mwp-Configuration/#dconf-editor","title":"dconf-editor","text":"This may not be installed by default, but should be available via the OS package manager / software centre.
Initial dconf-editor showing all mwp settings dconf-editor, editing a setting"},{"location":"mwp-Configuration/#list-of-mwp-settings","title":"List of mwp settings","text":"Name Summary Description Default adjust-tz Adjust FC's TZ (and DST) mwp should adjust FC's TZ (and DST) based on the local clock true ah-invert-roll Invert AH roll Set to true to invert roll in the AH (so it becomes an attitude indicator) false arming-speak speak arming states whether to reporting arming state by audio false atexit Something that is executed at exit e.g.gsettings set org.gnome.settings-daemon.plugins.power idle-dim true
. See also manage-power
(and consider setting manage-power
to true
instead). \"\" atstart Something that is executed at startup e.g. gsettings set org.gnome.settings-daemon.plugins.power idle-dim false
. See also manage-power
(and consider setting to true). \"\" audio-on-arm start audio on arm start audio on arm (and stop on disarm) true auto-follow set auto-follow set auto-follow on start true auto-restore-mission Whether to automatically import a mission in FC memory to MWP If the FC holds a valid mission in memory, and there is no mission loaded into MWP, this setting controls whether MWP automatically downloads the mission. false autoload-geozones Autoload geozones from FC Autoload geozones from FC on connect, remove from display on disconnect false autoload-safehomes Load safehomes on connect . If true, then safehomes will be loaded from the FC on connection. false baudrate Baud rate Serial baud rate 115200 beep Beep for alerts Whether to emit an alert sound for alerts. true blackbox-decode Name of the blackbox_decode application Name of the blackbox_decode application (in case there are separate for iNav and betaflight) \"blackbox_decode\" bluez-disco Use Bluetooth discovery Only discovered Bluetooth serial devices with non-zero RSSI will be offered true default-altitude Default altitude Default Altitude for mission (m) 20 default-latitude Default Latitude Default Latitude when no GPS 50.909528 default-loiter Default Loiter time Default Loiter time 30 default-longitude Default Longitude Default Longitude when no GPS -1.532936 default-map Default Map Default map key \"\" default-nav-speed Default Nav speed Default Nav speed (m/s). For calculating durations only. 2.5 default-zoom Default Map zoom Default map zoom 15 delta-minspeed Minimum speed for elapsed distance updates Minimum speed for elapsed distance updates (m/s). Default is zero, which means the elapsed distance is always updated; larger values will take out hover / jitter movements. 0.0 device-names Device names A list of device names to be added to those that can be auto-discovered [] display-distance Distance units 0=metres, 1=feet, 2=yards 0 display-dms Position display Show positions as dd:mm:ss rather than decimal degrees false display-speed Speed units 0=metres/sec, 1=kilometres/hour, 2=miles/hour, 3=knots 0 dump-unknown dump unknown dump unknown message payload (debug aid) false espeak-voice Default espeak voice Default espeak voice (see espeak documentation) \"en\" flash-warn Flash storage warning If a dataflash is configured for black box, and this key is non-zero, a warning in generated if the data flash is greater than \"flash-warn\" percent full. 0 flite-voice-file Default flite voice file Default flite voice file (full path, *.flitevox), see flite documentation) \"\" forward Types of message to forward Types of message to forward (none, LTM, minLTM, minMAV, all) \"minLTM\" ga-alt Units for GA Altiude 0=m, 1=ft, 2=FL 0 ga-range Units for GA Range 0=m, 1=km, 2=miles, 3=nautical miles 0 ga-speed Units for GA Speed 0=m/s, 1=kph, 2=mph, 3=knots 0 geouser User account on geonames.org A user account to query geonames.org for blackbox log timezone info. A default account of 'mwptools' is provided; however users are requested to create their own account. \"mwptools\" gpsd-host gpsd provider Provider for GCS location via gpsd. Default is \"localhost\", can be set to other host name or IP address. Setting blank (\"\") disables. \"localhost\" gpsintvl gps sanity time (m/s) gps sanity time (m/s), check for current fix 2000 ident-limit MSP_IDENT limit for MSP recognition Timeout value in seconds for a MSP FC to reply to a MSP_INDENT probe. Effectively a timeout counter in seconds. Set to a negative value to disable. 60 ignore-nm Ignore Network Manager Set to true to always ignore NM status (may slow down startup) false kml-path Directory for KML overlays Directory for KML overlays, default = current directory \"\" led GPS LED colour GPS LED colour as well know string or #RRGGBB \"#60ff00\" log-on-arm start logging on arm start logging on arm (and stop on disarm) false log-path Directory for replay log files Directory for log files (for replay), default = current directory \"\" log-save-path Directory for storing log files Directory for log files (for save), default = current directory \"\" los-margin Margin(m) for LOS Analysis Margin(m) for LOS Analysis 0 mag-sanity Enable mag sanity checking mwp offers a primitive mag sanity checker that compares compass heading with GPS course over the ground using LTM (only). There are various hard-coded constraints (speed > 3m/s, certain flight modes) and two configurable parameters that should be set here in order to enable this check. The parameters are angular difference (\u2070) and duration (s). The author finds a settings of 45,3 (i.e. 45\u2070 over 3 seconds) works OK, detecting real instances (a momentarily breaking cable) and not reporting false positives. \"\" manage-power manage power and screen whether to manage idle and screen saver false map-sources Additional Map sources JSON file defining additional map sources \"\" mapbox-apikey Mapbox API Key Mapbox API key, enables Mapbox as a map Provider. Setting blank (\"\") disables. \"\" max-climb-angle Maximum climb angle highlight for terrain analysis If non-zero, any climb angles exceeding the specified value will be highlighted in Terrain Analysis Climb / Dive report. Note that the absolute value is taken as a positive (climb) angle 0.0 max-dive-angle Maximum dive angle highlight for terrain analysis If non-zero, any dive angles exceeding the specified value will be highlighted in Terrain Analysis Climb / Dive report. Note that the absolute value is taken as a negative (dive) angle 0.0 max-home-delta home position delta (m) Maximum variation of home position without verbal alert 2.5 max-radar-slots Maximum number of aircraft Maximum number of aircraft reported by iNav-radar 4 max-wps Maximum number of WP supported Maximum number of WP supported 120 min-dem-zoom Minimum zoom for DEM loading DEMs will not be fetched if zoom is below this value 9 misc-icon-size Miscellaneous icon size Size for miscellaneous icons (radar, GCS location) in pixels. -1 means the image's natural size (no scaling). 32 mission-meta-tag use meta vice mwp in mission file If true, the legacy 'mwp' tag is named 'meta' false mission-path Directory for mission files Directory for mission files, default = current directory \"\" msp2-adsb MSP2_ADSB_VEHICLE_LIST usage Options for requesting MSP2_ADSB_VEHICLE_LIST. \"off\": never request, \"on:\" always request, \"auto:\" heuristic based on serial settings / bandwidth \"off\" osd-mode Data items overlaid on the map 0 = none, 1 = current WP/Max WP, 2 = next WP distance and course. This is a mask, so 3 means both OSD items. 3 p-height Internal setting 720 p-is-fullscreen Internal setting false p-is-maximised Internal setting true p-pane-width Internal setting Please do not change this unless you appreciate the consequences 0 p-width Internal setting 1280 poll-timeout Poll messages timeout (ms) Timeout in milliseconds for telemetry poll messages. Note that timer loop has a resolution of 100ms. 900 pos-is-centre Determines position label content Whether the position label is the centre or pointer location false radar-alert-altitude Altitude below which ADS-B alerts may be generated Target altitude (metres) below which ADS-B proximity alerts may be generated. Requires that 'radar-alert-range' is also set (non-zero). Setting to 0 disables. Note that ADS-B altitudes are AMSL (or geoid). 0 radar-alert-range Range below which ADS-B alerts may be generated Target range (metres) below which ADS-B proximity alerts may be generated. Requires that 'radar-alert-altitude' is also set (non-zero). Setting to 0 disables. 0 radar-list-max-altitude Maximum altitude for targets to show in the radar list view Maximum altitude (metres) to include targets in the radar list view. Targets higher than this value will show only in the map view. This is mainly for ADS-B receivers where there is no need for high altitude targets to be shown. Setting to 0 disables. Note that ADS-B altitudes are AMSL (or geoid). 0 rings-colour range rings colour range rings colour as well know string or #RRGGBBAA \"#ffffff20\" rth-autoland Set land on RTH waypoints Automatically assert land on RTH waypoints false say-bearing Whether audio report includes bearing Whether audio report includes bearing true show-sticks Whether to show sticks in log replay If \"yes\", stick position is shown bottom right during log replay, if \"no\" , never shown. If \"icon\", then it shown iconified (bottom right) \"icon\" sidebar-type Sidebar type Options for the sidebar type. Unless you know better, leave at auto \"auto\" smartport-fuel-unit User selected fuel type Units label for smartport fuel (none, %, mAh, mWh) \"none\" speak-amps When to speak amps/hr used none, live-n, all-n n=1,2,4 : n = how often spoken (modulus basically) \"none\" speak-interval Interval between voice prompts Interval between voice prompts, 0 disables 15 speech-api API for speech synthesis espeak, speechd, flite. Only change this if you know you have the required development files at build time \"espeak\" speechd-voice Default speechd voice Default speechd voice (see speechd documentation) \"male1\" stats-timeout timeout for flight statistics display (s) Timeout before the flight statistics popup automatically closes. A value of 0 means no timeout. 30 symbol-scale Symbol scale Symbol scale factor, scales map symbols as multiplier. 1.0 touch-factor Touch (Hi)DPI scaling Adjustment factor for HiDpi touch screens (0 disable, often 1.5 or 2.0). 0.0 touch-scale Touch symbol scale Symbol scale factor, scales map symbols as multiplier (for touch screens) 1.0 uc-mission-tags Upper case mission XML tags If true, MISSION, VERSION and MISSIONITEM tags are upper case (for interoperability with legacy Android applications) false uilang Language Handling \"en\" do everything as English (UI numeric decimal points, voice), \"ev\" do voice as English (so say 'point' for decimals even when shown as 'comma') \"\" view-mode UAV view mode Options for model view \"inview\" vlevels Voltage levels Semi-colon(;) separated list of cell voltages values for transition between voltage label colours \"\" window-scale Window size as percent of monitor Default window size size as percent of monitor size for non-full screen invocation. 80 wp-dist-size Font size (points) for OSD WP distance display Font size (points) for OSD WP distance display 56.0 wp-spotlight Style for the 'next waypoint' highlight Defines RGBA colour for 'next way point' highlight \"#ffffff60\" wp-text-style Style of text used for next WP display Defines the way the WP numbers are displayed. Font, size and RGBA description (or well known name, with alpha) \"Sans 72/#ff000060\" zone-detect Application to return timezone from location If supplied, the application will be used to return the timezone (in preference to geonames.org). The application should take latitude and longitude as parameters. See samples/tzget.sh \"\""},{"location":"mwp-Configuration/#replicating-gsettings-between-machines-or-users","title":"Replicating gsettings between machines or users","text":"The standard system dconf
application can be used to back up and restore the above gsettings
. To backup the settings:
dconf dump /org/stronnag/mwp >/tmp/mwp-dconf.txt\n
To restore the settings (overwrite). This could be for a different user or on a new machine.
dconf load /org/stronnag/mwp </tmp/mwp-dconf.txt\n
"},{"location":"mwp-Configuration/#settings-precedence-and-user-updates","title":"Settings precedence and user updates","text":"mwp installs a number of icon files in $prefix/share/mwp/pixmaps
. The user can override these by creating an eponymous file in the user configuration directory, ~/.config/mwp/pixmaps/
. Such user configurations are never over-written on upgrade.
For example, to replace a mwp specific icon; i.e. replace the GCS Location icon ($prefix/share/mwp/pixmaps/gcs.svg
) with a user defined file ~/.config/mwp/pixmaps/gcs.svg
.
While the file name must be consistent, the format does not have to be; the replacement could be be a PNG, rather than SVG; we're not MSDOS and file \"extensions\" are an advisory illusion.
"},{"location":"mwp-Configuration/#example","title":"Example","text":"e.g. replace the inav-radar icon.
mkdir -p ~/config/mwp/pixmaps\n# copy the preview image\ncp ~/.local/share/mwp/pixmaps/preview.png ~/config/mwp/pixmaps/\n# (optionally) resize it to 32x32 pixels\nmogrify -resize 80% ~/config/mwp/pixmaps/preview.png\n# and rename it, mwp doesn't care about the 'extension', this is not MSDOS:)\nmv ~/config/mwp/pixmaps/preview.png ~/config/mwp/pixmaps/inav-radar.svg\n# and verify ... perfect\nfile ~/.config/mwp/pixmaps/inav-radar.svg\n/home/jrh/.config/mwp/pixmaps/inav-radar.svg: PNG image data, 32 x 32, 8-bit/color RGBA, non-interlaced\n
Note also that the resize step is no longer required, as mwp scales the icon according to the misc-icon-size
setting.
mwp recognises the following application specific environment variables
Name \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 UsageCFG_UGLY_XML
Generate ugly multi-mission XML, so as not to confuse the inav configurator MWP_ARGS
Extra command line arguments MWP_BLACK_TILE
Specify a black tile to be used by the Black Tiles map proxy MWP_LOG_DIR
Location of console logs ($HOME if undefined) MWP_PRINT_RAW
If defined, output hex bytes from serial I/O MWP_TIME_FMT
The time format for log output; by default \"%FT%T%z\", any GLib2 DateTime (strftime-like) format may be used; \"%T.%f\" works well on modern GLib."},{"location":"mwp-Configuration/#mime-types-for-common-file-formats","title":"Mime types for common file formats","text":"mwp adds XDG mime types for certain file types handled by mwp.
Data Source Mime Type File Manager DnD Multiwii Mission (XML) application/vnd.mw.mission Yes 1 Yes 2 Blackbox log application/vnd.blackbox.log Yes Yes Mwp telemetry log application/vnd.mwp.log Yes Yes Multiwii mission (mwp JSON) application/vnd.mwp.json.mission Yes Yes OTX telemetry log application/vnd.otx.telemetry.log No YesNotes:
1. The file manager (at least Nautilus / Gnome) will offer mwp as the default application to open the file.
2. DnD. The file can be dropped onto the mwp map and will be opened. The file may also be provided on the mwp command line without --option
; e.g. mwp --mission demo.mission
and mwp demo.mission
will behave in the same way.
mwp provides a Dbus API to permit remote control or monitoring of mwp by third party applications.
Dbus is a common Linux API for inter-process communications, and can be used from most programming languages. mwptools/src/samples
provides examples in python
, ruby
and bash
.
It is intended that that the ruby
examples cover the majority of the API and provide canonical examples of usage.
As this is a developer topic, please raise GitHub issues if clarification is needed or you have a use case that would benefit from extending the API.
Please also note that the definitive definition of the DBus API is provided by DBus inspection.
"},{"location":"mwp-Dbus-API/#dbus-object-and-interface","title":"DBus object and interface","text":"The mwp Dbus API exists on the session bus when mwp is running.
/org/stronnag/mwp
\"org.stronnag.mwp\"
A set of APIs is provided for synchronous and asynchronous (signals, event by event) notification of vehicle status and location. A use case might be to drive an antenna tracker.
"},{"location":"mwp-Dbus-API/#flight-status-and-geo-location-methods","title":"Flight status and geo-location methods","text":""},{"location":"mwp-Dbus-API/#getmodenames","title":"GetModeNames","text":"Returns human-readable names for the FC 'mode' returned by GetState
, as an array of strings. The size of the array is the return value. These are effectively LTM modes.
int GetModeNames(out string[] states_names)\n\n<method name=\"GetModeNames\">\n <arg type=\"as\" name=\"names\" direction=\"out\"/>\n <arg type=\"i\" name=\"result\" direction=\"out\"/>\n</method>\n
"},{"location":"mwp-Dbus-API/#getstate","title":"GetState","text":"Returns the FC 'state' and 'mode'. state 0 if unarmed. Human-readable mode names are provided by(sic) GetModeNames()
.
void GetState(out int state, out int mode)\n\n<method name=\"GetState\">\n <arg type=\"i\" name=\"state\" direction=\"out\"/>\n <arg type=\"i\" name=\"mode\" direction=\"out\"/>\n</method>\n
"},{"location":"mwp-Dbus-API/#gethome","title":"GetHome","text":"Returns the home location as latitude (WGS84 decimal degrees), longitude (WGS84 decimal degrees) and relative altitude (metres, which should always be 0).
void GetHome(out double latitude, out double longitude, out int32 altitude)\n\n<method name=\"GetHome\">\n <arg type=\"d\" name=\"latitude\" direction=\"out\"/>\n <arg type=\"d\" name=\"longitude\" direction=\"out\"/>\n <arg type=\"i\" name=\"altitude\" direction=\"out\"/>\n</method>\n
"},{"location":"mwp-Dbus-API/#getlocation","title":"GetLocation","text":"Returns the vehicle location as latitude (WGS84 decimal degrees), longitude (WGS84 decimal degrees) and relative altitude (metres).
void GetLocation(out double latitude, out double longitude, out int32 altitude)\n\n<method name=\"GetLocation\">\n <arg type=\"d\" name=\"latitude\" direction=\"out\"/>\n <arg type=\"d\" name=\"longitude\" direction=\"out\"/>\n <arg type=\"i\" name=\"altitude\" direction=\"out\"/>\n</method>\n
"},{"location":"mwp-Dbus-API/#getsats","title":"GetSats","text":"Returns the number of satellites and the fix type (0=nofix, 1=undefined, 2=2D fix, 3=3D fix).
void GetSats(out uint8 number_satellites, uint8 fix_type)\n\n<method name=\"GetSats\">\n <arg type=\"y\" name=\"nsats\" direction=\"out\"/>\n <arg type=\"y\" name=\"fix\" direction=\"out\"/>\n</method>\n
"},{"location":"mwp-Dbus-API/#getvelocity","title":"GetVelocity","text":"Returns the vehicle speed (m/s) and course (degrees), GPS provided.
void GetVelocity(out uint32 speed, out uint32 course)\n\n<method name=\"GetVelocity\">\n <arg type=\"u\" name=\"speed\" direction=\"out\"/>\n <arg type=\"u\" name=\"course\" direction=\"out\"/>\n</method>\n
"},{"location":"mwp-Dbus-API/#getpolarcoordinates","title":"GetPolarCoordinates","text":"Returns the vehicle location as polar coordinates relative the home position: Range (m), Bearing (degrees) from home to vehicle, azimuth (elevation angle, degrees).
void GetPolarCoordinates(out uint32 range, out uint32 direction, out uint32 azimuth)\n\n<method name=\"GetPolarCoordinates\">\n <arg type=\"u\" name=\"range\" direction=\"out\"/>\n <arg type=\"u\" name=\"direction\" direction=\"out\"/>\n <arg type=\"u\" name=\"azimuth\" direction=\"out\"/>\n</method>\n
"},{"location":"mwp-Dbus-API/#getwaypointnumber","title":"GetWaypointNumber","text":"Returns the next WP number (en-route to) or -1 if not flying WPs.
int GetWaypointNumber()\n\n<method name=\"GetWaypointNumber\">\n <arg type=\"i\" name=\"result\" direction=\"out\"/>\n</method>\n
"},{"location":"mwp-Dbus-API/#flight-status-and-geo-location-signals","title":"Flight status and geo-location signals","text":"A number of signals (asynchronous event by event notifications) are issues for changes in state and location. This avoids applications having to poll for changes. In general, the data returned is that for the eponymous Get* methods.
All location signals may be rate limited by the DbusPosInterval
property in order to avoid excessive DBus traffic.
Notifies that the home position has changed.
signal void HomeChanged (double latitude, double longitude, int altitude)\n\n<signal name=\"HomeChanged\">\n <arg type=\"d\" name=\"latitude\"/>\n <arg type=\"d\" name=\"longitude\"/>\n <arg type=\"i\" name=\"altitude\"/>\n</signal>\n
"},{"location":"mwp-Dbus-API/#locationchanged","title":"LocationChanged","text":"Notifies that the vehicle position has changed (geographic coordinates).
signal void location_changed (double latitude, double longitude, int altitude)\n\n<signal name=\"LocationChanged\">\n <arg type=\"d\" name=\"latitude\"/>\n <arg type=\"d\" name=\"longitude\"/>\n <arg type=\"i\" name=\"altitude\"/>\n</signal>\n
"},{"location":"mwp-Dbus-API/#polarchanged","title":"PolarChanged","text":"Notifies that the vehicle position has changed relative to home (polar coordinates).
signal void polar_changed(uint32 range, uint32 direction, uint32 azimuth)\n\n<signal name=\"PolarChanged\">\n <arg type=\"u\" name=\"range\"/>\n <arg type=\"u\" name=\"direction\"/>\n <arg type=\"u\" name=\"azimuth\"/>\n</signal>\n
"},{"location":"mwp-Dbus-API/#velocitychanged","title":"VelocityChanged","text":"Notifies that the vehicle velocity (course or speed) has changed.
signal void velocity_changed(uint32 speed, uint32 course)\n\n<signal name=\"VelocityChanged\">\n <arg type=\"u\" name=\"speed\"/>\n <arg type=\"u\" name=\"course\"/>\n</signal>\n
"},{"location":"mwp-Dbus-API/#statechanged","title":"StateChanged","text":"Notifies that the vehicle 'state' has changed.
signal void StateChanged(int32 state)\n\n<signal name=\"StateChanged\">\n <arg type=\"i\" name=\"state\"/>\n</signal>\n
"},{"location":"mwp-Dbus-API/#satschanged","title":"SatsChanged","text":"Notifies that the satellite status has changed.
signal void SatsChanged(uint8 nsats, uint8 fix)\n\n<signal name=\"SatsChanged\">\n <arg type=\"y\" name=\"nsats\"/>\n <arg type=\"y\" name=\"fix\"/>\n</signal>\n
"},{"location":"mwp-Dbus-API/#waypointchanged","title":"WaypointChanged","text":"Notifies that the current WP number has changed.
signal void WaypointChanged(int32 wp)\n\n<signal name=\"WaypointChanged\">\n <arg type=\"i\" name=\"wp\"/>\n</signal>\n
"},{"location":"mwp-Dbus-API/#application-status","title":"Application Status","text":""},{"location":"mwp-Dbus-API/#quit","title":"Quit","text":"The Quit
signal is issued when mwp exits, allowing a dependent application to close down gracefully or take action to wait for the bus to reappear.
Quit()\n\n<signal name=\"Quit\">\n</signal>\n
"},{"location":"mwp-Dbus-API/#properties","title":"Properties","text":""},{"location":"mwp-Dbus-API/#dbusposinterval","title":"DbusPosInterval","text":"uint dbus_pos_interval\n
Defines rate limiting for all position related signals. The value represents the minimum update interval in 0.1s intervals.
A set of APIs is provided for remote serial port and mission management.
"},{"location":"mwp-Dbus-API/#serial-ports","title":"Serial Ports","text":""},{"location":"mwp-Dbus-API/#getdevices","title":"GetDevices","text":"The GetDevices
API returns a list of the serial devices known to the mwp instance, as an array of strings.
void GetDevices(out string[]device_names)\n\n<method name=\"GetDevices\">\n <arg type=\"as\" name=\"devices\" direction=\"out\"/>\n</method>\n
"},{"location":"mwp-Dbus-API/#connectionstatus","title":"ConnectionStatus","text":"The ConnectionStatus
API returns a boolean status as to whether mwp
is connected to a serial device, and if connected, the name of the device.
bool ConnectionsStatus(out string device_name)\n\n<method name=\"ConnectionStatus\">\n <arg type=\"s\" name=\"device\" direction=\"out\"/>\n <arg type=\"b\" name=\"result\" direction=\"out\"/>\n</method>\n
"},{"location":"mwp-Dbus-API/#connectdevice","title":"ConnectDevice","text":"The ConnectDevice
API attempts connection to the given device, and returns the status of the operation (true
=> connected).
bool ConnectDevice(string device_name)\n\n<method name=\"ConnectDevice\">\n <arg type=\"s\" name=\"device\" direction=\"in\"/>\n <arg type=\"b\" name=\"result\" direction=\"out\"/>\n</method>\n
"},{"location":"mwp-Dbus-API/#mission-management","title":"Mission Management","text":"Somewhat inconsistent set of mission management APIs. Note these are not yet multi-mission aware.
"},{"location":"mwp-Dbus-API/#clearmission","title":"ClearMission","text":"Clears the current mission from mwp.
void ClearMission()\n\n<method name=\"ClearMission\">\n</method>\n
"},{"location":"mwp-Dbus-API/#setmission","title":"SetMission","text":"Opens a mission in mwp from an XML or JSON document, returns the number of mission points.
int SetMission(string mission)\n\n<method name=\"SetMission\">\n <arg type=\"s\" name=\"mission\" direction=\"in\"/>\n <arg type=\"u\" name=\"result\" direction=\"out\"/>\n </method>\n
"},{"location":"mwp-Dbus-API/#loadmission","title":"LoadMission","text":"Opens a mission in mwp from an mission file, returns the number of mission points.
int LoadMission(string filename)\n\n<method name=\"LoadMission\">\n <arg type=\"s\" name=\"filename\" direction=\"in\"/>\n <arg type=\"u\" name=\"result\" direction=\"out\"/>\n</method>\n
"},{"location":"mwp-Dbus-API/#uploadmission","title":"UploadMission","text":"Loads the current mwp mission into the flight controller, optionally saving to it EEPROM. Returns the number of mission points.
int UploadMission(bool to_eeprom)\n\n<method name=\"UploadMission\">\n <arg type=\"b\" name=\"to_eeprom\" direction=\"in\"/>\n <arg type=\"i\" name=\"result\" direction=\"out\"/>\n</method>\n
"},{"location":"mwp-Dbus-API/#examples","title":"Examples","text":"samples/mwp-dbus-test.sh
samples/mwp-dbus.rb
samples/mwp-dbus.py
samples/mwp-dbus-loc.rb
samples/mwp-dbus-loc.py
samples/mwp-dbus-to-gpx.rb
Not withstanding the state of the documentation, it is possible introspect the API. Note that mwp must be running for the API to exist. The document returned by DBus introspection is the definitive definition of the API.
# Note samples/mwp-dbus-loc.rb also provides introspection.\n$ samples/mwp-dbus-test.sh introspect\n<!DOCTYPE node PUBLIC \"-//freedesktop//DTD D-BUS Object Introspection 1.0//EN\"\n \"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd\">\n<!-- GDBus 2.60.3 -->\n<node>\n <interface name=\"org.freedesktop.DBus.Properties\">\n <method name=\"Get\">\n <arg type=\"s\" name=\"interface_name\" direction=\"in\"/>\n <arg type=\"s\" name=\"property_name\" direction=\"in\"/>\n <arg type=\"v\" name=\"value\" direction=\"out\"/>\n </method>\n <method name=\"GetAll\">\n <arg type=\"s\" name=\"interface_name\" direction=\"in\"/>\n <arg type=\"a{sv}\" name=\"properties\" direction=\"out\"/>\n </method>\n <method name=\"Set\">\n <arg type=\"s\" name=\"interface_name\" direction=\"in\"/>\n <arg type=\"s\" name=\"property_name\" direction=\"in\"/>\n <arg type=\"v\" name=\"value\" direction=\"in\"/>\n </method>\n <signal name=\"PropertiesChanged\">\n <arg type=\"s\" name=\"interface_name\"/>\n <arg type=\"a{sv}\" name=\"changed_properties\"/>\n <arg type=\"as\" name=\"invalidated_properties\"/>\n </signal>\n </interface>\n <interface name=\"org.freedesktop.DBus.Introspectable\">\n <method name=\"Introspect\">\n <arg type=\"s\" name=\"xml_data\" direction=\"out\"/>\n </method>\n </interface>\n <interface name=\"org.freedesktop.DBus.Peer\">\n <method name=\"Ping\"/>\n <method name=\"GetMachineId\">\n <arg type=\"s\" name=\"machine_uuid\" direction=\"out\"/>\n </method>\n </interface>\n <interface name=\"org.stronng.mwp\">\n <method name=\"GetStateNames\">\n <arg type=\"as\" name=\"names\" direction=\"out\"/>\n <arg type=\"i\" name=\"result\" direction=\"out\"/>\n </method>\n <method name=\"GetVelocity\">\n <arg type=\"u\" name=\"speed\" direction=\"out\"/>\n <arg type=\"u\" name=\"course\" direction=\"out\"/>\n </method>\n <method name=\"GetPolarCoordinates\">\n <arg type=\"u\" name=\"range\" direction=\"out\"/>\n <arg type=\"u\" name=\"direction\" direction=\"out\"/>\n <arg type=\"u\" name=\"azimuth\" direction=\"out\"/>\n </method>\n <method name=\"GetHome\">\n <arg type=\"d\" name=\"latitude\" direction=\"out\"/>\n <arg type=\"d\" name=\"longitude\" direction=\"out\"/>\n <arg type=\"d\" name=\"altitude\" direction=\"out\"/>\n </method>\n <method name=\"GetLocation\">\n <arg type=\"d\" name=\"latitude\" direction=\"out\"/>\n <arg type=\"d\" name=\"longitude\" direction=\"out\"/>\n <arg type=\"d\" name=\"altitude\" direction=\"out\"/>\n </method>\n <method name=\"GetState\">\n <arg type=\"i\" name=\"result\" direction=\"out\"/>\n </method>\n <method name=\"GetSats\">\n <arg type=\"y\" name=\"nsats\" direction=\"out\"/>\n <arg type=\"y\" name=\"fix\" direction=\"out\"/>\n </method>\n <method name=\"SetMission\">\n <arg type=\"s\" name=\"mission\" direction=\"in\"/>\n <arg type=\"u\" name=\"result\" direction=\"out\"/>\n </method>\n <method name=\"LoadMission\">\n <arg type=\"s\" name=\"filename\" direction=\"in\"/>\n <arg type=\"u\" name=\"result\" direction=\"out\"/>\n </method>\n <method name=\"ClearMission\">\n </method>\n <method name=\"GetDevices\">\n <arg type=\"as\" name=\"devices\" direction=\"out\"/>\n </method>\n <method name=\"UploadMission\">\n <arg type=\"b\" name=\"to_eeprom\" direction=\"in\"/>\n <arg type=\"i\" name=\"result\" direction=\"out\"/>\n </method>\n <method name=\"ConnectionStatus\">\n <arg type=\"s\" name=\"device\" direction=\"out\"/>\n <arg type=\"b\" name=\"result\" direction=\"out\"/>\n </method>\n <method name=\"ConnectDevice\">\n <arg type=\"s\" name=\"device\" direction=\"in\"/>\n <arg type=\"b\" name=\"result\" direction=\"out\"/>\n </method>\n <signal name=\"HomeChanged\">\n <arg type=\"d\" name=\"latitude\"/>\n <arg type=\"d\" name=\"longitude\"/>\n <arg type=\"i\" name=\"altitude\"/>\n </signal>\n <signal name=\"LocationChanged\">\n <arg type=\"d\" name=\"latitude\"/>\n <arg type=\"d\" name=\"longitude\"/>\n <arg type=\"i\" name=\"altitude\"/>\n </signal>\n <signal name=\"PolarChanged\">\n <arg type=\"u\" name=\"range\"/>\n <arg type=\"u\" name=\"direction\"/>\n <arg type=\"u\" name=\"azimuth\"/>\n </signal>\n <signal name=\"VelocityChanged\">\n <arg type=\"u\" name=\"speed\"/>\n <arg type=\"u\" name=\"course\"/>\n </signal>\n <signal name=\"StateChanged\">\n <arg type=\"i\" name=\"state\"/>\n </signal>\n <signal name=\"SatsChanged\">\n <arg type=\"y\" name=\"nsats\"/>\n <arg type=\"y\" name=\"fix\"/>\n </signal>\n <signal name=\"Quit\">\n </signal>\n <property type=\"u\" name=\"DbusPosInterval\" access=\"readwrite\"/>\n </interface>\n</node>\n
"},{"location":"mwp-Gtk4-migration-guide/","title":"mwp Migration Guide","text":"This document describes the migration from legacy (Gtk+-3.0) mwp to contemporary (Gtk4) mwp.
"},{"location":"mwp-Gtk4-migration-guide/#system-requirements","title":"System Requirements","text":"The following are minimum versions.
For replaying blackbox log, bbl2kml 1.0.24 or later is rquired.
"},{"location":"mwp-Gtk4-migration-guide/#gsettings-dconf-schema","title":"GSettings /DConf schema","text":"The gsettings / dconf schema is now /org/stronnag/mwp/
. The keys are (mainly) the same as for legacy mwp/gtk3 and may be migrated:
dconf dump /org/mwptools/planner/ | dconf load /org/stronnag/mwp/\n
Full list of settings is at the end of this document.
"},{"location":"mwp-Gtk4-migration-guide/#libshumate","title":"libshumate","text":"libshumate is the replacement for the obsolete libchamplain. libshumate
uses a different cache directory organisation compared to libchamplain
. If required, you can bulk move (rsync
etc.) your old libchamplain
files to the new locations.
The old files are under ~/.cache/champlain/
, the new cache ~/.cache/shumate/
; the following table illustrates the naming for Bing and OpenStreetmap caches. Other caches follow a similar pattern.
libchamplain
libshumate
osm-mapnik
https___tile_openstreetmap_org__z___x___y__png
BingProxy
http___localhost_31897_Bing__z___x___y__png
"},{"location":"mwp-Gtk4-migration-guide/#map-sources","title":"Map Sources","text":"In preparation for the announced removal of the Bing Maps service, mwp
adds two new imagery sources:
libsecret
) or as a plain text string in the gsettings
database.Add to the MapBox key to the user keyring using secret-tool
with the following attributes:
secret-tool store --label=\"Mapbox API\" name mapbox-api-key domain org.stronnag.mwp\nPassword: *************************************************\n
"},{"location":"mwp-Gtk4-migration-guide/#gsettings","title":"Gsettings","text":"Alternatively, the key can be added to the gsettings
database:
gsettings set org.stronnag.mwp mapbox-apikey 'pk.xxxxxxx'\n # where 'pk.xxxxxxx' is your MapBox API Key\n
Note that sadly libshumate
creates a cache directory name from which the MapBox access token may be recovered, so there is little security / privacy gain by using the secret key-ring, alas. See Gitlab issue.
While it lasts, the Bing services (no registration required) provide:
As libgdl
is retired, a simple, bespoke panel comprising embedded resizeable panes has been implemented. The configuration may be user defined by a simple text file ~/.config/mwp/panel.conf
.
Each entry is defined by a comma separated line defining the panel widget, the row (0-3) and the column (0-2) and an optional minimum size (only required for the artificial horizon). The default panel is defined (in the absence of a configuration file) as:
# default widgets\nahi,0,1,100\nrssi, 1, 0\ndirn, 1, 1\nflight, 2, 0\nvolts, 3, 0\n
Which appears as:
The available panel widgets are named as:
Name Usageahi
Artificial horizon dirn
Direction comparison flight
\"Flight View\" Position / Velocity / Satellites etc, volts
Battery information vario
Vario indicator No other legacy widgets have been migrated.
So using the following ~/.config/mwp/panel.conf
# default + vario widgets\nahi,0,1,100\nvario,0,2\nrssi, 1, 0\ndirn, 1, 1\nflight, 2, 0\nvolts, 3, 0\n
would appear as:
"},{"location":"mwp-Gtk4-migration-guide/#coexistence","title":"Coexistence","text":"mwp (Gtk4) and legacy (Gtk+-3.0) versions can coexist.
If you use any of the map proxies (bproxy
, gmproxy
), you must use the latest version.
There are a couple of Gtk related environment variables that may affect the performance of mwp, particularly on older or less well supported GPUs:
GSK_RENDERER
: Recently the Gtk renderer default was changed from gl
to ngl
(4.14+) to vulkan
(4.16+). On some older / less well supported GPUs it may be necessary to use the cairo
renderer; cairo
is also necessary on the author's touch screen tablet for correct touch screen WP dragging. Note that there may well be trade offs: on one of the author's machines, WP dragging seems slightly snappier using the cairo
GSK_RENDERER
, however the CPU usage for BBL replay is much greater using cairo
compared to vulkan
.GDK_BACKEND
: In the event that your hardware / software stack is almost hopelessly broken such that mwp is aborted with a Gdk message like \"Error 71 (Protocol error) dispatching to Wayland display\", then setting this variable to x11
may allow mwp
to continue.From mwp 24.10.28, mwp will set GSK_RENDERER=cairo
for its own use if the OS or user has not previously set GSK_RENDERER
.
The environment variable(s) may be set in ~/.config/mwp/cmdopts
for mwp exclusive use if required.
GSK_RENDERER=cairo\n
Otherwise, the variable(s) may be set in /etc/environment
, .profile
or a .config/environment.d
file if required.
If you use a map sources file in ~/.config/mwp
, you may optionally convert the #X#
elements (for X, Y, Z) replacing with more standard {x}
etc.
For the Debian package runtime dependencies:
libadwaita-1-0 (>= 1.5~beta)\nlibc6 (>= 2.38)\nlibcairo2 (>= 1.2.4)\nlibgdk-pixbuf-2.0-0 (>= 2.22.0)\nlibglib2.0-0t64 (>= 2.80.0)\nlibgraphene-1.0-0 (>= 1.5.4)\nlibgstreamer1.0-0 (>= 1.6.0)\nlibgtk-4-1 (>= 4.13.5)\nlibgudev-1.0-0 (>= 146)\nlibjson-glib-1.0-0 (>= 1.5.2)\nlibpaho-mqtt1.3 (>= 1.3.0)\nlibpango-1.0-0 (>= 1.14.0)\nlibprotobuf-c1 (>= 1.0.1)\nlibsecret-1-0 (>= 0.7)\nlibshumate-1.0-1 (>= 1.0.0~alpha.1+20220818)\nlibsoup-3.0-0 (>= 3.3.1)\nlibtinfo6 (>= 6)\nlibvte-2.91-gtk4-0\nlibxml2 (>= 2.7.4)\n
Example packages: sudo apt install -y blueprint-compiler libprotobuf-c-dev \\\n libvte-2.91-gtk4-dev libshumate-dev libpaho-mqtt-dev libgtk-4-dev \\\n libadwaita-1-dev libsecret-1-dev\n
"},{"location":"mwp-Gtk4-migration-guide/#ubuntu","title":"Ubuntu","text":"The Ubuntu 24.04 version of meson
is too old. A more update version may be installed locally using pipx
. For Ubuntu 24.10, the distro version is adequate.
sudo apt install pipx\npipx install meson\n
Other packages as for Debian.
"},{"location":"mwp-Gtk4-migration-guide/#fedora","title":"Fedora","text":"Example package list:
sudo dnf5 install -y libshumate-devel vte291-gtk4-devel protobuf-c-devel \\\n paho-c-devel blueprint-compiler gtk4-devel libsecret-devel\n
"},{"location":"mwp-Gtk4-migration-guide/#macos","title":"MacOS","text":"Requires mwptools 2024.11.20 or later.
meson
and ninja
gsettings set org.gnome.settings-daemon.plugins.power idle-dim true
. See also manage-power
(and consider setting manage-power
to true
instead). \"\" atstart Something that is executed at startup e.g. gsettings set org.gnome.settings-daemon.plugins.power idle-dim false
. See also manage-power
(and consider setting to true). \"\" audio-on-arm start audio on arm start audio on arm (and stop on disarm) true auto-follow set auto-follow set auto-follow on start true auto-restore-mission Whether to automatically import a mission in FC memory to MWP If the FC holds a valid mission in memory, and there is no mission loaded into MWP, this setting controls whether MWP automatically downloads the mission. false autoload-geozones Autoload geozones from FC Autoload geozones from FC on connect, remove from display on disconnect false autoload-safehomes Load safehomes on connect . If true, then safehomes will be loaded from the FC on connection. false baudrate Baud rate Serial baud rate 115200 beep Beep for alerts Whether to emit an alert sound for alerts. true blackbox-decode Name of the blackbox_decode application Name of the blackbox_decode application (in case there are separate for iNav and betaflight) \"blackbox_decode\" bluez-disco Use Bluetooth discovery Only discovered Bluetooth serial devices with non-zero RSSI will be offered true default-altitude Default altitude Default Altitude for mission (m) 20 default-latitude Default Latitude Default Latitude when no GPS 50.909528 default-loiter Default Loiter time Default Loiter time 30 default-longitude Default Longitude Default Longitude when no GPS -1.532936 default-map Default Map Default map key \"\" default-nav-speed Default Nav speed Default Nav speed (m/s). For calculating durations only. 2.5 default-zoom Default Map zoom Default map zoom 15 delta-minspeed Minimum speed for elapsed distance updates Minimum speed for elapsed distance updates (m/s). Default is zero, which means the elapsed distance is always updated; larger values will take out hover / jitter movements. 0.0 device-names Device names A list of device names to be added to those that can be auto-discovered [] display-distance Distance units 0=metres, 1=feet, 2=yards 0 display-dms Position display Show positions as dd:mm:ss rather than decimal degrees false display-speed Speed units 0=metres/sec, 1=kilometres/hour, 2=miles/hour, 3=knots 0 dump-unknown dump unknown dump unknown message payload (debug aid) false espeak-voice Default espeak voice Default espeak voice (see espeak documentation) \"en\" flash-warn Flash storage warning If a dataflash is configured for black box, and this key is non-zero, a warning in generated if the data flash is greater than \"flash-warn\" percent full. 0 flite-voice-file Default flite voice file Default flite voice file (full path, *.flitevox), see flite documentation) \"\" forward Types of message to forward Types of message to forward (none, LTM, minLTM, minMAV, all) \"minLTM\" ga-alt Units for GA Altiude 0=m, 1=ft, 2=FL 0 ga-range Units for GA Range 0=m, 1=km, 2=miles, 3=nautical miles 0 ga-speed Units for GA Speed 0=m/s, 1=kph, 2=mph, 3=knots 0 geouser User account on geonames.org A user account to query geonames.org for blackbox log timezone info. A default account of 'mwptools' is provided; however users are requested to create their own account. \"mwptools\" gpsd-host gpsd provider Provider for GCS location via gpsd. Default is \"localhost\", can be set to other host name or IP address. Setting blank (\"\") disables. \"localhost\" gpsintvl gps sanity time (m/s) gps sanity time (m/s), check for current fix 2000 ident-limit MSP_IDENT limit for MSP recognition Timeout value in seconds for a MSP FC to reply to a MSP_INDENT probe. Effectively a timeout counter in seconds. Set to a negative value to disable. 60 ignore-nm Ignore Network Manager Set to true to always ignore NM status (may slow down startup) false kml-path Directory for KML overlays Directory for KML overlays, default = current directory \"\" led GPS LED colour GPS LED colour as well know string or #RRGGBB \"#60ff00\" log-on-arm start logging on arm start logging on arm (and stop on disarm) false log-path Directory for replay log files Directory for log files (for replay), default = current directory \"\" log-save-path Directory for storing log files Directory for log files (for save), default = current directory \"\" los-margin Margin(m) for LOS Analysis Margin(m) for LOS Analysis 0 mag-sanity Enable mag sanity checking mwp offers a primitive mag sanity checker that compares compass heading with GPS course over the ground using LTM (only). There are various hard-coded constraints (speed > 3m/s, certain flight modes) and two configurable parameters that should be set here in order to enable this check. The parameters are angular difference (\u2070) and duration (s). The author finds a settings of 45,3 (i.e. 45\u2070 over 3 seconds) works OK, detecting real instances (a momentarily breaking cable) and not reporting false positives. \"\" manage-power manage power and screen whether to manage idle and screen saver false map-sources Additional Map sources JSON file defining additional map sources \"\" mapbox-apikey Mapbox API Key Mapbox API key, enables Mapbox as a map Provider. Setting blank (\"\") disables. \"\" max-climb-angle Maximum climb angle highlight for terrain analysis If non-zero, any climb angles exceeding the specified value will be highlighted in Terrain Analysis Climb / Dive report. Note that the absolute value is taken as a positive (climb) angle 0.0 max-dive-angle Maximum dive angle highlight for terrain analysis If non-zero, any dive angles exceeding the specified value will be highlighted in Terrain Analysis Climb / Dive report. Note that the absolute value is taken as a negative (dive) angle 0.0 max-home-delta home position delta (m) Maximum variation of home position without verbal alert 2.5 max-radar-slots Maximum number of aircraft Maximum number of aircraft reported by iNav-radar 4 max-wps Maximum number of WP supported Maximum number of WP supported 120 min-dem-zoom Minimum zoom for DEM loading DEMs will not be fetched if zoom is below this value 9 misc-icon-size Miscellaneous icon size Size for miscellaneous icons (radar, GCS location) in pixels. -1 means the image's natural size (no scaling). 32 mission-meta-tag use meta vice mwp in mission file If true, the legacy 'mwp' tag is named 'meta' false mission-path Directory for mission files Directory for mission files, default = current directory \"\" msp2-adsb MSP2_ADSB_VEHICLE_LIST usage Options for requesting MSP2_ADSB_VEHICLE_LIST. \"off\": never request, \"on:\" always request, \"auto:\" heuristic based on serial settings / bandwidth \"off\" osd-mode Data items overlaid on the map 0 = none, 1 = current WP/Max WP, 2 = next WP distance and course. This is a mask, so 3 means both OSD items. 3 p-pane-width Private setting Please do not change this unless you appreciate the consequences 0 poll-timeout Poll messages timeout (ms) Timeout in milliseconds for telemetry poll messages. Note that timer loop has a resolution of 100ms. 900 pos-is-centre Determines position label content Whether the position label is the centre or pointer location false radar-alert-altitude Altitude below which ADS-B alerts may be generated Target altitude (metres) below which ADS-B proximity alerts may be generated. Requires that 'radar-alert-range' is also set (non-zero). Setting to 0 disables. Note that ADS-B altitudes are AMSL (or geoid). 0 radar-alert-range Range below which ADS-B alerts may be generated Target range (metres) below which ADS-B proximity alerts may be generated. Requires that 'radar-alert-altitude' is also set (non-zero). Setting to 0 disables. 0 radar-list-max-altitude Maximum altitude for targets to show in the radar list view Maximum altitude (metres) to include targets in the radar list view. Targets higher than this value will show only in the map view. This is mainly for ADS-B receivers where there is no need for high altitude targets to be shown. Setting to 0 disables. Note that ADS-B altitudes are AMSL (or geoid). 0 rings-colour range rings colour range rings colour as well know string or #RRGGBBAA \"#ffffff20\" rth-autoland Set land on RTH waypoints Automatically assert land on RTH waypoints false say-bearing Whether audio report includes bearing Whether audio report includes bearing true show-sticks Whether to show sticks in log replay If \"yes\", stick position is shown bottom right during log replay, if \"no\" , never shown. If \"icon\", then it shown iconified (bottom right) \"icon\" sidebar-type Sidebar type Options for the sidebar type. Unless you know better, leave at auto \"auto\" smartport-fuel-unit User selected fuel type Units label for smartport fuel (none, %, mAh, mWh) \"none\" speak-amps When to speak amps/hr used none, live-n, all-n n=1,2,4 : n = how often spoken (modulus basically) \"none\" speak-interval Interval between voice prompts Interval between voice prompts, 0 disables 15 speech-api API for speech synthesis espeak, speechd, flite. Only change this if you know you have the required development files at build time \"espeak\" speechd-voice Default speechd voice Default speechd voice (see speechd documentation) \"male1\" stats-timeout timeout for flight statistics display (s) Timeout before the flight statistics popup automatically closes. A value of 0 means no timeout. 30 symbol-scale Symbol scale Symbol scale factor, scales map symbols as multiplier. 1.0 touch-factor Touch (Hi)DPI scaling Adjustment factor for HiDpi touch screens (0 disable, often 1.5 or 2.0). 0.0 touch-scale Touch symbol scale Symbol scale factor, scales map symbols as multiplier (for touch screens) 1.0 uc-mission-tags Upper case mission XML tags If true, MISSION, VERSION and MISSIONITEM tags are upper case (for interoperability with legacy Android applications) false uilang Language Handling \"en\" do everything as English (UI numeric decimal points, voice), \"ev\" do voice as English (so say 'point' for decimals even when shown as 'comma') \"\" view-mode UAV view mode Options for model view \"inview\" vlevels Voltage levels Semi-colon(;) separated list of cell voltages values for transition between voltage label colours \"\" window-scale Window size as percent of monitor Default window size size as percent of monitor size for non-full screen invocation. 80 wp-dist-size Font size (points) for OSD WP distance display Font size (points) for OSD WP distance display 56.0 wp-spotlight Style for the 'next waypoint' highlight Defines RGBA colour for 'next way point' highlight \"#ffffff60\" wp-text-style Style of text used for next WP display Defines the way the WP numbers are displayed. Font, size and RGBA description (or well known name, with alpha) \"Sans 72/#ff000060\" zone-detect Application to return timezone from location If supplied, the application will be used to return the timezone (in preference to geonames.org). The application should take latitude and longitude as parameters. See samples/tzget.sh \"\""},{"location":"mwp-Gtk4-migration-guide/#dbus","title":"DBus","text":"The DBus name / path are changed to map the application Id; e.g. org.stronnag.mwp
and /org/stronnag/mwp
. A few of the DBus interfaces have been enhanced.
There are a number of ways of managing the screen (inhibit screen saver etc.)
Use an external screen-saver manager such as caffeine
Use the legacy mwp settings options, for example:
org.stronnag.mwp atexit 'gsettings set org.gnome.settings-daemon.plugins.power idle-dim true'\norg.stronnag.mwp atstart 'gsettings set org.gnome.settings-daemon.plugins.power idle-dim false'\n
Allow mwp to manage screen and power settings, controlled by a setting:
gsettings set org.stronnag.mwp manage-power true\n
In the first two cases, the setting is somewhat coarse, either requiring the user to click on something and applying to the whole mwp session.
The final case applies only when mwp is receiving push telemetry (LTM, Mavlink, MQTT). Inhibiting IDLE and SUSPEND is performed using the GTK inhibit() API and will thus work with most window managers.
"},{"location":"mwp-Radar-View/","title":"Radar View","text":"mwp supports the display of \"radar\" contacts. This provides a view of adjacent aircraft obtained from a number of sources:
INAV-radar. INAV radar works in conjunction with INAV flight controllers to broadcast the location of UAS fitted with an ESP32 LoRa module. mwp can listen to one of these modems in ground station mode to display the positions of the rest of the 'swarm' (up to 4 UAS); technical / MSP details.
Full size aircraft reported by the MAVLink 'Traffic Report' / 'ADSB Vehicle' message. Examples of available hardware include:
Full size aircraft typically reported using SDR (Software Defined Radios) using SBS streaming TCP protocol. This is generated by the open source dump1090 and readsb open source applications with a SDR receiver, as well as commercial products.
Full size aircraft typically reported using SDR (Software Defined Radios) using the dump1090-fa JSON format.
Full size aircraft typically reported using SDR (Software Defined Radios) using the readsb \"protobuf\" format. This is the preferred way to access SDR ADSB / Mode-S data.
Full size aircraft reported using the MSP2_ADSB_VEHICLE_LIST
message. This is generated by INAV later than 7.1.0 when a PingRX or TT-SC1 device is attached to the flight controller. This is received by the main mwp MSP port without user configuration (no need to set up a radar-device
). Due to the size of MSP2_ADSB_VEHICLE_LIST
message, mwp does not poll for MSP2_ADSB_VEHICLE_LIST
by default, see the setting key msp2-adsb
, below.
Proximity alerts (visual and audible) for manned (ADS-B / sbs-1 / dump1090 / readsb) aircraft, based on planned or actual home location.
For SDR (Software Defined Radios) using the readsb or dump1090 where the SDR host has a web server configured to supply the generated \"protobuf\" or JSON output, then mwp can obtain the data from the web server. Otherwise, it will be necessary to set up a small daemon on SDR host, see the src/samples/adsb-extra
directory for further details.
Note that the SDR protocols may also be used with network services that provide ADS-B reports (usually for a fee or for provided local data).
"},{"location":"mwp-Radar-View/#mwp-configuration","title":"mwp Configuration","text":"mwp can receive the 'radar' data over one or two connections, either or both may be active, and mwp can receive and display 'own vehicle' telemetry (MSP, LTM or Smartpost), Tracked Telemetry, 'INAV-radar' and 'MAVlink Traffic' data simultaneously. Radar data may be received over:
MSP2_ADSB_VEHICLE_LIST
.radar-device
CLI or configuration parameter (MAVLink Traffic, INAV-radar, SDR protocols)The radar-device
option is defined by the standard mwp naming scheme:
/dev/ttyACM0
, /dev/ttyUSB4@567600
, /dev/rfcomm3
00:0B:0D:87:13:A2
udp://:30001
local UDP listener.readsb
protobuf source or dump1090
JSON source over http
/https
, for example, using hosts woozle
(protobuf) and jagular
(JSON):http://woozle/readsb/data/aircraft.pb
http://jagular/dump1090/data/aircraft.json
readsb
protobuf source, defined by a special URI:pba://[[host][:port]]
(requires adsbpbsrv
on the SDR host). Host and port are optional, defaulting to localhost
and 38008
. So the minimal \"URI\" is pba://
.dump1090
JSON source, defined by a special URI:jsa://[[host][:port]]
(requires jsacsrv
on the SDR host). Host and port are optional, defaulting to localhost
and 37007
. So the minimal \"URI\" is jsa://
.sbs://[[host][:port]]
Host and port are optional, defaulting to localhost
and 30003
. So the minimal \"URI\" is sbs://
.For \"Telemetry Tracking\", please see its separate article.
The specific (not shared with the main serial port) radar device(s) may be defined on the command line, or in the static command options file (~/.config/mwp/cmdopts
):
mwp --radar-device udp://:30001
$ cat ~/.config/mwp/cmdopts
# Default options for mwp\n# using udev rule to associate a specifc USB-TTL adaptor to a name\n--radar-device=/dev/pingRX@57600\n
Multiple devices may be defined, e.g.
--radar-device=/dev/pingRX@57600 --radar-device= /dev/inavradar@115200
--radar-device=/dev/pingRX@57600,/dev/inavradar@115200
Any bespoke radar-device
is started automatically on startup (or when it shows up). It is not managed via the serial Connect
button.
The main mwp serial port may be used for MavLink Traffic and MSP2_ADSB_VEHICLE_LIST
messages without any further configuration. For INAV-radar, to use the main MSP port for INAV-radar (vice using --radar-device
), it is still necessary to add a command option to mwp; it needs to told to relax the default inbound MSP direction check.
This is enabled as
mwp --relaxed-msp\n
which should be 'mainly harmless' for normal operations. It's entirely acceptable to put this in ~/config/mwp/cmdopts
to make it the default, as the protocol check dilution is slight.
The following dconf
setting affect the radar function:
radar-list-max-altitude
Maximum altitude (metres) to show targets in the radar list view; targets higher than this value will show only in the map view. Setting to 0 disables. Note that ADS-B altitudes are AMSL (or geoid) and SDR altitudes are \"Flight Level\" (standard atmosphere). radar-alert-altitude
Target altitude (metres) below which ADS-B / SDR proximity alerts may be generated. Requires that 'radar-alert-range' is also set (none zero). Setting to 0 disables. Note that the above altitude datum. radar-alert-range
Target range (metres) below which ADS-B / SDR proximity alerts may be generated. Requires that 'radar-alert-altitude' is also set (none zero). Setting to 0 disables. ga-alt
Units for GA Altiude, enumerated as 0=m, 1=ft, 2=FL ga-range
Units for GA Range, enumerated as 0=m, 1=km, 2=miles, 3=nautical miles ga-speed
Units for GA Speed, enumerated as 0=m/s, 1=kph, 2=mph, 3=knots msp2-adsb
Options for requesting MSP2_ADSB_VEHICLE_LIST. \"off\": never request, \"on:\" always request, \"auto:\" heuristic based on serial settings / bandwidth Note that proximity alerts require that both the radar-alert-altitude
and radar-alert-range
values are set, and that there is a planned or actual home location. For readsb \"protobuf\" data, the range from the SDR is available and this will be shown as range (and used for alerts) where there is no home set (home will override).
Legacy Images
The images this section are from legacy mwp, however the capability is the same.
Once the radar interface is open, radar tracks are displayed on the map and in a list available from the \"View -> Radar View' menu option.
Id
, Status
, Last
(time) and Range
columns.Hide Tracks
(Show Tracks
) button.TTRK-
"},{"location":"mwp-Radar-View/#status","title":"Status","text":"Radar contacts have one of the following status values:
Status Explanation Undefined ADS-B: Not shown in list or on the map, INAV-Radar not armed / updated Stale The last contact was more that 120s previous. Displayed in the list and shown on the map with reduced intensity or an INAV-radar node has 'lost' status Armed An active INAV-radar contact ADS-B A live MAVLink Traffic report SDR SDR radio report (sbs, json, protobuf) Hidden A MAVLink Traffic /SDR contact is between 5 and 10 minutes old. It remains in the list but is not displayed in the map. MAVLink Traffic Report / SDR tracks are removed from the list (and internal storage) after 10 minutes inactivity. INAV-radar ground station. Stale / 'Lost' INAV-radar contacts do not expire, as they may relate to a lost model.The number displayed after the status text is:
Type Usage INAV-radar The link quality Traffic Report Time since last communication in seconds SDR reports Time since last communication in seconds"},{"location":"mwp-Radar-View/#columns","title":"Columns","text":"The columns are sortable. Note that since the introduction of Telemetry Tracking, a new column \"*\" has been added, this contains a single character indicating the source:
Indicator Source A ADS-B via MAVLink I INAV Radar S ADS-B via SDR protocol T Telemetry Tracker "},{"location":"mwp-Radar-View/#examples","title":"Examples","text":"There are simulators for both INAV-radar and MAVLink 'Traffic Report' (e.g. uAvionix PingRX) in the mwptools/src/samples/radar
directory.
There is a replay tool for SBS CSV logs mwptools/src/samples/sbs-test/sbs-player.rb
.
Any map symbol used by mwp can be changed by the user; in the image above, the INAV radar node symbol has been changed from the default stylised INAV multirotor to a smaller version of the mission replay \"paper plane\" symbol as described in creating your own icon.
"},{"location":"mwp-Radar-View/#protocol-documentation","title":"Protocol documentation","text":""},{"location":"mwp-Radar-View/#mavlink-traffic-report-eg-uavionix-pingrx","title":"MAVLink 'Traffic Report' (e.g. uAvionix PingRX)","text":"The MAVLink implementation is comprehensively documented by the vendor.
"},{"location":"mwp-Radar-View/#inav-radar","title":"INAV radar","text":"The following is required by a device wishing to act as a ground node (it either masquerades as an INAV FC, or declares itself a GCS)
INAV
or (from 2021/05/06) GCS
for generic ground control stations).INAV
and GCS
modes)INAV
and GCS
modes)INAV
mode)INAV
mode)INAV
mode)INAV
mode)Note that the device firmware assumes that MSP buffer sizes are \"as specification\"; exceeding the expected message buffer size may crash the device (mea culpa).
In GCS
mode, the node is passive; it does not use a LoRa slot and does not attempt to broadcast a location. In INAV
mode, the node takes up a LoRa slot and is expected to reply to the additional MSP queries.
mwp's behaviour is defined by the GCS Location
INAV
and return the GCS Location, which may be driven by gpsd if required.GCS
.Protocol description.
"},{"location":"mwp-area-planner/","title":"Mwp Survey Planner","text":"mwp survey / area planner is a tool to plan \"survey\" or \"search\" missions. It generates MWXML mission files compatible with mwp and the INAV Configurator. A simple \"parallel lines across a polygon\" survey pattern is supported, as well as a \"creeping square\" pattern and a spiral pattern.
"},{"location":"mwp-area-planner/#usage","title":"Usage","text":"The area planner is invoked from the \"Edit\" menu. It loads a dialogue window and presents a basic search area outline.
The drop-down in the top right offers options of:
The dialog provides options for mission creation that are common to each survey pattern:
Legacy Images
There are some older images in the samples below without the AMSL button.
"},{"location":"mwp-area-planner/#control-buttons","title":"Control Buttons","text":"The tool is controlled by the three buttons at the bottom of the window.
Apply: The settings are applied and the pattern is drawn. The button will be disabled if the size of the survey outline and the row separation values would result in an impractically large number of turning points. In order to resolve this it will be necessary to either reduce the size of the survey area or increase the row separation.
Reset View: The survey view is reset. The survey outline is reset to a rectangle covering 80% of the map. This is used to reset the area after panning or zooming out of the initial view.
Generate Mission: Generates a mission from the survey plan. The survey tool is closed. The mission may be edited / save / uploaded to the FC as normal. If the number of points would exceed the maximum number of mission points, this button is disabled. In order to resolve this it will be necessary to either reduce the size of the survey area or increase the row separation.
Points may be inserted / deleted from the survey outline from a right mouse / long press on a survey points. Insert adds a point in a clock-wise direction; delete removes the clicked point.
Points may be moved by dragging.
Any plotted outline mission will be recalculated as points are manipulated.
"},{"location":"mwp-area-planner/#parameters","title":"Parameters","text":"Once an initial solution has been plotted, changing any of the first three parameters will result in the solution being recalculated.
After a solution has been calculated, the \"Mission Data\" summary is updated.
Example of too many points being generated due to over-large area / narrow row separation:
Example of fewer points being generated with adjusted area and row separation:
Note also how the angle and turn parameters affect the staring point.
Example of generated mission with KML backdrop showing original survey area:
"},{"location":"mwp-area-planner/#square-pattern-generator","title":"\"Square\" pattern generator","text":"The \"Square\" generator provides a single draggable point with options of start angle, first leg distance and the number of iterations.
The default parameters result in the following survey pattern.
And a generated mission from these settings looks might look like:
"},{"location":"mwp-area-planner/#spiral-pattern-generator","title":"\"Spiral\" pattern generator","text":"The \"Spiral\" generator provides a single draggable point with options of first leg distance and the number of iterations. In this case, the first leg distance is the range to the 0\u00b0 radial, which is repeated for each iteration. The number of points per iteration varies with the \"radius\" in order to provide practical leg lengths within INAV's 120 mission point constraint.
The default parameters result in the following survey pattern.
And a generated mission from these settings looks might look like:
"},{"location":"mwp-area-planner/#file-menu","title":"File Menu","text":"The area planner dialog has a drop down menu to load and save area definitions to / from the file system. The files are the same format as for the legacy mwp-area-planner
.
In addition (not shown), it is also possible to save the survey outline as a KML file for future display / analysis.
"},{"location":"mwp-area-planner/#obsolete-video","title":"Obsolete video","text":"There is an old youtube video covering both the legacy mwp-area-planner
and iforce2d's on line tool.
May 2023, mwp supports an implementation of INAV's Follow Me.
In order to use this:
POSHOLD
with the GCS NAV
mode also asserted.In addition to the manual (drag icon) positioning described below, it is also possible to use a local gpsd
instance to drive the follow me location by checking the GPSd box.
Legacy Images
The remaining images this section are from legacy mwp, however the capability is the same.
Under the Edit menu, there is a new option Set FollowMe Point. Until you're armed and in POSHOLD this is not sensitive.
Now armed, but not POSHOLD (orange Home icon showing), still not sensitive ...
Now in POSHOLD. note the green POSHOLD icon ... menu option is sensitive!
Clicking the menu option invokes the FollowMe dialog:
The FollowMe desired location is indicated by the second green icon (with the \u2a01 symbol). This may be dragged to the required location. An altitude, relative to home may also be set, 0
means don't change altitude.
Once mwp has transmitted the desired location (WP#255), mwp will interrogate the FC for confirmation (WP#254, sic). This is logged, for example:
11:31:38.530919 Special WP#254 (4) 35.772714 140.361790 20m 0\u00b0\n
"},{"location":"mwp-follow-me/#caveats","title":"Caveats","text":"It's probably 6 years since anyone has used this sort of INAV functionality, so take care. In particular, I'm not sure how well the altitude item works (in the firmware, mwp appears to send the correct data). So start will plenty of altitude and 0
as the altitude setting.
Note also that this has not been flight tested; the images and data tests have been done using the INAV SITL (software in the loop), i.e. running INAV firmware as a desktop application, with fl2sitl as the (trivial) sensor provider and ser2tcp allowing a physical RX/TX to be used with the SITL.
In the event that someone flight tests this, a mwp \"stderr\" log and a blackbox log would be appreciated.
"},{"location":"mwp-geozones/","title":"mwp and Geozones","text":""},{"location":"mwp-geozones/#introduction","title":"Introduction","text":"mwp provides a UI for the Geozones function that first appeared in INAV 8.0.0. The technical details for this feature are published as part of INAV 8.0 INAV Documentation.
Version Requirements
The proposed INAV 8.0 implementation of GeoZones requires mwp 24.11.14 or later.
Geozones provides a set of geographical shapes that the FC can navigate around, characterised by:
Shape
Type
Action
The effect these parameters have on FC behaviour are described in the INAV Documentation.
"},{"location":"mwp-geozones/#geozone-validity-and-enforcement","title":"Geozone Validity and Enforcement","text":""},{"location":"mwp-geozones/#zone-geometry","title":"Zone Geometry","text":"mwp checks that Geozones conform to the FC's known rules for validity:
mwp provides a \"Check Validity\" menu option to perform ad-hoc checks. mwp will not permit the upload of an invalid Geozone set to the FC. It is however possible to save a set that mwp claims is invalid in case the user wish to dispute such categorisation with the developer.
"},{"location":"mwp-geozones/#runtime-considerations","title":"Runtime Considerations","text":"There are a number of runtime recommendations from the Geozone developer:
2 * loiter radius
(or geozone_mr_stop_distance
for multirotors) horizontally and 50 metres vertically to allow RTH to calculate a proper heading.mwp does not currently attempt to enforce the runtime recommendations nor warns of their violation.
"},{"location":"mwp-geozones/#mwp-user-interface","title":"mwp User interface","text":"Legacy Images
The majority of images this section are from legacy mwp, however the capability is the same.
"},{"location":"mwp-geozones/#menu-options","title":"Menu options","text":"mwp adds a Geozones menu option, with suboptions:
Note that the Save, Export, Clear, Download and Upload options are not sensitive if no geozone is loaded. Once a geozone is loaded, some or all of these options will be enabled. The MSP options are only enabled if the FC offers feature GEOZONE
with the INAV 8.0 feature
value of (1 << 4)
.
Note that if feature GEOZONE
is present, mwp will attempt to load Geozones from the FC if the setting autoload-geozones
is true, e.g.:
gsettings set org.stronnag.mwp autoload-geozones true\n
"},{"location":"mwp-geozones/#user-interface","title":"User Interface","text":"Edit UI Images
The image immediately below represents the current Edit UI (it has the AMSL button); other Edit UI images are from an earlier instance without this button. The altitude values have no bearing on mwp's display of the Geozones, other than in the generated KML.
The icons along the top are:
If there is no Geozone loaded, the editor is as shown at the \"new zone\" state: the \"Shape\" item is enabled and a note explains how to proceed. Note that to create a circular zone, the radius must be non-zero. If the \"Shape\" item is set to \"Polygon\", then no radius is required to proceed.
Once the required details have been entered, pressing refresh draws the template shape. circle has a dragable centre and editable radius.
A polygon has 3 points (the mimimum), each of which can be dragged.
Additional points can be added immediately in front of an existing point from the right mouse menu.
With multiple zones loaded (or created), the user can switch between zones using the <
and >
icons.
In the following image, from left to right
Zone Id Colour Characteristics Validity 0 Red Counter-clockwise Valid 1 Green Clockwise Invalid 2 Red, fill Counter-clockwise, \"complex\" Invalid 3 Green, fill Counter-clockwise, concave ValidInvalid zones are reported with the \"Check Valdity\" or \"Upload to FC\" options.
"},{"location":"mwp-geozones/#zone-colours","title":"Zone Colours","text":"mwp sets line and fill characteristics for GeoZones according to the zone's type
and action
.
The default values are set as:
Type Action Line Fill Exclusive None red 4 4 Exclusive Avoid red 4 red Exclusive PosHold red 10 red Exclusive RTH red 10 red Inclusive None green 4 4 Inclusive Avoid green 4 Inclusive PosHold green 10 Inclusive RTH green 10 greenThe values after the line colour are line width and optional dash width.
The default colours are those suggested by the user who requested that mwp support GeoZones.
The default \"red\" and \"green\" colours have some opacity set:
Type Value Line redrgba(255,0,0,0.625)
Fill red rgba(255,0,0,0.125)
Line green rgba(0,255,0,0.625)
Fill green rgba(0,255,0,0.125)
Where line width is greater than 10, the opacity is further reduced by 20% to satisfy the author's aesthetic opinion.
"},{"location":"mwp-geozones/#user-definition","title":"User definition","text":"The user may specify their own colours by creating a pipe separated file, $HOME/.config/mwp/zone_colours
. This is a text file of the format:
type|action|line_colour|line_width|line_dash|fill_colour\n
"},{"location":"mwp-geozones/#user-definition-fields","title":"User definition fields:","text":"Type: The zone type as an integer (0-1 : Exclusive / Inclusive)
Action: The zone action as an integer (0-3 : None / Avoid / Poshold / RTH).
Line Colour: see below for colour formats
Line Width: In pixels, as an integer
Line Dash: In pixels, as an integer; the line will alternate on/off using this value.
Fill Colour: see below for colour formats
"},{"location":"mwp-geozones/#colour-defintion","title":"Colour defintion","text":"Colours may be defined as:
#rrggbb
or #rrggbbaa
; orrgb(r,g,b)
); or rgba(r,g,b,a)
Where r
, g
, b
and a
are respectively the red, green, blue and alpha colour values. In the \"rgb()
\" format, r
, g
, and b
are either integers in the range 0 to 255 or percentage values in the range 0% to 100%, and a
is a floating point value in the range 0 to 1.
If the alpha component is not specified then it is set to be fully opaque.
For \"standard X11 names\", an opacity may be defined by appending a floating point value in the range 0 to 1.0 to the name, separated by a semi-colon, for example steelblue;0.8
zone_colours
file","text":"The default settings can be represented in a zone_colours
file as:
0|0|rgba(255,0,0,0.625)|4|4|\n0|1|rgba(255,0,0,0.625)|4|0|rgba(255,0,0,0.125)\n0|2|rgba(255,0,0,0.625)|10|0|rgba(255,0,0,0.125)\n0|3|rgba(255,0,0,0.625)|10|0|rgba(255,0,0,0.125)\n1|0|rgba(0,255,0,0.625)|4|4|\n1|1|rgba(0,255,0,0.625)|4|0|\n1|2|rgba(0,255,0,0.625)|10|0|\n1|3|rgba(0,255,0,0.625)|10|0|rgba(0,255,0,0.125)\n
Where fill is not required, it is left blank.
If a line cannot be parsed, an error will the logged, giving the offending line number(s). Blank lines and comment lines (starting with #
or ;
) are ignored.
Please also note that floating point values must be specified with a point (.
), even when the locale customary format would use comma (,
).
Alternate colour expressions for the first line above are therefore:
0|0|red;0.625|4|4|\n0|0|#ff0000a0|4|4|\n
"},{"location":"mwp-los-tool/","title":"Line of Sight (LOS) Tool","text":""},{"location":"mwp-los-tool/#overview","title":"Overview","text":"mwp provides a LOS tool that establishes whether there is LOS between the observer location (the mwp home icon) and arbitrary points on an INAV mission. This is may be useful to establish:
There are a number of issues to take into consideration.
mwp uses Mapzen DEM data, which improves accuracy (more users get 30m data) with better accuracy, as well as a significant performance boost and offline usage after the initial data download.
Please be aware of these accuracy / fidelity issues when evaluating the results of any elevation analysis.
"},{"location":"mwp-los-tool/#invocation","title":"Invocation","text":"Legacy Images
The images this section are from legacy mwp, however the capability is the same.
LOS is invoked from any waypoint using the right mouse button.
"},{"location":"mwp-los-tool/#line-of-sight","title":"Line of sight ...","text":"The user can select locations on the mission via a slider and run an analysis. A LOS calculation is performed, a graphical view is shown and a red (no LOS), orange (LOS below a user defined margin) or green (unconditional LOS) line is displayed on the map from the observer (home location) to the chosen location. This may be repeated as required.
"},{"location":"mwp-los-tool/#area-los","title":"Area LOS","text":"Pressing a modifier key (Shift or Control) while selecting \"Line of Sight ...\" will invoke Area LOS ; the calculation is performed automatically with 1% increments of the naive mission length. A set of resulting green/orange/red LOS lines is displayed on the map.
Note that both options are available from the LOS analysis window; the modifier option is merely a convenience.
"},{"location":"mwp-los-tool/#examples","title":"Examples","text":"When the LOS slider is displayed, the only UI actions available are:
This restriction means that the mission cannot be changed while a LOS Analysis is being performed.
"},{"location":"mwp-los-tool/#manual-los-analysis","title":"Manual LOS Analysis","text":"In the image below, the user has selected \"Line of Sight ...\" from the right mouse menu at WP9. The slider is positioned appropriate to WP9. Note that if the mission contains JUMP WPs, these are executed once only (regardless of the mission setting). This is why the slider might appear less advanced compared to the mission length if the JUMP is ignored. The user can reposition the WP using the slider (or the start / end buttons).
When \"Point LOS\" is clicked, the LOS is calculated between planned home (brown icon, lower left) and the red \"\u2a01\" \"Point of Interest\" (POI) icon. This is displayed as a terrain plot with the LOS line superimposed over the terrain elevation. The line is red as there is no LOS (and it would be green where there is LOS). A red \"dot-dash\" is also displayed on the map. If a margin is specified, then LOS lines with clearance between the terrain and the margin value are shown in orange.
The user may repeat the \"move slider\" / \"Point LOS\" action as required. The prior terrain plot is removed each time \"Point LOS\" is selected; the lines on the map are removed when the slider dialog is closed. \"Area LOS\" may be used to run a continuous analysis from the currently selected location. \"Area LOS\" may be started / stopped at any point (and Point Analysis invoked at any time when stopped).
When an analysis results in an orange or red LOS line, the first point where the LOS break is detected is shown on the line as a coloured blob. This is apparent in the Area image below.
"},{"location":"mwp-los-tool/#area-los_1","title":"Area LOS","text":"This analysis is iterated along the mission path automatically, providing Area coverage for the mission.
The image shows the state after a complete \"Area\" analysis. While the analysis is running, the slider and \"Point LOS\" are not sensitive; once the run has completed, these controls are available if the user wishes to investigate further. The user can stop (and restart) Area using the \"Area LOS\" / \"Stop\" button. (Note: in earlier versions, \"Area LOS\" was called \"Auto LOS\").
Here, the user has subsequently used \"Point LOS\" to examine a point in the orange region. As expected, there is very little clearance between the LOS line and the terrain. This is confirmed on the map plot where the \"blobs\" (immediately to the right of the plot window close button) indicate the point where LOS is compromised.
It is important to note that Area LOS is performed at 1% increments of the naive mission length, it is not contiguous. In the above case, there is a point at 34.1% where there is no LOS.
If you press a modifier (Shift or Control) while invoking \"Area LOS\", you get 0.1% increments, which may be used to investigate small segments (it will be slow ... and resource intensive). Here a detailed analysis has been run from 33.6% to 34.6% which captures the instance of complete loss of LOS.
Caveat user!
There is also a You Tube video (uses a slightly earlier UI iteration).
"},{"location":"mwp-los-tool/#local-dems","title":"Local DEMs","text":"mwp uses Mapzen DEM SRTM (Shuttle Radar Telemetry Mission) HGT files for all mwp elevation requirements. These are downloaded on demand. No user access key is required.
"},{"location":"mwp-los-tool/#miscellaneous-notes","title":"Miscellaneous notes","text":"The mwp suite contains numerous command line tools developed since 2015 in order to aid development of INAV, development of mwp and diagnosing numerous (often 3rd party) problems, more so in the early days.
This chapter describes a few of the command line tools that are provided by mwptools. Note that not all these tools are built or installed by default; it may be necessary to enter a source directory and invoke make
in situ, or copy a script to a directory on the $PATH
.
fc-get
and fc-set
are tools to manage CLI settings:
fc-get
: Dump cli diff
settings to a file that can be replayed by fc-set
fc-set
: Replay a file of cli settings to the FC. Once the settings have been saved, a backup is made of the original file; the settings are then read from the FC and the original file updated.$ fc-set --help\nUsage:\n fc-set [OPTION?] - fc diff manager\n\nHelp Options:\n -h, --help Show help options\n\nApplication Options:\n -b, --baud baud rate\n -d, --device device\n -n, --no-back no backup\n
NOTE: fc-get
and fc-set
are essentially the same program, the function is defined by the name.
The tools auto-detect the plugging of an FC.
$ fc-get /tmp/dodo-test.txt\n12:16:04 No device given ... watching\n12:16:04 Opening /dev/ttyUSB0\n12:16:04 Establishing CLI\n12:16:05 Starting \"diff all\"\n12:16:06 Exiting\n12:16:06 Rebooting\n
Then, maybe after flashing the FC to a new version:
$ fc-set /tmp/dodo-test.txt\n12:16:56 No device given ... watching\n12:16:56 Opening /dev/ttyUSB0\n12:16:56 Starting restore\n12:16:56 Establishing CLI\n12:16:58 [\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588] 100%\n12:16:58 Rebooting\n12:17:01 Establishing CLI\n12:17:03 Starting \"diff all\"\n12:17:03 Exiting\n12:17:03 Rebooting\n
And now we have a settings backup ...
$ ls -l /tmp/dodo*\n-rw-r----- 1 jrh jrh 2115 Mar 28 12:17 /tmp/dodo-test.txt\n-rw-r----- 1 jrh jrh 2115 Mar 28 12:16 /tmp/dodo-test.txt.2018-03-28T12.17.01\n
"},{"location":"mwp-miscellaneous-tools/#flashsh-fcflash","title":"flash.sh, fcflash","text":"fcflash
is a script to flash INAV images to a flight controller using the command line. It requires that stm32flash
and dfu-util
are installed on your computer. Optionally, it requires GCC objcopy
to convert hex files to binary for DFU operation.
dfu-util
stm32flash
fcflash
decides which tool to use depending on the detected device node (which can be overridden)
/dev/ttyACMx
=> DFU/dev/ttyUSBx
=> USB serialNote: fcflash
is the installed file, in the repository it's src/samples/flash.sh
.
fcflash
performs the following tasks
rescue
is specified, and the FC is set to DFU via hardare (switch, pads))hex
image to a bin
image (for DFU)fcflash
parses a set of options given on the command line. Normally, only the path to the hex file is required and everything else will be detected (device, flashing mode).
rescue
: Assumed the FC is already in bootloader mode, requires a device name/dev/*
: The name of the serial device, required for rescue
, typically /dev/ttyACM0
erase
: Performs full chip erase[123456789]*
: Digits, representing a baud rate. 115200
is assumed by default.A file name (an INAV hex file) is also required.
"},{"location":"mwp-miscellaneous-tools/#examples","title":"Examples","text":""},{"location":"mwp-miscellaneous-tools/#flash-image-dfu-auto-detect","title":"Flash image, DFU, auto-detect","text":"fcflash inav_5.0.0_MATEKF405.hex\n
"},{"location":"mwp-miscellaneous-tools/#flash-image-usb-serial-devttyusb0-auto-detect","title":"Flash image, USB serial (/dev/ttyUSB0), auto-detect","text":"For my broken FC (USB connector unreliable).
# as above, /dev/ttyUSB0 is autodetected\nfcflash inav_5.0.0_MATEKF405.hex\n\n# force device (and USB serial mode)\nfcflash /dev/ttyUSB0 inav_5.0.0_MATEKF405.hex\n
"},{"location":"mwp-miscellaneous-tools/#flash-image-rescue-mode-hardware-boot-button-full-flash-erase","title":"Flash image, rescue mode (hardware boot button), full flash erase","text":"fcflash rescue erase /dev/ttyACM0 inav_5.0.0_MATEKF405.hex\n
The no specific ordering of the command line options is required.
In summary, the command:
fcflash inav_5.0.0_WINGFC.hex\n
results in
dfu-util
.dfu-util
is invoked as:
dfu-util -d 0483:df11 --alt 0 -s 0x08000000:force:leave -D inav_5.0.0_WINGFC.bin\n
The firmware is flashed and the FC reboots
Note that gcc objcopy
is required to convert from .hex
to .bin
(as required by dfu-util
).
flashgo
is a tool to download blackbox logs from on-board flash. If you're doing this on a VCP board, it will download much faster then the apparent baud rate indicates. If you're using a non-VCP board (i.e. F3 or earlier), then consider using flash_dump.rb
which can temporarily alter the baudrate to achieve faster rates using CLI (vice MSP) commands.
flashgo
is a replacement for the earlier flashdl
tool.
$ flashgo --help\nUsage of flashgo [options] [device]\n-dir string\n output directory ($(cwd) if not specified)\n-erase\n erase after download\n -file string\n output file, auto-generated (bbl_YYYY-MM-DD_hhmmss.TXT) if not specified\n -info\n show flash info and exit\n -only-erase\n erase only and exit\n -test\n download whole flash regardess of used state\n\ndevice is the FC serial device, which may be auto-dectected\n
"},{"location":"mwp-miscellaneous-tools/#usage-examples","title":"Usage Examples","text":""},{"location":"mwp-miscellaneous-tools/#check-flash-usage","title":"Check flash usage","text":"$ flashgo -info\nUsing /dev/ttyACM0\nFirmware: INAV\nVersion: 5.0.0\nData flash 0 / 2097152 (0%)\n
"},{"location":"mwp-miscellaneous-tools/#test-mode-download-whole-flash","title":"Test mode (download whole flash)","text":"$ flashgo -test\nUsing /dev/ttyACM0\nFirmware: INAV\nVersion: 5.0.0\nEntering test mode for 2097152b\nData flash 2097152 / 2097152 (100%)\nDownloading to bbl_2022-05-22_113211.TXT\n[\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587] 2.0MB/2.0MB 100% 0s\n2097152 bytes in 40.2s, 52218.4 bytes/s\n
"},{"location":"mwp-miscellaneous-tools/#check-flash-info","title":"Check flash info","text":"$ flashgo -info\nUsing /dev/ttyACM0\nUnexpected MSP 108 (0x6c)\nFirmware: INAV\nVersion: 5.0.0\nData flash 27674 / 2097152 (1%)\n
"},{"location":"mwp-miscellaneous-tools/#download-to-auto-generated-file-name","title":"Download to auto-generated file name","text":"$ flashgo\nUsing /dev/ttyACM0\nFirmware: INAV\nVersion: 5.0.0\nData flash 27674 / 2097152 (1%)\nDownloading to bbl_2022-05-22_114044.TXT\n[\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587] 27.0KB/27.0KB 100% 0s\n27674 bytes in 0.5s, 50838.4 bytes/s\n
"},{"location":"mwp-miscellaneous-tools/#erase-the-flash-only-no-download","title":"Erase the flash (only, no download)","text":"$ flashgo -only-erase\nUsing /dev/ttyACM0\nFirmware: INAV\nVersion: 5.0.0\nErase in progress ...\nCompleted\n
"},{"location":"mwp-miscellaneous-tools/#check-flash-info_1","title":"Check flash info","text":"$ flashgo -info\nUsing /dev/ttyACM0\nFirmware: INAV\nVersion: 5.0.0\nData flash 46893 / 2097152 (2%)\n
"},{"location":"mwp-miscellaneous-tools/#download-to-nominated-file-name","title":"Download to nominated file name","text":"$ flashgo -file bbl_TEST.txt\nUsing /dev/ttyACM0\nFirmware: INAV\nVersion: 5.0.0\nData flash 46893 / 2097152 (2%)\nDownloading to bbl_TEST.txt\n[\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587] 45.8KB/45.8KB 100% 0s\n46893 bytes in 0.9s, 52290.6 bytes/s\n
"},{"location":"mwp-miscellaneous-tools/#download-to-nominated-file-and-directory","title":"Download to nominated file and directory","text":"$ flashgo -file bbl_TEST.txt -dir /tmp/\nUsing /dev/ttyACM0\nFirmware: INAV\nVersion: 5.0.0\nData flash 46893 / 2097152 (2%)\nDownloading to /tmp/bbl_TEST.txt\n[\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587] 45.8KB/45.8KB 100% 0s\n46893 bytes in 0.9s, 52298.0 bytes/s\n
"},{"location":"mwp-miscellaneous-tools/#download-to-auto-generated-file-name-and-nominated-directory-then-erase-flash","title":"Download to auto-generated file name and nominated directory, then erase flash","text":"$ flashgo -dir /tmp/ -erase\nUsing /dev/ttyACM0\nFirmware: INAV\nVersion: 5.0.0\nData flash 46893 / 2097152 (2%)\nDownloading to /tmp/bbl_2022-05-22_114515.TXT\n[\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587] 45.8KB/45.8KB 100% 0s\n46893 bytes in 0.9s, 52291.9 bytes/s\nErase in progress ...\nCompleted\n
Note that in every case, the FC device node is auto-detected.
Note also that the download speed is approximately 5 times greater than one would expect from the nominal baud rate (115200 ~= 10800 bytes/sec).
"},{"location":"mwp-miscellaneous-tools/#flash_dumprb","title":"flash_dump.rb","text":"flash_dump.rb
is another tool for downloading blackbox logs from on-board flash. Whereas flashgo
uses MSP, flash_dump.rb uses CLI commands and is thus rather more fragile and requires that the FC firmware is compiled with #define USE_FLASH_TOOLS
(which is not the default).
$ flash_dump.rb --help\n\nflash_dump.rb [options] file\nDownload bb from flash\n -s, --serial-device=DEV\n -e, --erase\n -E, --erase-only\n -o, --output=FILE\n -b, --baud=RATE\n -B, --super-baud=RATE\n -?, --help Show this message\n
Unlike flashdl
which auto-detects serial ports, flash_dump.rb
tries /dev/ttyUSB0
and /dev/ttyACM0
, or the device given with -d
. The \"super baud\" rate must be specified to use a faster rate than the FC default:
$ flash_dump.rb -B 921600\n/dev/ttyUSB0\nChanging baud rate to 921600\nFound \"serial 0 1 115200 38400 115200 115200\"\nsetting serial 0 1 921600 38400 115200 115200\nReopened at 921600\nSize = 1638400\nread 1638400 / 1638400 100% 0s\nGot 1638400 bytes in 18.8s 87268.8 b/s\nExiting\n
After the download has completed, the serial port is reset to the previously configured baud rate (typically 115200). Note the very high speed of the download, 87268 bytes /sec; this is almost 9 times faster than the standard baud (and 9x the speed of using the configurator with a USB board).
Should the download fail and the board serial speed is not reset automatically, it will be necessary to manually reset UART1, possibly using cliterm
.
So, had the above failed, it could be rescued by pasting in the \"Found\" line above:
$ cliterm -b 921600\nopen /dev/ttyUSB0\n\nEntering CLI Mode, type 'exit' to return, or 'help'\n\n# serial 0 1 115200 38400 115200 115200\n\n# save\nSaving\nRebooting\n
"},{"location":"mwp-miscellaneous-tools/#cliterm","title":"cliterm","text":"cliterm
is a terminal program for interacting with the INAV CLI. Unlike alternative tools (picocom
, minicom
etc.), it will auto-detect the FC serial device, uses 115200 as the baud rate and, by default, automatically enters the CLI.
$ cliterm --help\n Usage:\n cliterm [OPTION?] - cli tool\n\n Help Options:\n -h, --help Show help options\n\n Application Options:\n -b, --baud=115200 baud rate\n -d, --device device\n -n, --noinit=false noinit\n -m, --msc=false msc mode\n -g, --gpspass=false gpspassthrough\n -p, --gpspass=false gpspassthrough\n -f, --file file\n --eolmode=[cr,lf,crlf,crcrlf] eol mode\n
-g
, -p
, the FC is put into GPS passthrough mode, in order to use tools like ublox-cli
or u-center
(sic).-m
, --msc
causes the FC to reboot in MSC (USB Mass Storage) mode.The options -n
(don't enter CLI automatically) and -m
may be useful when accessing other devices (for example a 3DR radio, HC-12 radio or ESP8266) in command mode.
cliterm
understands Ctrl-D as \"quit CLI without saving\". You should quit cliterm
with Ctrl-C, having first exited the CLI in the FC (save
, exit
, Ctrl-D). Or after save
, exit
, cliterm
will exit when the FC is rebooted, by seeing the tear-down of the USB device node.
mwptools has always included tools to simplify blackbox analysis. it seems to the author that it's often much easier to pre-process the output of INAV blackbox_decode
into a smaller dataset that addresses the specific problem rather than try and make sense of the mass of data in a blackbox log.
There are a few basic prerequisites for doing this analysis using the mwp scripts:
blackbox_decode
ruby
interpreter installedgnuplot
installed; it's also possible to generate graphs (\"charts\") from spreadsheet applications (LibreOffice Calc, MS Excel).A user reported serious toilet-bowling / fly away on a large cine-octa with expensive VTX RF gear and camera gimbal. Two blackbox logs were provided, one with the RF and gimbal disabled, the other with them enabled (when the problem appears).
The logs were processed with the mwptools/src/bbox-replay/inav-parse_bb_compass.rb
. This script:
GPS_ground_course
and attitude[2]/10
.You need to run this from a shell (Linux / MacOS /FreeBSD terminal, Windows powershell or cmd). blackbox_decode
and (optionally) gnuplot
need to be on the PATH
.
$ ./inav-parse_bb_compass.rb --help\ninav-parse_bb_compass.rb [options] [file]\n --list-states\n --plot Generate SVG graph (requires 'gnuplot')\n --thr Include throttle value in output\n -o, --output=FILE CSV Output (default stdout\n -i, --index=IDX BBL index (default 1)\n -t, --min-throttle=THROTTLE Min Throttle for comparison (1000)\n -s, --states=a,b,c Nav states to consider [all]\n -d, --delta=SECS Down sample interval (default 0.1s)\n -?, --help Show this message\n
"},{"location":"mwp-miscellaneous-tools/#results-from-the-analysis","title":"Results from the analysis","text":"First, the good log (no VTX-RF or gimbal enabled):
./inav-parse_bb_compass.rb --plot /tmp/LOG00001.TXT\nINAV 4.1.0, states from 2.7.0\nLog 1 of 1, start 00:49.654, end 06:33.615, duration 05:43.961\n\nStatistics\nLooptime 506 avg 14.9 std dev (2.9%)\nI frames 21061 128.0 bytes avg 2696240 bytes total\nP frames 315692 81.6 bytes avg 25753176 bytes total\nH frames 164 10.0 bytes avg 1640 bytes total\nG frames 1865 21.6 bytes avg 40300 bytes total\nE frames 1 6.0 bytes avg 6 bytes total\nS frames 4066 40.0 bytes avg 162637 bytes total\nFrames 336753 84.5 bytes avg 28449416 bytes total\nData rate 979Hz 83359 bytes/s 833600 baud\n\n29 frames failed to decode, rendering 181 loop iterations unreadable. 2897 iterations are missing in total (1466ms, 0.43%)\n339649 loop iterations weren't logged because of your blackbox_rate settings (171980ms, 50.00%)\n\nGraph in /tmp/LOG00001.TXT.csv.svg\n
We see some information, mainly the summary from blackbox_decode
and notification of the resulting graph file.
Looks OK, there's a few deviations between the GPS and position estimator, possibly a result of hard Acro mode manoeuvres.
Let's now look at the log with the VTX-RF and gimbal enabled:
./inav-parse_bb_compass.rb --plot /tmp/LOG00008.TXT\n...\n Graph in /tmp/LOG00001.TXT.csv.svg\n
Note the difference
Something in generating enough interference to cause the heading / position estimator attitude[2]
to essentially flat-line.
So now we have concrete evidence of the problem, the next steps would be for the pilot to repeat the exercise enabling just one of the suspect devices to identify the actual cause of the problem and then rectify it:
PH unstable altitude is often caused by excessive vibrations or inadequately protected (open cell foam) barometer. mwptools/src/bbox-replay/inav_gps_alt.rb
will generate a similar graph of baro v. GPS v. position estimator elevations.
mwp supports a number of different data transports for \"serial\" protocols:
Each of these requires a specific device name and may require a protocol selection.
"},{"location":"mwp-multi-procotol/#serial-devices","title":"Serial devices","text":"Serial devices are defined by the operating system device node name and optionally include an embedded baud rate, for example:
# Linux, USB seral\n/dev/ttyACM0\n# Linux, USB serial with baud rate\n/dev/ttyUSB0@57600\n# Linux, RFCOM Bluetooth\n/dev/rfcomm1\n\n# FreeBSD\n/dev/cuaU0\n
"},{"location":"mwp-multi-procotol/#bluetooth","title":"Bluetooth","text":"Bluetooth may be specified by either an rfcomm
device node (/dev/rfcommX
on Linux, /dev/ttypX
pseudo-terminal abstraction on FreeBSD) or by the device address (BD_ADDR
, Linux and FreeBSD only):
# BT RFCOMM device node (Linux)\n/dev/rfcomm1\n/dev/rfcomm1@57600\n# RFCOMM / SPP (FreeBSD)\n/dev/ttyp6\n# BT device address (note here baud rate is immaterial)\n35:53:17:04:07:27\n
For legacy devices, it is recommended that these are paired before use; this will greatly speed up the device recognition process.
For BLE, in general it is not possible to pair devices; it is recommended that you use operating system tools (e.g. bluetoothctl
to discover the device and find all the BLE/Gatt characteristics (e.g. by connect
in bluetoothctl
). Otherwise you may end up in a \"Morton's fork\" situation where in order recognise the device as BLE, mwp needs to connect to it and in order to use the BLE connect functions, mwp needs to know it's a BLE device.
A sequence of bluetoothctl
commands (where aa:bb:cc:dd:ee:ff
represents a new device address); such as the following will help :
$ bluetoothctl\npower on\ndefault-agent\nscan on\n## ... devices are discovered\ninfo aa:bb:cc:dd:ee:ff\n## note this will probably only show up a little data and 0 or 1 UUIDs (we need more)\nconnect aa:bb:cc:dd:ee:ff\n## for a BLE device, this will spew out a load of \"characteristics\" and multiple UUIDS\ntrust aa:bb:cc:dd:ee:ff\ndisconnect aa:bb:cc:dd:ee:ff\nquit\n
Now the device should be discovered in mwp and should connect.
The following BLE chip-sets are supported:
The first and last items having been tested by the author.
"},{"location":"mwp-multi-procotol/#discovery-and-filtering","title":"Discovery and filtering","text":"By default, mwp relies on the bonded information about bluetooth devices known to the operating system. This has (at least) two consequences:
There is a somewhat experimental option that includes scanning and RSSI filtering such that:
The downside being that is RSSI if never discovered / advertised by the OS, then the device is not listed.
This mode is enabled by a setting:
$ gsettings set org.stronnag.mwp bluez-disco true\n
This is persistent, in order to revert to the default, non-scanning no RSSI filter:
$ gsettings set org.stronnag.mwp bluez-disco false\n
"},{"location":"mwp-multi-procotol/#mwp-ble-bridge","title":"mwp-ble-bridge","text":"In order to use BLE serial devices with tools (i.e. other than mwp) that do not implement the BLE protocol, mwp provides a mwp-ble-bridge
tool that uses a pseudo-terminal, TCP server or UDP server to facilitate BLE connectivity for other tools that expect a device node. See the README.md
in src/mwp-ble-bridge
.
Using a bridge with TCP allows connectivity with the INAV Configurator versions that appear not to understand BLE on Linux. Note that INAV Configurator 8.0 will \"sort of\" support BLE on Linux.
"},{"location":"mwp-multi-procotol/#ble-caveats","title":"BLE Caveats","text":"BLE not particularly useful for anything other than low power. The transfer rates are extremely slow and whether the device can be used at all depends on its MTU (maximum transmission unit). For some devices this is unacceptable low for use with mwp / INAV.
mwp will never send more than 20 bytes in a single write to a BLE device; chunking up messages as required. The FC cannot do this, so large messages will result in massive data overrun (for example MSP_BOX_NAMES will typically return more than 400 bytes).
mwp will log the detected MTU when it connects a BLE device.
13:05:07.547489 BLE chipset CC2541, mtu 23 (unlikely to end well)\n...\n13:07:36.946329 BLE chipset SpeedyBee Type 2, mtu 517\n
"},{"location":"mwp-multi-procotol/#serial-permissions","title":"Serial permissions","text":"It is necessary for the user to have read / write permission on serial devices. The installation guide provides instructions.
"},{"location":"mwp-multi-procotol/#ip-protocols-udp-and-tcp","title":"IP protocols (UDP and TCP)","text":"mwp uses a pseudo-URL format for TCP and UDP connections udp://host:port
and tcp://host:port
(where host
is either a hostname or an IP address as required).
Typically on one side of the connection you'll provide a hostname /IP and on the other you won't (as it can get the peer address from the first data packet).
Assuming the required UDP port is 43210
if mwp is the \"listener\" (doesn't need, a priori, to know the address of peer), set the \"Device\" to:
udp://:43210\n
i.e. the host part is empty.
If the remote device / application is the listener, and we know its IP address; in the following example \"192.168.42.17\", set the \"Device\" to:
udp://192.168.42.17:43210\n
Note that for TCP, mwp only supports the latter form (it expects to be the TCP client).
"},{"location":"mwp-multi-procotol/#special-cases","title":"Special Cases","text":""},{"location":"mwp-multi-procotol/#udp-devices-required-defined-local-and-remote-port-numbers","title":"UDP devices required defined local and remote port numbers","text":"Some UDP devices (typically ESP8266 transparent serial) require that the port number is specified for both local and remote addresses; often the same port number at both ends. udp://local_host:local_port/remote_host:remote_port
or udp://remotehost:remote_port/?bind=port
. The following have the same effect.
udp://:14014/esp-air:14014\n# both sides use port 14014, remote (FC) is esp-air, blank local name is understood as INADDR_AN\nudp://esp-air:14014/?bind=14014\n
"},{"location":"mwp-multi-procotol/#mqtt-bulletgcss","title":"MQTT / BulletGCSS","text":"See the mwp's MQTT support article for a detailed description of the URI format:
mqtt://[user[:pass]@]broker[:port]/topic[?cafile=file]\n
"},{"location":"mwp-multi-procotol/#multi-protocol-selection","title":"Multi Protocol selection","text":""},{"location":"mwp-multi-procotol/#overview","title":"Overview","text":"There is a protocol drop-down that allows the user to select the in-use serial protocol.
Offering:
"},{"location":"mwp-multi-procotol/#usage","title":"Usage","text":"Item Usage Auto Auto-detects the protocol from the serial data stream. Note that MPM cannot (yet) be auto-detected reliably, and must be explicitly selected). INAV INAV protocols, MSP, LTM and MAVLink. Legacy behaviours S-Port Smartport telemetry, previously required--smartport
options. Expects a non-inverted stream CRSF Crossfire Telemetry. MPM Multi-Protocol-Module telemetry. The output from an EdgeTX / OpenTX radio with a multi-protocol module, FrSky Smartport or Flysky 'AA' via the EdgeTX / OpenTX \"Telem Mirror\" function. Prior to EdgeTX 2.7, this cannot be reliably auto-detected, and should be explicitly selected; with EdgeTX 2.7 and later, auto-detection is possible and reliable."},{"location":"mwp-multi-procotol/#notes","title":"Notes","text":"--radar-device=
option. Leave the protocol selector at 'Auto'.--forward-to=
option. Leave the protocol selector at 'Auto'.set ibus_telemetry_type = 0
is required; any other ibus_telemetry_type
value will not work.One of the great features of INAV 2.6 was the safehome
capability. The user can define of set of up to eight locations, and if any of these is within 200m (configurable up to 650m in INAV 2.7), then that is used as the home location for RTH (and RTH failsafe).
safehome
is set in INAV using the CLI, (note more recent Configurators also have a UI); here's an example:
# safehome\nsafehome 0 1 508047750 -14948970\nsafehome 1 1 509102384 -15344850\nsafehome 2 1 509390336 -14613540\nsafehome 3 1 509149619 -15337365\nsafehome 4 0 508054891 -14961431\nsafehome 5 0 543545392 -45219430\nsafehome 6 0 540954148 -47328458\nsafehome 7 0 0 0\n
As you see, it's not too user friendly; the parameters are
It can be error prone to get locations into the correct format, particularly when a common source (Google Maps) only provides 6 decimal places of precision.
"},{"location":"mwp-safehomes-editor/#mwp-solution","title":"mwp solution","text":""},{"location":"mwp-safehomes-editor/#graphical-user-interface","title":"Graphical User Interface","text":"Legacy Images
The images this section are from legacy mwp, however the capability is the same.
Note: Since mwp 7.32.?, mwp provides additional fields for the Autoland function that first appeared in INAV 7.1.0.
mwp now offers a Safe Homes
menu option:
This will launch the Safe Home
window:
From here it is possible to:
safehome
and fwapproach
stanzas are changed; other information in the diff / dump is preserved.safehome
and fwapproach
data to/from the flight controller.Clicking the \"Edit\" button at the end of row enables editing FWA parameters:
Note that editing functions are only available when the Safe Homes
window is active; if the windows is dismissed with icons displayed, then the icons remain on the map, but are not editable.
It also is possible to set a gsettings
key to define a file of safehomes to load at startup, and optionally display (readonly) icons.
gsettings set org.stronnag.mwp load-safehome ~/.config/mwp/safehome.txt,Y\n
This sets the default safehomes file to ~/.config/mwp/safehome.txt
and the appended ,Y
means display the icons on the map.
If the file also contains fwapproach
data, that will be applied as well.
If the name part is set to -FC-
, then the safehomes will be loaded from the flight controller, for example:
gsettings get org.stronnag.mwp load-safehome\n'-FC-,Y'\n
"},{"location":"mwp-safehomes-editor/#example","title":"Example","text":"The image below shows a blackbox replay. Note that the flight home location (brown icon) is coincident with the pale orange safehome icon.
"},{"location":"mwp-safehomes-editor/#fw-approach-fwa-visualisation","title":"FW Approach (FWA) visualisation","text":"Please note that for the display of the geometry of the FWA, mwp uses the same rules as the flight controller; in particular the length of \"base leg / dog leg\" depends two CLI parameters, nav_fw_land_approach_length
, nav_fw_loiter_radius
. These are not part of the safe home (or mission) definition, rather they are properties of the model (and thus are persisted in a CLI diff
file).
mwp can load these properties from a CLI diff
/dump
format file, as well as other CLI artefacts.
In particular, the length of the \"base leg / dog leg\" is the maximum of:
nav_fw_land_approach_length / 2
ornav_fw_loiter_radius * 4
For example, in the first image the user had set nav_fw_land_approach_length
to 150m (for a small, agile plane) but had accidentally left the nav_fw_loiter_radius
at the default of 75m
. The excessive radius dominates and gives an unacceptable geometry:
Setting the radius to a more appropriate value for the model (40m) results in a much more acceptable geometry (still dominated by the loiter radius).
In summary, in order to display FWA accurately for either safe homes or missions, it is advisable to provide a CLI diff
format file containing at a minimum, set
values for nav_fw_land_approach_length
and nav_fw_loiter_radius
. For the above example:
set nav_fw_loiter_radius = 4000\nset nav_fw_land_approach_length = 15000\n
"},{"location":"mwp-telemetry-tracker/","title":"Telemetry Tracking","text":""},{"location":"mwp-telemetry-tracker/#overview","title":"Overview","text":"The mwp \"Telemetry Tracking\" function allows additional vehicles to be tracked by a single mwp instance.
One use case is:
This capability builds on extant mwp features.
Primary
device by user action (as now, from the \"Connect\" button).The devices will be read for any push telemetry supported by mwp and INAV (e.g. LTM, MAVLink, CRSF, Smartport, MPM). The protocol will be auto-detected. When valid (3D fix, geo-referenced) telemetry data is received, a symbol and name will be displayed on the map (as for the mwp radar display). The name associated with the symbol may be:
TTRK-ttyUSB1
)Legacy Images
The images this section are from legacy mwp, however the capability is the same.
In order to use Telemetry Tracking, it will be necessary for the user to assign the required devices. The primary device (once connected) and any devices predefined for \"Radar\" will not be considered. Once a device has been assigned as a \"Secondary / Telemetry Tracking\" device, it may not the used as the \"Primary\" device. Likewise, an established primary device will not be offered as a secondary device.
The \"Telemery Tracking\" device(s) may be assigned from the \"View\" / \"Telemetry Tracker\" menu option (Control-Shift T).
~/.config/mwp/secdevs
. This file lists zero or more devices, each with protocol and optional \"Alias\" text.TTRK-ttyACM0
. The user can edit / override this alias if she so wishes.35:53:*
) have aliases defined at the operating system level. The user can edit / override this alias if she so wishes./dev/ttyACM0
is subsequently connected as the primary device, it will not appear in this list.Hint
column lets the user define the specific protocol to used (vice let it be auto-detected). The default, \"Auto\", should work in most cases, other than perhaps MPM on OpenTX.Tracking devices are enabled / disabled using the \"Enable\" check-button. Once a device is enabled, mwp will attempt to read data from it and display it. The device is closed by toggling the \"Enable\" button. Once disabled, its resources are freed. If a USB device is physically removed when enabled, its resources will also be freed.
"},{"location":"mwp-telemetry-tracker/#visualisation","title":"Visualisation","text":"\"Telemetry Tracked\" objects are displayed on the map can be inspected using the existing mwp radar display functionality. \"Telemetry Tracking\" may be used at the same time as the extant \"INAV-Radar and \"ADS-B\" tracking.
And example of visualisation is:
The \"Primary\" vehicle (a flying wing) has the standard mwp visualisation attributes. The other icons, Replay 0
and Replay 1
are \"secondary\" tracks from other pilot's CRSF telemetry (but it could be any of LTM, Mavlink, CRSF, SPort or Flysky 'AA' (INAV type 1)). Note also that Replay 0
has not reported for over 5 minutes (\"stale\"); maybe it's crashed? At least the pilot knows where to start looking.
All \"Telemetry Tracked\" vehicles use a common icon (inav-telem.svg
). The default icon may be overridden by the user if so desired.
Linux preferred, due to the udev
dependency for device enumeration. On other platforms it will be necessary to define devices a priori using the ~/.config/mwp/secdevs
file. This file is maintained by the \"Telemetry Tracker\" GUI editor.
An example secdevs
file might be:
# name, hint, alias\nudp://:23456,Auto,Replay 0\nudp://:23457,CRSF,Replay 1\nudp://:23458,MPM\nudp://:23459,INAV\ntcp://localhost:43210,Sport,Sport player\n
"},{"location":"mwp-terrain-avoidance-quick-guide/","title":"Terrain Avoidance Quick Guide","text":"There's already quite a long article on mwp's terrain analysis tool; this is a quick summary of how to use it in three steps.
"},{"location":"mwp-terrain-avoidance-quick-guide/#1-load-your-mission","title":"1. Load your mission","text":"First load (or create) the mission in mwp. Here, the pilot chooses to take a cruise around the lake and adjacent country side. The brown / grey icon at the top of the mission is the planned home location. At first glance, the terrain looks quite benign.
"},{"location":"mwp-terrain-avoidance-quick-guide/#2-set-your-avoidance-parameters","title":"2. Set your avoidance parameters","text":"By right clicking on any waypoint, we can select Terrain Analysis. No internet connection is required if you already have cached imagery and DEM tiles.
On clicking Apply, the analysis will run.
"},{"location":"mwp-terrain-avoidance-quick-guide/#3-review-the-output","title":"3. Review the output","text":"The output is displayed as a chart of the terrain (green), the original mission (red), the avoidance margin (blue, 30m in this example), and the adjusted mission (orange). There is also a Climb / Dive analysis.
There are a few places that could benefit from further manual adjustment, but in general it looks pretty good.
So it looks good. Or does it?
"},{"location":"mwp-terrain-avoidance-quick-guide/#terrain-may-not-be-the-only-hazard","title":"Terrain may not be the only hazard","text":"The terrain analysis is only as good as the terrain data. If we zoom in closely, or look at a difference map source (e.g. OpenTopo), or examine the route in 3D (Google Earth) via flightlog2kml / mission2kml, maybe from fl2xui we can see another hazard. Between WP36-WP37 and WP47-WP48 there are high voltage overhead transmission lines. Hitting these, or at WP48, the tower would be sub-optimal.
A re-plan seems like a good idea, at least adding significant altitude on these legs of the mission.
"},{"location":"mwp-text-to-speech/","title":"Text to Speech","text":""},{"location":"mwp-text-to-speech/#overview","title":"Overview","text":"On all platforms, an external TTS
(Text to speech) application may be defined by the --voice-command
option. Alternately, on POSIX platforms, a speech library may be dynamically loaded at run time. This requires the desired speech library to have been available when mwp was compiled.
None of these provide very good speech synthesis
"},{"location":"mwp-text-to-speech/#external-commands","title":"External Commands","text":"You can use an external command on all platforms (it is the only option on Windows). Any external speech command should:
stdin
(standard input)stdin
for new text until it is closed.The simplest way is to add a --voice-command
line to your cmdopts file.
Examples:
# Espeak-ng\n--voice-command=\"espeak-ng\"\n
# Speech Dispatcher\n--voice-command=\"spd-say -t female2 -e\"\n
# piper-tts\n# Choose your model, I have like the Scottish lady ...\n#VMODEL=/usr/share/piper-voices/en/en_GB/jenny_dioco/medium/en_GB-jenny_dioco-medium.onnx\n#VMODEL=/usr/share/piper-voices/en/en_GB/aru/medium/en_GB-aru-medium.onnx\nVMODEL=/usr/share/piper-voices/en/en_GB/alba/medium/en_GB-alba-medium.onnx\n--voice-command=\"sh -c \\\"piper-tts -q --model $VMODEL --output-raw | aplay -q -r 22050 -f S16_LE -t raw -\\\"\"\n
In the piper-tts
example, (by far the best TTS for Linux), the voice model file is defined by an environment variable VMODEL
which is evaluated by mwp before the voice command is invoked, making it easy to test out different voices.
mwp can use the flite
text to speech engine directly (as well as espeak or speech-dispatcher. Flite is enabled if:
Flite is available at run-time if:
Unfortunately, it is non-trivial to detect the flite version at mwp build time.
Flite provides reasonable quality voices with low overhead, including some female voices.
"},{"location":"mwp-text-to-speech/#configuration","title":"Configuration","text":"Flite is configured using two gsettings
keys:
speech-api
Defines the speech API to be used, one of none
, espeak
, speechd
or flite
flite-voice
The voice file to be used. If not specified, the internal slt
(female) voice is used. The value takes the absolute path name to a voice file, optionally followed by a ,
and a floating point speed factor (see below) $ gsettings set org.stronnag.mwp speech-api flite\n$ gsettings set org.stronnag.mwp flite-voice-file /home/jrh/.config/mwp/cmu_us_clb.flitevox,0.9\n
"},{"location":"mwp-text-to-speech/#flite-discussion","title":"Flite Discussion","text":""},{"location":"mwp-text-to-speech/#voice-files","title":"Voice Files","text":"flite can use external voice files that provide better quality than the built-in voices. Your distro may provide these voice files in an optional package, or you can download from http://www.festvox.org, e.g. for flite 2.1 http://www.festvox.org/flite/packed/flite-2.1/voices/ (replace 2.1 with 2.0 etc., not all the 2.1 voices may exist for 2.0). The following script will bulk download the non-Indic voices; you can test them out with the flite
application.
#!/bin/bash\n\nBASE=http://www.festvox.org/flite/packed/flite-2.1/voices\n\nfor V in cmu_us_aew.flitevox cmu_us_ahw.flitevox cmu_us_aup.flitevox \\\n cmu_us_awb.flitevox cmu_us_axb.flitevox cmu_us_bdl.flitevox \\\n cmu_us_clb.flitevox cmu_us_eey.flitevox cmu_us_fem.flitevox \\\n cmu_us_gka.flitevox cmu_us_jmk.flitevox cmu_us_ksp.flitevox \\\n cmu_us_ljm.flitevox cmu_us_lnh.flitevox cmu_us_rms.flitevox \\\n cmu_us_rxr.flitevox cmu_us_slp.flitevox cmu_us_slt.flitevox\ndo\n wget -P . $BASE/$V\ndone\n
"},{"location":"mwp-text-to-speech/#replay-speed","title":"Replay Speed","text":"The default replay speed for some flite voices is rather slow. The optional rate setting in the gsettings flite-voice-file
key may be used to increase the rate.
#off-topic
)master
version.trixie
, sid
), and contemporaneous derivatives.RELEASE
mwp_stderr_YYYY-MM-DD.txt
, e.g. $HOME/mwp_stderr_2021-12-28.txt
. Do not delete any information from this file; the contents are there for a purpose, or paste the terminal output into a file (or copy paste into the issue). The terminal output may include information from system components that are not the mwp log (e.g. GDK / GTK / Wayland messages).--raw-log
option.Issues that do not meet these information requirements most likely be ignored / closed without explanation.
"},{"location":"mwp_support/#unsupported","title":"Unsupported","text":"Problem reports on non-supported platforms may receive some consideration, however it's unlikely that too much time be expended on such environments unless the problem can also be demonstrated on a supported platform (or it's an interesting issue). Compliance with the Information requirements above is mandatory.
"},{"location":"mwp_video_player/","title":"Playing Video in mwp","text":"mwp provides support for live and replay video.
Legacy Images
The images this section are from legacy mwp, however the capability is the same.
"},{"location":"mwp_video_player/#live-stream-mode-gcs","title":"Live stream mode (GCS)","text":"There is now a Video Stream option under the view menu.
Selecting this option opens the source selection dialogue. Camera devices offering a \"video4linux\" interface (i.e most webcams) will be auto-detected. There is also the option to enter a URI, which could be a http
/https
, rtsp
or other standard streaming protocol, or even a file.
The selected source will then play in a separate window. This window will remain above the mwp application and can be resized, minimised and moved.
In stream mode, there are minimal video controls; a play/pause button and volume control. Note the volume is that of the video, the overall volume is controlled by the system volume control.
"},{"location":"mwp_video_player/#blackbox-replay-mode-bbl-replay","title":"Blackbox replay mode (BBL replay)","text":"The Blackbox log replay chooser also offers a video replay option.
Here the user can select a media file and start options, i.e. whether and when to start the video replay with respect to the start of the BB log replay.
When playing a file (vice a stream), the player gains a progress bar (which can be used to position the stream and \"beginning\" and \"end\" buttons.
"},{"location":"mwp_video_player/#other-os","title":"Other OS","text":"v4l2:///dev/video0
(for example) can be used in streaming mode if required.In order to replay log files, mwp has a number of external dependencies, in particular the flightlog2x fl2ltm
tool provided by the bbl2kml repository. As well as providing replay tools for mwp, the bbl2kml tools offer the facility to generate attractive animated KML / KMZ files for visualisation in google-earth.
Analysis
The RSSI view shows why the aircraft is playing \"failsafe ping-pong\" at the right extreme of flight
bbl2kml binary packages are provided for many popular platforms.
"},{"location":"replay-tools/#log-replay","title":"Log replay","text":"mwp can replay a number of \"flight log\" formats. Other artefacts such as mission files / safehomes / (geozones) can be displayed while the replay is in progress.
"},{"location":"replay-tools/#location-rebase","title":"Location rebase","text":"You may wish to obfuscate the location of log replay, particularly if you are publishing screen shots or vidoes. The --rebase
option allows this. --rebase
requires a latitude and longitude of the relocated position; the latitude and longitude may be separated by comma, semi-colon or space (the latter two quoted or shell escape) and may be decimal degrees or DD:MM:SS.ss format. The following would relocate a replay to Narita Airport in Japan (plausible denial, protect the innocent etc.):
mwp --rebase 35.761000,140.378945 -b reloc-test.TXT -m reloc-test.mission\nmwp --rebase 35.761000\\;140.378945 -b reloc-test.TXT -m reloc-test.mission\nmwp --rebase 35.761000\\ 140.378945 -b reloc-test.TXT -m reloc-test.mission\nmwp --rebase \"35:45:39.6N 140:22:44.2E\" -b reloc-test.TXT -m reloc-test.mission\n
Currently (March 2024) only flight logs and mission files are rebased. Safehomes (and Geozones) may also be relocated in future.
"},{"location":"replay-tools/#blackbox-replay","title":"Blackbox replay","text":"In order to replay blackbox logs, you additionally need inav blackbox tools, specifically blackbox_decode
). Binary packages are provided for many popular platforms. The minimum required version in 0.4.4, the latest release is recommended.
OpenTX enables the storage of CRSF and Smartport telemetry logs on a transmitter's SD-Card. These logs contain telemetry information transmitted from the flight controller.
mwp can replay these logs, in a similar manner to the replay of Blackbox or mwp logs, albeit with less detail and typically at lower data rates.
No addition software requirements.
"},{"location":"replay-tools/#bulletgcss-logs","title":"BulletGCSS Logs","text":"Requires that mwp is built with MQTT support.
No addition software requirements.
"},{"location":"replay-tools/#ardupilot-logs","title":"Ardupilot logs","text":"Requires Ardupilot's mavlogdump.py.
"},{"location":"replay-tools/#mwp-json-logs","title":"mwp JSON logs","text":"No addition requirements.
"},{"location":"replay-tools/#mwp-raw-logs","title":"mwp \"raw\" logs","text":"mwp \"raw\" logs are either recorded directly in mwp (--raw-log
) for indirectly using the external mwp-serial-cap
tool. The logs generated by mwp
and mwp-serial-cap
contain meta-data describing the size and time of each item recorded; mwp
can also play 3rd party logs that are 'plain' rw data (i.e. without any timing meta-data).
Recent versions of mwp
contain a \"Replay mwp RAW log\" menu item that automates the manual process described below. This provides a dialogue to select the raw log file and an optional delay which is applied every 16 bytes read.
Otherwise it is necessary to build and install mwp-log-replay
and run it outside of mwp,
# Start mwp as a UDP listener, port is arbitrary, here 40001 is chosen\n## -a connect immediately without user intervention\n## -d serial-device. No host part means it listens for remote connections\n## listen on UDP port 40001\n\nmwp -a -d udp://:40001\n\n# In another terminal (even other machine if you replace localhost with the machine running mwp)\n\nmwp-log-replay -d udp://localhost:40001 /path/to/my/logfile.raw\n
Raw logs containing MSP, LTM, MAVLink, CRSF and MPM Smartport and IBUS messages can be replayed.
"},{"location":"replay-tools/#display-of-rc-stick-positions","title":"Display of RC Stick positions","text":"Where such data is available (Blackbox, OTX/ETX logs), mwp can display the position of the 'sticks'. This is displayed in the bottom right corner of the map.
All the developer's tutorial videos are in a YouTube playlist. These refer to the legacy version.
"},{"location":"running/#graphical-user-interface","title":"Graphical User Interface","text":"Once you've built and / or installed mwp.
The install process installs an desktop icon and mwp.desktop
application file
The desktop
file tells the window manager where to find mwp and on modern desktop environments (e.g. Gnome Shell, xfce, kde), mwp will be added to the system application menu and / or 'finder'.
The mwp map and map symbols are 'touch-aware'.
mwp's command line options may be displayed with the --help
option:
$ mwp --help\nUsage:\n mwp [OPTION\u2026]\n\nHelp Options:\n -h, --help Show help options\n --help-all Show all help options\n --help-gapplication Show GApplication options\n\nApplication Options:\n -a, --auto-connect Legacy, ignored)\n --build-id show build id\n --centre=position Centre position (lat lon or named place)\n -H, --centre-on-home Centre on home\n --cli-file CLI File\n -c, --connect connect to first device (does not set auto flag)\n --debug-flags Debug flags (mask)\n -d, --device=device-name Serial device\n --dont-maximise Legacy, ignored\n --force-mag force mag for vehicle direction\n -t, --force-type=type-code_no Model type\n -4, --force4 Force ipv4\n --forward-to=device-name forward telemetry to\n --full-screen Legacy, ignored\n -k, --kmlfile=file-name KML file\n -m, --mission=file-name Mission file\n -M, --mod-points=N Modulo points to show in GPS trail\n -S, --n-points=N Number of points shown in GPS trail\n -N, --no-poll don't poll for nav info\n -T, --no-trail don't display GPS trail\n --offline force offline proxy mode\n --radar-device=device-name dedicated inav radar device\n -r, --raw-log log raw serial data to file\n --really-really-run-as-root no reason to ever use this\n --rebase=lat,lon rebase location (for replay)\n --relaxed-msp don't check MSP direction flag\n -b, --replay-bbox=file-name replay bbox log file\n -p, --replay-mwp=file-name replay mwp log file\n --rings=number,interval Range rings (number, interval(m)), e.g. --rings 10,20\n -s, --serial-device=device_name Serial device\n -v, --version show version\n --voice-command=command string External speech command\n
"},{"location":"running/#bash-completion","title":"Bash completion","text":"mwp installation also installs a 'bash completion' script. Note this is only available after you log in, so on first install, it's only available after the next login.
This facilitates automatic command completion, so you don't have to remember all the options or be always typing mwp --help
.
Typing mwp
and then <TAB>
will first display the option lead --
; then a subsequent <TAB><TAB>
will display all the options. If one then typed ra<TAB><TAB>
, it would complete to:
$ mwp --ra\n--radar-device --raw-log\n
Further entry (e.g. d
) would complete the command (--radar-device
).
Certain options, like --replay-bbox
, --mission
allow you to add a file to a running mwp. So if mwp was running, either from the command line or Desktop Environment icon, then (for example):
mwp --mission file-i-forgot.mission\n
would load the mission file-i-forgot.mission
into the running mwp rather than starting a new instance.
You can drag and drop relevant files onto the mwp map:
mwp can extract the following artefacts from a CLI File (diff
or dump
):
set
parameters affecting visualisation (nav_fw_land_approach_length
, nav_fw_loiter_radius
).The mwp main window and the main user interface elements are:
In the sections that follow, there will be a brief summary of each part; more detail will then provided in subsequent sections.
"},{"location":"ui/#menu-bar-1","title":"Menu Bar (1)","text":"The following tables summarise the available menu options. Where usage is not obvious, operation will be described later on.
"},{"location":"ui/#file-menu","title":"File Menu","text":"Item Usage Open Mission Offers a dialog to open a mission file Append Mission file Appends a mission to the current mission set (creates a multi-mission element) CLI File Loads CLI artefacts from a CLI File Save Mission Saves the mission to the current mission file, overwriting any extant content Save Mission As Saves the mission to a user selected file. For a multi-mission the user can choose not to save specified mission segments. Download Mission from FC Downs a (multi-) mission from the flight controller Upload Mission to FC > Upload Active Mission Uploads the current mission segment to the flight controller Upload Mission to FC > Upload All Missions Uploads all mission segments to the flight controller Restore Mission from EEPROM Restores the EEPROM stored mission from the flight controller Save Mission to EEPROM Saves the current mission segment(s) to the flight controller. The current active mission segment (in a multi-mission) is set as the active mission in the FC Replay mwp log Replay a mwp (JSON) log file Replay blackbox log Replays a Blackbox log file Replay OTX log Replays an OpenTX / EdgeTX CSV log file. (Also BulletGCSS and Ardupilot logs where available) Replay mwp RAW log Replay a mwp raw (binary) log file Stop Replay Stops a running replay Static Overlay > Load Loads a static KML format overlay file Static Overlay > Remove Removes a loaded KML file from the display Geozones Invokes the INAV Geozones editor Safe Homes Invokes the INAV safe-home editor Quit Cleanly quits the application, saving the display layout"},{"location":"ui/#edit-menu","title":"Edit Menu","text":"Item Usage Set FollowMe Point Displays the Follow Me dialogue Preferences Displays the preferences dialogue Survey / Area Planner Invokes the area-planner to generate search or survey plans as a mission. Mission Manager Display the multi-mission dialogue to remove segments from a multi-mission CLI serial terminal Displays the INAV CLI using the current connection Get FC Mission Info Display the mission status from a connected FC Seed current map Shows a dialogue to seed the map cache for offline (field) use Reboot FC Reboots a connected flight controller Audio Test Reads out the mwp version number as an audio test"},{"location":"ui/#view-menu","title":"View Menu","text":"Item Usage Zoom to Mission Zooms the map to the currently loaded mission Set location as default Sets the current location as the default (startup) location Centre on position ... Shows the \"Centre on Position\" selector and \"favourite places\" editor\" GPS Statistics Displays FC GPS status (rate, packets, errors, timeouts, HDOP/EPV/EPH) Radar View Displays the Radar (inav radar / ADS-B) view Telemetry Tracker Displays the Telemetry Tracker UI Flight Statistics Display the flight statistic dialogue (also automatic on disarm) Video Stream Opens the (live) video stream window GCS Location Displays the indicative GCS location icon"},{"location":"ui/#help-menu","title":"Help Menu","text":"Item Usage Online Manual Opens this document in the default browser Shortcut keys list Displays the short cut keys list About Displays version, author and copyright information"},{"location":"ui/#map-and-mission-settings-2","title":"Map and Mission Settings (2)","text":"A number of different map provides are available. mwp offers the mapping library (libshumate
) defaults, MapBox, Bing Map, and user defined options, for example anonymous maps.
Note that Bing Maps is deprecated, and MapBox will only be offered if the user has supplied a MapBox API key.
The zoom level may be selected from the control here, or by zooming the map with the mouse wheel.
The +Add WPs (Edit WPs) button enables mission edit mode (click on the map to create a WP, drag to move, right mouse button for properties). Graphical WP editing may be augmented by the table orientated mission table view, which allows additional control (altitude, speed, special functions, for example fly-by-home waypoints).
The \"Active Mission\" drop down supports INAV 4.0+ multi-mission. There is also a mission manager item under the Edit menu.
"},{"location":"ui/#communications-and-telemetry-settings-3","title":"Communications and telemetry settings (3)","text":"There is a (blue \"!\" in the example) 'navigation safe' status icon. If this icon is shown (i.e. navigation is unsafe, then clicking on the item will provide more information:
The Device drop-down offers detected and pre-set (Preferences) devices for the FC / telemetry port. The device syntax is described the Device and Protocol definition chapter.
The Protocol Selection drop-down (showing Auto in the reference image) allows the user to provide a hint as to communication protocols available on Device. These are further described in the Device and Protocol definition article.
The Connect / Disconnect button connects / disconnects the displayed device.
The auto button causes mwp to automatically attempt to connect to the nominated device.
"},{"location":"ui/#side-bar-visibility-4","title":"Side Bar Visibility (4)","text":"Toggling this button will hide or show the side bar (6).
"},{"location":"ui/#map-area-5","title":"Map Area (5)","text":"The map area displays the currently selected map at the desired zoom level. The map may be managed using familiar controls (drag, scroll wheel etc).
"},{"location":"ui/#side-bar-elements-6","title":"Side Bar elements (6)","text":"The side bar displays a set if user defined UI elements (\"dockets\") that display flight / sensor information.
See Side Bar Management. In the main window screen shot (left to right, top to bottom) we have:
The location of the mouse pointer on the map. Position in the user's preferred format and ground elevation are shown.
"},{"location":"ui/#fc-information-8","title":"FC Information (8)","text":"Displays the firmware, version and build with API information, profile and flight mode.
"},{"location":"ui/#vehicle-visualisation-9","title":"Vehicle Visualisation (9)","text":"auto-follow
. whether the map always displays the aircraft icon and tracks (requires GPS).audio-on-arm
. Whether to \"speak\" status information.The green / red bars show gyro / acc / baro / mag / gps / sonar sensor status. If a required sensor fails, a map annotation will be displayed, together with an audible alarm (image from legacy version).
"}]} \ No newline at end of file +{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Overview","text":"Sweet dreams and flying machines1
mwp (originally \"multi-wii planner\") is a mission planner, ground control station and flight logger for MSP (Multiwiii Serial Protocol) compatible flight controller firmware (INAV and Multiwii at least).
From its MultiWii origins mwp has evolved to support navigation capabilities in INAV.
INAV is now the main development target, however MultiWii mission planning and ground control remains a supported function.
"},{"location":"#features","title":"Features","text":"mwp supports the following telemetry protocols :
mwp also supports the real-time display of adjacent aircraft using:
mwp supports replay of:
.bin
) logLog replay requires tools from the flightlog2x project.
"},{"location":"#platforms-and-os","title":"Platforms and OS","text":"The tools are designed to be portable and as far as possible platform and architecture agnostic. The suite is developed on Arch Linux and is tested on Debian (Trixie / Sid), Alpine (Edge), Fedora (current) and FreeBSD (current release). Being able to satisfy the required dependencies is more important than the actual distro / OS / platform. mwptools also runs on proprietary OS such as MacOS and Windows.
"},{"location":"#build-and-installation","title":"Build and installation","text":"Build and installation is described in the following sections:
If you are migrating from the legacy (Gtk+-3.0) version to the extant (Gtk 4) version, you are advised to read the migration guide first.
James Taylor, Fire and Rain. Full line is 'sweet dreams and flying machines in pieces on the ground', you may skip the final part.\u00a0\u21a9
mwp provides a pseudo-map proxy that just gives you a black map (or user specified tile). This may be useful for a number of use-cases:
This proxy is not build by default, it is necessary to build, install and configure the proxy manually.
cd mwptools/qproxy\nmake bproxy\n# copy bproxy somewhere on the PATH\ncp bproxy ~/.local/bin/\n# or\nsudo cp broxy /usr/local/bin\n# or\nsudo cp broxy /usr/bin\n
"},{"location":"Black-Ops/#configuration","title":"Configuration","text":"That was the easy bit! Now it is necessary to tell mwp where to find the proxy. This involves a setting and a configuration file.
First of all, ensure that the map-sources
setting is enabled:
$ gsettings get org.stronnag.mwp map-sources\n'sources.json'\n# here this set to a file sources.json (in the configuraion directory ~/.config/mwp/ / $LOCALAPPDATA/mwp)\n
if this is not set, then set it:
$ gsettings set org.stronnag.mwp map-sources 'sources.json'\n
Now we need to edit the configuration file sources.json
, there is a sample file in mwptools/samples/sources.json
. you file needs a stanza like:
{\n \"id\": \"Black\",\n \"name\": \"Black Tiles\",\n \"license\": \"(c) jh \",\n \"license_uri\": \"http://daria.co.uk/\",\n \"min_zoom\": 0,\n \"max_zoom\": 20,\n \"tile_size\": 256,\n \"projection\": \"MERCATOR\",\n \"spawn\" : \"bproxy\",\n}\n
So a minimal sources.json
looks like:
{\n \"sources\" : [\n {\n \"id\": \"Black\",\n \"name\": \"Black Tiles\",\n \"license\": \"(c) jh \",\n \"license_uri\": \"http://daria.co.uk/\",\n \"min_zoom\": 0,\n \"max_zoom\": 20,\n \"tile_size\": 256,\n \"projection\": \"MERCATOR\",\n \"spawn\" : \"bproxy\",\n }\n ]\n}\n
On starting mwp you should see a new map option \"Black Tiles\".
"},{"location":"Black-Ops/#custom-tile","title":"Custom Tile","text":"It's also possible to have a custom tile (which does not have to be black). The tile must be:
The full path is provided in the environment variable MWP_BLACK_TILE
, e.g.
# put this in e.g. ~/.bashrc to make it permanent\nexport MWP_BLACK_TILE=~/.config/mwp/mytile.png\n
The environment variable may instead be added to cmdopts
.
For example:
"},{"location":"Building-with-meson-and-ninja/","title":"Build / install mwp (Generic)","text":""},{"location":"Building-with-meson-and-ninja/#overview","title":"Overview","text":"If you just want to install mwp on a Debian /derivative, x64_64, then you can install the reasonably recent binary .deb
package from the Release Area.
For Arch Linux, you can install the AUR package mwptools-git
. This tracks master
.
Otherwise, if you're using a different (not Debian based) distribution, just curious about building mwptools, you want to explore other tools and scripts in the repository or you're using a different architecture (ia32, Arm7, aarch64, riscv64, ppc etc.), or you want the most recent code, then you can build from source. This is the recommended installation method.
The mwptools suite is built using the meson and ninja toolchain. For most users these will be automatically provided by a build-essentials
type of package.
For Debian and derivatives there is a \"one stop\" installation script, as well as a x86_64 \"Release\" .deb
archive.
For Fedora, the is a also a documented list of packages.
For Arch, the PKGBLD
lists the required packages.
For MacOS, use Homebrew to install required packages, having evinced the names from one of the Linux guides.
For Windows (MSys2), see Github discussion #182 for dependencies and workarounds).
For any other distribution / platform / OS, any of the above documents should give you an idea of the packages required, typically:
Numbers is parenthesis indicate a minimum version. Modern OS should be able to satisfy these requirements.
"},{"location":"Building-with-meson-and-ninja/#usage","title":"Usage","text":""},{"location":"Building-with-meson-and-ninja/#normative-guide","title":"Normative guide","text":"Note that the normative build reference is the INSTALL
file in the source tree. This is most current documentation.
Set up the meson
build system from the top level. Note that _build
is a directory that is created by meson setup
; you can use what ever name you wish, and can have multiple build directories for different options (e.g _build
for local and _sysbuild
for system wide installations.
meson setup _build --buildtype=release --strip [--prefix $HOME/.local]\n
--prefix $HOME/.local
$HOME/.local/bin
, which should be added to $PATH
as required.--prefix /usr
--prefix
as the default (/usr/local
) is suitableUnless you need a multi-user setup, a local install is preferable, as you don't need sudo
to install, and you'll not risk messing up build permissions.
chmod +x deb-install.sh
./deb-install.sh -y
~/.local/bin
. Ensure this exists on $PATH
; modern distros should do this for you.ninja -C _build\n# for a local install\nninja -C _build install\n# for system install\nninja -C _build\nsudo ninja -C _build install\n
"},{"location":"Building-with-meson-and-ninja/#accessing-the-serial-port","title":"Accessing the serial port","text":"The user needs to have read / write permissions on the serial port in order to communicate with a flight controller. This is done by adding the user to a group:
sudo usermod -aG uucp $USER
sudo usermod -aG dialout $USER
All Linux with systemd
: In you log in via systemd
's loginctl
, then you can create a udev
rule that does not rquire the user being a member of a particular group:
#less /etc/udev/rules.d/45-stm32.rules\nSUBSYSTEMS==\"usb\", ATTRS{idVendor}==\"0483\", ATTRS{idProduct}==\"5740\", MODE=\"0660\", TAG+=\"uaccess\", ENV{ID_MM_DEVICE_IGNORE}=\"1\", ENV{ID_MM_CANDIDATE}=\"0\"\nSUBSYSTEMS==\"usb\", ATTRS{idVendor}==\"0483\", ATTRS{idProduct}==\"df11\", MODE=\"0660\", TAG+=\"uaccess\"\n
FreeBSD: sudo pw group mod dialer -m $USER
mwp
Mission planner, GCS, log replay etc. mwp-plot-elevations
1 Mission elevation / terrain analysis cliterm
Interact with the CLI fc-get
, fc-set
2 Backup / restore CLI diff inav_states.rb
Summarise BBL state changes, also installed inav_states_data.rb
fcflash
FC flashing tool, requires dfu-util
and / or stmflash32
flashgo
Tools to examine, download logs and erase from dataflash bproxy
Black maps tiles, for those covert operations"},{"location":"Building-with-meson-and-ninja/#libraries","title":"Libraries","text":"$prefix/lib/libmwpclib.*so.x.0.0\n$prefix/lib/libmwpclib.a\n$prefix/lib/libmwpvlib.*so.x.0.0\n$prefix/lib/libmwpclib.a\n
Notes:
1. This may either be the new Go executable or the legacy, less functional Ruby script.
2. fc-set
is a hard link to fc-get
These are only built by explicit target name; they will be installed if built.
# one of more of the following targets\nninja ublox-cli\nsudo ninja install\n
Application Usage ublox-cli
Ublox GPS tool gmproxy
Proxy for certain commercial TMS"},{"location":"Building-with-meson-and-ninja/#troubleshooting-and-hints","title":"Troubleshooting and Hints","text":""},{"location":"Building-with-meson-and-ninja/#migrate-from-a-system-install-to-a-user-install","title":"Migrate from a system install to a user install","text":"Either use separate build directories, or reconfigure.
cd _build\nsudo ninja uninstall\nmeson --reconfigure --prefix=$HOME/.local\nninja install\n
"},{"location":"Building-with-meson-and-ninja/#fixing-build-permissions","title":"Fixing build permissions","text":"If you install to system locations, it is possible that sudo ninja install
will write as root
to some of the install files, and they become non-writable to the normal user.
build
directory, run sudo chown -R $USER .
If you used the deb-install.sh
script, then it installed everything into $HOME/.local/bin
(and other folders under ~/.local
). This is nice because:
sudo
to install it.Linux (like most other OS) has the concept of a PATH
, a list of places where it looks for executable files). You can see this from a terminal:
## a colon separated list\necho $PATH\n
So check that $HOME/.local/bin
is on $PATH
; preferably near the front.
If it is, then the problem may be that the older mwp also exists elsewhere on the PATH, and the system will not re-evaluate the possible chain of locations if it previously found the file it wants.
So, maybe you have an old install. You didn't remove it (alas); so the system thinks that mwp is /usr/bin/mwp
; in fact it's now $HOME/.local/bin/mwp
If $HOME/.local/bin
is on the PATH before /usr/bin
, the you have two choices:
# reset the path search\nhash -r\n# mwp, where art thou? Hopefully now is ~/.local/bin\nwhich mwp\n# From **this terminal** executing mwp will run the location reported by `which mwp`\n
or
Log out, log in. The PATH will be re-evaluated.
If $HOME/.local/bin
is not on PATH. then it needs to be added to a login file (.profile
, .bashrc
, .bash_profile
etc.). Modern distros do this for you, however if you've updated an older install you may have to add it yourself.
# set PATH so it includes user's private bin if it exists\nif [ -d \"$HOME/bin\" ] ; then\n PATH=\"$HOME/bin:$PATH\"\nfi\n\n# set PATH so it includes user's private bin if it exists\nif [ -d \"$HOME/.local/bin\" ] ; then\n PATH=\"$HOME/.local/bin:$PATH\"\nfi\n
If an older (perhaps Makefile generated) mwp exists; then you should remove all evidence of an earlier system install.
find /usr -iname \\*mwp\\*\n
review the list and as root, delete the old files. Do similar for blackbox-decode.
If you're content with the list, then (caveat emptor):
sudo find /usr -iname \\*mwp\\* -delete\n
You'll still have to remove non-empty directories manually.
"},{"location":"Building-with-meson-and-ninja/#ninja-error-loading-buildninja-no-such-file-or-directory","title":"\"ninja: error: loading 'build.ninja': No such file or directory","text":"Something, or persons unknown has removed this file.
cd mwptools\nmeson setup --reconfigure _build --prefix ~/.local\ncd _build\nninja install\n
"},{"location":"Building-with-meson-and-ninja/#error-dependency-not-found-tried-pkgconfig","title":"ERROR: Dependency \"?????\" not found, tried pkgconfig","text":"mwp requires a new dependency. This ~~will~~ should be documented in the wiki Recent Changes document.
src/common/mwp_icon.svg
$prefix/share/icons/hicolor/scalable/apps/
Desktop icon src/mwp/org.stronnag.mwp.gschema.xml
$prefix/share/glib-2.0/schemas/
Settings schema src/mwp/volts.css
$prefix/share/mwp/
Colours used by battery widget src/mwp/beep-sound.ogg
$prefix/share/mwp/
Alert sound src/mwp/bleet.ogg
$prefix/share/mwp/
Alert sound src/mwp/menubar.ui
$prefix/share/mwp/
Menu definition src/mwp/mwp.ui
$prefix/share/mwp/
UI definition src/mwp/orange.ogg
$prefix/share/mwp/
Alert sound src/mwp/sat_alert.ogg
$prefix/share/mwp/
Alert sound src/mwp/mwp.desktop
$prefix/share/applications/
Desktop launcher src/mwp/mwp_complete.sh
$prefix/share/bash-completion/completions/
bash completion for mwp
src/mwp/pixmaps
$prefix/share/mwp/pixmaps/
UI Icons docs/debian-ubuntu-dependencies.txt
$prefix/share/doc/mwp/
Debian / Ubuntu dependencies docs/fedora.txt
$prefix/share/doc/mwp/
Fedora dependencies"},{"location":"Fly-By-Home-waypoints-%28inav-4-new-feature%29/","title":"Fly By Home Waypoints","text":""},{"location":"Fly-By-Home-waypoints-%28inav-4-new-feature%29/#introduction","title":"Introduction","text":"For INAV 4.0, there is a \"FlyBy Home\" (FBH) waypoint modifier.
This will set waypoints of types WAYPOINT, POSHOLD_TIME and LAND to execute at the arming home location (any safehome is ignored).
The flight controller applies FBH behaviour to waypoints having one (or both) of the following characteristics:
flag
field is set to 0x48 (72 decimal, 'H')In this case, the waypoint position is determined at run time (when the WP is actually used) and is set to the arming location. Note that the arming location must be set with a valid GPS fix.
As the waypoint location is determined during execution, it is not stored; so downloading a completed mission will return the original locations, not the locations used during the mission.
mwp will perform the following checks when importing WAYPOINT, POSHOLD_TIME and LAND points:
This will ensure, as far as possible, that when such a mission is exported, it is safe on earlier INAV firmware. Note that this excludes using exactly 0,0 as an actual waypoint location (but 0.00001,0.00001 would be OK); in practical terms this is only likely to affect 007 villains.
"},{"location":"Fly-By-Home-waypoints-%28inav-4-new-feature%29/#implications-for-a-graphical-mission-planner","title":"Implications for a graphical mission planner","text":"INAV (and mwp) do not require a planned homed location, so providing graphical support for waypoints whose location is indeterminate prior to mission execution is an interesting challenge. mwp incorporates a number of new features to support FBH.
flag
attribute has been added the XML mission file schema.The practical results being:
flag
set. This means they will behave predictably when uploaded to older firmware.A waypoint may set set to FBH (or have FBH removed) from either the right mouse popup or the MiWP List menu.
Legacy Images
The images this section are from legacy mwp, however the capability is the same.
In the first image, no FBH waypoints have been set. We can see the planned home (the brown icon, which was read from the extant mission file), and the popup menu and mission editor. Note: the popup entry has since been renamed 'Fly By Home' for consistency.
1. Initial state, no FBHIn the second image, WP2 has been made a FBH WP; we can see that it is now attached the home icon (and slightly faded). The home icon can be dragged, the attached FBH waypoint is no longer independently draggable.
2. WP2 set as FBHIn the third image, the planned home has been moved slightly north, WP2 has moved with it.
3. Home moved, WP2 moved as FBHIn the forth image, a second waypoint (WP14) has been set as FBH; it is also now locked to the planned home location.
4. Add WP14 as FBHIn the fifth image, the FBH attribute as been cleared on WP2; it has been independently dragged to a new location.
5. Remove FBH from WP2"},{"location":"Fly-By-Home-waypoints-%28inav-4-new-feature%29/#mwp-ground-control-station-and-replay-modes","title":"mwp Ground Control Station and Replay modes","text":"If a mission is loaded when mwp is used as ground control station or for log replay, and the mission contains FBH waypoints, then the mission will be redrawn with the actual home location when the home location is established.
"},{"location":"Mission-Elevation-Plot-and-Terrain-Analysis/","title":"Mission Elevations","text":""},{"location":"Mission-Elevation-Plot-and-Terrain-Analysis/#overview","title":"Overview","text":"Prior to INAV 3.0, mission altitudes are relative to the HOME (arming) location, which is not part of a mission definition. As a result, the pilot has to be ensure by some other means that the mission will clear any raised elevations on the mission path. For INAV 3.0, missions may be either relative to home or absolute (above a datum, see below).
mwp includes a mwp-plot-elevations
tool that performs mission and terrain analysis. This tool is platform independent and can be used without mwp for mission terrain analysis.
mwp-plot-elevations
can rewrite the mission file with new elevations to provide a specified ground clearance.
Legacy Images
The images this section are from legacy mwp, however the capability is the same.
"},{"location":"Mission-Elevation-Plot-and-Terrain-Analysis/#video-tutorial-ui-integration","title":"Video Tutorial & UI integration","text":"From of 2018-12-06, mwp-plot-elevations
is integrated into the mwp
application.
There is a video tutorial.
Obsolescence Note
The video uses the older ruby application, but that doesn't really affect basic functionality.
"},{"location":"Mission-Elevation-Plot-and-Terrain-Analysis/#sample-output","title":"Sample output","text":"Given the mission shown below:
and knowing that the land rises to the north and west, we can check that we do indeed have adequate clearance with the planned route and elevations:
# for decimal '.' locales\n $ mwp-plot-elevations -- home 50.9104826,-1.5350745 --plotfile profile.svg west_field.mission\n # for decimal ',' locales\n $ mwp-plot-elevations --home \"50,9104826 -1,5350745\" --plotfile profile.svg west_field.mission\n
where:
west_field.mission
is the MW-XML mission file (via mwp, INAV configurator, [ezgui, mission planner for INAV] or impload)--home lat,lon
option defines the home position (which may also be set by the environment variable MWP_HOME
), the command line having preference. Note that for modern mwp generated mission files, this information is provided in the mission file.profile.svg
, via the --plotfile
option.The result from this command is an SVG file, which can be displayed with common image tools (eog
, ImageMagick display
et al). It can also be converted to a raster image using e.g. rsvg-convert
); a sample is shown below:
The red line represents the planned mission altitudes (which are defined relative to the estimated home location), and the green area represents the terrain. As we can see, we clear the hill (and other terrain), but cannot guarantee that we have LOS to lowest point of the mission, or that we're clear of the trees.
We can also specify a \"clearance\" option, in the image below this was set to 16m. Where the blue line is above the red line, one should review that the mission elevations are adequate.
"},{"location":"Mission-Elevation-Plot-and-Terrain-Analysis/#creating-a-new-mission-file","title":"Creating a new mission file","text":"It is also possible (see command line options below) to write out a new mission that takes into account the clearance (margin
parameter). If we then plot this new mission file, we can see that we are at least margin
(in this example 16m) distance clear of the terrain.
Note that the original mission elevations are still taken into account. We can also ignore these, so we end up the absolute clearance distance above the terrain.
$ mwp-plot-elevations nm_west_field.mission --output /tmp/p1.mission --no-mission-alts\n
"},{"location":"Mission-Elevation-Plot-and-Terrain-Analysis/#dependencies","title":"Dependencies","text":"The mwp-plot-elevations
has NO dependency on mwp or Linux / FreeBSD, it can just as easily be run on MacOS or MS Windows. It does however has some dependencies:
Go compiler (1.18 or later)
gnuplot
gnuplot
is easily provided (by your distro or from a binary download).
On all operating systems, the terrain graph is also plotted interactively, regardless of whether the -p
(save SVG plot) option has been specified. The following shows the UI on Windows (it's pretty much the same on other OS).
Digital elevation services can use the WGS84 Ellipsoid or \"sea level\"; survey maps typically use AMSL (Above Mean Sea Level); GPS can report either or both of WGS Ellipsoid and above MSL (mean sea level). INAV and mwp both use AMSL.
There may be a difference between ASML, \"sea level\", WGS84 Ellipsoid and Survey heights, for example, for a test point of 54.149461 -4.669315 (summit of South Barrule, Isle of Man):
Note that while OpenTopo appears to be an accurate web service, it has significant issues that mean it is unacceptable as a reliable data source:
For these reasons, mwp used locally hosted Mapzen DEMs.
There is a more detailed analysis of the available DEMs on the wiki.
"},{"location":"Mission-Elevation-Plot-and-Terrain-Analysis/#so-whos-right","title":"So who's right?","text":"Many years ago, I took a GPS up South Barrule.
It reads 485m, this pretty much agrees with the OS (Survey) height (AMSL). So the real issue is with the DEM available online (either Bing or Google). The 'sea-level\" height DEM reports for this location is c. 13m below Ordnance Survey AMSL value whilst the WGS84 ellipsoid value is 43m above the OS AMSL value.
"},{"location":"Mission-Elevation-Plot-and-Terrain-Analysis/#command-line-help-and-options","title":"Command line help and options","text":"$ mwp-plot-elevations --help\n -dump\n Dump internal data, exit\n -force-alt int\n Force Altitude Mode (-1=from mission, 0=Relative, 1=Absolute (default -1)\n -home string\n home as DD.dddd,DDD.dddd\n -keep\n Keep intermediate plt files\n -margin int\n Clearance margin (m)\n -no-graph\n No interactive plot\n -no-mission-alts\n Ignore extant mission altitudes\n -output string\n Revised mission file\n -rth-alt int\n RTH altitude (m)\n -svg string\n SVG graph file\n -upland\n Update landing elevation offset\n
Note that Go considers -foo
and --foo
to the equivalent. The ruby script requires the --
notation.
As well as specifying options such as home location, clearance margin and RTH altitude on the command line (or as an environment variable), some or all of these options may be set in a configuration file.
mwp-plot-elevations
looks for options in one of the following (in order) ./.elev-plot.rc
(i.e. current directory), $HOME/.config/mwp/elev-plot
, and $HOME/.elev-plot.rc
. The configuration file is a plain text file containing key=value
pairs. Blank lines and lines beginning with #
are ignored; the following example illustrates the recognised keys. Note that $HOME/.config/mwp/elev-plot
is the preferred location, as this is also used by mwp
to populate its graphical dialogue to launch the analysis tool.
# settings for mwp-plot-elevations\nmargin = 16\nhome = 50.910476,-1.535038\n# for ',' locales\n# home = 50,910476 -1,535038\nrth-alt=25\n# 'sanity' is the home -> WP1 distance check; default if not set here is 100m\nsanity = 200\n
"},{"location":"Mission-Elevation-Plot-and-Terrain-Analysis/#usage-examples","title":"Usage Examples","text":"# Interactive plot, using the above configuration file:\n$ mwp-plot-elevations nm_west_field.mission\n\n# Interactive plot. save SVG file\n$ mwp-plot-elevations --plotfile /tmp/mission.svg nm_west_field.mission\n\n# Interactive plot. save SVG file, rewrite mission file\n$ mwp-plot-elevations --plotfile /tmp/mission.svg --output new_west_field.mission nm_west_field.mission\n\n# Interactive plot. save SVG file, rewrite mission file, override clearance margin (20m)\n$ mwp-plot-elevationsb --plotfile /tmp/mission.svg --outout new_west_field.mission --margin 20 nm_west_field.mission\n\n# Interactive plot. save SVG file, rewrite mission file,\n# override clearance margin (20m), reduce RTH altitude (22m)\n$ mwp-plot-elevations --plotfile /tmp/mission.svg --output new_west_field.mission --margin 20 --rth-alt 22 nm_west_field.mission\n
Another contrived example ... create a mission in Google Earth (tied to ground), save as KMZ, convert to MWXML mission file with impload (0 altitude). Use mwp-plot-elevations.rb
to calculate a safe mission.
# convert the saved KMZ file to a MWXML mission file\n$ impload convert /tmp/IOM.kmz /tmp/perwick.mission\n\n# Verify the elevations and clearance with plot-elevations.rb\n$ mwp-plot-elevations.rb -h 54.068826,-4.735472 -m 40 /tmp/perwick.mission\n
Looks OK (well, apart from the flying through the hill, due to impload's default altitude of 20m).
If we specify that a new mission file be generated (--output
), the updated mission is also plotted, and we can see that this clears the hill.
mwp-plot-elevations --home 54.068826,-4.735472 --margin 40 --output /tmp/perwick-ok.mission /tmp/perwick.mission\n
It's not yet perfect, we could be more aggressive in reaching just the clearance altitude, but we clear the hill!.
"},{"location":"Mission-Elevation-Plot-and-Terrain-Analysis/#climb-and-dive-angle-report","title":"Climb and Dive Angle Report","text":"Mission used for climb /dive exampleAs of 2021-06, it's also possible to get climb and dive angles for the calculated mission. Before I added the WP12 => WP7 jump in the mission shown below, it was almost OK; below the desired clearance in a couple of places and just failing to clear the hill at WP15. After adding the JUMP, it hits the terrain pretty conclusively between WP12 and WP7. The modified mission is interesting, as it has to adjust the WPs within the JUMP for the worst case (so the WP7, the second pass is definitive).
The final result:
We also get a climb / dive report, currently to STDOUT and $TMP/mwpmission-angles.txt
(tab separated for easy analysis).
$ mwp-plot-elevations --margin 25 -no-mission-alts --output /tmp/n.mission \\\n --home 54.125205,-4.730322 -rth-alt 40 mwp/missions/IoM/barrule-jump.mission\nHOME - WP1 21.3\u00b0 (climb)\n WP1 - WP2 -13.9\u00b0 (dive)\n WP2 - WP3 16.2\u00b0 (climb)\n WP3 - WP4 -8.1\u00b0 (dive)\n WP4 - WP5 11.4\u00b0 (climb)\n WP5 - WP6 4.9\u00b0 (climb)\n WP6 - WP7 -6.6\u00b0 (dive)\n WP7 - WP8 -8.9\u00b0 (dive)\n WP8 - WP9 1.3\u00b0 (climb)\n WP9 - WP10 7.0\u00b0 (climb)\nWP10 - WP11 4.4\u00b0 (climb)\nWP11 - WP12 -11.9\u00b0 (dive)\nWP12 - WP7 0.3\u00b0 (climb)\n WP7 - WP8 -8.9\u00b0 (dive)\n WP8 - WP9 1.3\u00b0 (climb)\n WP9 - WP10 7.0\u00b0 (climb)\nWP10 - WP11 4.4\u00b0 (climb)\nWP11 - WP12 -11.9\u00b0 (dive)\nWP12 - WP14 2.5\u00b0 (climb)\nWP14 - WP15 -5.2\u00b0 (dive)\nWP15 - RTH -3.6\u00b0 (dive)\n
If you run mwp-plot-elevations via mwp, the information is presented in a separate window.
mwp can also highlight any legs that exceed user-defined (not 0) climb and dive angle limits. However, it's up to you to work out the best solution.
The steep hill and valley at the start are just too much here; best to reroute.
"},{"location":"Replaying-Ardupilot-logs/","title":"Ardupilot log replay","text":""},{"location":"Replaying-Ardupilot-logs/#requirements","title":"Requirements","text":"It is possible to replay Ardupilot logs in the same way as one can replay blackbox, OpenTX / EdgeTX and BulletGCCS logs. This also requires flightlog2x tools 1.0.24 or more recent.
As the author does not have any (useful) AP logs, contributions are welcome.
"},{"location":"Support-for-inav-3.0-WP-features/","title":"mwp and INAV 3.0 Mission Updates","text":""},{"location":"Support-for-inav-3.0-WP-features/#overview","title":"Overview","text":"INAV 3.0 adds a couple of changes to INAV mission planning:
For Multiwii and INAV prior to 3.0, waypoint altitudes were always relative to the arming location. If you always fly in a flat area, or always arm at the same point, this wasn't really an issue; you could always use mwp's terrain analysis to check that you'd clear any obstructions.
However, if you armed some (vertical) distance from the arming point assumed when the plan was created, the absolute, (AMSL) elevation of the WP would differ by the ground difference between the assumed arming point at planning time and the actual arming point at take off. In the worst case (arming at an 'zero' absolute elevation well below the 'assumed at planning time' location), this could result in automated flight into terrain, which is generally undesirable.
Absolute mission altitudes addresses this issue, as the AMSL elevation of the WP is fixed and does not depend on arming location.
"},{"location":"Support-for-inav-3.0-WP-features/#land-wp-ground-elevation-setting","title":"Land WP ground elevation setting","text":"A similar issue existed prior to INAV 3.0 for the LAND WP; the initial implementation assumed that the LAND WP site ground elevation was at approximately the same ground elevation as the arming location. INAV computes landing behaviour based on relative altitude from home; if the actual LAND site was lower than home, then the descent would be slow; if it was higher, then slowdown might not occur and there would be a hard landing (for MR). For FW the final approach and motor-off would be sub-optimal.
The required land elevation uses the P2
WP parameter, in metres.
mwp supports the new feature in the WP Editor and Terrain Analysis.
"},{"location":"Support-for-inav-3.0-WP-features/#terrain-analysis","title":"Terrain Analysis","text":"mwp's terrain analysis function has been upgraded to handle INAV 3.0 features (Relative / Absolute Elevations, Land Ground Elevation). The mwp terrain analysis article describes the new analysis tool.
In the image below, the dialogue has been enhanced to allow selection of the altitude mode and adjustment of LAND elevation. The orange graph line shows the generated mission with a 40m clearance of all obstacles.
The user can select the following altitude modes:
The INAV wiki describes WP mission parameters in some detail.
Discussion of the meaning of \"sea level\". It's confusing.
"},{"location":"dock/","title":"Side Bar Concepts and Usage","text":""},{"location":"dock/#side-bar-overview","title":"Side Bar Overview","text":"The Side Bar, items 4 and 6 in the main window guide provides an area for optional widgets.
The main dock controls are shown below. Please note these images are from the legacy version of mwp.:
"},{"location":"dock/#side-bar-items-dockets","title":"Side Bar Items (Dockets)","text":"The following items are provided.
"},{"location":"dock/#artificial-horizon","title":"Artificial Horizon","text":""},{"location":"dock/#direction-view","title":"Direction View","text":""},{"location":"dock/#flight-view","title":"Flight View","text":""},{"location":"dock/#rssi-lq-status","title":"RSSI / LQ Status","text":""},{"location":"dock/#battery-monitor","title":"Battery Monitor","text":""},{"location":"dock/#vario-view","title":"Vario View","text":""},{"location":"dock/#side-bar-configuration","title":"Side Bar Configuration","text":"A very simple, bespoke panel comprising embedded resizeable panes has been implemented. The configuration may be user defined by a simple text file ~/.config/mwp/panel.conf
.
Each entry is defined by a comma separated line defining the panel widget name, the row (0-3) and the column (0-2) and an optional minimum size (only required for the artificial horizon). The default panel is defined (in the absence of a configuration file) as:
# default widgets\nahi,0,1,100\nrssi, 1, 0\ndirn, 1, 1\nflight, 2, 0\nvolts, 3, 0\n
Which appears as:
The available panel widgets are named as:
Name Usageahi
Artificial horizon dirn
Direction comparison flight
\"Flight View\" Position / Velocity / Satellites etc, volts
Battery information vario
Vario indicator No other legacy widgets have been migrated.
So using the following ~/.config/mwp/panel.conf
# default + vario widgets\nahi,0,1,100\nvario,0,2\nrssi, 1, 0\ndirn, 1, 1\nflight, 2, 0\nvolts, 3, 0\n
would appear as:
"},{"location":"gcs-features/","title":"Ground Control Station Features","text":""},{"location":"gcs-features/#gcs-usage","title":"GCS Usage","text":""},{"location":"gcs-features/#basic-functionality","title":"Basic functionality","text":"When flying waypoints, if the mission is also loaded into mwp, mwp can display some limited \"OSD\" information.
Various settings (colour, items displayed etc.) are defined by settings.
"},{"location":"gcs-features/#gcs-location-icon","title":"GCS Location Icon","text":"A icon representing the GCS location can be activated from the View/GCS Location\" menu option.
By default, it will display a tasteful yellow / blue icon which one may drag around. It has a few other purposes beyond showing some user specified location (but see below).
If you don't like the icon, you can override it by creating your own icon.
If gpsd
is detected (on localhost
), then the position will be driven by gpsd
, as long as it has a 3D fix.
The one usage is when inav-radar is active; if the GCS icon is enabled (either by manual location or driven by gpsd
), then rather than being a passive 'GCS' node, mwp will masquerade as an 'INAV' node and advertise the GCS (icon) location to other nodes. This implies that you have sufficient LoRa slots to support this node usage.
gpsd
.Note: The images in this section are from the legacy version, however the concepts are the same.
In INAV 4.0, the FC supports \"multi-missions\", that is allowing the user to upload and store multiple missions.
The mission to be executed may be set when the mission set is uploaded, or selected by OSD command (or stick command).
"},{"location":"inav-4.0-multi-missions/#mwp-support","title":"mwp support","text":"The means by which this function is provided by the FC is a little inconvenient (for the planner) but expedient; it's hard to see how else it could have been implemented.
In general and in summary, the functionality allows multiple missions to exist in a single \"mission file\" and either one or all of those mission can be uploaded to the FC.
When a \"multi-mission\" set is downloaded from the FC, mwp will set the active mission to that set as active in the FC.
When a \"multi-mission\" set is uploaded to the FC, mwp will set the active FC mission to its active mission.
"},{"location":"inav-4.0-multi-missions/#mwp-changes","title":"mwp changes","text":""},{"location":"inav-4.0-multi-missions/#top-bar","title":"Top Bar","text":"The top bar how includes an \"Active Mission\" item. This always has mission 1 (the legacy mission) and offers \"New\", allowing multiple missions to be maintained in one mwp session.
"},{"location":"inav-4.0-multi-missions/#open-mission-file","title":"Open Mission file","text":"The file open dialog has a preview pane that displays the missions in a multi-mission file. The user can select the mission to be the active mission.
"},{"location":"inav-4.0-multi-missions/#append-mission-file","title":"Append Mission File","text":"It is now possible to append an existing mission file (which may hold multiple missions) into a multi-mission set. This uses same dialog as Open Mission File.
"},{"location":"inav-4.0-multi-missions/#save-as-mission-file","title":"Save As Mission file","text":"The file \"Save as\" dialog has an option to exclude specific segments from a multi-mission (via the Remove Segments from file button in the following image). Note that \"Save\" will always save all mission segments.
In this case, only segment 1 of the multi-mission would be saved.
"},{"location":"inav-4.0-multi-missions/#upload-download-menu-options","title":"Upload / Download Menu Options","text":"The menu options reflect the new capability to upload all or the active mission. The \"Save to EEPROM\" option may also change to this pattern in future.
"},{"location":"inav-4.0-multi-missions/#multi-mission-manager","title":"Multi-Mission Manager","text":"The Edit menu has a Multi Mission Manager option. This allows the user to delete one or more missions from a multi-mission scenario.
"},{"location":"inav-4.0-multi-missions/#fc-limits","title":"FC Limits","text":"INAV 4.0 limits the total number of waypoints to 120 and the number of mission segments within a multi-mission scenario to 9.
mwp will allow the user to exceed these limits while creating / editing multi-mission scenarios, but enforces the limits for upload. So it would be possible to open / append files containing a total of (for example) 11 mission segments and 150 WPs. It would be necessary to reduce the mission set to the FC limits before it could be uploaded.
"},{"location":"inav-4.0-multi-missions/#legacy","title":"Legacy","text":"mwp still supports prior FC firmware, including MW. It is a bug if this is not the case. However, the user needs to be aware of the capabilities of the FC firmware.
"},{"location":"inav-4.0-multi-missions/#caveats","title":"Caveats","text":"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<mission>\n <!--mw planner 0.01-->\n <version value=\"42\"></version>\n <mwp save-date=\"2021-11-11T07:22:43+0000\" zoom=\"14\" cx=\"-3.2627249\" cy=\"54.5710168\" home-x=\"-3.2989342\" home-y=\"54.5707123\" generator=\"mwp (mwptools)\"><details><distance units=\"m\" value=\"3130\"></distance><nav-speed units=\"m/s\" value=\"10\"></nav-speed><fly-time units=\"s\" value=\"319\"></fly-time><loiter-time units=\"s\" value=\"0\"></loiter-time></details></mwp>\n <missionitem no=\"1\" action=\"WAYPOINT\" lat=\"54.5722109\" lon=\"-3.2869291\" alt=\"660\" parameter1=\"0\" parameter2=\"0\" parameter3=\"0\" flag=\"0\"></missionitem>\n <missionitem no=\"2\" action=\"WAYPOINT\" lat=\"54.5708178\" lon=\"-3.2642698\" alt=\"755\" parameter1=\"0\" parameter2=\"0\" parameter3=\"0\" flag=\"0\"></missionitem>\n <missionitem no=\"3\" action=\"WAYPOINT\" lat=\"54.5698227\" lon=\"-3.2385206\" alt=\"513\" parameter1=\"0\" parameter2=\"0\" parameter3=\"0\" flag=\"165\"></missionitem>\n <mwp save-date=\"2021-11-11T07:22:43+0000\" zoom=\"15\" cx=\"-3.2778311\" cy=\"54.5568837\" home-x=\"-3.2983737\" home-y=\"54.5622331\" generator=\"mwp (mwptools)\"><details><distance units=\"m\" value=\"9029\"></distance><nav-speed units=\"m/s\" value=\"10\"></nav-speed><fly-time units=\"s\" value=\"929\"></fly-time><loiter-time units=\"s\" value=\"0\"></loiter-time></details></mwp>\n <missionitem no=\"1\" action=\"WAYPOINT\" lat=\"54.5599696\" lon=\"-3.2958555\" alt=\"236\" parameter1=\"0\" parameter2=\"0\" parameter3=\"0\" flag=\"0\"></missionitem>\n <missionitem no=\"2\" action=\"WAYPOINT\" lat=\"54.5537978\" lon=\"-3.2958555\" alt=\"136\" parameter1=\"0\" parameter2=\"0\" parameter3=\"0\" flag=\"0\"></missionitem>\n <missionitem no=\"3\" action=\"WAYPOINT\" lat=\"54.5547933\" lon=\"-3.2864141\" alt=\"238\" parameter1=\"0\" parameter2=\"0\" parameter3=\"0\" flag=\"0\"></missionitem>\n <missionitem no=\"4\" action=\"WAYPOINT\" lat=\"54.5597705\" lon=\"-3.2695913\" alt=\"570\" parameter1=\"0\" parameter2=\"0\" parameter3=\"0\" flag=\"0\"></missionitem>\n <missionitem no=\"5\" action=\"WAYPOINT\" lat=\"54.5552910\" lon=\"-3.2598066\" alt=\"502\" parameter1=\"0\" parameter2=\"0\" parameter3=\"0\" flag=\"0\"></missionitem>\n <missionitem no=\"6\" action=\"JUMP\" lat=\"0.0000000\" lon=\"0.0000000\" alt=\"0\" parameter1=\"1\" parameter2=\"1\" parameter3=\"0\" flag=\"165\"></missionitem>\n <mwp save-date=\"2021-11-11T07:22:43+0000\" zoom=\"20\" cx=\"-3.2501935\" cy=\"54.5714148\" generator=\"mwp (mwptools)\"><details><distance units=\"m\" value=\"0\"></distance></details></mwp>\n <missionitem no=\"1\" action=\"WAYPOINT\" lat=\"54.5714148\" lon=\"-3.2501935\" alt=\"50\" parameter1=\"0\" parameter2=\"0\" parameter3=\"0\" flag=\"165\"></missionitem>\n</mission>\n
Download sample mission
"},{"location":"licence-misc-info/","title":"Licence and Alternative Tools","text":"GPL v3 or later. (c) Jonathan Hudson and contributors.
"},{"location":"licence-misc-info/#alternative-tools","title":"Alternative Tools","text":"In addition to mwp, the following INAV mission planners (and GCS in some cases) exist, in various states of usefulness, at least:
The following alternatives exist for mwp's survey / area planner :
The \"Edit > Preferences\" menu provides a UI for some gsetting
/ dconf
settings. The settings here are applied immediately if 'Apply' is clicked.
Unit preferences should be instantly reflected in the UI when 'Apply' is clicked.
"},{"location":"misc-ui-elements/#favourite-places","title":"Favourite Places","text":"mwp maintains a list of favourite places, from \"View > Centre on Location\" menu item.
The \"Place\" combo menu holds all places defined in ~/.config/mwp/places
(see the configuration reference).
For convenience, clicking the 'Editor ...' button will load the \"Places Editor\".
Locations can be edited clicking the \"Document Edit\" icon at the end of the row.
The context (right mouse button) menu:
~/.config/mwp/places
In the image, we are measuring the distance between the take off home (brown icon) and the landing home (orange icon); the distance markers are the black/white circles. Ctrl-D has been pressed a second time to display the result.
The following chapters provide specific information for advanced INAV capability topics:
Please note that some of the images in this chapter are from the legacy version of mwp.
"},{"location":"mission-editor/#map-features","title":"Map Features","text":"Missions may be added on the map by enabling mission add mode:
This will:
WPs have a context popup menu via right click on a WP icon
Almost all functions are available here, however some advanced functions, acting on multiple WP, etc. requires the tabular mission editor.
"},{"location":"mission-editor/#edit-waypoint","title":"Edit Waypoint","text":"The Edit Waypoint option opens an edit form for the current waypoint. The items displayed depend on the type of waypoint.
In this image, note:
WAYPOINT
.LAND
WP types.Multiple attributes may be set.
If the AMSL button is toggled, and a valid planned home location is set, then the altitude will be adjusted. For the above example, if the AMSL box is cleared, the dialogue shows:
Note that the Altitude box has an orange border to show that the altitude has been automatically updated.
If there is no planned home location, and the AMSL box is toggled, then the Altitude box assumes a red border to indicate to the user that manual intervention is required.
In the above image, a relative altitude of 16m has been toggled to absolute; there is no home position, so the altitude entry has a red border, as this is now below the absolute altitude of the terrain.
Note also that this example has multiple option set (SET HEAD and JUMP).
For a LAND
WP, the FW Approach parameters are available.
The Mission WP List may be invoked from the WP context menu.
It provides the following functions:
There is a right mouse context menu, the availability of items depending on whether zero, one or multiple items are selected.
The param3
value is presented as:
R
: Relative AltitudeA
: Absolute (AMSL) Altitude[1234]
: User action setThe flags
values are presented as:
EoM
: End of mission markerFBH
: Fly By Home (FBH) waypointMany of the operations described below are shown in the videos, which probably provide a clearer explanation that any textual description could. Note also that many of these (images and videos) are legacy, but the concepts are still valid.
"},{"location":"mission-editor/#add-shape","title":"Add Shape","text":"If a SET POI point is added to the mission, (there may also be other extant way-points), this option will display a dialogue to enter the number of points in a shape, the radial distance (from the SET POI to each point), an offset angle and the direction of rotation. i.e this defines a polygon around the POI.
SET_POI
point may be deleted, unless you really want SET_POI
functionality.Bulk location updates may be applied to selected waypoints.
If an item if left black (or 0), then no adjustment is applied to that axis. Offsets are in metres, regardless of the user's preference distance unit.
"},{"location":"mission-editor/#speed-and-altitude-updates","title":"Speed and Altitude updates","text":"Bulk speed and altitude updates may be applied to selected waypoints. The altitude update allows either relative (to home) to absolute (ASL) altitudes.
"},{"location":"mission-editor/#preview-mission","title":"Preview Mission","text":"\"Flys\" an aircraft icon around the mission; this may be useful for predicting the behaviour of multiple embedded JUMPs.
"},{"location":"mission-editor/#clear-mission","title":"Clear Mission","text":"The Clear Mission option clears the mission. There is no confirmation, so be sure you really want to do this.
"},{"location":"mission-editor/#uncommitted-changes","title":"Uncommitted Changes","text":"If mwp detects uncommitted changes when opening a new mission / downloading from the FC / cleanly exiting the application, then the user is presented with the following dialogue.
Video example setting up JUMP, POSHOLD TIMED and LAND waypoints.
"},{"location":"mission-editor/#set_poi-set_head-as-mission-elements","title":"SET_POI, SET_HEAD as mission elements","text":"Video example SET_POI and SET_HEAD (real mission usage).
"},{"location":"mission-editor/#mission-preview","title":"Mission Preview","text":"Video example of preview for a complex (multiple jumps, timed POSHOLD) mission (preview from the first video).
"},{"location":"mqtt---bulletgcss-telemetry/","title":"BulletGCSS Telemetry","text":""},{"location":"mqtt---bulletgcss-telemetry/#mwp-requirements","title":"mwp requirements","text":"mwp works with the web-based Ground Control Station BulletGCSS MQTT protocol, tested with both a fl2mqtt
simulation and a recorded live session.
The MQTT component is build if either paho-mqtt
or mosquitto
libraries are detected; paho-mtqq
is preferred.
## Arch ##\nyay -S paho-mqtt-c-git ## or you favourite AUR helper\n# or #\nsudo pacman -S mosquitto\n\n## Debian and derivatives ##\n### Debian testing / Ubuntu 20.10 + for paho ###\nsudo apt install libpaho-mqtt-dev\n# or #\nsudo apt install libmosquitto-dev\n\n## Fedora ##\ndnf install paho-c-devel\n# or #\ndnf install mosquitto-devel\n\n## FreeBSD ##\n## paho-mqtt\n# Clone github repo and build from source. Configure with cmake -DPAHO_WITH_SSL=true ..\ngit clone https://github.com/eclipse/paho.mqtt.c.git\ncd paho.mqtt.c\nmkdir build\ncd build\ncmake -DPAHO_WITH_SSL=true ..\nmake && sudo make install\n\n# or #\nsudo pkg install mosquitto\n
If you have both paho-mqtt
and mosquitto
installed, then paho-mqtt
is preferred.
Once mwp is built with a MQTT library, you can use an MQTT URL as a device name, for example for the demo that runs every other hour (00:00, 02:00 .. 22:00) UTC on broker.emqx.io
with topic org/mwptools/mqtt/otxplayer
, the mqtt URI for mwp would be:
mqtt://broker.emqx.io/org/mwptools/mqtt/otxplayer\n
Or in general:
mqtt://[user[:pass]@]broker[:port]/topic[?cafile=file]\n
Note:
The scheme part (mqtt://
) in the example is interpreted as:
ws://
- Websocket (vice TCP socket), ensure the websocket port is also specified, requires 'paho-mqtt' as the provider.wss://
- Encrypted websocket, ensure the TLS websocket port is also specified. TLS validation is performed using the operating system. Not supported by mosquitto
; requires paho-mqtt
1.39 or later.mqtts://
,ssl://
- Secure (TLS) TCP connection. Ensure the TLS port is specified. TLS validation is performed using the operating system, unless cafile
is provided.mqtt://
- TCP connection. If ?cafile=file
is specified, then that is used for TLS validation (and the TLS port should be specified).MQTT looks like an incredibly elegant solution to long range telemetry.
More information on the BulletGCSS website and BulletGCSS wiki
See also fl2mqtt, a tool to replay Blackbox and OpenTx logs as MQTT and BulletGCSS mosquitto hosting guide for hosting your own MQTT broker.
"},{"location":"mwp-Configuration/","title":"mwp Configuration","text":""},{"location":"mwp-Configuration/#overview","title":"Overview","text":"mwp stores configuration in a number of places, to some degree at the developer's whim, but also in accordance with the data item's volatility.
Each type is further discussed below.
"},{"location":"mwp-Configuration/#command-line-options","title":"Command line options","text":"Command line options provide a 'per instantiation' means to control mwp behaviour; the current set of command line options may be viewed by running mwp from the command line with the single option --help
:
$ mwp --help\n
Where it is required to give permanence to command line options, they can be added to the configuration file $HOME/.config/mwp/cmdopts
(on Windows $LOCALAPPDATA/mwp/cmdopts
), which is described in more detail in the following section.
Note that the documentation will habitually refer to the configuration base directory as ~/.config
as that is where it is found on the majority of OS; if you're using Windows, please adjust as necessary.
You can also use a system-wide \"cmdopts\" file, /etc/default/mwp
. If this flie exists, it will read before the user's file.
--radar-device
, definitions will be additive.The --debug-flags
option takes a numeric value defines areas where additional debug information may be output.
Values may be ORd together (so 4095 means all).
"},{"location":"mwp-Configuration/#configuration-files","title":"Configuration Files","text":"mwp configuration files are stored in a standard directory $HOME/.config/mwp
. This directory is created on first invocation if it does not exist.
$XDG_CONFIG_HOME
)$HOME/.config
$LOCALAPPDATA
/ %LOCALAPPDATA%
/ $Env:LOCALAPPDATA
The following files may be found in the mwp
directory:
cmdopts
","text":"The file cmdopts
contains command line options that the user wishes to apply permanently (and conveniently when run from a launcher icon rather than the command line).
The file contains CLI options exactly as would be issued from the terminal. Options may be on separate lines, and blank lines and line prefixed with a hash '#' are ignored. For example:
In addition to options (--
), the file may also contain environment variables e.g. FOO=BAR
.
# Default options for mwp\n--rings 50,20\n#--voice-command \"spd-say -t female2 -e\"\n#--debug-flags=2\n--dont-maximise\n#-S 8192\n# set the anonymous tile file.\nMWP_BLACK_TILE=/home/jrh/.config/mwp/mars.png\n
So here the only current, valid options are --rings 50,20 --dont-maximise
, and the environment variable MWP_BLACK_TILE is set (for anonymous maps).
The environment is set before any GTK / UI calls are made.
"},{"location":"mwp-Configuration/#map-sources","title":"Map Sources","text":"mwp provides by default:
In preparation for the announced removal of the Bing Maps service, mwp
adds a MapBox
entry where the user has acquired a Mapbox API key.
This key may be either stored in the Desktop keyring (managed by libsecret
) or as a plain text string in the gsettings
database.
Add to the keyring using secret-tool
with the following attributes:
secret-tool store --label=\"Mapbox API\" name mapbox-api-key domain org.stronnag.mwp\nPassword: *************************************************\n
"},{"location":"mwp-Configuration/#gsettings","title":"Gsettings","text":"Alternatively, the key can be added to the gsettings
database:
gsettings set org.stronnag.mwp mapbox-apikey 'pk.xxxxxxx'\n # where 'pk.xxxxxxx' is your MapBox API Key\n
Note that sadly libshumate
creates a cache directory name from which the MapBox access token may be recovered, so there is little security / privacy gain by using the secret key-ring, alas. See Gitlab issue.
sources.json
","text":"sources.json
facilitates adding non-standard map sources to mwp. See the anonymous maps section and comments in the source files in the qproxy
directory.
Here is an example mwptools/src/samples/sources.json
.
{\n \"sources\" : [\n {\n \"id\": \"OpenTopoMP\",\n \"name\": \"OpenTopo\",\n \"license\": \"(c) OSM\",\n \"license_uri\": \"http://www.openstreetmap.org/copyright\",\n \"min_zoom\": 0,\n \"max_zoom\": 19,\n \"tile_size\": 256,\n \"projection\": \"MERCATOR\",\n \"uri_format\": \"http://map-proxy/mapproxy/tiles/1.0.0/opentopo/EPSG3857/{z}/{x}/{y}.png\"\n },\n {\n \"id\": \"LandscapeMP\",\n \"name\": \"Landscape\",\n \"license\": \"(c) OSM\",\n \"license_uri\": \"http://www.openstreetmap.org/copyright\",\n \"min_zoom\": 0,\n \"max_zoom\": 19,\n \"tile_size\": 256,\n \"projection\": \"MERCATOR\",\n \"uri_format\": \"http://map-proxy/mapproxy/tiles/1.0.0/landscape/EPSG3857/{z}/{x}/{y}.png\"\n },\n {\n \"id\": \"CyclemapMP\",\n \"name\": \"Cyclemap\",\n \"license\": \"(c) OSM\",\n \"license_uri\": \"http://www.openstreetmap.org/copyright\",\n \"min_zoom\": 0,\n \"max_zoom\": 19,\n \"tile_size\": 256,\n \"projection\": \"MERCATOR\",\n \"uri_format\": \"http://map-proxy/mapproxy/tiles/1.0.0/cyclemap/EPSG3857/{z}/{x}/{y}.png\"\n },\n {\n \"id\": \"Black\",\n \"name\": \"Black Tiles\",\n \"license\": \"(c) jh \",\n \"license_uri\": \"http://daria.co.uk/\",\n \"min_zoom\": 0,\n \"max_zoom\": 20,\n \"tile_size\": 256,\n \"projection\": \"MERCATOR\",\n \"spawn\" : \"bproxy\"\n }\n ]\n}\n
See also anonymous maps to customise the \"black tile\". The spawn
stanza uses a proxy for non-TMS formats (see mwptools/src/qproxy
for some examples).
volts.css
","text":"vol.css
contains alternate CSS themeing for the battery voltage dock item that may work better on dark desktop themes. An example file is provided as mwp/vcol.css
which can be copied into .config/mwp/
.
places
","text":"The places
(~/.config/mwp/places
) file is a delimited (CSV) file that defines a list of \"shortcut\" home locations used by the \"View / Centre on Position ...\" menu item. It consists of a Name, Latitude, Longitude and optionally zoom level, separated by a TAB
,|
,:
or ;
. Note that positions may be localised in the file and thus .
is no longer recognised as a field separator.
Example places
# mwp places name,lat,lon [,zoom]\nBeaulieu|50.8047104|-1.4942621|17\nJurby:54.353974:-4.523600:-1\n
The user may maintain these files manually if used, or use the graphic places editor. The command line option --centre
accepts a place name as well as a geographic coordinates.
The underlying infrastructure used by mwp has a facility for storing configuration items in a registry like store. This is used extensively by mwp. The items can viewed and modified using a number of tools:
dconf-editor
graphical settings editorgsettings
toolFor gsettings
and dconf-editor
, the name-space is org.stronnag.mwp
, so to view the list of items:
$ gsettings list-recursively org.stronnag.mwp\n
and to list then get / set a single item:
$ gsettings get org.stronnag.mwp log-save-path\n..\n$ gsettings set org.stronnag.mwp log-save-path ~/flight-logs/\n
"},{"location":"mwp-Configuration/#dconf-editor","title":"dconf-editor","text":"This may not be installed by default, but should be available via the OS package manager / software centre.
Initial dconf-editor showing all mwp settings dconf-editor, editing a setting"},{"location":"mwp-Configuration/#list-of-mwp-settings","title":"List of mwp settings","text":"Name Summary Description Default adjust-tz Adjust FC's TZ (and DST) mwp should adjust FC's TZ (and DST) based on the local clock true ah-invert-roll Invert AH roll Set to true to invert roll in the AH (so it becomes an attitude indicator) false arming-speak speak arming states whether to reporting arming state by audio false atexit Something that is executed at exit e.g.gsettings set org.gnome.settings-daemon.plugins.power idle-dim true
. See also manage-power
(and consider setting manage-power
to true
instead). \"\" atstart Something that is executed at startup e.g. gsettings set org.gnome.settings-daemon.plugins.power idle-dim false
. See also manage-power
(and consider setting to true). \"\" audio-on-arm start audio on arm start audio on arm (and stop on disarm) true auto-follow set auto-follow set auto-follow on start true auto-restore-mission Whether to automatically import a mission in FC memory to MWP If the FC holds a valid mission in memory, and there is no mission loaded into MWP, this setting controls whether MWP automatically downloads the mission. false autoload-geozones Autoload geozones from FC Autoload geozones from FC on connect, remove from display on disconnect false autoload-safehomes Load safehomes on connect . If true, then safehomes will be loaded from the FC on connection. false baudrate Baud rate Serial baud rate 115200 beep Beep for alerts Whether to emit an alert sound for alerts. true blackbox-decode Name of the blackbox_decode application Name of the blackbox_decode application (in case there are separate for iNav and betaflight) \"blackbox_decode\" bluez-disco Use Bluetooth discovery Only discovered Bluetooth serial devices with non-zero RSSI will be offered true default-altitude Default altitude Default Altitude for mission (m) 20 default-latitude Default Latitude Default Latitude when no GPS 50.909528 default-loiter Default Loiter time Default Loiter time 30 default-longitude Default Longitude Default Longitude when no GPS -1.532936 default-map Default Map Default map key \"\" default-nav-speed Default Nav speed Default Nav speed (m/s). For calculating durations only. 2.5 default-zoom Default Map zoom Default map zoom 15 delta-minspeed Minimum speed for elapsed distance updates Minimum speed for elapsed distance updates (m/s). Default is zero, which means the elapsed distance is always updated; larger values will take out hover / jitter movements. 0.0 device-names Device names A list of device names to be added to those that can be auto-discovered [] display-distance Distance units 0=metres, 1=feet, 2=yards 0 display-dms Position display Show positions as dd:mm:ss rather than decimal degrees false display-speed Speed units 0=metres/sec, 1=kilometres/hour, 2=miles/hour, 3=knots 0 dump-unknown dump unknown dump unknown message payload (debug aid) false espeak-voice Default espeak voice Default espeak voice (see espeak documentation) \"en\" flash-warn Flash storage warning If a dataflash is configured for black box, and this key is non-zero, a warning in generated if the data flash is greater than \"flash-warn\" percent full. 0 flite-voice-file Default flite voice file Default flite voice file (full path, *.flitevox), see flite documentation) \"\" forward Types of message to forward Types of message to forward (none, LTM, minLTM, minMAV, all) \"minLTM\" ga-alt Units for GA Altiude 0=m, 1=ft, 2=FL 0 ga-range Units for GA Range 0=m, 1=km, 2=miles, 3=nautical miles 0 ga-speed Units for GA Speed 0=m/s, 1=kph, 2=mph, 3=knots 0 geouser User account on geonames.org A user account to query geonames.org for blackbox log timezone info. A default account of 'mwptools' is provided; however users are requested to create their own account. \"mwptools\" gpsd-host gpsd provider Provider for GCS location via gpsd. Default is \"localhost\", can be set to other host name or IP address. Setting blank (\"\") disables. \"localhost\" gpsintvl gps sanity time (m/s) gps sanity time (m/s), check for current fix 2000 ident-limit MSP_IDENT limit for MSP recognition Timeout value in seconds for a MSP FC to reply to a MSP_INDENT probe. Effectively a timeout counter in seconds. Set to a negative value to disable. 60 ignore-nm Ignore Network Manager Set to true to always ignore NM status (may slow down startup) false kml-path Directory for KML overlays Directory for KML overlays, default = current directory \"\" led GPS LED colour GPS LED colour as well know string or #RRGGBB \"#60ff00\" log-on-arm start logging on arm start logging on arm (and stop on disarm) false log-path Directory for replay log files Directory for log files (for replay), default = current directory \"\" log-save-path Directory for storing log files Directory for log files (for save), default = current directory \"\" los-margin Margin(m) for LOS Analysis Margin(m) for LOS Analysis 0 mag-sanity Enable mag sanity checking mwp offers a primitive mag sanity checker that compares compass heading with GPS course over the ground using LTM (only). There are various hard-coded constraints (speed > 3m/s, certain flight modes) and two configurable parameters that should be set here in order to enable this check. The parameters are angular difference (\u2070) and duration (s). The author finds a settings of 45,3 (i.e. 45\u2070 over 3 seconds) works OK, detecting real instances (a momentarily breaking cable) and not reporting false positives. \"\" manage-power manage power and screen whether to manage idle and screen saver false map-sources Additional Map sources JSON file defining additional map sources \"\" mapbox-apikey Mapbox API Key Mapbox API key, enables Mapbox as a map Provider. Setting blank (\"\") disables. \"\" max-climb-angle Maximum climb angle highlight for terrain analysis If non-zero, any climb angles exceeding the specified value will be highlighted in Terrain Analysis Climb / Dive report. Note that the absolute value is taken as a positive (climb) angle 0.0 max-dive-angle Maximum dive angle highlight for terrain analysis If non-zero, any dive angles exceeding the specified value will be highlighted in Terrain Analysis Climb / Dive report. Note that the absolute value is taken as a negative (dive) angle 0.0 max-home-delta home position delta (m) Maximum variation of home position without verbal alert 2.5 max-radar-slots Maximum number of aircraft Maximum number of aircraft reported by iNav-radar 4 max-wps Maximum number of WP supported Maximum number of WP supported 120 min-dem-zoom Minimum zoom for DEM loading DEMs will not be fetched if zoom is below this value 9 misc-icon-size Miscellaneous icon size Size for miscellaneous icons (radar, GCS location) in pixels. -1 means the image's natural size (no scaling). 32 mission-meta-tag use meta vice mwp in mission file If true, the legacy 'mwp' tag is named 'meta' false mission-path Directory for mission files Directory for mission files, default = current directory \"\" msp2-adsb MSP2_ADSB_VEHICLE_LIST usage Options for requesting MSP2_ADSB_VEHICLE_LIST. \"off\": never request, \"on:\" always request, \"auto:\" heuristic based on serial settings / bandwidth \"off\" osd-mode Data items overlaid on the map 0 = none, 1 = current WP/Max WP, 2 = next WP distance and course. This is a mask, so 3 means both OSD items. 3 p-height Internal setting 720 p-is-fullscreen Internal setting false p-is-maximised Internal setting true p-pane-width Internal setting Please do not change this unless you appreciate the consequences 0 p-width Internal setting 1280 poll-timeout Poll messages timeout (ms) Timeout in milliseconds for telemetry poll messages. Note that timer loop has a resolution of 100ms. 900 pos-is-centre Determines position label content Whether the position label is the centre or pointer location false radar-alert-altitude Altitude below which ADS-B alerts may be generated Target altitude (metres) below which ADS-B proximity alerts may be generated. Requires that 'radar-alert-range' is also set (non-zero). Setting to 0 disables. Note that ADS-B altitudes are AMSL (or geoid). 0 radar-alert-range Range below which ADS-B alerts may be generated Target range (metres) below which ADS-B proximity alerts may be generated. Requires that 'radar-alert-altitude' is also set (non-zero). Setting to 0 disables. 0 radar-list-max-altitude Maximum altitude for targets to show in the radar list view Maximum altitude (metres) to include targets in the radar list view. Targets higher than this value will show only in the map view. This is mainly for ADS-B receivers where there is no need for high altitude targets to be shown. Setting to 0 disables. Note that ADS-B altitudes are AMSL (or geoid). 0 rings-colour range rings colour range rings colour as well know string or #RRGGBBAA \"#ffffff20\" rth-autoland Set land on RTH waypoints Automatically assert land on RTH waypoints false say-bearing Whether audio report includes bearing Whether audio report includes bearing true show-sticks Whether to show sticks in log replay If \"yes\", stick position is shown bottom right during log replay, if \"no\" , never shown. If \"icon\", then it shown iconified (bottom right) \"icon\" sidebar-type Sidebar type Options for the sidebar type. Unless you know better, leave at auto \"auto\" smartport-fuel-unit User selected fuel type Units label for smartport fuel (none, %, mAh, mWh) \"none\" speak-amps When to speak amps/hr used none, live-n, all-n n=1,2,4 : n = how often spoken (modulus basically) \"none\" speak-interval Interval between voice prompts Interval between voice prompts, 0 disables 15 speech-api API for speech synthesis espeak, speechd, flite. Only change this if you know you have the required development files at build time \"espeak\" speechd-voice Default speechd voice Default speechd voice (see speechd documentation) \"male1\" stats-timeout timeout for flight statistics display (s) Timeout before the flight statistics popup automatically closes. A value of 0 means no timeout. 30 symbol-scale Symbol scale Symbol scale factor, scales map symbols as multiplier. 1.0 touch-factor Touch (Hi)DPI scaling Adjustment factor for HiDpi touch screens (0 disable, often 1.5 or 2.0). 0.0 touch-scale Touch symbol scale Symbol scale factor, scales map symbols as multiplier (for touch screens) 1.0 uc-mission-tags Upper case mission XML tags If true, MISSION, VERSION and MISSIONITEM tags are upper case (for interoperability with legacy Android applications) false uilang Language Handling \"en\" do everything as English (UI numeric decimal points, voice), \"ev\" do voice as English (so say 'point' for decimals even when shown as 'comma') \"\" view-mode UAV view mode Options for model view \"inview\" vlevels Voltage levels Semi-colon(;) separated list of cell voltages values for transition between voltage label colours \"\" window-scale Window size as percent of monitor Default window size size as percent of monitor size for non-full screen invocation. 80 wp-dist-size Font size (points) for OSD WP distance display Font size (points) for OSD WP distance display 56.0 wp-spotlight Style for the 'next waypoint' highlight Defines RGBA colour for 'next way point' highlight \"#ffffff60\" wp-text-style Style of text used for next WP display Defines the way the WP numbers are displayed. Font, size and RGBA description (or well known name, with alpha) \"Sans 72/#ff000060\" zone-detect Application to return timezone from location If supplied, the application will be used to return the timezone (in preference to geonames.org). The application should take latitude and longitude as parameters. See samples/tzget.sh \"\""},{"location":"mwp-Configuration/#replicating-gsettings-between-machines-or-users","title":"Replicating gsettings between machines or users","text":"The standard system dconf
application can be used to back up and restore the above gsettings
. To backup the settings:
dconf dump /org/stronnag/mwp >/tmp/mwp-dconf.txt\n
To restore the settings (overwrite). This could be for a different user or on a new machine.
dconf load /org/stronnag/mwp </tmp/mwp-dconf.txt\n
"},{"location":"mwp-Configuration/#settings-precedence-and-user-updates","title":"Settings precedence and user updates","text":"mwp installs a number of icon files in $prefix/share/mwp/pixmaps
. The user can override these by creating an eponymous file in the user configuration directory, ~/.config/mwp/pixmaps/
. Such user configurations are never over-written on upgrade.
For example, to replace a mwp specific icon; i.e. replace the GCS Location icon ($prefix/share/mwp/pixmaps/gcs.svg
) with a user defined file ~/.config/mwp/pixmaps/gcs.svg
.
While the file name must be consistent, the format does not have to be; the replacement could be be a PNG, rather than SVG; we're not MSDOS and file \"extensions\" are an advisory illusion.
"},{"location":"mwp-Configuration/#example","title":"Example","text":"e.g. replace the inav-radar icon.
mkdir -p ~/config/mwp/pixmaps\n# copy the preview image\ncp ~/.local/share/mwp/pixmaps/preview.png ~/config/mwp/pixmaps/\n# (optionally) resize it to 32x32 pixels\nmogrify -resize 80% ~/config/mwp/pixmaps/preview.png\n# and rename it, mwp doesn't care about the 'extension', this is not MSDOS:)\nmv ~/config/mwp/pixmaps/preview.png ~/config/mwp/pixmaps/inav-radar.svg\n# and verify ... perfect\nfile ~/.config/mwp/pixmaps/inav-radar.svg\n/home/jrh/.config/mwp/pixmaps/inav-radar.svg: PNG image data, 32 x 32, 8-bit/color RGBA, non-interlaced\n
Note also that the resize step is no longer required, as mwp scales the icon according to the misc-icon-size
setting.
mwp recognises the following application specific environment variables
Name \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 UsageCFG_UGLY_XML
Generate ugly multi-mission XML, so as not to confuse the inav configurator MWP_ARGS
Extra command line arguments MWP_BLACK_TILE
Specify a black tile to be used by the Black Tiles map proxy MWP_LOG_DIR
Location of console logs ($HOME if undefined) MWP_PRINT_RAW
If defined, output hex bytes from serial I/O MWP_TIME_FMT
The time format for log output; by default \"%FT%T%z\", any GLib2 DateTime (strftime-like) format may be used; \"%T.%f\" works well on modern GLib."},{"location":"mwp-Configuration/#mime-types-for-common-file-formats","title":"Mime types for common file formats","text":"mwp adds XDG mime types for certain file types handled by mwp.
Data Source Mime Type File Manager DnD Multiwii Mission (XML) application/vnd.mw.mission Yes 1 Yes 2 Blackbox log application/vnd.blackbox.log Yes Yes Mwp telemetry log application/vnd.mwp.log Yes Yes Multiwii mission (mwp JSON) application/vnd.mwp.json.mission Yes Yes OTX telemetry log application/vnd.otx.telemetry.log No YesNotes:
1. The file manager (at least Nautilus / Gnome) will offer mwp as the default application to open the file.
2. DnD. The file can be dropped onto the mwp map and will be opened. The file may also be provided on the mwp command line without --option
; e.g. mwp --mission demo.mission
and mwp demo.mission
will behave in the same way.
mwp provides a Dbus API to permit remote control or monitoring of mwp by third party applications.
Dbus is a common Linux API for inter-process communications, and can be used from most programming languages. mwptools/src/samples
provides examples in python
, ruby
and bash
.
It is intended that that the ruby
examples cover the majority of the API and provide canonical examples of usage.
As this is a developer topic, please raise GitHub issues if clarification is needed or you have a use case that would benefit from extending the API.
Please also note that the definitive definition of the DBus API is provided by DBus inspection.
"},{"location":"mwp-Dbus-API/#dbus-object-and-interface","title":"DBus object and interface","text":"The mwp Dbus API exists on the session bus when mwp is running.
/org/stronnag/mwp
\"org.stronnag.mwp\"
A set of APIs is provided for synchronous and asynchronous (signals, event by event) notification of vehicle status and location. A use case might be to drive an antenna tracker.
"},{"location":"mwp-Dbus-API/#flight-status-and-geo-location-methods","title":"Flight status and geo-location methods","text":""},{"location":"mwp-Dbus-API/#getmodenames","title":"GetModeNames","text":"Returns human-readable names for the FC 'mode' returned by GetState
, as an array of strings. The size of the array is the return value. These are effectively LTM modes.
int GetModeNames(out string[] states_names)\n\n<method name=\"GetModeNames\">\n <arg type=\"as\" name=\"names\" direction=\"out\"/>\n <arg type=\"i\" name=\"result\" direction=\"out\"/>\n</method>\n
"},{"location":"mwp-Dbus-API/#getstate","title":"GetState","text":"Returns the FC 'state' and 'mode'. state 0 if unarmed. Human-readable mode names are provided by(sic) GetModeNames()
.
void GetState(out int state, out int mode)\n\n<method name=\"GetState\">\n <arg type=\"i\" name=\"state\" direction=\"out\"/>\n <arg type=\"i\" name=\"mode\" direction=\"out\"/>\n</method>\n
"},{"location":"mwp-Dbus-API/#gethome","title":"GetHome","text":"Returns the home location as latitude (WGS84 decimal degrees), longitude (WGS84 decimal degrees) and relative altitude (metres, which should always be 0).
void GetHome(out double latitude, out double longitude, out int32 altitude)\n\n<method name=\"GetHome\">\n <arg type=\"d\" name=\"latitude\" direction=\"out\"/>\n <arg type=\"d\" name=\"longitude\" direction=\"out\"/>\n <arg type=\"i\" name=\"altitude\" direction=\"out\"/>\n</method>\n
"},{"location":"mwp-Dbus-API/#getlocation","title":"GetLocation","text":"Returns the vehicle location as latitude (WGS84 decimal degrees), longitude (WGS84 decimal degrees) and relative altitude (metres).
void GetLocation(out double latitude, out double longitude, out int32 altitude)\n\n<method name=\"GetLocation\">\n <arg type=\"d\" name=\"latitude\" direction=\"out\"/>\n <arg type=\"d\" name=\"longitude\" direction=\"out\"/>\n <arg type=\"i\" name=\"altitude\" direction=\"out\"/>\n</method>\n
"},{"location":"mwp-Dbus-API/#getsats","title":"GetSats","text":"Returns the number of satellites and the fix type (0=nofix, 1=undefined, 2=2D fix, 3=3D fix).
void GetSats(out uint8 number_satellites, uint8 fix_type)\n\n<method name=\"GetSats\">\n <arg type=\"y\" name=\"nsats\" direction=\"out\"/>\n <arg type=\"y\" name=\"fix\" direction=\"out\"/>\n</method>\n
"},{"location":"mwp-Dbus-API/#getvelocity","title":"GetVelocity","text":"Returns the vehicle speed (m/s) and course (degrees), GPS provided.
void GetVelocity(out uint32 speed, out uint32 course)\n\n<method name=\"GetVelocity\">\n <arg type=\"u\" name=\"speed\" direction=\"out\"/>\n <arg type=\"u\" name=\"course\" direction=\"out\"/>\n</method>\n
"},{"location":"mwp-Dbus-API/#getpolarcoordinates","title":"GetPolarCoordinates","text":"Returns the vehicle location as polar coordinates relative the home position: Range (m), Bearing (degrees) from home to vehicle, azimuth (elevation angle, degrees).
void GetPolarCoordinates(out uint32 range, out uint32 direction, out uint32 azimuth)\n\n<method name=\"GetPolarCoordinates\">\n <arg type=\"u\" name=\"range\" direction=\"out\"/>\n <arg type=\"u\" name=\"direction\" direction=\"out\"/>\n <arg type=\"u\" name=\"azimuth\" direction=\"out\"/>\n</method>\n
"},{"location":"mwp-Dbus-API/#getwaypointnumber","title":"GetWaypointNumber","text":"Returns the next WP number (en-route to) or -1 if not flying WPs.
int GetWaypointNumber()\n\n<method name=\"GetWaypointNumber\">\n <arg type=\"i\" name=\"result\" direction=\"out\"/>\n</method>\n
"},{"location":"mwp-Dbus-API/#flight-status-and-geo-location-signals","title":"Flight status and geo-location signals","text":"A number of signals (asynchronous event by event notifications) are issues for changes in state and location. This avoids applications having to poll for changes. In general, the data returned is that for the eponymous Get* methods.
All location signals may be rate limited by the DbusPosInterval
property in order to avoid excessive DBus traffic.
Notifies that the home position has changed.
signal void HomeChanged (double latitude, double longitude, int altitude)\n\n<signal name=\"HomeChanged\">\n <arg type=\"d\" name=\"latitude\"/>\n <arg type=\"d\" name=\"longitude\"/>\n <arg type=\"i\" name=\"altitude\"/>\n</signal>\n
"},{"location":"mwp-Dbus-API/#locationchanged","title":"LocationChanged","text":"Notifies that the vehicle position has changed (geographic coordinates).
signal void location_changed (double latitude, double longitude, int altitude)\n\n<signal name=\"LocationChanged\">\n <arg type=\"d\" name=\"latitude\"/>\n <arg type=\"d\" name=\"longitude\"/>\n <arg type=\"i\" name=\"altitude\"/>\n</signal>\n
"},{"location":"mwp-Dbus-API/#polarchanged","title":"PolarChanged","text":"Notifies that the vehicle position has changed relative to home (polar coordinates).
signal void polar_changed(uint32 range, uint32 direction, uint32 azimuth)\n\n<signal name=\"PolarChanged\">\n <arg type=\"u\" name=\"range\"/>\n <arg type=\"u\" name=\"direction\"/>\n <arg type=\"u\" name=\"azimuth\"/>\n</signal>\n
"},{"location":"mwp-Dbus-API/#velocitychanged","title":"VelocityChanged","text":"Notifies that the vehicle velocity (course or speed) has changed.
signal void velocity_changed(uint32 speed, uint32 course)\n\n<signal name=\"VelocityChanged\">\n <arg type=\"u\" name=\"speed\"/>\n <arg type=\"u\" name=\"course\"/>\n</signal>\n
"},{"location":"mwp-Dbus-API/#statechanged","title":"StateChanged","text":"Notifies that the vehicle 'state' has changed.
signal void StateChanged(int32 state)\n\n<signal name=\"StateChanged\">\n <arg type=\"i\" name=\"state\"/>\n</signal>\n
"},{"location":"mwp-Dbus-API/#satschanged","title":"SatsChanged","text":"Notifies that the satellite status has changed.
signal void SatsChanged(uint8 nsats, uint8 fix)\n\n<signal name=\"SatsChanged\">\n <arg type=\"y\" name=\"nsats\"/>\n <arg type=\"y\" name=\"fix\"/>\n</signal>\n
"},{"location":"mwp-Dbus-API/#waypointchanged","title":"WaypointChanged","text":"Notifies that the current WP number has changed.
signal void WaypointChanged(int32 wp)\n\n<signal name=\"WaypointChanged\">\n <arg type=\"i\" name=\"wp\"/>\n</signal>\n
"},{"location":"mwp-Dbus-API/#application-status","title":"Application Status","text":""},{"location":"mwp-Dbus-API/#quit","title":"Quit","text":"The Quit
signal is issued when mwp exits, allowing a dependent application to close down gracefully or take action to wait for the bus to reappear.
Quit()\n\n<signal name=\"Quit\">\n</signal>\n
"},{"location":"mwp-Dbus-API/#properties","title":"Properties","text":""},{"location":"mwp-Dbus-API/#dbusposinterval","title":"DbusPosInterval","text":"uint dbus_pos_interval\n
Defines rate limiting for all position related signals. The value represents the minimum update interval in 0.1s intervals.
A set of APIs is provided for remote serial port and mission management.
"},{"location":"mwp-Dbus-API/#serial-ports","title":"Serial Ports","text":""},{"location":"mwp-Dbus-API/#getdevices","title":"GetDevices","text":"The GetDevices
API returns a list of the serial devices known to the mwp instance, as an array of strings.
void GetDevices(out string[]device_names)\n\n<method name=\"GetDevices\">\n <arg type=\"as\" name=\"devices\" direction=\"out\"/>\n</method>\n
"},{"location":"mwp-Dbus-API/#connectionstatus","title":"ConnectionStatus","text":"The ConnectionStatus
API returns a boolean status as to whether mwp
is connected to a serial device, and if connected, the name of the device.
bool ConnectionsStatus(out string device_name)\n\n<method name=\"ConnectionStatus\">\n <arg type=\"s\" name=\"device\" direction=\"out\"/>\n <arg type=\"b\" name=\"result\" direction=\"out\"/>\n</method>\n
"},{"location":"mwp-Dbus-API/#connectdevice","title":"ConnectDevice","text":"The ConnectDevice
API attempts connection to the given device, and returns the status of the operation (true
=> connected).
bool ConnectDevice(string device_name)\n\n<method name=\"ConnectDevice\">\n <arg type=\"s\" name=\"device\" direction=\"in\"/>\n <arg type=\"b\" name=\"result\" direction=\"out\"/>\n</method>\n
"},{"location":"mwp-Dbus-API/#mission-management","title":"Mission Management","text":"Somewhat inconsistent set of mission management APIs. Note these are not yet multi-mission aware.
"},{"location":"mwp-Dbus-API/#clearmission","title":"ClearMission","text":"Clears the current mission from mwp.
void ClearMission()\n\n<method name=\"ClearMission\">\n</method>\n
"},{"location":"mwp-Dbus-API/#setmission","title":"SetMission","text":"Opens a mission in mwp from an XML or JSON document, returns the number of mission points.
int SetMission(string mission)\n\n<method name=\"SetMission\">\n <arg type=\"s\" name=\"mission\" direction=\"in\"/>\n <arg type=\"u\" name=\"result\" direction=\"out\"/>\n </method>\n
"},{"location":"mwp-Dbus-API/#loadmission","title":"LoadMission","text":"Opens a mission in mwp from an mission file, returns the number of mission points.
int LoadMission(string filename)\n\n<method name=\"LoadMission\">\n <arg type=\"s\" name=\"filename\" direction=\"in\"/>\n <arg type=\"u\" name=\"result\" direction=\"out\"/>\n</method>\n
"},{"location":"mwp-Dbus-API/#uploadmission","title":"UploadMission","text":"Loads the current mwp mission into the flight controller, optionally saving to it EEPROM. Returns the number of mission points.
int UploadMission(bool to_eeprom)\n\n<method name=\"UploadMission\">\n <arg type=\"b\" name=\"to_eeprom\" direction=\"in\"/>\n <arg type=\"i\" name=\"result\" direction=\"out\"/>\n</method>\n
"},{"location":"mwp-Dbus-API/#examples","title":"Examples","text":"samples/mwp-dbus-test.sh
samples/mwp-dbus.rb
samples/mwp-dbus.py
samples/mwp-dbus-loc.rb
samples/mwp-dbus-loc.py
samples/mwp-dbus-to-gpx.rb
Not withstanding the state of the documentation, it is possible introspect the API. Note that mwp must be running for the API to exist. The document returned by DBus introspection is the definitive definition of the API.
# Note samples/mwp-dbus-loc.rb also provides introspection.\n$ samples/mwp-dbus-test.sh introspect\n<!DOCTYPE node PUBLIC \"-//freedesktop//DTD D-BUS Object Introspection 1.0//EN\"\n \"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd\">\n<!-- GDBus 2.60.3 -->\n<node>\n <interface name=\"org.freedesktop.DBus.Properties\">\n <method name=\"Get\">\n <arg type=\"s\" name=\"interface_name\" direction=\"in\"/>\n <arg type=\"s\" name=\"property_name\" direction=\"in\"/>\n <arg type=\"v\" name=\"value\" direction=\"out\"/>\n </method>\n <method name=\"GetAll\">\n <arg type=\"s\" name=\"interface_name\" direction=\"in\"/>\n <arg type=\"a{sv}\" name=\"properties\" direction=\"out\"/>\n </method>\n <method name=\"Set\">\n <arg type=\"s\" name=\"interface_name\" direction=\"in\"/>\n <arg type=\"s\" name=\"property_name\" direction=\"in\"/>\n <arg type=\"v\" name=\"value\" direction=\"in\"/>\n </method>\n <signal name=\"PropertiesChanged\">\n <arg type=\"s\" name=\"interface_name\"/>\n <arg type=\"a{sv}\" name=\"changed_properties\"/>\n <arg type=\"as\" name=\"invalidated_properties\"/>\n </signal>\n </interface>\n <interface name=\"org.freedesktop.DBus.Introspectable\">\n <method name=\"Introspect\">\n <arg type=\"s\" name=\"xml_data\" direction=\"out\"/>\n </method>\n </interface>\n <interface name=\"org.freedesktop.DBus.Peer\">\n <method name=\"Ping\"/>\n <method name=\"GetMachineId\">\n <arg type=\"s\" name=\"machine_uuid\" direction=\"out\"/>\n </method>\n </interface>\n <interface name=\"org.stronng.mwp\">\n <method name=\"GetStateNames\">\n <arg type=\"as\" name=\"names\" direction=\"out\"/>\n <arg type=\"i\" name=\"result\" direction=\"out\"/>\n </method>\n <method name=\"GetVelocity\">\n <arg type=\"u\" name=\"speed\" direction=\"out\"/>\n <arg type=\"u\" name=\"course\" direction=\"out\"/>\n </method>\n <method name=\"GetPolarCoordinates\">\n <arg type=\"u\" name=\"range\" direction=\"out\"/>\n <arg type=\"u\" name=\"direction\" direction=\"out\"/>\n <arg type=\"u\" name=\"azimuth\" direction=\"out\"/>\n </method>\n <method name=\"GetHome\">\n <arg type=\"d\" name=\"latitude\" direction=\"out\"/>\n <arg type=\"d\" name=\"longitude\" direction=\"out\"/>\n <arg type=\"d\" name=\"altitude\" direction=\"out\"/>\n </method>\n <method name=\"GetLocation\">\n <arg type=\"d\" name=\"latitude\" direction=\"out\"/>\n <arg type=\"d\" name=\"longitude\" direction=\"out\"/>\n <arg type=\"d\" name=\"altitude\" direction=\"out\"/>\n </method>\n <method name=\"GetState\">\n <arg type=\"i\" name=\"result\" direction=\"out\"/>\n </method>\n <method name=\"GetSats\">\n <arg type=\"y\" name=\"nsats\" direction=\"out\"/>\n <arg type=\"y\" name=\"fix\" direction=\"out\"/>\n </method>\n <method name=\"SetMission\">\n <arg type=\"s\" name=\"mission\" direction=\"in\"/>\n <arg type=\"u\" name=\"result\" direction=\"out\"/>\n </method>\n <method name=\"LoadMission\">\n <arg type=\"s\" name=\"filename\" direction=\"in\"/>\n <arg type=\"u\" name=\"result\" direction=\"out\"/>\n </method>\n <method name=\"ClearMission\">\n </method>\n <method name=\"GetDevices\">\n <arg type=\"as\" name=\"devices\" direction=\"out\"/>\n </method>\n <method name=\"UploadMission\">\n <arg type=\"b\" name=\"to_eeprom\" direction=\"in\"/>\n <arg type=\"i\" name=\"result\" direction=\"out\"/>\n </method>\n <method name=\"ConnectionStatus\">\n <arg type=\"s\" name=\"device\" direction=\"out\"/>\n <arg type=\"b\" name=\"result\" direction=\"out\"/>\n </method>\n <method name=\"ConnectDevice\">\n <arg type=\"s\" name=\"device\" direction=\"in\"/>\n <arg type=\"b\" name=\"result\" direction=\"out\"/>\n </method>\n <signal name=\"HomeChanged\">\n <arg type=\"d\" name=\"latitude\"/>\n <arg type=\"d\" name=\"longitude\"/>\n <arg type=\"i\" name=\"altitude\"/>\n </signal>\n <signal name=\"LocationChanged\">\n <arg type=\"d\" name=\"latitude\"/>\n <arg type=\"d\" name=\"longitude\"/>\n <arg type=\"i\" name=\"altitude\"/>\n </signal>\n <signal name=\"PolarChanged\">\n <arg type=\"u\" name=\"range\"/>\n <arg type=\"u\" name=\"direction\"/>\n <arg type=\"u\" name=\"azimuth\"/>\n </signal>\n <signal name=\"VelocityChanged\">\n <arg type=\"u\" name=\"speed\"/>\n <arg type=\"u\" name=\"course\"/>\n </signal>\n <signal name=\"StateChanged\">\n <arg type=\"i\" name=\"state\"/>\n </signal>\n <signal name=\"SatsChanged\">\n <arg type=\"y\" name=\"nsats\"/>\n <arg type=\"y\" name=\"fix\"/>\n </signal>\n <signal name=\"Quit\">\n </signal>\n <property type=\"u\" name=\"DbusPosInterval\" access=\"readwrite\"/>\n </interface>\n</node>\n
"},{"location":"mwp-Gtk4-migration-guide/","title":"mwp Migration Guide","text":"This document describes the migration from legacy (Gtk+-3.0) mwp to contemporary (Gtk4) mwp.
"},{"location":"mwp-Gtk4-migration-guide/#system-requirements","title":"System Requirements","text":"The following are minimum versions.
For replaying blackbox log, bbl2kml 1.0.24 or later is rquired.
"},{"location":"mwp-Gtk4-migration-guide/#gsettings-dconf-schema","title":"GSettings /DConf schema","text":"The gsettings / dconf schema is now /org/stronnag/mwp/
. The keys are (mainly) the same as for legacy mwp/gtk3 and may be migrated:
dconf dump /org/mwptools/planner/ | dconf load /org/stronnag/mwp/\n
Full list of settings is at the end of this document.
"},{"location":"mwp-Gtk4-migration-guide/#libshumate","title":"libshumate","text":"libshumate is the replacement for the obsolete libchamplain. libshumate
uses a different cache directory organisation compared to libchamplain
. If required, you can bulk move (rsync
etc.) your old libchamplain
files to the new locations.
The old files are under ~/.cache/champlain/
, the new cache ~/.cache/shumate/
; the following table illustrates the naming for Bing and OpenStreetmap caches. Other caches follow a similar pattern.
libchamplain
libshumate
osm-mapnik
https___tile_openstreetmap_org__z___x___y__png
BingProxy
http___localhost_31897_Bing__z___x___y__png
"},{"location":"mwp-Gtk4-migration-guide/#map-sources","title":"Map Sources","text":"In preparation for the announced removal of the Bing Maps service, mwp
adds two new imagery sources:
libsecret
) or as a plain text string in the gsettings
database.Add to the MapBox key to the user keyring using secret-tool
with the following attributes:
secret-tool store --label=\"Mapbox API\" name mapbox-api-key domain org.stronnag.mwp\nPassword: *************************************************\n
"},{"location":"mwp-Gtk4-migration-guide/#gsettings","title":"Gsettings","text":"Alternatively, the key can be added to the gsettings
database:
gsettings set org.stronnag.mwp mapbox-apikey 'pk.xxxxxxx'\n # where 'pk.xxxxxxx' is your MapBox API Key\n
Note that sadly libshumate
creates a cache directory name from which the MapBox access token may be recovered, so there is little security / privacy gain by using the secret key-ring, alas. See Gitlab issue.
While it lasts, the Bing services (no registration required) provide:
As libgdl
is retired, a simple, bespoke panel comprising embedded resizeable panes has been implemented. The configuration may be user defined by a simple text file ~/.config/mwp/panel.conf
.
Each entry is defined by a comma separated line defining the panel widget, the row (0-3) and the column (0-2) and an optional minimum size (only required for the artificial horizon). The default panel is defined (in the absence of a configuration file) as:
# default widgets\nahi,0,1,100\nrssi, 1, 0\ndirn, 1, 1\nflight, 2, 0\nvolts, 3, 0\n
Which appears as:
The available panel widgets are named as:
Name Usageahi
Artificial horizon dirn
Direction comparison flight
\"Flight View\" Position / Velocity / Satellites etc, volts
Battery information vario
Vario indicator No other legacy widgets have been migrated.
So using the following ~/.config/mwp/panel.conf
# default + vario widgets\nahi,0,1,100\nvario,0,2\nrssi, 1, 0\ndirn, 1, 1\nflight, 2, 0\nvolts, 3, 0\n
would appear as:
"},{"location":"mwp-Gtk4-migration-guide/#coexistence","title":"Coexistence","text":"mwp (Gtk4) and legacy (Gtk+-3.0) versions can coexist.
If you use any of the map proxies (bproxy
, gmproxy
), you must use the latest version.
There are a couple of Gtk related environment variables that may affect the performance of mwp, particularly on older or less well supported GPUs:
GSK_RENDERER
: Recently the Gtk renderer default was changed from gl
to ngl
(4.14+) to vulkan
(4.16+). On some older / less well supported GPUs it may be necessary to use the cairo
renderer; cairo
is also necessary on the author's touch screen tablet for correct touch screen WP dragging. Note that there may well be trade offs: on one of the author's machines, WP dragging seems slightly snappier using the cairo
GSK_RENDERER
, however the CPU usage for BBL replay is much greater using cairo
compared to vulkan
.GDK_BACKEND
: In the event that your hardware / software stack is almost hopelessly broken such that mwp is aborted with a Gdk message like \"Error 71 (Protocol error) dispatching to Wayland display\", then setting this variable to x11
may allow mwp
to continue.From mwp 24.10.28, mwp will set GSK_RENDERER=cairo
for its own use if the OS or user has not previously set GSK_RENDERER
.
The environment variable(s) may be set in ~/.config/mwp/cmdopts
for mwp exclusive use if required.
GSK_RENDERER=cairo\n
Otherwise, the variable(s) may be set in /etc/environment
, .profile
or a .config/environment.d
file if required.
If you use a map sources file in ~/.config/mwp
, you may optionally convert the #X#
elements (for X, Y, Z) replacing with more standard {x}
etc.
For the Debian package runtime dependencies:
libadwaita-1-0 (>= 1.5~beta)\nlibc6 (>= 2.38)\nlibcairo2 (>= 1.2.4)\nlibgdk-pixbuf-2.0-0 (>= 2.22.0)\nlibglib2.0-0t64 (>= 2.80.0)\nlibgraphene-1.0-0 (>= 1.5.4)\nlibgstreamer1.0-0 (>= 1.6.0)\nlibgtk-4-1 (>= 4.13.5)\nlibgudev-1.0-0 (>= 146)\nlibjson-glib-1.0-0 (>= 1.5.2)\nlibpaho-mqtt1.3 (>= 1.3.0)\nlibpango-1.0-0 (>= 1.14.0)\nlibprotobuf-c1 (>= 1.0.1)\nlibsecret-1-0 (>= 0.7)\nlibshumate-1.0-1 (>= 1.0.0~alpha.1+20220818)\nlibsoup-3.0-0 (>= 3.3.1)\nlibtinfo6 (>= 6)\nlibvte-2.91-gtk4-0\nlibxml2 (>= 2.7.4)\n
Example packages: sudo apt install -y blueprint-compiler libprotobuf-c-dev \\\n libvte-2.91-gtk4-dev libshumate-dev libpaho-mqtt-dev libgtk-4-dev \\\n libadwaita-1-dev libsecret-1-dev\n
"},{"location":"mwp-Gtk4-migration-guide/#ubuntu","title":"Ubuntu","text":"The Ubuntu 24.04 version of meson
is too old. A more update version may be installed locally using pipx
. For Ubuntu 24.10, the distro version is adequate.
sudo apt install pipx\npipx install meson\n
Other packages as for Debian.
"},{"location":"mwp-Gtk4-migration-guide/#fedora","title":"Fedora","text":"Example package list:
sudo dnf5 install -y libshumate-devel vte291-gtk4-devel protobuf-c-devel \\\n paho-c-devel blueprint-compiler gtk4-devel libsecret-devel\n
"},{"location":"mwp-Gtk4-migration-guide/#macos","title":"MacOS","text":"Requires mwptools 2024.11.20 or later.
meson
and ninja
gsettings set org.gnome.settings-daemon.plugins.power idle-dim true
. See also manage-power
(and consider setting manage-power
to true
instead). \"\" atstart Something that is executed at startup e.g. gsettings set org.gnome.settings-daemon.plugins.power idle-dim false
. See also manage-power
(and consider setting to true). \"\" audio-on-arm start audio on arm start audio on arm (and stop on disarm) true auto-follow set auto-follow set auto-follow on start true auto-restore-mission Whether to automatically import a mission in FC memory to MWP If the FC holds a valid mission in memory, and there is no mission loaded into MWP, this setting controls whether MWP automatically downloads the mission. false autoload-geozones Autoload geozones from FC Autoload geozones from FC on connect, remove from display on disconnect false autoload-safehomes Load safehomes on connect . If true, then safehomes will be loaded from the FC on connection. false baudrate Baud rate Serial baud rate 115200 beep Beep for alerts Whether to emit an alert sound for alerts. true blackbox-decode Name of the blackbox_decode application Name of the blackbox_decode application (in case there are separate for iNav and betaflight) \"blackbox_decode\" bluez-disco Use Bluetooth discovery Only discovered Bluetooth serial devices with non-zero RSSI will be offered true default-altitude Default altitude Default Altitude for mission (m) 20 default-latitude Default Latitude Default Latitude when no GPS 50.909528 default-loiter Default Loiter time Default Loiter time 30 default-longitude Default Longitude Default Longitude when no GPS -1.532936 default-map Default Map Default map key \"\" default-nav-speed Default Nav speed Default Nav speed (m/s). For calculating durations only. 2.5 default-zoom Default Map zoom Default map zoom 15 delta-minspeed Minimum speed for elapsed distance updates Minimum speed for elapsed distance updates (m/s). Default is zero, which means the elapsed distance is always updated; larger values will take out hover / jitter movements. 0.0 device-names Device names A list of device names to be added to those that can be auto-discovered [] display-distance Distance units 0=metres, 1=feet, 2=yards 0 display-dms Position display Show positions as dd:mm:ss rather than decimal degrees false display-speed Speed units 0=metres/sec, 1=kilometres/hour, 2=miles/hour, 3=knots 0 dump-unknown dump unknown dump unknown message payload (debug aid) false espeak-voice Default espeak voice Default espeak voice (see espeak documentation) \"en\" flash-warn Flash storage warning If a dataflash is configured for black box, and this key is non-zero, a warning in generated if the data flash is greater than \"flash-warn\" percent full. 0 flite-voice-file Default flite voice file Default flite voice file (full path, *.flitevox), see flite documentation) \"\" forward Types of message to forward Types of message to forward (none, LTM, minLTM, minMAV, all) \"minLTM\" ga-alt Units for GA Altiude 0=m, 1=ft, 2=FL 0 ga-range Units for GA Range 0=m, 1=km, 2=miles, 3=nautical miles 0 ga-speed Units for GA Speed 0=m/s, 1=kph, 2=mph, 3=knots 0 geouser User account on geonames.org A user account to query geonames.org for blackbox log timezone info. A default account of 'mwptools' is provided; however users are requested to create their own account. \"mwptools\" gpsd-host gpsd provider Provider for GCS location via gpsd. Default is \"localhost\", can be set to other host name or IP address. Setting blank (\"\") disables. \"localhost\" gpsintvl gps sanity time (m/s) gps sanity time (m/s), check for current fix 2000 ident-limit MSP_IDENT limit for MSP recognition Timeout value in seconds for a MSP FC to reply to a MSP_INDENT probe. Effectively a timeout counter in seconds. Set to a negative value to disable. 60 ignore-nm Ignore Network Manager Set to true to always ignore NM status (may slow down startup) false kml-path Directory for KML overlays Directory for KML overlays, default = current directory \"\" led GPS LED colour GPS LED colour as well know string or #RRGGBB \"#60ff00\" log-on-arm start logging on arm start logging on arm (and stop on disarm) false log-path Directory for replay log files Directory for log files (for replay), default = current directory \"\" log-save-path Directory for storing log files Directory for log files (for save), default = current directory \"\" los-margin Margin(m) for LOS Analysis Margin(m) for LOS Analysis 0 mag-sanity Enable mag sanity checking mwp offers a primitive mag sanity checker that compares compass heading with GPS course over the ground using LTM (only). There are various hard-coded constraints (speed > 3m/s, certain flight modes) and two configurable parameters that should be set here in order to enable this check. The parameters are angular difference (\u2070) and duration (s). The author finds a settings of 45,3 (i.e. 45\u2070 over 3 seconds) works OK, detecting real instances (a momentarily breaking cable) and not reporting false positives. \"\" manage-power manage power and screen whether to manage idle and screen saver false map-sources Additional Map sources JSON file defining additional map sources \"\" mapbox-apikey Mapbox API Key Mapbox API key, enables Mapbox as a map Provider. Setting blank (\"\") disables. \"\" max-climb-angle Maximum climb angle highlight for terrain analysis If non-zero, any climb angles exceeding the specified value will be highlighted in Terrain Analysis Climb / Dive report. Note that the absolute value is taken as a positive (climb) angle 0.0 max-dive-angle Maximum dive angle highlight for terrain analysis If non-zero, any dive angles exceeding the specified value will be highlighted in Terrain Analysis Climb / Dive report. Note that the absolute value is taken as a negative (dive) angle 0.0 max-home-delta home position delta (m) Maximum variation of home position without verbal alert 2.5 max-radar-slots Maximum number of aircraft Maximum number of aircraft reported by iNav-radar 4 max-wps Maximum number of WP supported Maximum number of WP supported 120 min-dem-zoom Minimum zoom for DEM loading DEMs will not be fetched if zoom is below this value 9 misc-icon-size Miscellaneous icon size Size for miscellaneous icons (radar, GCS location) in pixels. -1 means the image's natural size (no scaling). 32 mission-meta-tag use meta vice mwp in mission file If true, the legacy 'mwp' tag is named 'meta' false mission-path Directory for mission files Directory for mission files, default = current directory \"\" msp2-adsb MSP2_ADSB_VEHICLE_LIST usage Options for requesting MSP2_ADSB_VEHICLE_LIST. \"off\": never request, \"on:\" always request, \"auto:\" heuristic based on serial settings / bandwidth \"off\" osd-mode Data items overlaid on the map 0 = none, 1 = current WP/Max WP, 2 = next WP distance and course. This is a mask, so 3 means both OSD items. 3 p-pane-width Private setting Please do not change this unless you appreciate the consequences 0 poll-timeout Poll messages timeout (ms) Timeout in milliseconds for telemetry poll messages. Note that timer loop has a resolution of 100ms. 900 pos-is-centre Determines position label content Whether the position label is the centre or pointer location false radar-alert-altitude Altitude below which ADS-B alerts may be generated Target altitude (metres) below which ADS-B proximity alerts may be generated. Requires that 'radar-alert-range' is also set (non-zero). Setting to 0 disables. Note that ADS-B altitudes are AMSL (or geoid). 0 radar-alert-range Range below which ADS-B alerts may be generated Target range (metres) below which ADS-B proximity alerts may be generated. Requires that 'radar-alert-altitude' is also set (non-zero). Setting to 0 disables. 0 radar-list-max-altitude Maximum altitude for targets to show in the radar list view Maximum altitude (metres) to include targets in the radar list view. Targets higher than this value will show only in the map view. This is mainly for ADS-B receivers where there is no need for high altitude targets to be shown. Setting to 0 disables. Note that ADS-B altitudes are AMSL (or geoid). 0 rings-colour range rings colour range rings colour as well know string or #RRGGBBAA \"#ffffff20\" rth-autoland Set land on RTH waypoints Automatically assert land on RTH waypoints false say-bearing Whether audio report includes bearing Whether audio report includes bearing true show-sticks Whether to show sticks in log replay If \"yes\", stick position is shown bottom right during log replay, if \"no\" , never shown. If \"icon\", then it shown iconified (bottom right) \"icon\" sidebar-type Sidebar type Options for the sidebar type. Unless you know better, leave at auto \"auto\" smartport-fuel-unit User selected fuel type Units label for smartport fuel (none, %, mAh, mWh) \"none\" speak-amps When to speak amps/hr used none, live-n, all-n n=1,2,4 : n = how often spoken (modulus basically) \"none\" speak-interval Interval between voice prompts Interval between voice prompts, 0 disables 15 speech-api API for speech synthesis espeak, speechd, flite. Only change this if you know you have the required development files at build time \"espeak\" speechd-voice Default speechd voice Default speechd voice (see speechd documentation) \"male1\" stats-timeout timeout for flight statistics display (s) Timeout before the flight statistics popup automatically closes. A value of 0 means no timeout. 30 symbol-scale Symbol scale Symbol scale factor, scales map symbols as multiplier. 1.0 touch-factor Touch (Hi)DPI scaling Adjustment factor for HiDpi touch screens (0 disable, often 1.5 or 2.0). 0.0 touch-scale Touch symbol scale Symbol scale factor, scales map symbols as multiplier (for touch screens) 1.0 uc-mission-tags Upper case mission XML tags If true, MISSION, VERSION and MISSIONITEM tags are upper case (for interoperability with legacy Android applications) false uilang Language Handling \"en\" do everything as English (UI numeric decimal points, voice), \"ev\" do voice as English (so say 'point' for decimals even when shown as 'comma') \"\" view-mode UAV view mode Options for model view \"inview\" vlevels Voltage levels Semi-colon(;) separated list of cell voltages values for transition between voltage label colours \"\" window-scale Window size as percent of monitor Default window size size as percent of monitor size for non-full screen invocation. 80 wp-dist-size Font size (points) for OSD WP distance display Font size (points) for OSD WP distance display 56.0 wp-spotlight Style for the 'next waypoint' highlight Defines RGBA colour for 'next way point' highlight \"#ffffff60\" wp-text-style Style of text used for next WP display Defines the way the WP numbers are displayed. Font, size and RGBA description (or well known name, with alpha) \"Sans 72/#ff000060\" zone-detect Application to return timezone from location If supplied, the application will be used to return the timezone (in preference to geonames.org). The application should take latitude and longitude as parameters. See samples/tzget.sh \"\""},{"location":"mwp-Gtk4-migration-guide/#dbus","title":"DBus","text":"The DBus name / path are changed to map the application Id; e.g. org.stronnag.mwp
and /org/stronnag/mwp
. A few of the DBus interfaces have been enhanced.
There are a number of ways of managing the screen (inhibit screen saver etc.)
Use an external screen-saver manager such as caffeine
Use the legacy mwp settings options, for example:
org.stronnag.mwp atexit 'gsettings set org.gnome.settings-daemon.plugins.power idle-dim true'\norg.stronnag.mwp atstart 'gsettings set org.gnome.settings-daemon.plugins.power idle-dim false'\n
Allow mwp to manage screen and power settings, controlled by a setting:
gsettings set org.stronnag.mwp manage-power true\n
In the first two cases, the setting is somewhat coarse, either requiring the user to click on something and applying to the whole mwp session.
The final case applies only when mwp is receiving push telemetry (LTM, Mavlink, MQTT). Inhibiting IDLE and SUSPEND is performed using the GTK inhibit() API and will thus work with most window managers.
"},{"location":"mwp-Radar-View/","title":"Radar View","text":"mwp supports the display of \"radar\" contacts. This provides a view of adjacent aircraft obtained from a number of sources:
INAV-radar. INAV radar works in conjunction with INAV flight controllers to broadcast the location of UAS fitted with an ESP32 LoRa module. mwp can listen to one of these modems in ground station mode to display the positions of the rest of the 'swarm' (up to 4 UAS); technical / MSP details.
Full size aircraft reported by the MAVLink 'Traffic Report' / 'ADSB Vehicle' message. Examples of available hardware include:
Full size aircraft typically reported using SDR (Software Defined Radios) using SBS streaming TCP protocol. This is generated by the open source dump1090 and readsb open source applications with a SDR receiver, as well as commercial products.
Full size aircraft typically reported using SDR (Software Defined Radios) using the dump1090-fa JSON format.
Full size aircraft typically reported using SDR (Software Defined Radios) using the readsb \"protobuf\" format. This is the preferred way to access SDR ADSB / Mode-S data.
Full size aircraft reported using the MSP2_ADSB_VEHICLE_LIST
message. This is generated by INAV later than 7.1.0 when a PingRX or TT-SC1 device is attached to the flight controller. This is received by the main mwp MSP port without user configuration (no need to set up a radar-device
). Due to the size of MSP2_ADSB_VEHICLE_LIST
message, mwp does not poll for MSP2_ADSB_VEHICLE_LIST
by default, see the setting key msp2-adsb
, below.
Proximity alerts (visual and audible) for manned (ADS-B / sbs-1 / dump1090 / readsb) aircraft, based on planned or actual home location.
For SDR (Software Defined Radios) using the readsb or dump1090 where the SDR host has a web server configured to supply the generated \"protobuf\" or JSON output, then mwp can obtain the data from the web server. Otherwise, it will be necessary to set up a small daemon on SDR host, see the src/samples/adsb-extra
directory for further details.
Note that the SDR protocols may also be used with network services that provide ADS-B reports (usually for a fee or for provided local data).
"},{"location":"mwp-Radar-View/#mwp-configuration","title":"mwp Configuration","text":"mwp can receive the 'radar' data over one or two connections, either or both may be active, and mwp can receive and display 'own vehicle' telemetry (MSP, LTM or Smartpost), Tracked Telemetry, 'INAV-radar' and 'MAVlink Traffic' data simultaneously. Radar data may be received over:
MSP2_ADSB_VEHICLE_LIST
.radar-device
CLI or configuration parameter (MAVLink Traffic, INAV-radar, SDR protocols)The radar-device
option is defined by the standard mwp naming scheme:
/dev/ttyACM0
, /dev/ttyUSB4@567600
, /dev/rfcomm3
00:0B:0D:87:13:A2
udp://:30001
local UDP listener.readsb
protobuf source or dump1090
JSON source over http
/https
, for example, using hosts woozle
(protobuf) and jagular
(JSON):http://woozle/readsb/data/aircraft.pb
http://jagular/dump1090/data/aircraft.json
readsb
protobuf source, defined by a special URI:pba://[[host][:port]]
(requires adsbpbsrv
on the SDR host). Host and port are optional, defaulting to localhost
and 38008
. So the minimal \"URI\" is pba://
.dump1090
JSON source, defined by a special URI:jsa://[[host][:port]]
(requires jsacsrv
on the SDR host). Host and port are optional, defaulting to localhost
and 37007
. So the minimal \"URI\" is jsa://
.sbs://[[host][:port]]
Host and port are optional, defaulting to localhost
and 30003
. So the minimal \"URI\" is sbs://
.For \"Telemetry Tracking\", please see its separate article.
The specific (not shared with the main serial port) radar device(s) may be defined on the command line, or in the static command options file (~/.config/mwp/cmdopts
):
mwp --radar-device udp://:30001
$ cat ~/.config/mwp/cmdopts
# Default options for mwp\n# using udev rule to associate a specifc USB-TTL adaptor to a name\n--radar-device=/dev/pingRX@57600\n
Multiple devices may be defined, e.g.
--radar-device=/dev/pingRX@57600 --radar-device= /dev/inavradar@115200
--radar-device=/dev/pingRX@57600,/dev/inavradar@115200
Any bespoke radar-device
is started automatically on startup (or when it shows up). It is not managed via the serial Connect
button.
The main mwp serial port may be used for MavLink Traffic and MSP2_ADSB_VEHICLE_LIST
messages without any further configuration. For INAV-radar, to use the main MSP port for INAV-radar (vice using --radar-device
), it is still necessary to add a command option to mwp; it needs to told to relax the default inbound MSP direction check.
This is enabled as
mwp --relaxed-msp\n
which should be 'mainly harmless' for normal operations. It's entirely acceptable to put this in ~/config/mwp/cmdopts
to make it the default, as the protocol check dilution is slight.
The following dconf
setting affect the radar function:
radar-list-max-altitude
Maximum altitude (metres) to show targets in the radar list view; targets higher than this value will show only in the map view. Setting to 0 disables. Note that ADS-B altitudes are AMSL (or geoid) and SDR altitudes are \"Flight Level\" (standard atmosphere). radar-alert-altitude
Target altitude (metres) below which ADS-B / SDR proximity alerts may be generated. Requires that 'radar-alert-range' is also set (none zero). Setting to 0 disables. Note that the above altitude datum. radar-alert-range
Target range (metres) below which ADS-B / SDR proximity alerts may be generated. Requires that 'radar-alert-altitude' is also set (none zero). Setting to 0 disables. ga-alt
Units for GA Altiude, enumerated as 0=m, 1=ft, 2=FL ga-range
Units for GA Range, enumerated as 0=m, 1=km, 2=miles, 3=nautical miles ga-speed
Units for GA Speed, enumerated as 0=m/s, 1=kph, 2=mph, 3=knots msp2-adsb
Options for requesting MSP2_ADSB_VEHICLE_LIST. \"off\": never request, \"on:\" always request, \"auto:\" heuristic based on serial settings / bandwidth Note that proximity alerts require that both the radar-alert-altitude
and radar-alert-range
values are set, and that there is a planned or actual home location. For readsb \"protobuf\" data, the range from the SDR is available and this will be shown as range (and used for alerts) where there is no home set (home will override).
Legacy Images
The images this section are from legacy mwp, however the capability is the same.
Once the radar interface is open, radar tracks are displayed on the map and in a list available from the \"View -> Radar View' menu option.
Id
, Status
, Last
(time) and Range
columns.Hide Tracks
(Show Tracks
) button.TTRK-
"},{"location":"mwp-Radar-View/#status","title":"Status","text":"Radar contacts have one of the following status values:
Status Explanation Undefined ADS-B: Not shown in list or on the map, INAV-Radar not armed / updated Stale The last contact was more that 120s previous. Displayed in the list and shown on the map with reduced intensity or an INAV-radar node has 'lost' status Armed An active INAV-radar contact ADS-B A live MAVLink Traffic report SDR SDR radio report (sbs, json, protobuf) Hidden A MAVLink Traffic /SDR contact is between 5 and 10 minutes old. It remains in the list but is not displayed in the map. MAVLink Traffic Report / SDR tracks are removed from the list (and internal storage) after 10 minutes inactivity. INAV-radar ground station. Stale / 'Lost' INAV-radar contacts do not expire, as they may relate to a lost model.The number displayed after the status text is:
Type Usage INAV-radar The link quality Traffic Report Time since last communication in seconds SDR reports Time since last communication in seconds"},{"location":"mwp-Radar-View/#columns","title":"Columns","text":"The columns are sortable. Note that since the introduction of Telemetry Tracking, a new column \"*\" has been added, this contains a single character indicating the source:
Indicator Source A ADS-B via MAVLink I INAV Radar S ADS-B via SDR protocol T Telemetry Tracker "},{"location":"mwp-Radar-View/#examples","title":"Examples","text":"There are simulators for both INAV-radar and MAVLink 'Traffic Report' (e.g. uAvionix PingRX) in the mwptools/src/samples/radar
directory.
There is a replay tool for SBS CSV logs mwptools/src/samples/sbs-test/sbs-player.rb
.
Any map symbol used by mwp can be changed by the user; in the image above, the INAV radar node symbol has been changed from the default stylised INAV multirotor to a smaller version of the mission replay \"paper plane\" symbol as described in creating your own icon.
"},{"location":"mwp-Radar-View/#protocol-documentation","title":"Protocol documentation","text":""},{"location":"mwp-Radar-View/#mavlink-traffic-report-eg-uavionix-pingrx","title":"MAVLink 'Traffic Report' (e.g. uAvionix PingRX)","text":"The MAVLink implementation is comprehensively documented by the vendor.
"},{"location":"mwp-Radar-View/#inav-radar","title":"INAV radar","text":"The following is required by a device wishing to act as a ground node (it either masquerades as an INAV FC, or declares itself a GCS)
INAV
or (from 2021/05/06) GCS
for generic ground control stations).INAV
and GCS
modes)INAV
and GCS
modes)INAV
mode)INAV
mode)INAV
mode)INAV
mode)Note that the device firmware assumes that MSP buffer sizes are \"as specification\"; exceeding the expected message buffer size may crash the device (mea culpa).
In GCS
mode, the node is passive; it does not use a LoRa slot and does not attempt to broadcast a location. In INAV
mode, the node takes up a LoRa slot and is expected to reply to the additional MSP queries.
mwp's behaviour is defined by the GCS Location
INAV
and return the GCS Location, which may be driven by gpsd if required.GCS
.Protocol description.
"},{"location":"mwp-area-planner/","title":"Mwp Survey Planner","text":"mwp survey / area planner is a tool to plan \"survey\" or \"search\" missions. It generates MWXML mission files compatible with mwp and the INAV Configurator. A simple \"parallel lines across a polygon\" survey pattern is supported, as well as a \"creeping square\" pattern and a spiral pattern.
"},{"location":"mwp-area-planner/#usage","title":"Usage","text":"The area planner is invoked from the \"Edit\" menu. It loads a dialogue window and presents a basic search area outline.
The drop-down in the top right offers options of:
The dialog provides options for mission creation that are common to each survey pattern:
Legacy Images
There are some older images in the samples below without the AMSL button.
"},{"location":"mwp-area-planner/#control-buttons","title":"Control Buttons","text":"The tool is controlled by the three buttons at the bottom of the window.
Apply: The settings are applied and the pattern is drawn. The button will be disabled if the size of the survey outline and the row separation values would result in an impractically large number of turning points. In order to resolve this it will be necessary to either reduce the size of the survey area or increase the row separation.
Reset View: The survey view is reset. The survey outline is reset to a rectangle covering 80% of the map. This is used to reset the area after panning or zooming out of the initial view.
Generate Mission: Generates a mission from the survey plan. The survey tool is closed. The mission may be edited / save / uploaded to the FC as normal. If the number of points would exceed the maximum number of mission points, this button is disabled. In order to resolve this it will be necessary to either reduce the size of the survey area or increase the row separation.
Points may be inserted / deleted from the survey outline from a right mouse / long press on a survey points. Insert adds a point in a clock-wise direction; delete removes the clicked point.
Points may be moved by dragging.
Any plotted outline mission will be recalculated as points are manipulated.
"},{"location":"mwp-area-planner/#parameters","title":"Parameters","text":"Once an initial solution has been plotted, changing any of the first three parameters will result in the solution being recalculated.
After a solution has been calculated, the \"Mission Data\" summary is updated.
Example of too many points being generated due to over-large area / narrow row separation:
Example of fewer points being generated with adjusted area and row separation:
Note also how the angle and turn parameters affect the staring point.
Example of generated mission with KML backdrop showing original survey area:
"},{"location":"mwp-area-planner/#square-pattern-generator","title":"\"Square\" pattern generator","text":"The \"Square\" generator provides a single draggable point with options of start angle, first leg distance and the number of iterations.
The default parameters result in the following survey pattern.
And a generated mission from these settings looks might look like:
"},{"location":"mwp-area-planner/#spiral-pattern-generator","title":"\"Spiral\" pattern generator","text":"The \"Spiral\" generator provides a single draggable point with options of first leg distance and the number of iterations. In this case, the first leg distance is the range to the 0\u00b0 radial, which is repeated for each iteration. The number of points per iteration varies with the \"radius\" in order to provide practical leg lengths within INAV's 120 mission point constraint.
The default parameters result in the following survey pattern.
And a generated mission from these settings looks might look like:
"},{"location":"mwp-area-planner/#file-menu","title":"File Menu","text":"The area planner dialog has a drop down menu to load and save area definitions to / from the file system. The files are the same format as for the legacy mwp-area-planner
.
In addition (not shown), it is also possible to save the survey outline as a KML file for future display / analysis.
"},{"location":"mwp-area-planner/#obsolete-video","title":"Obsolete video","text":"There is an old youtube video covering both the legacy mwp-area-planner
and iforce2d's on line tool.
May 2023, mwp supports an implementation of INAV's Follow Me.
In order to use this:
POSHOLD
with the GCS NAV
mode also asserted.In addition to the manual (drag icon) positioning described below, it is also possible to use a local gpsd
instance to drive the follow me location by checking the GPSd box.
Legacy Images
The remaining images this section are from legacy mwp, however the capability is the same.
Under the Edit menu, there is a new option Set FollowMe Point. Until you're armed and in POSHOLD this is not sensitive.
Now armed, but not POSHOLD (orange Home icon showing), still not sensitive ...
Now in POSHOLD. note the green POSHOLD icon ... menu option is sensitive!
Clicking the menu option invokes the FollowMe dialog:
The FollowMe desired location is indicated by the second green icon (with the \u2a01 symbol). This may be dragged to the required location. An altitude, relative to home may also be set, 0
means don't change altitude.
Once mwp has transmitted the desired location (WP#255), mwp will interrogate the FC for confirmation (WP#254, sic). This is logged, for example:
11:31:38.530919 Special WP#254 (4) 35.772714 140.361790 20m 0\u00b0\n
"},{"location":"mwp-follow-me/#caveats","title":"Caveats","text":"It's probably 6 years since anyone has used this sort of INAV functionality, so take care. In particular, I'm not sure how well the altitude item works (in the firmware, mwp appears to send the correct data). So start will plenty of altitude and 0
as the altitude setting.
Note also that this has not been flight tested; the images and data tests have been done using the INAV SITL (software in the loop), i.e. running INAV firmware as a desktop application, with fl2sitl as the (trivial) sensor provider and ser2tcp allowing a physical RX/TX to be used with the SITL.
In the event that someone flight tests this, a mwp \"stderr\" log and a blackbox log would be appreciated.
"},{"location":"mwp-geozones/","title":"mwp and Geozones","text":""},{"location":"mwp-geozones/#introduction","title":"Introduction","text":"mwp provides a UI for the Geozones function that first appeared in INAV 8.0.0. The technical details for this feature are published as part of INAV 8.0 INAV Documentation.
Version Requirements
The proposed INAV 8.0 implementation of GeoZones requires mwp 24.11.14 or later.
Geozones provides a set of geographical shapes that the FC can navigate around, characterised by:
Shape
Type
Action
The effect these parameters have on FC behaviour are described in the INAV Documentation.
"},{"location":"mwp-geozones/#geozone-validity-and-enforcement","title":"Geozone Validity and Enforcement","text":""},{"location":"mwp-geozones/#zone-geometry","title":"Zone Geometry","text":"mwp checks that Geozones conform to the FC's known rules for validity:
mwp provides a \"Check Validity\" menu option to perform ad-hoc checks. mwp will not permit the upload of an invalid Geozone set to the FC. It is however possible to save a set that mwp claims is invalid in case the user wish to dispute such categorisation with the developer.
"},{"location":"mwp-geozones/#runtime-considerations","title":"Runtime Considerations","text":"There are a number of runtime recommendations from the Geozone developer:
2 * loiter radius
(or geozone_mr_stop_distance
for multirotors) horizontally and 50 metres vertically to allow RTH to calculate a proper heading.mwp does not currently attempt to enforce the runtime recommendations nor warns of their violation.
"},{"location":"mwp-geozones/#mwp-user-interface","title":"mwp User interface","text":"Legacy Images
The majority of images this section are from legacy mwp, however the capability is the same.
"},{"location":"mwp-geozones/#menu-options","title":"Menu options","text":"mwp adds a Geozones menu option, with suboptions:
Note that the Save, Export, Clear, Download and Upload options are not sensitive if no geozone is loaded. Once a geozone is loaded, some or all of these options will be enabled. The MSP options are only enabled if the FC offers feature GEOZONE
with the INAV 8.0 feature
value of (1 << 4)
.
Note that if feature GEOZONE
is present, mwp will attempt to load Geozones from the FC if the setting autoload-geozones
is true, e.g.:
gsettings set org.stronnag.mwp autoload-geozones true\n
"},{"location":"mwp-geozones/#user-interface","title":"User Interface","text":"Edit UI Images
The image immediately below represents the current Edit UI (it has the AMSL button); other Edit UI images are from an earlier instance without this button. The altitude values have no bearing on mwp's display of the Geozones, other than in the generated KML.
The icons along the top are:
If there is no Geozone loaded, the editor is as shown at the \"new zone\" state: the \"Shape\" item is enabled and a note explains how to proceed. Note that to create a circular zone, the radius must be non-zero. If the \"Shape\" item is set to \"Polygon\", then no radius is required to proceed.
Once the required details have been entered, pressing refresh draws the template shape. circle has a dragable centre and editable radius.
A polygon has 3 points (the mimimum), each of which can be dragged.
Additional points can be added immediately in front of an existing point from the right mouse menu.
With multiple zones loaded (or created), the user can switch between zones using the <
and >
icons.
In the following image, from left to right
Zone Id Colour Characteristics Validity 0 Red Counter-clockwise Valid 1 Green Clockwise Invalid 2 Red, fill Counter-clockwise, \"complex\" Invalid 3 Green, fill Counter-clockwise, concave ValidInvalid zones are reported with the \"Check Valdity\" or \"Upload to FC\" options.
"},{"location":"mwp-geozones/#zone-colours","title":"Zone Colours","text":"mwp sets line and fill characteristics for GeoZones according to the zone's type
and action
.
The default values are set as:
Type Action Line Fill Exclusive None red 4 4 Exclusive Avoid red 4 red Exclusive PosHold red 10 red Exclusive RTH red 10 red Inclusive None green 4 4 Inclusive Avoid green 4 Inclusive PosHold green 10 Inclusive RTH green 10 greenThe values after the line colour are line width and optional dash width.
The default colours are those suggested by the user who requested that mwp support GeoZones.
The default \"red\" and \"green\" colours have some opacity set:
Type Value Line redrgba(255,0,0,0.625)
Fill red rgba(255,0,0,0.125)
Line green rgba(0,255,0,0.625)
Fill green rgba(0,255,0,0.125)
Where line width is greater than 10, the opacity is further reduced by 20% to satisfy the author's aesthetic opinion.
"},{"location":"mwp-geozones/#user-definition","title":"User definition","text":"The user may specify their own colours by creating a pipe separated file, $HOME/.config/mwp/zone_colours
. This is a text file of the format:
type|action|line_colour|line_width|line_dash|fill_colour\n
"},{"location":"mwp-geozones/#user-definition-fields","title":"User definition fields:","text":"Type: The zone type as an integer (0-1 : Exclusive / Inclusive)
Action: The zone action as an integer (0-3 : None / Avoid / Poshold / RTH).
Line Colour: see below for colour formats
Line Width: In pixels, as an integer
Line Dash: In pixels, as an integer; the line will alternate on/off using this value.
Fill Colour: see below for colour formats
"},{"location":"mwp-geozones/#colour-defintion","title":"Colour defintion","text":"Colours may be defined as:
#rrggbb
or #rrggbbaa
; orrgb(r,g,b)
); or rgba(r,g,b,a)
Where r
, g
, b
and a
are respectively the red, green, blue and alpha colour values. In the \"rgb()
\" format, r
, g
, and b
are either integers in the range 0 to 255 or percentage values in the range 0% to 100%, and a
is a floating point value in the range 0 to 1.
If the alpha component is not specified then it is set to be fully opaque.
For \"standard X11 names\", an opacity may be defined by appending a floating point value in the range 0 to 1.0 to the name, separated by a semi-colon, for example steelblue;0.8
zone_colours
file","text":"The default settings can be represented in a zone_colours
file as:
0|0|rgba(255,0,0,0.625)|4|4|\n0|1|rgba(255,0,0,0.625)|4|0|rgba(255,0,0,0.125)\n0|2|rgba(255,0,0,0.625)|10|0|rgba(255,0,0,0.125)\n0|3|rgba(255,0,0,0.625)|10|0|rgba(255,0,0,0.125)\n1|0|rgba(0,255,0,0.625)|4|4|\n1|1|rgba(0,255,0,0.625)|4|0|\n1|2|rgba(0,255,0,0.625)|10|0|\n1|3|rgba(0,255,0,0.625)|10|0|rgba(0,255,0,0.125)\n
Where fill is not required, it is left blank.
If a line cannot be parsed, an error will the logged, giving the offending line number(s). Blank lines and comment lines (starting with #
or ;
) are ignored.
Please also note that floating point values must be specified with a point (.
), even when the locale customary format would use comma (,
).
Alternate colour expressions for the first line above are therefore:
0|0|red;0.625|4|4|\n0|0|#ff0000a0|4|4|\n
"},{"location":"mwp-los-tool/","title":"Line of Sight (LOS) Tool","text":""},{"location":"mwp-los-tool/#overview","title":"Overview","text":"mwp provides a LOS tool that establishes whether there is LOS between the observer location (the mwp home icon) and arbitrary points on an INAV mission. This is may be useful to establish:
There are a number of issues to take into consideration.
mwp uses Mapzen DEM data, which improves accuracy (more users get 30m data) with better accuracy, as well as a significant performance boost and offline usage after the initial data download.
Please be aware of these accuracy / fidelity issues when evaluating the results of any elevation analysis.
"},{"location":"mwp-los-tool/#invocation","title":"Invocation","text":"Legacy Images
The images this section are from legacy mwp, however the capability is the same.
LOS is invoked from any waypoint using the right mouse button.
"},{"location":"mwp-los-tool/#line-of-sight","title":"Line of sight ...","text":"The user can select locations on the mission via a slider and run an analysis. A LOS calculation is performed, a graphical view is shown and a red (no LOS), orange (LOS below a user defined margin) or green (unconditional LOS) line is displayed on the map from the observer (home location) to the chosen location. This may be repeated as required.
"},{"location":"mwp-los-tool/#area-los","title":"Area LOS","text":"Pressing a modifier key (Shift or Control) while selecting \"Line of Sight ...\" will invoke Area LOS ; the calculation is performed automatically with 1% increments of the naive mission length. A set of resulting green/orange/red LOS lines is displayed on the map.
Note that both options are available from the LOS analysis window; the modifier option is merely a convenience.
"},{"location":"mwp-los-tool/#examples","title":"Examples","text":"When the LOS slider is displayed, the only UI actions available are:
This restriction means that the mission cannot be changed while a LOS Analysis is being performed.
"},{"location":"mwp-los-tool/#manual-los-analysis","title":"Manual LOS Analysis","text":"In the image below, the user has selected \"Line of Sight ...\" from the right mouse menu at WP9. The slider is positioned appropriate to WP9. Note that if the mission contains JUMP WPs, these are executed once only (regardless of the mission setting). This is why the slider might appear less advanced compared to the mission length if the JUMP is ignored. The user can reposition the WP using the slider (or the start / end buttons).
When \"Point LOS\" is clicked, the LOS is calculated between planned home (brown icon, lower left) and the red \"\u2a01\" \"Point of Interest\" (POI) icon. This is displayed as a terrain plot with the LOS line superimposed over the terrain elevation. The line is red as there is no LOS (and it would be green where there is LOS). A red \"dot-dash\" is also displayed on the map. If a margin is specified, then LOS lines with clearance between the terrain and the margin value are shown in orange.
The user may repeat the \"move slider\" / \"Point LOS\" action as required. The prior terrain plot is removed each time \"Point LOS\" is selected; the lines on the map are removed when the slider dialog is closed. \"Area LOS\" may be used to run a continuous analysis from the currently selected location. \"Area LOS\" may be started / stopped at any point (and Point Analysis invoked at any time when stopped).
When an analysis results in an orange or red LOS line, the first point where the LOS break is detected is shown on the line as a coloured blob. This is apparent in the Area image below.
"},{"location":"mwp-los-tool/#area-los_1","title":"Area LOS","text":"This analysis is iterated along the mission path automatically, providing Area coverage for the mission.
The image shows the state after a complete \"Area\" analysis. While the analysis is running, the slider and \"Point LOS\" are not sensitive; once the run has completed, these controls are available if the user wishes to investigate further. The user can stop (and restart) Area using the \"Area LOS\" / \"Stop\" button. (Note: in earlier versions, \"Area LOS\" was called \"Auto LOS\").
Here, the user has subsequently used \"Point LOS\" to examine a point in the orange region. As expected, there is very little clearance between the LOS line and the terrain. This is confirmed on the map plot where the \"blobs\" (immediately to the right of the plot window close button) indicate the point where LOS is compromised.
It is important to note that Area LOS is performed at 1% increments of the naive mission length, it is not contiguous. In the above case, there is a point at 34.1% where there is no LOS.
If you press a modifier (Shift or Control) while invoking \"Area LOS\", you get 0.1% increments, which may be used to investigate small segments (it will be slow ... and resource intensive). Here a detailed analysis has been run from 33.6% to 34.6% which captures the instance of complete loss of LOS.
Caveat user!
There is also a You Tube video (uses a slightly earlier UI iteration).
"},{"location":"mwp-los-tool/#local-dems","title":"Local DEMs","text":"mwp uses Mapzen DEM SRTM (Shuttle Radar Telemetry Mission) HGT files for all mwp elevation requirements. These are downloaded on demand. No user access key is required.
"},{"location":"mwp-los-tool/#miscellaneous-notes","title":"Miscellaneous notes","text":"The mwp suite contains numerous command line tools developed since 2015 in order to aid development of INAV, development of mwp and diagnosing numerous (often 3rd party) problems, more so in the early days.
This chapter describes a few of the command line tools that are provided by mwptools. Note that not all these tools are built or installed by default; it may be necessary to enter a source directory and invoke make
in situ, or copy a script to a directory on the $PATH
.
fc-get
and fc-set
are tools to manage CLI settings:
fc-get
: Dump cli diff
settings to a file that can be replayed by fc-set
fc-set
: Replay a file of cli settings to the FC. Once the settings have been saved, a backup is made of the original file; the settings are then read from the FC and the original file updated.$ fc-set --help\nUsage:\n fc-set [OPTION?] - fc diff manager\n\nHelp Options:\n -h, --help Show help options\n\nApplication Options:\n -b, --baud baud rate\n -d, --device device\n -n, --no-back no backup\n
NOTE: fc-get
and fc-set
are essentially the same program, the function is defined by the name.
The tools auto-detect the plugging of an FC.
$ fc-get /tmp/dodo-test.txt\n12:16:04 No device given ... watching\n12:16:04 Opening /dev/ttyUSB0\n12:16:04 Establishing CLI\n12:16:05 Starting \"diff all\"\n12:16:06 Exiting\n12:16:06 Rebooting\n
Then, maybe after flashing the FC to a new version:
$ fc-set /tmp/dodo-test.txt\n12:16:56 No device given ... watching\n12:16:56 Opening /dev/ttyUSB0\n12:16:56 Starting restore\n12:16:56 Establishing CLI\n12:16:58 [\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588] 100%\n12:16:58 Rebooting\n12:17:01 Establishing CLI\n12:17:03 Starting \"diff all\"\n12:17:03 Exiting\n12:17:03 Rebooting\n
And now we have a settings backup ...
$ ls -l /tmp/dodo*\n-rw-r----- 1 jrh jrh 2115 Mar 28 12:17 /tmp/dodo-test.txt\n-rw-r----- 1 jrh jrh 2115 Mar 28 12:16 /tmp/dodo-test.txt.2018-03-28T12.17.01\n
"},{"location":"mwp-miscellaneous-tools/#flashsh-fcflash","title":"flash.sh, fcflash","text":"fcflash
is a script to flash INAV images to a flight controller using the command line. It requires that stm32flash
and dfu-util
are installed on your computer. Optionally, it requires GCC objcopy
to convert hex files to binary for DFU operation.
dfu-util
stm32flash
fcflash
decides which tool to use depending on the detected device node (which can be overridden)
/dev/ttyACMx
=> DFU/dev/ttyUSBx
=> USB serialNote: fcflash
is the installed file, in the repository it's src/samples/flash.sh
.
fcflash
performs the following tasks
rescue
is specified, and the FC is set to DFU via hardare (switch, pads))hex
image to a bin
image (for DFU)fcflash
parses a set of options given on the command line. Normally, only the path to the hex file is required and everything else will be detected (device, flashing mode).
rescue
: Assumed the FC is already in bootloader mode, requires a device name/dev/*
: The name of the serial device, required for rescue
, typically /dev/ttyACM0
erase
: Performs full chip erase[123456789]*
: Digits, representing a baud rate. 115200
is assumed by default.A file name (an INAV hex file) is also required.
"},{"location":"mwp-miscellaneous-tools/#examples","title":"Examples","text":""},{"location":"mwp-miscellaneous-tools/#flash-image-dfu-auto-detect","title":"Flash image, DFU, auto-detect","text":"fcflash inav_5.0.0_MATEKF405.hex\n
"},{"location":"mwp-miscellaneous-tools/#flash-image-usb-serial-devttyusb0-auto-detect","title":"Flash image, USB serial (/dev/ttyUSB0), auto-detect","text":"For my broken FC (USB connector unreliable).
# as above, /dev/ttyUSB0 is autodetected\nfcflash inav_5.0.0_MATEKF405.hex\n\n# force device (and USB serial mode)\nfcflash /dev/ttyUSB0 inav_5.0.0_MATEKF405.hex\n
"},{"location":"mwp-miscellaneous-tools/#flash-image-rescue-mode-hardware-boot-button-full-flash-erase","title":"Flash image, rescue mode (hardware boot button), full flash erase","text":"fcflash rescue erase /dev/ttyACM0 inav_5.0.0_MATEKF405.hex\n
The no specific ordering of the command line options is required.
In summary, the command:
fcflash inav_5.0.0_WINGFC.hex\n
results in
dfu-util
.dfu-util
is invoked as:
dfu-util -d 0483:df11 --alt 0 -s 0x08000000:force:leave -D inav_5.0.0_WINGFC.bin\n
The firmware is flashed and the FC reboots
Note that gcc objcopy
is required to convert from .hex
to .bin
(as required by dfu-util
).
flashgo
is a tool to download blackbox logs from on-board flash. If you're doing this on a VCP board, it will download much faster then the apparent baud rate indicates. If you're using a non-VCP board (i.e. F3 or earlier), then consider using flash_dump.rb
which can temporarily alter the baudrate to achieve faster rates using CLI (vice MSP) commands.
flashgo
is a replacement for the earlier flashdl
tool.
$ flashgo --help\nUsage of flashgo [options] [device]\n-dir string\n output directory ($(cwd) if not specified)\n-erase\n erase after download\n -file string\n output file, auto-generated (bbl_YYYY-MM-DD_hhmmss.TXT) if not specified\n -info\n show flash info and exit\n -only-erase\n erase only and exit\n -test\n download whole flash regardess of used state\n\ndevice is the FC serial device, which may be auto-dectected\n
"},{"location":"mwp-miscellaneous-tools/#usage-examples","title":"Usage Examples","text":""},{"location":"mwp-miscellaneous-tools/#check-flash-usage","title":"Check flash usage","text":"$ flashgo -info\nUsing /dev/ttyACM0\nFirmware: INAV\nVersion: 5.0.0\nData flash 0 / 2097152 (0%)\n
"},{"location":"mwp-miscellaneous-tools/#test-mode-download-whole-flash","title":"Test mode (download whole flash)","text":"$ flashgo -test\nUsing /dev/ttyACM0\nFirmware: INAV\nVersion: 5.0.0\nEntering test mode for 2097152b\nData flash 2097152 / 2097152 (100%)\nDownloading to bbl_2022-05-22_113211.TXT\n[\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587] 2.0MB/2.0MB 100% 0s\n2097152 bytes in 40.2s, 52218.4 bytes/s\n
"},{"location":"mwp-miscellaneous-tools/#check-flash-info","title":"Check flash info","text":"$ flashgo -info\nUsing /dev/ttyACM0\nUnexpected MSP 108 (0x6c)\nFirmware: INAV\nVersion: 5.0.0\nData flash 27674 / 2097152 (1%)\n
"},{"location":"mwp-miscellaneous-tools/#download-to-auto-generated-file-name","title":"Download to auto-generated file name","text":"$ flashgo\nUsing /dev/ttyACM0\nFirmware: INAV\nVersion: 5.0.0\nData flash 27674 / 2097152 (1%)\nDownloading to bbl_2022-05-22_114044.TXT\n[\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587] 27.0KB/27.0KB 100% 0s\n27674 bytes in 0.5s, 50838.4 bytes/s\n
"},{"location":"mwp-miscellaneous-tools/#erase-the-flash-only-no-download","title":"Erase the flash (only, no download)","text":"$ flashgo -only-erase\nUsing /dev/ttyACM0\nFirmware: INAV\nVersion: 5.0.0\nErase in progress ...\nCompleted\n
"},{"location":"mwp-miscellaneous-tools/#check-flash-info_1","title":"Check flash info","text":"$ flashgo -info\nUsing /dev/ttyACM0\nFirmware: INAV\nVersion: 5.0.0\nData flash 46893 / 2097152 (2%)\n
"},{"location":"mwp-miscellaneous-tools/#download-to-nominated-file-name","title":"Download to nominated file name","text":"$ flashgo -file bbl_TEST.txt\nUsing /dev/ttyACM0\nFirmware: INAV\nVersion: 5.0.0\nData flash 46893 / 2097152 (2%)\nDownloading to bbl_TEST.txt\n[\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587] 45.8KB/45.8KB 100% 0s\n46893 bytes in 0.9s, 52290.6 bytes/s\n
"},{"location":"mwp-miscellaneous-tools/#download-to-nominated-file-and-directory","title":"Download to nominated file and directory","text":"$ flashgo -file bbl_TEST.txt -dir /tmp/\nUsing /dev/ttyACM0\nFirmware: INAV\nVersion: 5.0.0\nData flash 46893 / 2097152 (2%)\nDownloading to /tmp/bbl_TEST.txt\n[\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587] 45.8KB/45.8KB 100% 0s\n46893 bytes in 0.9s, 52298.0 bytes/s\n
"},{"location":"mwp-miscellaneous-tools/#download-to-auto-generated-file-name-and-nominated-directory-then-erase-flash","title":"Download to auto-generated file name and nominated directory, then erase flash","text":"$ flashgo -dir /tmp/ -erase\nUsing /dev/ttyACM0\nFirmware: INAV\nVersion: 5.0.0\nData flash 46893 / 2097152 (2%)\nDownloading to /tmp/bbl_2022-05-22_114515.TXT\n[\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587\u2587] 45.8KB/45.8KB 100% 0s\n46893 bytes in 0.9s, 52291.9 bytes/s\nErase in progress ...\nCompleted\n
Note that in every case, the FC device node is auto-detected.
Note also that the download speed is approximately 5 times greater than one would expect from the nominal baud rate (115200 ~= 10800 bytes/sec).
"},{"location":"mwp-miscellaneous-tools/#flash_dumprb","title":"flash_dump.rb","text":"flash_dump.rb
is another tool for downloading blackbox logs from on-board flash. Whereas flashgo
uses MSP, flash_dump.rb uses CLI commands and is thus rather more fragile and requires that the FC firmware is compiled with #define USE_FLASH_TOOLS
(which is not the default).
$ flash_dump.rb --help\n\nflash_dump.rb [options] file\nDownload bb from flash\n -s, --serial-device=DEV\n -e, --erase\n -E, --erase-only\n -o, --output=FILE\n -b, --baud=RATE\n -B, --super-baud=RATE\n -?, --help Show this message\n
Unlike flashdl
which auto-detects serial ports, flash_dump.rb
tries /dev/ttyUSB0
and /dev/ttyACM0
, or the device given with -d
. The \"super baud\" rate must be specified to use a faster rate than the FC default:
$ flash_dump.rb -B 921600\n/dev/ttyUSB0\nChanging baud rate to 921600\nFound \"serial 0 1 115200 38400 115200 115200\"\nsetting serial 0 1 921600 38400 115200 115200\nReopened at 921600\nSize = 1638400\nread 1638400 / 1638400 100% 0s\nGot 1638400 bytes in 18.8s 87268.8 b/s\nExiting\n
After the download has completed, the serial port is reset to the previously configured baud rate (typically 115200). Note the very high speed of the download, 87268 bytes /sec; this is almost 9 times faster than the standard baud (and 9x the speed of using the configurator with a USB board).
Should the download fail and the board serial speed is not reset automatically, it will be necessary to manually reset UART1, possibly using cliterm
.
So, had the above failed, it could be rescued by pasting in the \"Found\" line above:
$ cliterm -b 921600\nopen /dev/ttyUSB0\n\nEntering CLI Mode, type 'exit' to return, or 'help'\n\n# serial 0 1 115200 38400 115200 115200\n\n# save\nSaving\nRebooting\n
"},{"location":"mwp-miscellaneous-tools/#cliterm","title":"cliterm","text":"cliterm
is a terminal program for interacting with the INAV CLI. Unlike alternative tools (picocom
, minicom
etc.), it will auto-detect the FC serial device, uses 115200 as the baud rate and, by default, automatically enters the CLI.
$ cliterm --help\n Usage:\n cliterm [OPTION?] - cli tool\n\n Help Options:\n -h, --help Show help options\n\n Application Options:\n -b, --baud=115200 baud rate\n -d, --device device\n -n, --noinit=false noinit\n -m, --msc=false msc mode\n -g, --gpspass=false gpspassthrough\n -p, --gpspass=false gpspassthrough\n -f, --file file\n --eolmode=[cr,lf,crlf,crcrlf] eol mode\n
-g
, -p
, the FC is put into GPS passthrough mode, in order to use tools like ublox-cli
or u-center
(sic).-m
, --msc
causes the FC to reboot in MSC (USB Mass Storage) mode.The options -n
(don't enter CLI automatically) and -m
may be useful when accessing other devices (for example a 3DR radio, HC-12 radio or ESP8266) in command mode.
cliterm
understands Ctrl-D as \"quit CLI without saving\". You should quit cliterm
with Ctrl-C, having first exited the CLI in the FC (save
, exit
, Ctrl-D). Or after save
, exit
, cliterm
will exit when the FC is rebooted, by seeing the tear-down of the USB device node.
mwptools has always included tools to simplify blackbox analysis. it seems to the author that it's often much easier to pre-process the output of INAV blackbox_decode
into a smaller dataset that addresses the specific problem rather than try and make sense of the mass of data in a blackbox log.
There are a few basic prerequisites for doing this analysis using the mwp scripts:
blackbox_decode
ruby
interpreter installedgnuplot
installed; it's also possible to generate graphs (\"charts\") from spreadsheet applications (LibreOffice Calc, MS Excel).A user reported serious toilet-bowling / fly away on a large cine-octa with expensive VTX RF gear and camera gimbal. Two blackbox logs were provided, one with the RF and gimbal disabled, the other with them enabled (when the problem appears).
The logs were processed with the mwptools/src/bbox-replay/inav-parse_bb_compass.rb
. This script:
GPS_ground_course
and attitude[2]/10
.You need to run this from a shell (Linux / MacOS /FreeBSD terminal, Windows powershell or cmd). blackbox_decode
and (optionally) gnuplot
need to be on the PATH
.
$ ./inav-parse_bb_compass.rb --help\ninav-parse_bb_compass.rb [options] [file]\n --list-states\n --plot Generate SVG graph (requires 'gnuplot')\n --thr Include throttle value in output\n -o, --output=FILE CSV Output (default stdout\n -i, --index=IDX BBL index (default 1)\n -t, --min-throttle=THROTTLE Min Throttle for comparison (1000)\n -s, --states=a,b,c Nav states to consider [all]\n -d, --delta=SECS Down sample interval (default 0.1s)\n -?, --help Show this message\n
"},{"location":"mwp-miscellaneous-tools/#results-from-the-analysis","title":"Results from the analysis","text":"First, the good log (no VTX-RF or gimbal enabled):
./inav-parse_bb_compass.rb --plot /tmp/LOG00001.TXT\nINAV 4.1.0, states from 2.7.0\nLog 1 of 1, start 00:49.654, end 06:33.615, duration 05:43.961\n\nStatistics\nLooptime 506 avg 14.9 std dev (2.9%)\nI frames 21061 128.0 bytes avg 2696240 bytes total\nP frames 315692 81.6 bytes avg 25753176 bytes total\nH frames 164 10.0 bytes avg 1640 bytes total\nG frames 1865 21.6 bytes avg 40300 bytes total\nE frames 1 6.0 bytes avg 6 bytes total\nS frames 4066 40.0 bytes avg 162637 bytes total\nFrames 336753 84.5 bytes avg 28449416 bytes total\nData rate 979Hz 83359 bytes/s 833600 baud\n\n29 frames failed to decode, rendering 181 loop iterations unreadable. 2897 iterations are missing in total (1466ms, 0.43%)\n339649 loop iterations weren't logged because of your blackbox_rate settings (171980ms, 50.00%)\n\nGraph in /tmp/LOG00001.TXT.csv.svg\n
We see some information, mainly the summary from blackbox_decode
and notification of the resulting graph file.
Looks OK, there's a few deviations between the GPS and position estimator, possibly a result of hard Acro mode manoeuvres.
Let's now look at the log with the VTX-RF and gimbal enabled:
./inav-parse_bb_compass.rb --plot /tmp/LOG00008.TXT\n...\n Graph in /tmp/LOG00001.TXT.csv.svg\n
Note the difference
Something in generating enough interference to cause the heading / position estimator attitude[2]
to essentially flat-line.
So now we have concrete evidence of the problem, the next steps would be for the pilot to repeat the exercise enabling just one of the suspect devices to identify the actual cause of the problem and then rectify it:
PH unstable altitude is often caused by excessive vibrations or inadequately protected (open cell foam) barometer. mwptools/src/bbox-replay/inav_gps_alt.rb
will generate a similar graph of baro v. GPS v. position estimator elevations.
mwp supports a number of different data transports for \"serial\" protocols:
Each of these requires a specific device name and may require a protocol selection.
"},{"location":"mwp-multi-procotol/#serial-devices","title":"Serial devices","text":"Serial devices are defined by the operating system device node name and optionally include an embedded baud rate, for example:
# Linux, USB seral\n/dev/ttyACM0\n# Linux, USB serial with baud rate\n/dev/ttyUSB0@57600\n# Linux, RFCOM Bluetooth\n/dev/rfcomm1\n\n# FreeBSD\n/dev/cuaU0\n
"},{"location":"mwp-multi-procotol/#bluetooth","title":"Bluetooth","text":"Bluetooth may be specified by either an rfcomm
device node (/dev/rfcommX
on Linux, /dev/ttypX
pseudo-terminal abstraction on FreeBSD) or by the device address (BD_ADDR
, Linux and FreeBSD only):
# BT RFCOMM device node (Linux)\n/dev/rfcomm1\n/dev/rfcomm1@57600\n# RFCOMM / SPP (FreeBSD)\n/dev/ttyp6\n# BT device address (note here baud rate is immaterial)\n35:53:17:04:07:27\n
For legacy devices, it is recommended that these are paired before use; this will greatly speed up the device recognition process.
For BLE, in general it is not possible to pair devices; it is recommended that you use operating system tools (e.g. bluetoothctl
to discover the device and find all the BLE/Gatt characteristics (e.g. by connect
in bluetoothctl
). Otherwise you may end up in a \"Morton's fork\" situation where in order recognise the device as BLE, mwp needs to connect to it and in order to use the BLE connect functions, mwp needs to know it's a BLE device.
A sequence of bluetoothctl
commands (where aa:bb:cc:dd:ee:ff
represents a new device address); such as the following will help :
$ bluetoothctl\npower on\ndefault-agent\nscan on\n## ... devices are discovered\ninfo aa:bb:cc:dd:ee:ff\n## note this will probably only show up a little data and 0 or 1 UUIDs (we need more)\nconnect aa:bb:cc:dd:ee:ff\n## for a BLE device, this will spew out a load of \"characteristics\" and multiple UUIDS\ntrust aa:bb:cc:dd:ee:ff\ndisconnect aa:bb:cc:dd:ee:ff\nquit\n
Now the device should be discovered in mwp and should connect.
The following BLE chip-sets are supported:
The first and last items having been tested by the author.
"},{"location":"mwp-multi-procotol/#discovery-and-filtering","title":"Discovery and filtering","text":"By default, mwp relies on the bonded information about bluetooth devices known to the operating system. This has (at least) two consequences:
There is a somewhat experimental option that includes scanning and RSSI filtering such that:
The downside being that is RSSI if never discovered / advertised by the OS, then the device is not listed.
This mode is enabled by a setting:
$ gsettings set org.stronnag.mwp bluez-disco true\n
This is persistent, in order to revert to the default, non-scanning no RSSI filter:
$ gsettings set org.stronnag.mwp bluez-disco false\n
"},{"location":"mwp-multi-procotol/#mwp-ble-bridge","title":"mwp-ble-bridge","text":"In order to use BLE serial devices with tools (i.e. other than mwp) that do not implement the BLE protocol, mwp provides a mwp-ble-bridge
tool that uses a pseudo-terminal, TCP server or UDP server to facilitate BLE connectivity for other tools that expect a device node. See the README.md
in src/mwp-ble-bridge
.
Using a bridge with TCP allows connectivity with the INAV Configurator versions that appear not to understand BLE on Linux. Note that INAV Configurator 8.0 will \"sort of\" support BLE on Linux.
"},{"location":"mwp-multi-procotol/#ble-caveats","title":"BLE Caveats","text":"BLE not particularly useful for anything other than low power. The transfer rates are extremely slow and whether the device can be used at all depends on its MTU (maximum transmission unit). For some devices this is unacceptable low for use with mwp / INAV.
mwp will never send more than 20 bytes in a single write to a BLE device; chunking up messages as required. The FC cannot do this, so large messages will result in massive data overrun (for example MSP_BOX_NAMES will typically return more than 400 bytes).
mwp will log the detected MTU when it connects a BLE device.
13:05:07.547489 BLE chipset CC2541, mtu 23 (unlikely to end well)\n...\n13:07:36.946329 BLE chipset SpeedyBee Type 2, mtu 517\n
"},{"location":"mwp-multi-procotol/#serial-permissions","title":"Serial permissions","text":"It is necessary for the user to have read / write permission on serial devices. The installation guide provides instructions.
"},{"location":"mwp-multi-procotol/#ip-protocols-udp-and-tcp","title":"IP protocols (UDP and TCP)","text":"mwp uses a pseudo-URL format for TCP and UDP connections udp://host:port
and tcp://host:port
(where host
is either a hostname or an IP address as required).
Typically on one side of the connection you'll provide a hostname /IP and on the other you won't (as it can get the peer address from the first data packet).
Assuming the required UDP port is 43210
if mwp is the \"listener\" (doesn't need, a priori, to know the address of peer), set the \"Device\" to:
udp://:43210\n
i.e. the host part is empty.
If the remote device / application is the listener, and we know its IP address; in the following example \"192.168.42.17\", set the \"Device\" to:
udp://192.168.42.17:43210\n
Note that for TCP, mwp only supports the latter form (it expects to be the TCP client).
"},{"location":"mwp-multi-procotol/#special-cases","title":"Special Cases","text":""},{"location":"mwp-multi-procotol/#udp-devices-required-defined-local-and-remote-port-numbers","title":"UDP devices required defined local and remote port numbers","text":"Some UDP devices (typically ESP8266 transparent serial) require that the port number is specified for both local and remote addresses; often the same port number at both ends. udp://local_host:local_port/remote_host:remote_port
or udp://remotehost:remote_port/?bind=port
. The following have the same effect.
udp://:14014/esp-air:14014\n# both sides use port 14014, remote (FC) is esp-air, blank local name is understood as INADDR_AN\nudp://esp-air:14014/?bind=14014\n
"},{"location":"mwp-multi-procotol/#mqtt-bulletgcss","title":"MQTT / BulletGCSS","text":"See the mwp's MQTT support article for a detailed description of the URI format:
mqtt://[user[:pass]@]broker[:port]/topic[?cafile=file]\n
"},{"location":"mwp-multi-procotol/#multi-protocol-selection","title":"Multi Protocol selection","text":""},{"location":"mwp-multi-procotol/#overview","title":"Overview","text":"There is a protocol drop-down that allows the user to select the in-use serial protocol.
Offering:
"},{"location":"mwp-multi-procotol/#usage","title":"Usage","text":"Item Usage Auto Auto-detects the protocol from the serial data stream. Note that MPM cannot (yet) be auto-detected reliably, and must be explicitly selected). INAV INAV protocols, MSP, LTM and MAVLink. Legacy behaviours S-Port Smartport telemetry, previously required--smartport
options. Expects a non-inverted stream CRSF Crossfire Telemetry. MPM Multi-Protocol-Module telemetry. The output from an EdgeTX / OpenTX radio with a multi-protocol module, FrSky Smartport or Flysky 'AA' via the EdgeTX / OpenTX \"Telem Mirror\" function. Prior to EdgeTX 2.7, this cannot be reliably auto-detected, and should be explicitly selected; with EdgeTX 2.7 and later, auto-detection is possible and reliable."},{"location":"mwp-multi-procotol/#notes","title":"Notes","text":"--radar-device=
option. Leave the protocol selector at 'Auto'.--forward-to=
option. Leave the protocol selector at 'Auto'.set ibus_telemetry_type = 0
is required; any other ibus_telemetry_type
value will not work.One of the great features of INAV 2.6 was the safehome
capability. The user can define of set of up to eight locations, and if any of these is within 200m (configurable up to 650m in INAV 2.7), then that is used as the home location for RTH (and RTH failsafe).
safehome
is set in INAV using the CLI, (note more recent Configurators also have a UI); here's an example:
# safehome\nsafehome 0 1 508047750 -14948970\nsafehome 1 1 509102384 -15344850\nsafehome 2 1 509390336 -14613540\nsafehome 3 1 509149619 -15337365\nsafehome 4 0 508054891 -14961431\nsafehome 5 0 543545392 -45219430\nsafehome 6 0 540954148 -47328458\nsafehome 7 0 0 0\n
As you see, it's not too user friendly; the parameters are
It can be error prone to get locations into the correct format, particularly when a common source (Google Maps) only provides 6 decimal places of precision.
"},{"location":"mwp-safehomes-editor/#mwp-solution","title":"mwp solution","text":""},{"location":"mwp-safehomes-editor/#graphical-user-interface","title":"Graphical User Interface","text":"Legacy Images
The images this section are from legacy mwp, however the capability is the same.
Note: Since mwp 7.32.?, mwp provides additional fields for the Autoland function that first appeared in INAV 7.1.0.
mwp now offers a Safe Homes
menu option:
This will launch the Safe Home
window:
From here it is possible to:
safehome
and fwapproach
stanzas are changed; other information in the diff / dump is preserved.safehome
and fwapproach
data to/from the flight controller.Clicking the \"Edit\" button at the end of row enables editing FWA parameters:
Note that editing functions are only available when the Safe Homes
window is active; if the windows is dismissed with icons displayed, then the icons remain on the map, but are not editable.
It also is possible to set a gsettings
key to define a file of safehomes to load at startup, and optionally display (readonly) icons.
gsettings set org.stronnag.mwp load-safehome ~/.config/mwp/safehome.txt,Y\n
This sets the default safehomes file to ~/.config/mwp/safehome.txt
and the appended ,Y
means display the icons on the map.
If the file also contains fwapproach
data, that will be applied as well.
If the name part is set to -FC-
, then the safehomes will be loaded from the flight controller, for example:
gsettings get org.stronnag.mwp load-safehome\n'-FC-,Y'\n
"},{"location":"mwp-safehomes-editor/#example","title":"Example","text":"The image below shows a blackbox replay. Note that the flight home location (brown icon) is coincident with the pale orange safehome icon.
"},{"location":"mwp-safehomes-editor/#fw-approach-fwa-visualisation","title":"FW Approach (FWA) visualisation","text":"Please note that for the display of the geometry of the FWA, mwp uses the same rules as the flight controller; in particular the length of \"base leg / dog leg\" depends two CLI parameters, nav_fw_land_approach_length
, nav_fw_loiter_radius
. These are not part of the safe home (or mission) definition, rather they are properties of the model (and thus are persisted in a CLI diff
file).
mwp can load these properties from a CLI diff
/dump
format file, as well as other CLI artefacts.
In particular, the length of the \"base leg / dog leg\" is the maximum of:
nav_fw_land_approach_length / 2
ornav_fw_loiter_radius * 4
For example, in the first image the user had set nav_fw_land_approach_length
to 150m (for a small, agile plane) but had accidentally left the nav_fw_loiter_radius
at the default of 75m
. The excessive radius dominates and gives an unacceptable geometry:
Setting the radius to a more appropriate value for the model (40m) results in a much more acceptable geometry (still dominated by the loiter radius).
In summary, in order to display FWA accurately for either safe homes or missions, it is advisable to provide a CLI diff
format file containing at a minimum, set
values for nav_fw_land_approach_length
and nav_fw_loiter_radius
. For the above example:
set nav_fw_loiter_radius = 4000\nset nav_fw_land_approach_length = 15000\n
"},{"location":"mwp-telemetry-tracker/","title":"Telemetry Tracking","text":""},{"location":"mwp-telemetry-tracker/#overview","title":"Overview","text":"The mwp \"Telemetry Tracking\" function allows additional vehicles to be tracked by a single mwp instance.
One use case is:
This capability builds on extant mwp features.
Primary
device by user action (as now, from the \"Connect\" button).The devices will be read for any push telemetry supported by mwp and INAV (e.g. LTM, MAVLink, CRSF, Smartport, MPM). The protocol will be auto-detected. When valid (3D fix, geo-referenced) telemetry data is received, a symbol and name will be displayed on the map (as for the mwp radar display). The name associated with the symbol may be:
TTRK-ttyUSB1
)Legacy Images
The images this section are from legacy mwp, however the capability is the same.
In order to use Telemetry Tracking, it will be necessary for the user to assign the required devices. The primary device (once connected) and any devices predefined for \"Radar\" will not be considered. Once a device has been assigned as a \"Secondary / Telemetry Tracking\" device, it may not the used as the \"Primary\" device. Likewise, an established primary device will not be offered as a secondary device.
The \"Telemery Tracking\" device(s) may be assigned from the \"View\" / \"Telemetry Tracker\" menu option (Control-Shift T).
~/.config/mwp/secdevs
. This file lists zero or more devices, each with protocol and optional \"Alias\" text.TTRK-ttyACM0
. The user can edit / override this alias if she so wishes.35:53:*
) have aliases defined at the operating system level. The user can edit / override this alias if she so wishes./dev/ttyACM0
is subsequently connected as the primary device, it will not appear in this list.Hint
column lets the user define the specific protocol to used (vice let it be auto-detected). The default, \"Auto\", should work in most cases, other than perhaps MPM on OpenTX.Tracking devices are enabled / disabled using the \"Enable\" check-button. Once a device is enabled, mwp will attempt to read data from it and display it. The device is closed by toggling the \"Enable\" button. Once disabled, its resources are freed. If a USB device is physically removed when enabled, its resources will also be freed.
"},{"location":"mwp-telemetry-tracker/#visualisation","title":"Visualisation","text":"\"Telemetry Tracked\" objects are displayed on the map can be inspected using the existing mwp radar display functionality. \"Telemetry Tracking\" may be used at the same time as the extant \"INAV-Radar and \"ADS-B\" tracking.
And example of visualisation is:
The \"Primary\" vehicle (a flying wing) has the standard mwp visualisation attributes. The other icons, Replay 0
and Replay 1
are \"secondary\" tracks from other pilot's CRSF telemetry (but it could be any of LTM, Mavlink, CRSF, SPort or Flysky 'AA' (INAV type 1)). Note also that Replay 0
has not reported for over 5 minutes (\"stale\"); maybe it's crashed? At least the pilot knows where to start looking.
All \"Telemetry Tracked\" vehicles use a common icon (inav-telem.svg
). The default icon may be overridden by the user if so desired.
Linux preferred, due to the udev
dependency for device enumeration. On other platforms it will be necessary to define devices a priori using the ~/.config/mwp/secdevs
file. This file is maintained by the \"Telemetry Tracker\" GUI editor.
An example secdevs
file might be:
# name, hint, alias\nudp://:23456,Auto,Replay 0\nudp://:23457,CRSF,Replay 1\nudp://:23458,MPM\nudp://:23459,INAV\ntcp://localhost:43210,Sport,Sport player\n
"},{"location":"mwp-terrain-avoidance-quick-guide/","title":"Terrain Avoidance Quick Guide","text":"There's already quite a long article on mwp's terrain analysis tool; this is a quick summary of how to use it in three steps.
"},{"location":"mwp-terrain-avoidance-quick-guide/#1-load-your-mission","title":"1. Load your mission","text":"First load (or create) the mission in mwp. Here, the pilot chooses to take a cruise around the lake and adjacent country side. The brown / grey icon at the top of the mission is the planned home location. At first glance, the terrain looks quite benign.
"},{"location":"mwp-terrain-avoidance-quick-guide/#2-set-your-avoidance-parameters","title":"2. Set your avoidance parameters","text":"By right clicking on any waypoint, we can select Terrain Analysis. No internet connection is required if you already have cached imagery and DEM tiles.
On clicking Apply, the analysis will run.
"},{"location":"mwp-terrain-avoidance-quick-guide/#3-review-the-output","title":"3. Review the output","text":"The output is displayed as a chart of the terrain (green), the original mission (red), the avoidance margin (blue, 30m in this example), and the adjusted mission (orange). There is also a Climb / Dive analysis.
There are a few places that could benefit from further manual adjustment, but in general it looks pretty good.
So it looks good. Or does it?
"},{"location":"mwp-terrain-avoidance-quick-guide/#terrain-may-not-be-the-only-hazard","title":"Terrain may not be the only hazard","text":"The terrain analysis is only as good as the terrain data. If we zoom in closely, or look at a difference map source (e.g. OpenTopo), or examine the route in 3D (Google Earth) via flightlog2kml / mission2kml, maybe from fl2xui we can see another hazard. Between WP36-WP37 and WP47-WP48 there are high voltage overhead transmission lines. Hitting these, or at WP48, the tower would be sub-optimal.
A re-plan seems like a good idea, at least adding significant altitude on these legs of the mission.
"},{"location":"mwp-text-to-speech/","title":"Text to Speech","text":""},{"location":"mwp-text-to-speech/#overview","title":"Overview","text":"On all platforms, an external TTS
(Text to speech) application may be defined by the --voice-command
option. Alternately, on POSIX platforms, a speech library may be dynamically loaded at run time. This requires the desired speech library to have been available when mwp was compiled.
None of these provide very good speech synthesis
"},{"location":"mwp-text-to-speech/#external-commands","title":"External Commands","text":"You can use an external command on all platforms (it is the only option on Windows). Any external speech command should:
stdin
(standard input)stdin
for new text until it is closed.The simplest way is to add a --voice-command
line to your cmdopts file.
Examples:
# Espeak-ng\n--voice-command=\"espeak-ng\"\n
# Speech Dispatcher\n--voice-command=\"spd-say -t female2 -e\"\n
# piper-tts\n# Choose your model, I have like the Scottish lady ...\n#VMODEL=/usr/share/piper-voices/en/en_GB/jenny_dioco/medium/en_GB-jenny_dioco-medium.onnx\n#VMODEL=/usr/share/piper-voices/en/en_GB/aru/medium/en_GB-aru-medium.onnx\nVMODEL=/usr/share/piper-voices/en/en_GB/alba/medium/en_GB-alba-medium.onnx\n--voice-command=\"sh -c \\\"piper-tts -q --model $VMODEL --output-raw | aplay -q -r 22050 -f S16_LE -t raw -\\\"\"\n
In the piper-tts
example, (by far the best TTS for Linux), the voice model file is defined by an environment variable VMODEL
which is evaluated by mwp before the voice command is invoked, making it easy to test out different voices.
mwp can use the flite
text to speech engine directly (as well as espeak or speech-dispatcher. Flite is enabled if:
Flite is available at run-time if:
Unfortunately, it is non-trivial to detect the flite version at mwp build time.
Flite provides reasonable quality voices with low overhead, including some female voices.
"},{"location":"mwp-text-to-speech/#configuration","title":"Configuration","text":"Flite is configured using two gsettings
keys:
speech-api
Defines the speech API to be used, one of none
, espeak
, speechd
or flite
flite-voice
The voice file to be used. If not specified, the internal slt
(female) voice is used. The value takes the absolute path name to a voice file, optionally followed by a ,
and a floating point speed factor (see below) $ gsettings set org.stronnag.mwp speech-api flite\n$ gsettings set org.stronnag.mwp flite-voice-file /home/jrh/.config/mwp/cmu_us_clb.flitevox,0.9\n
"},{"location":"mwp-text-to-speech/#flite-discussion","title":"Flite Discussion","text":""},{"location":"mwp-text-to-speech/#voice-files","title":"Voice Files","text":"flite can use external voice files that provide better quality than the built-in voices. Your distro may provide these voice files in an optional package, or you can download from http://www.festvox.org, e.g. for flite 2.1 http://www.festvox.org/flite/packed/flite-2.1/voices/ (replace 2.1 with 2.0 etc., not all the 2.1 voices may exist for 2.0). The following script will bulk download the non-Indic voices; you can test them out with the flite
application.
#!/bin/bash\n\nBASE=http://www.festvox.org/flite/packed/flite-2.1/voices\n\nfor V in cmu_us_aew.flitevox cmu_us_ahw.flitevox cmu_us_aup.flitevox \\\n cmu_us_awb.flitevox cmu_us_axb.flitevox cmu_us_bdl.flitevox \\\n cmu_us_clb.flitevox cmu_us_eey.flitevox cmu_us_fem.flitevox \\\n cmu_us_gka.flitevox cmu_us_jmk.flitevox cmu_us_ksp.flitevox \\\n cmu_us_ljm.flitevox cmu_us_lnh.flitevox cmu_us_rms.flitevox \\\n cmu_us_rxr.flitevox cmu_us_slp.flitevox cmu_us_slt.flitevox\ndo\n wget -P . $BASE/$V\ndone\n
"},{"location":"mwp-text-to-speech/#replay-speed","title":"Replay Speed","text":"The default replay speed for some flite voices is rather slow. The optional rate setting in the gsettings flite-voice-file
key may be used to increase the rate.
master
version.trixie
, sid
), and contemporaneous derivatives.RELEASE
mwp_stderr_YYYY-MM-DD.txt
, e.g. $HOME/mwp_stderr_2021-12-28.txt
. Do not delete any information from this file; the contents are there for a purpose, or paste the terminal output into a file (or copy paste into the issue). The terminal output may include information from system components that are not the mwp log (e.g. GDK / GTK / Wayland messages).--raw-log
option.Issues that do not meet these information requirements most likely be ignored / closed without explanation.
"},{"location":"mwp_support/#unsupported","title":"Unsupported","text":"Problem reports on non-supported platforms may receive some consideration, however it's unlikely that too much time be expended on such environments unless the problem can also be demonstrated on a supported platform (or it's an interesting issue). Compliance with the Information requirements above is mandatory.
"},{"location":"mwp_video_player/","title":"Playing Video in mwp","text":"mwp provides support for live and replay video.
Legacy Images
The images this section are from legacy mwp, however the capability is the same.
"},{"location":"mwp_video_player/#live-stream-mode-gcs","title":"Live stream mode (GCS)","text":"There is now a Video Stream option under the view menu.
Selecting this option opens the source selection dialogue. Camera devices offering a \"video4linux\" interface (i.e most webcams) will be auto-detected. There is also the option to enter a URI, which could be a http
/https
, rtsp
or other standard streaming protocol, or even a file.
The selected source will then play in a separate window. This window will remain above the mwp application and can be resized, minimised and moved.
In stream mode, there are minimal video controls; a play/pause button and volume control. Note the volume is that of the video, the overall volume is controlled by the system volume control.
"},{"location":"mwp_video_player/#blackbox-replay-mode-bbl-replay","title":"Blackbox replay mode (BBL replay)","text":"The Blackbox log replay chooser also offers a video replay option.
Here the user can select a media file and start options, i.e. whether and when to start the video replay with respect to the start of the BB log replay.
When playing a file (vice a stream), the player gains a progress bar (which can be used to position the stream and \"beginning\" and \"end\" buttons.
"},{"location":"mwp_video_player/#other-os","title":"Other OS","text":"v4l2:///dev/video0
(for example) can be used in streaming mode if required.In order to replay log files, mwp has a number of external dependencies, in particular the flightlog2x fl2ltm
tool provided by the bbl2kml repository. As well as providing replay tools for mwp, the bbl2kml tools offer the facility to generate attractive animated KML / KMZ files for visualisation in google-earth.
Analysis
The RSSI view shows why the aircraft is playing \"failsafe ping-pong\" at the right extreme of flight
bbl2kml binary packages are provided for many popular platforms.
"},{"location":"replay-tools/#log-replay","title":"Log replay","text":"mwp can replay a number of \"flight log\" formats. Other artefacts such as mission files / safehomes / (geozones) can be displayed while the replay is in progress.
"},{"location":"replay-tools/#location-rebase","title":"Location rebase","text":"You may wish to obfuscate the location of log replay, particularly if you are publishing screen shots or vidoes. The --rebase
option allows this. --rebase
requires a latitude and longitude of the relocated position; the latitude and longitude may be separated by comma, semi-colon or space (the latter two quoted or shell escape) and may be decimal degrees or DD:MM:SS.ss format. The following would relocate a replay to Narita Airport in Japan (plausible denial, protect the innocent etc.):
mwp --rebase 35.761000,140.378945 -b reloc-test.TXT -m reloc-test.mission\nmwp --rebase 35.761000\\;140.378945 -b reloc-test.TXT -m reloc-test.mission\nmwp --rebase 35.761000\\ 140.378945 -b reloc-test.TXT -m reloc-test.mission\nmwp --rebase \"35:45:39.6N 140:22:44.2E\" -b reloc-test.TXT -m reloc-test.mission\n
Currently (March 2024) only flight logs and mission files are rebased. Safehomes (and Geozones) may also be relocated in future.
"},{"location":"replay-tools/#blackbox-replay","title":"Blackbox replay","text":"In order to replay blackbox logs, you additionally need inav blackbox tools, specifically blackbox_decode
). Binary packages are provided for many popular platforms. The minimum required version in 0.4.4, the latest release is recommended.
OpenTX enables the storage of CRSF and Smartport telemetry logs on a transmitter's SD-Card. These logs contain telemetry information transmitted from the flight controller.
mwp can replay these logs, in a similar manner to the replay of Blackbox or mwp logs, albeit with less detail and typically at lower data rates.
No addition software requirements.
"},{"location":"replay-tools/#bulletgcss-logs","title":"BulletGCSS Logs","text":"Requires that mwp is built with MQTT support.
No addition software requirements.
"},{"location":"replay-tools/#ardupilot-logs","title":"Ardupilot logs","text":"Requires Ardupilot's mavlogdump.py.
"},{"location":"replay-tools/#mwp-json-logs","title":"mwp JSON logs","text":"No addition requirements.
"},{"location":"replay-tools/#mwp-raw-logs","title":"mwp \"raw\" logs","text":"mwp \"raw\" logs are either recorded directly in mwp (--raw-log
) for indirectly using the external mwp-serial-cap
tool. The logs generated by mwp
and mwp-serial-cap
contain meta-data describing the size and time of each item recorded; mwp
can also play 3rd party logs that are 'plain' rw data (i.e. without any timing meta-data).
Recent versions of mwp
contain a \"Replay mwp RAW log\" menu item that automates the manual process described below. This provides a dialogue to select the raw log file and an optional delay which is applied every 16 bytes read.
Otherwise it is necessary to build and install mwp-log-replay
and run it outside of mwp,
# Start mwp as a UDP listener, port is arbitrary, here 40001 is chosen\n## -a connect immediately without user intervention\n## -d serial-device. No host part means it listens for remote connections\n## listen on UDP port 40001\n\nmwp -a -d udp://:40001\n\n# In another terminal (even other machine if you replace localhost with the machine running mwp)\n\nmwp-log-replay -d udp://localhost:40001 /path/to/my/logfile.raw\n
Raw logs containing MSP, LTM, MAVLink, CRSF and MPM Smartport and IBUS messages can be replayed.
"},{"location":"replay-tools/#display-of-rc-stick-positions","title":"Display of RC Stick positions","text":"Where such data is available (Blackbox, OTX/ETX logs), mwp can display the position of the 'sticks'. This is displayed in the bottom right corner of the map.
All the developer's tutorial videos are in a YouTube playlist. These refer to the legacy version.
"},{"location":"running/#graphical-user-interface","title":"Graphical User Interface","text":"Once you've built and / or installed mwp.
The install process installs an desktop icon and mwp.desktop
application file
The desktop
file tells the window manager where to find mwp and on modern desktop environments (e.g. Gnome Shell, xfce, kde), mwp will be added to the system application menu and / or 'finder'.
The mwp map and map symbols are 'touch-aware'.
mwp's command line options may be displayed with the --help
option:
$ mwp --help\nUsage:\n mwp [OPTION\u2026]\n\nHelp Options:\n -h, --help Show help options\n --help-all Show all help options\n --help-gapplication Show GApplication options\n\nApplication Options:\n -a, --auto-connect Legacy, ignored)\n --build-id show build id\n --centre=position Centre position (lat lon or named place)\n -H, --centre-on-home Centre on home\n --cli-file CLI File\n -c, --connect connect to first device (does not set auto flag)\n --debug-flags Debug flags (mask)\n -d, --device=device-name Serial device\n --dont-maximise Legacy, ignored\n --force-mag force mag for vehicle direction\n -t, --force-type=type-code_no Model type\n -4, --force4 Force ipv4\n --forward-to=device-name forward telemetry to\n --full-screen Legacy, ignored\n -k, --kmlfile=file-name KML file\n -m, --mission=file-name Mission file\n -M, --mod-points=N Modulo points to show in GPS trail\n -S, --n-points=N Number of points shown in GPS trail\n -N, --no-poll don't poll for nav info\n -T, --no-trail don't display GPS trail\n --offline force offline proxy mode\n --radar-device=device-name dedicated inav radar device\n -r, --raw-log log raw serial data to file\n --really-really-run-as-root no reason to ever use this\n --rebase=lat,lon rebase location (for replay)\n --relaxed-msp don't check MSP direction flag\n -b, --replay-bbox=file-name replay bbox log file\n -p, --replay-mwp=file-name replay mwp log file\n --rings=number,interval Range rings (number, interval(m)), e.g. --rings 10,20\n -s, --serial-device=device_name Serial device\n -v, --version show version\n --voice-command=command string External speech command\n
"},{"location":"running/#bash-completion","title":"Bash completion","text":"mwp installation also installs a 'bash completion' script. Note this is only available after you log in, so on first install, it's only available after the next login.
This facilitates automatic command completion, so you don't have to remember all the options or be always typing mwp --help
.
Typing mwp
and then <TAB>
will first display the option lead --
; then a subsequent <TAB><TAB>
will display all the options. If one then typed ra<TAB><TAB>
, it would complete to:
$ mwp --ra\n--radar-device --raw-log\n
Further entry (e.g. d
) would complete the command (--radar-device
).
Certain options, like --replay-bbox
, --mission
allow you to add a file to a running mwp. So if mwp was running, either from the command line or Desktop Environment icon, then (for example):
mwp --mission file-i-forgot.mission\n
would load the mission file-i-forgot.mission
into the running mwp rather than starting a new instance.
You can drag and drop relevant files onto the mwp map:
mwp can extract the following artefacts from a CLI File (diff
or dump
):
set
parameters affecting visualisation (nav_fw_land_approach_length
, nav_fw_loiter_radius
).The mwp main window and the main user interface elements are:
In the sections that follow, there will be a brief summary of each part; more detail will then provided in subsequent sections.
"},{"location":"ui/#menu-bar-1","title":"Menu Bar (1)","text":"The following tables summarise the available menu options. Where usage is not obvious, operation will be described later on.
"},{"location":"ui/#file-menu","title":"File Menu","text":"Item Usage Open Mission Offers a dialog to open a mission file Append Mission file Appends a mission to the current mission set (creates a multi-mission element) CLI File Loads CLI artefacts from a CLI File Save Mission Saves the mission to the current mission file, overwriting any extant content Save Mission As Saves the mission to a user selected file. For a multi-mission the user can choose not to save specified mission segments. Download Mission from FC Downs a (multi-) mission from the flight controller Upload Mission to FC > Upload Active Mission Uploads the current mission segment to the flight controller Upload Mission to FC > Upload All Missions Uploads all mission segments to the flight controller Restore Mission from EEPROM Restores the EEPROM stored mission from the flight controller Save Mission to EEPROM Saves the current mission segment(s) to the flight controller. The current active mission segment (in a multi-mission) is set as the active mission in the FC Replay mwp log Replay a mwp (JSON) log file Replay blackbox log Replays a Blackbox log file Replay OTX log Replays an OpenTX / EdgeTX CSV log file. (Also BulletGCSS and Ardupilot logs where available) Replay mwp RAW log Replay a mwp raw (binary) log file Stop Replay Stops a running replay Static Overlay > Load Loads a static KML format overlay file Static Overlay > Remove Removes a loaded KML file from the display Geozones Invokes the INAV Geozones editor Safe Homes Invokes the INAV safe-home editor Quit Cleanly quits the application, saving the display layout"},{"location":"ui/#edit-menu","title":"Edit Menu","text":"Item Usage Set FollowMe Point Displays the Follow Me dialogue Preferences Displays the preferences dialogue Survey / Area Planner Invokes the area-planner to generate search or survey plans as a mission. Mission Manager Display the multi-mission dialogue to remove segments from a multi-mission CLI serial terminal Displays the INAV CLI using the current connection Get FC Mission Info Display the mission status from a connected FC Seed current map Shows a dialogue to seed the map cache for offline (field) use Reboot FC Reboots a connected flight controller Audio Test Reads out the mwp version number as an audio test"},{"location":"ui/#view-menu","title":"View Menu","text":"Item Usage Zoom to Mission Zooms the map to the currently loaded mission Set location as default Sets the current location as the default (startup) location Centre on position ... Shows the \"Centre on Position\" selector and \"favourite places\" editor\" GPS Statistics Displays FC GPS status (rate, packets, errors, timeouts, HDOP/EPV/EPH) Radar View Displays the Radar (inav radar / ADS-B) view Telemetry Tracker Displays the Telemetry Tracker UI Flight Statistics Display the flight statistic dialogue (also automatic on disarm) Video Stream Opens the (live) video stream window GCS Location Displays the indicative GCS location icon"},{"location":"ui/#help-menu","title":"Help Menu","text":"Item Usage Online Manual Opens this document in the default browser Shortcut keys list Displays the short cut keys list About Displays version, author and copyright information"},{"location":"ui/#map-and-mission-settings-2","title":"Map and Mission Settings (2)","text":"A number of different map provides are available. mwp offers the mapping library (libshumate
) defaults, MapBox, Bing Map, and user defined options, for example anonymous maps.
Note that Bing Maps is deprecated, and MapBox will only be offered if the user has supplied a MapBox API key.
The zoom level may be selected from the control here, or by zooming the map with the mouse wheel.
The +Add WPs (Edit WPs) button enables mission edit mode (click on the map to create a WP, drag to move, right mouse button for properties). Graphical WP editing may be augmented by the table orientated mission table view, which allows additional control (altitude, speed, special functions, for example fly-by-home waypoints).
The \"Active Mission\" drop down supports INAV 4.0+ multi-mission. There is also a mission manager item under the Edit menu.
"},{"location":"ui/#communications-and-telemetry-settings-3","title":"Communications and telemetry settings (3)","text":"There is a (blue \"!\" in the example) 'navigation safe' status icon. If this icon is shown (i.e. navigation is unsafe, then clicking on the item will provide more information:
The Device drop-down offers detected and pre-set (Preferences) devices for the FC / telemetry port. The device syntax is described the Device and Protocol definition chapter.
The Protocol Selection drop-down (showing Auto in the reference image) allows the user to provide a hint as to communication protocols available on Device. These are further described in the Device and Protocol definition article.
The Connect / Disconnect button connects / disconnects the displayed device.
The auto button causes mwp to automatically attempt to connect to the nominated device.
"},{"location":"ui/#side-bar-visibility-4","title":"Side Bar Visibility (4)","text":"Toggling this button will hide or show the side bar (6).
"},{"location":"ui/#map-area-5","title":"Map Area (5)","text":"The map area displays the currently selected map at the desired zoom level. The map may be managed using familiar controls (drag, scroll wheel etc).
"},{"location":"ui/#side-bar-elements-6","title":"Side Bar elements (6)","text":"The side bar displays a set if user defined UI elements (\"dockets\") that display flight / sensor information.
See Side Bar Management. In the main window screen shot (left to right, top to bottom) we have:
The location of the mouse pointer on the map. Position in the user's preferred format and ground elevation are shown.
"},{"location":"ui/#fc-information-8","title":"FC Information (8)","text":"Displays the firmware, version and build with API information, profile and flight mode.
"},{"location":"ui/#vehicle-visualisation-9","title":"Vehicle Visualisation (9)","text":"auto-follow
. whether the map always displays the aircraft icon and tracks (requires GPS).audio-on-arm
. Whether to \"speak\" status information.The green / red bars show gyro / acc / baro / mag / gps / sonar sensor status. If a required sensor fails, a map annotation will be displayed, together with an audible alarm (image from legacy version).
"}]} \ No newline at end of file diff --git a/sitemap.xml.gz b/sitemap.xml.gz index e0910e06..eef7c5ca 100644 Binary files a/sitemap.xml.gz and b/sitemap.xml.gz differ