mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 19:07:45 +08:00
linux_pwm_out: add dynamic mixing support
This commit is contained in:
@@ -37,6 +37,8 @@ px4_add_module(
|
|||||||
COMPILE_FLAGS
|
COMPILE_FLAGS
|
||||||
SRCS
|
SRCS
|
||||||
linux_pwm_out.cpp
|
linux_pwm_out.cpp
|
||||||
|
MODULE_CONFIG
|
||||||
|
module.yaml
|
||||||
DEPENDS
|
DEPENDS
|
||||||
output_limit
|
output_limit
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -44,9 +44,11 @@ LinuxPWMOut::LinuxPWMOut() :
|
|||||||
_cycle_perf(perf_alloc(PC_ELAPSED, MODULE_NAME": cycle")),
|
_cycle_perf(perf_alloc(PC_ELAPSED, MODULE_NAME": cycle")),
|
||||||
_interval_perf(perf_alloc(PC_INTERVAL, MODULE_NAME": interval"))
|
_interval_perf(perf_alloc(PC_INTERVAL, MODULE_NAME": interval"))
|
||||||
{
|
{
|
||||||
|
if (!_mixing_output.useDynamicMixing()) {
|
||||||
_mixing_output.setAllMinValues(PWM_DEFAULT_MIN);
|
_mixing_output.setAllMinValues(PWM_DEFAULT_MIN);
|
||||||
_mixing_output.setAllMaxValues(PWM_DEFAULT_MAX);
|
_mixing_output.setAllMaxValues(PWM_DEFAULT_MAX);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
LinuxPWMOut::~LinuxPWMOut()
|
LinuxPWMOut::~LinuxPWMOut()
|
||||||
{
|
{
|
||||||
@@ -154,8 +156,8 @@ void LinuxPWMOut::update_params()
|
|||||||
{
|
{
|
||||||
updateParams();
|
updateParams();
|
||||||
|
|
||||||
// skip update when armed
|
// skip update when armed or dynamic mixing enabled
|
||||||
if (_mixing_output.armed().armed) {
|
if (_mixing_output.armed().armed || _mixing_output.useDynamicMixing()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
module_name: PWM Output
|
||||||
|
actuator_output:
|
||||||
|
output_groups:
|
||||||
|
- param_prefix: PWM
|
||||||
|
channel_label: 'PWM Actuator'
|
||||||
|
standard_params:
|
||||||
|
disarmed: { min: 800, max: 2200, default: 900 }
|
||||||
|
min: { min: 800, max: 1400, default: 1000 }
|
||||||
|
max: { min: 1600, max: 2200, default: 2000 }
|
||||||
|
failsafe: { min: 800, max: 2200 }
|
||||||
|
num_channels: 8
|
||||||
|
|
||||||
Reference in New Issue
Block a user