2018-08-27 06:40:32 -03:00
|
|
|
# Cerberus Validation Schema for module configuration files.
|
|
|
|
# See http://docs.python-cerberus.org/en/stable/validation-rules.html
|
|
|
|
|
|
|
|
|
|
|
|
module_name:
|
|
|
|
# human-readable module name (used for descriptions, can contain spaces)
|
|
|
|
type: string
|
|
|
|
required: true
|
|
|
|
|
|
|
|
serial_config:
|
|
|
|
# UART configuration (optional)
|
|
|
|
# A module can register autostart command(s) that are associated with a
|
|
|
|
# configuration parameter, so that a user can select on which serial port to
|
|
|
|
# run the command.
|
|
|
|
# One or several commands can be defined.
|
|
|
|
type: list
|
|
|
|
minlength: 1
|
|
|
|
schema:
|
|
|
|
type: dict
|
|
|
|
schema:
|
|
|
|
command:
|
|
|
|
# script command that is executed on autostart.
|
|
|
|
# These variables can be used:
|
|
|
|
# ${SERIAL_DEV} Serial device (e.g. /dev/ttyS1)
|
|
|
|
# ${BAUD_PARAM} param name for the baudrate
|
|
|
|
# ${i} instance in [0, N-1] (for multi-instance commands)
|
|
|
|
# It's possible to use multiple lines.
|
|
|
|
type: string
|
|
|
|
required: true
|
|
|
|
|
|
|
|
port_config_param:
|
|
|
|
# Parameter definition to configure on which port to run the
|
|
|
|
# command
|
|
|
|
type: dict
|
|
|
|
required: true
|
|
|
|
schema:
|
|
|
|
name:
|
|
|
|
# Parameter name (e.g. TEL_FRSKY_CONFIG, MAV_${i}_CONFIG)
|
|
|
|
type: string
|
2018-09-27 06:03:59 -03:00
|
|
|
regex: '[0-9A-Z_]+(\$\{i\}[0-9A-Z_]*)?_(CONFIG|CFG)'
|
2018-08-27 06:40:32 -03:00
|
|
|
required: true
|
|
|
|
group:
|
|
|
|
# Associated parameter group (e.g. GPS)
|
|
|
|
type: string
|
|
|
|
required: true
|
|
|
|
default:
|
|
|
|
# Default value(s). This can be a string to specify the
|
|
|
|
# serial tag (e.g. GPS1, TEL1, ...) or a list of strings
|
|
|
|
# for multiple instances.
|
|
|
|
# If omitted, the command is disabled by default.
|
|
|
|
anyof:
|
|
|
|
- type: string
|
|
|
|
- type: list
|
|
|
|
minlength: 1
|
|
|
|
schema:
|
|
|
|
type: string
|
2019-07-05 09:13:58 -03:00
|
|
|
depends_on_port:
|
|
|
|
# Optional serial tag dependency (e.g. GPS1). If a board
|
|
|
|
# does not specify this serial port, the parameter will
|
|
|
|
# not be included in the build (i.e. it's not
|
|
|
|
# configurable)
|
|
|
|
type: string
|
|
|
|
description_extended:
|
|
|
|
# Optional extended description
|
|
|
|
type: string
|
2018-08-27 06:40:32 -03:00
|
|
|
label:
|
|
|
|
# Optional command label (e.g. used in the autostart script).
|
|
|
|
# If omitted, module_name is used.
|
|
|
|
type: string
|
|
|
|
num_instances:
|
|
|
|
# Allow to configure and run multiple instances of a command.
|
|
|
|
# For multiple instances, '${i}' can be used to refer to
|
|
|
|
# an instance, for example in the parameter name or script
|
|
|
|
# command.
|
|
|
|
# Default: 1
|
|
|
|
type: integer
|
|
|
|
min: 1
|
|
|
|
|
2018-09-04 10:04:11 -03:00
|
|
|
|
2018-08-27 06:40:32 -03:00
|
|
|
parameters:
|
2018-09-04 10:04:11 -03:00
|
|
|
# Parameter definitions.
|
|
|
|
# This is a list of parameter groups, where each group has one or more
|
|
|
|
# parameter definitions.
|
2018-08-27 06:40:32 -03:00
|
|
|
type: list
|
2018-09-04 10:04:11 -03:00
|
|
|
minlength: 1
|
|
|
|
schema:
|
|
|
|
type: dict
|
|
|
|
schema:
|
|
|
|
group:
|
|
|
|
# Parameter group (should be short)
|
|
|
|
# This applies to all parameters in the definitions dictionary
|
|
|
|
type: string
|
|
|
|
required: true
|
|
|
|
definitions:
|
|
|
|
type: dict
|
|
|
|
keyschema:
|
|
|
|
type: string
|
|
|
|
regex: '[0-9A-Z_]+(\$\{i\}[0-9A-Z_]*)?'
|
|
|
|
valueschema:
|
|
|
|
type: dict
|
|
|
|
schema:
|
|
|
|
description:
|
|
|
|
type: dict
|
|
|
|
required: true
|
|
|
|
schema:
|
|
|
|
short:
|
|
|
|
# Short description (one line)
|
|
|
|
type: string
|
|
|
|
required: true
|
|
|
|
long:
|
|
|
|
# Long description (can be multiple lines)
|
|
|
|
type: string
|
|
|
|
required: true
|
|
|
|
|
|
|
|
type:
|
|
|
|
# Define the parameter type
|
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
allowed: ['int32', 'float', 'boolean', 'enum', 'bitmask' ]
|
|
|
|
min:
|
|
|
|
# Optional minimum value (only for int32 or float)
|
|
|
|
type: number
|
|
|
|
max:
|
|
|
|
# Optional maximum value (only for int32 or float)
|
|
|
|
type: number
|
2019-09-02 13:27:51 -03:00
|
|
|
decimal:
|
|
|
|
# Optional number of decimal places to display (only for float)
|
|
|
|
type: number
|
|
|
|
increment:
|
|
|
|
# Optional increment step size (for a GCS) (only for float)
|
|
|
|
type: number
|
2018-09-04 10:04:11 -03:00
|
|
|
unit:
|
|
|
|
# Optional parameter unit (only for int32 or float)
|
|
|
|
# (Extend this list as needed)
|
|
|
|
type: string
|
|
|
|
allowed: [
|
|
|
|
'%', 'Hz', 'mAh',
|
2020-08-24 06:33:08 -03:00
|
|
|
'rad', '%/rad', 'rad/s', 'rad/s^2', '%/rad/s', 'rad s^2/m','rad s/m',
|
2018-09-04 10:04:11 -03:00
|
|
|
'bit/s', 'B/s',
|
|
|
|
'deg', 'deg*1e7', 'deg/s',
|
|
|
|
'celcius', 'gauss', 'gauss/s', 'mgauss', 'mgauss^2',
|
2020-08-24 06:33:08 -03:00
|
|
|
'hPa', 'kg', 'kg/m^2', 'kg m^2',
|
|
|
|
'mm', 'm', 'm/s', 'm^2', 'm/s^2', 'm/s^3', 'm/s^2/sqrt(Hz)', 'm/s/rad',
|
2019-11-07 10:59:12 -04:00
|
|
|
'Ohm', 'V',
|
2020-08-24 06:33:08 -03:00
|
|
|
'us', 'ms', 's',
|
|
|
|
'S', 'A/%', '(m/s^2)^2', 'm/m', 'tan(rad)^2', '(m/s)^2', 'm/rad',
|
|
|
|
'm/s^3/sqrt(Hz)', 'm/s/sqrt(Hz)', 's/(1000*PWM)', '%m/s', 'min', 'us/C',
|
|
|
|
'N/(m/s)', 'Nm/(rad/s)', 'Nm', 'N',
|
|
|
|
'normalized_thrust/s', 'normalized_thrust', 'norm', 'SD']
|
2018-09-04 10:04:11 -03:00
|
|
|
bit:
|
|
|
|
# description of all bits for type bitmask.
|
|
|
|
# The first bit is 0.
|
|
|
|
type: dict
|
|
|
|
keyschema:
|
|
|
|
type: integer
|
|
|
|
valueschema:
|
|
|
|
type: string
|
|
|
|
|
|
|
|
values:
|
|
|
|
# enumeration of possible values for type enum
|
|
|
|
type: dict
|
|
|
|
keyschema:
|
|
|
|
type: integer
|
|
|
|
valueschema:
|
|
|
|
type: string
|
|
|
|
|
|
|
|
default:
|
|
|
|
# Default value(s). This is an integer or a float,
|
|
|
|
# or a list of values for multiple instances.
|
|
|
|
required: true
|
|
|
|
anyof:
|
|
|
|
- type: boolean
|
|
|
|
- type: number
|
|
|
|
- type: list
|
|
|
|
minlength: 1
|
|
|
|
schema:
|
|
|
|
anyof:
|
|
|
|
- type: boolean
|
|
|
|
- type: number
|
|
|
|
- type: list
|
|
|
|
|
|
|
|
category:
|
|
|
|
# Optional parameter category
|
|
|
|
type: string
|
|
|
|
allowed: [ 'Developer', 'System' ]
|
|
|
|
volatile:
|
|
|
|
# Optional volatile flag. Set to true if the
|
|
|
|
# parameter can be changed by the system
|
|
|
|
# automatially
|
|
|
|
type: boolean
|
|
|
|
reboot_required:
|
|
|
|
# set to true, if changing of the parameter requires
|
|
|
|
# a reboot to take effect
|
|
|
|
type: boolean
|
|
|
|
num_instances:
|
|
|
|
# Optional number of instances.
|
|
|
|
# For multiple instances, '${i}' can be used to
|
|
|
|
# refer to an instance, for example in the parameter
|
|
|
|
# name or description.
|
|
|
|
# Default: 1
|
|
|
|
type: integer
|
|
|
|
min: 1
|
|
|
|
instance_start:
|
|
|
|
# The value of the first instance for multiple
|
|
|
|
# instances, used in '${i}'. If 0, ${i} expands to
|
|
|
|
# [0, N-1]
|
|
|
|
# Default: 0
|
|
|
|
type: integer
|
|
|
|
|
2018-08-27 06:40:32 -03:00
|
|
|
|