mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-27 18:27:05 +08:00
generate_actuators_metadata.py: add mixer rules support
This commit is contained in:
@@ -417,10 +417,18 @@ def get_mixers(yaml_config, output_functions, verbose):
|
|||||||
|
|
||||||
if verbose:
|
if verbose:
|
||||||
print('Mixer configs: {}'.format(config))
|
print('Mixer configs: {}'.format(config))
|
||||||
|
|
||||||
|
rules = []
|
||||||
|
for rule in yaml_config['mixer'].get('rules', []):
|
||||||
|
rules.append({k.replace('_','-'): v for k, v in rule.items()})
|
||||||
|
|
||||||
|
if verbose:
|
||||||
|
print('Mixer rules: {}'.format(rules))
|
||||||
|
|
||||||
mixers = {
|
mixers = {
|
||||||
'actuator-types': actuator_types,
|
'actuator-types': actuator_types,
|
||||||
'config': config,
|
'config': config,
|
||||||
|
'rules': rules,
|
||||||
}
|
}
|
||||||
return mixers
|
return mixers
|
||||||
|
|
||||||
|
|||||||
@@ -498,6 +498,12 @@ mixer:
|
|||||||
type: integer
|
type: integer
|
||||||
function:
|
function:
|
||||||
type: string
|
type: string
|
||||||
|
identifier:
|
||||||
|
# for rules
|
||||||
|
type: string
|
||||||
|
rules:
|
||||||
|
# mixer rules, validated by the mavlink actuator component information schema
|
||||||
|
type: list
|
||||||
config:
|
config:
|
||||||
# Airframe types
|
# Airframe types
|
||||||
type: dict
|
type: dict
|
||||||
@@ -526,6 +532,8 @@ mixer:
|
|||||||
schema:
|
schema:
|
||||||
actuator_type:
|
actuator_type:
|
||||||
type: string
|
type: string
|
||||||
|
group_label:
|
||||||
|
type: string
|
||||||
count:
|
count:
|
||||||
# param name or fixed count
|
# param name or fixed count
|
||||||
oneof:
|
oneof:
|
||||||
|
|||||||
Reference in New Issue
Block a user