diff --git a/Tools/px4airframes/markdownout.py b/Tools/px4airframes/markdownout.py
index e48f078c66..8903d4e6d0 100644
--- a/Tools/px4airframes/markdownout.py
+++ b/Tools/px4airframes/markdownout.py
@@ -1,8 +1,9 @@
from xml.sax.saxutils import escape
import codecs
+import os
class MarkdownTablesOutput():
- def __init__(self, groups, board):
+ def __init__(self, groups, board, image_path):
result = ("# Airframes Reference\n"
"> **Note** **This list is auto-generated from the source code**.\n"
"> \n"
@@ -28,7 +29,8 @@ class MarkdownTablesOutput():
image_name = group.GetImageName()
result += '
\n'
if image_name != 'AirframeUnknown':
- result += '

\n' % (image_name)
+ image_name = os.path.join(image_path, image_name)
+ result += '

\n' % (image_name)
# check if all outputs are equal for the group: if so, show them
# only once
diff --git a/Tools/px_process_airframes.py b/Tools/px_process_airframes.py
index 4f3c74bea4..1adf977fa8 100755
--- a/Tools/px_process_airframes.py
+++ b/Tools/px_process_airframes.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
############################################################################
#
-# Copyright (C) 2013-2015 PX4 Development Team. All rights reserved.
+# Copyright (C) 2013-2017 PX4 Development Team. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@@ -35,10 +35,11 @@
#
# PX4 airframe config processor (main executable file)
#
-# This tool scans the PX4 source code for declarations of airframes
+# This tool scans the PX4 ROMFS code for declarations of airframes
#
# Currently supported formats are:
# * XML for the parametric UI generator
+# * Markdown for the PX4 dev guide (https://github.com/PX4/Devguide)
#
#
@@ -67,6 +68,12 @@ def main():
metavar="FILENAME",
help="Create Markdown file"
" (default FILENAME: airframes_reference.md)")
+ default_image_path = '../../assets/airframes/types'
+ parser.add_argument("-i", "--image-path",
+ default=default_image_path,
+ metavar="IMAGEPATH",
+ help="HTML image path for Markdown (containing the airframe svg files)"
+ " (default IMAGEPATH: "+default_image_path+")")
parser.add_argument("-s", "--start-script",
nargs='?',
const="rc.autostart",
@@ -108,7 +115,7 @@ def main():
# Output to markdown file
if args.markdown:
if args.verbose: print("Creating markdown file " + args.markdown)
- out = markdownout.MarkdownTablesOutput(param_groups, args.board)
+ out = markdownout.MarkdownTablesOutput(param_groups, args.board, args.image_path)
out.Save(args.markdown)
if args.start_script: