cockpit
cockpit copied to clipboard
data-lake: provide access to autopilot parameters
- Accessing parameter values would allow more robust treatment of dynamic behaviour controls
- e.g. the
RELAY1_PINparameter value could be used to determine whichSERVO_OUTPUT_RAWMAVLink message value should be read as part of the feedback for implementing relay toggle functionality
- e.g. the
- Setting parameter values would allow deeper configuration of autopilot functionalities through Cockpit without requiring them to be built into the application
- e.g. setting
BARO_SPEC_GRAVbased on estimated/measured water density at the start of an ROV dive would improve depth estimates, and because the value may change every dive it seems reasonable to include in the control station software rather than relegating it to BlueOS - this could be extra useful for custom vehicle support, to provide nice access to configuration without needing a custom Cockpit build
- this is likely more complicated than reading, especially given setting some parameters requires rebooting the autopilot, so it's understandable if this is left for a second phase of implementation
- e.g. setting
As an extension of this idea, we could also determine relevant pins from the SERVOn_FUNCTION parameters to set calculated data-lake values representing output pins.
At least if the parameters were accessible we'd be able to do that via a workaround with compound variables, e.g.
Lights1 Pin:
output_assignments = [
{{ params/SERVO1_FUNCTION }},
{{ params/SERVO2_FUNCTION }},
...
{{ params/SERVO16_FUNCTION }},
]
lights1_func = 181;
lights1_pin = output_assignments.indexOf(lights1_func);
return lights1_pin != -1 ? lights1_pin : NaN;
or determining several within a JS Action, but it could be nice to provide that automatically (respecting different autopilot firmware types, and their corresponding outputs) 🤷♂️