diff --git a/doc/README.md b/doc/README.md index cdad2268aa..f9d4b39aa7 100644 --- a/doc/README.md +++ b/doc/README.md @@ -7,10 +7,11 @@ Files: - **mavlink.php**: Generates online documentation from MAVLink XML - http://mavlink.org/messages/common - **mavlink_to_html_table.xsl**: XSL transform used by **mavlink.php** - **mavlink.css**: CSS used by online documentation -- **mavlink_gitbook.py**: Generates documentation from MAVLink XML that can be imported into gitbook - - **mavlink_to_html_table_gitbook.xsl**: XSL transform used by **mavlink_gitbook.py** +- **mavlink_xml_to_markdown.py**: Converts MAVLink XML to markdown +- **mavlink_gitbook.py** (Deprecated): Generates documentation from MAVLink XML that can be imported into gitbook - replaced by mavlink_xml_to_markdown.py + - **mavlink_to_html_table_gitbook.xsl** (Deprecated): XSL transform used by **mavlink_gitbook.py** For more information, please visit: https://mavlink.io/en/ -(c) 2009-2010 Lorenz Meier / PIXHAWK Team +(c) 2009-2023 Lorenz Meier / PIXHAWK Team diff --git a/doc/mavlink_xml_to_markdown.py b/doc/mavlink_xml_to_markdown.py index 0f5c2769a1..bf1ca95869 100644 --- a/doc/mavlink_xml_to_markdown.py +++ b/doc/mavlink_xml_to_markdown.py @@ -417,6 +417,7 @@ def __init__(self, soup, parent, extension): self.default = None self.minValue = None self.maxValue = None + self.multiplier = None self.extension = extension for attr, value in soup.attrs.items(): # We do it this way to catch all of them. New additions will throw debug @@ -442,6 +443,8 @@ def __init__(self, soup, parent, extension): self.minValue = value elif attr == 'maxValue': self.maxValue = value + elif attr == 'multiplier': + self.multiplier = value else: print( f"Debug: MAVField: Unexpected attribute: {attr}, Value: {value}") @@ -481,12 +484,13 @@ def __init__(self, soup, parent, extension): parent.fieldnames.add('default') if self.invalid: parent.fieldnames.add('invalid') - + if self.multiplier: + parent.fieldnames.add('multiplier') # self.debug() def debug(self): print( - f"Debug_Field- name ({self.name}), type ({self.type}), desc({self.description}), units({self.units}), display({self.display}), instance({self.instance})") + f"Debug_Field- name ({self.name}), type ({self.type}), desc({self.description}), units({self.units}), display({self.display}), instance({self.instance}), multiplier({self.multiplier})") # TODO - display, instance, are not output. @@ -579,9 +583,13 @@ def getMarkdown(self, currentDialect): tableHeadings.append('Type') valueHeading = False unitsHeading = False + multiplierHeading = False if any(field in self.fieldnames for field in ('units',)): unitsHeading = True tableHeadings.append('Units') + if any(field in self.fieldnames for field in ('multiplier',)): + multiplierHeading = True + tableHeadings.append('Multiplier') if any(field in self.fieldnames for field in ('enum', 'invalid, maxValue, minValue, default')): valueHeading = True tableHeadings.append('Values') @@ -595,7 +603,8 @@ def getMarkdown(self, currentDialect): row.append(f"`{field.type}`") if unitsHeading: row.append(f"{field.units if field.units else ''}") - + if multiplierHeading: + row.append(f"{field.multiplier if field.multiplier else ''}") if valueHeading: # Values: #invalid, default, minValue, maxValue. values = [] @@ -767,6 +776,7 @@ def __init__(self, soup, parent): self.description = None self.reserved = None self.default = None + self.multiplier = None for attr, value in soup.attrs.items(): # We do it this way to catch all of them. New additions will throw debug @@ -788,6 +798,8 @@ def __init__(self, soup, parent): self.reserved = True # TODO is it ever reserved by default, and if so make happen elif attr == 'default': self.default = value # TODO is it ever default by default, and if so make happen? + elif attr == 'multiplier': + self.multiplier = value else: print( f"Debug: MAVCommandParam: Unexpected attribute: {attr}, Value: {value}") @@ -813,7 +825,8 @@ def __init__(self, soup, parent): parent.param_fieldnames.add('increment') if self.enum: parent.param_fieldnames.add('enum') - + if self.multiplier: + parent.param_fieldnames.add('multiplier') class MAVCommand(object): def __init__(self, soup, basename): @@ -876,12 +889,16 @@ def getMarkdown(self, currentDialect): tableHeadings.append('Description') valueHeading = False unitsHeading = False + multiplierHeading = False if any(field in self.param_fieldnames for field in ('enum', 'minValue', 'maxValue', 'increment')): valueHeading = True tableHeadings.append('Values') if 'units' in self.param_fieldnames: unitsHeading = True tableHeadings.append('Units') + if 'multiplier' in self.param_fieldnames: + multiplierHeading = True + tableHeadings.append('Multiplier') tableRows = [] for param in self.params: @@ -910,6 +927,12 @@ def getMarkdown(self, currentDialect): unitsString = param.units row.append(unitsString) + if multiplierHeading: + multiplierString = " " + if param.multiplier: + multiplierString = param.multiplier + row.append(multiplierString) + tableRows.append(row) # print("debugtablerows") diff --git a/message_definitions/v1.0/development.xml b/message_definitions/v1.0/development.xml index 15bdedc4ea..4610361f50 100644 --- a/message_definitions/v1.0/development.xml +++ b/message_definitions/v1.0/development.xml @@ -376,6 +376,18 @@ Empty Empty + + Set an external estimate of wind direction and speed. + This might be used to provide an initial wind estimate to the estimator (EKF) in the case where the vehicle is wind dead-reckoning, extending the time when operating without GPS before before position drift builds to an unsafe level. For this use case the command might reasonably be sent every few minutes when operating at altitude, and the value is cleared if the estimator resets itself. + + Horizontal wind speed. + Estimated 1 sigma accuracy of wind speed. Set to NaN if unknown. + Azimuth (relative to true north) from where the wind is blowing. + Estimated 1 sigma accuracy of wind direction. Set to NaN if unknown. + Empty + Empty + Empty + These flags indicate the sensor reporting capabilities for TARGET_ABSOLUTE.