diff --git a/src/drivers/dshot/DShot.h b/src/drivers/dshot/DShot.h index 225d71b3ba..7fdb6c85b8 100644 --- a/src/drivers/dshot/DShot.h +++ b/src/drivers/dshot/DShot.h @@ -140,7 +140,7 @@ private: void update_telemetry_num_motors(); - MixingOutput _mixing_output{DIRECT_PWM_OUTPUT_CHANNELS, *this, MixingOutput::SchedulingPolicy::Auto, false, false}; + MixingOutput _mixing_output{"PWM_FMU", DIRECT_PWM_OUTPUT_CHANNELS, *this, MixingOutput::SchedulingPolicy::Auto, false, false}; Telemetry *_telemetry{nullptr}; diff --git a/src/drivers/linux_pwm_out/linux_pwm_out.hpp b/src/drivers/linux_pwm_out/linux_pwm_out.hpp index 79755dcd69..a34012ba98 100644 --- a/src/drivers/linux_pwm_out/linux_pwm_out.hpp +++ b/src/drivers/linux_pwm_out/linux_pwm_out.hpp @@ -85,7 +85,7 @@ private: void update_params(); - MixingOutput _mixing_output{MAX_ACTUATORS, *this, MixingOutput::SchedulingPolicy::Auto, false}; + MixingOutput _mixing_output{"PWM", MAX_ACTUATORS, *this, MixingOutput::SchedulingPolicy::Auto, false}; uORB::SubscriptionInterval _parameter_update_sub{ORB_ID(parameter_update), 1_s}; diff --git a/src/drivers/pca9685_pwm_out/main.cpp b/src/drivers/pca9685_pwm_out/main.cpp index cd4d2a7b28..391e198455 100644 --- a/src/drivers/pca9685_pwm_out/main.cpp +++ b/src/drivers/pca9685_pwm_out/main.cpp @@ -115,7 +115,7 @@ protected: uORB::SubscriptionInterval _parameter_update_sub{ORB_ID(parameter_update), 1_s}; - MixingOutput _mixing_output{PCA9685_PWM_CHANNEL_COUNT, *this, MixingOutput::SchedulingPolicy::Disabled, true}; + MixingOutput _mixing_output{"PCA9685", PCA9685_PWM_CHANNEL_COUNT, *this, MixingOutput::SchedulingPolicy::Disabled, true}; }; PCA9685Wrapper::PCA9685Wrapper(int schd_rate_limit) : diff --git a/src/drivers/pwm_out/PWMOut.hpp b/src/drivers/pwm_out/PWMOut.hpp index a58d739a01..a3e03d4003 100644 --- a/src/drivers/pwm_out/PWMOut.hpp +++ b/src/drivers/pwm_out/PWMOut.hpp @@ -129,7 +129,7 @@ private: static const int MAX_PER_INSTANCE{8}; - MixingOutput _mixing_output{FMU_MAX_ACTUATORS, *this, MixingOutput::SchedulingPolicy::Auto, true}; + MixingOutput _mixing_output{"PWM_FMU", FMU_MAX_ACTUATORS, *this, MixingOutput::SchedulingPolicy::Auto, true}; uint32_t _backup_schedule_interval_us{1_s}; diff --git a/src/drivers/pwm_out_sim/PWMSim.hpp b/src/drivers/pwm_out_sim/PWMSim.hpp index 42a2d5dde4..7f22a17b11 100644 --- a/src/drivers/pwm_out_sim/PWMSim.hpp +++ b/src/drivers/pwm_out_sim/PWMSim.hpp @@ -77,7 +77,7 @@ private: static constexpr uint16_t PWM_SIM_PWM_MIN_MAGIC = 1000; static constexpr uint16_t PWM_SIM_PWM_MAX_MAGIC = 2000; - MixingOutput _mixing_output{MAX_ACTUATORS, *this, MixingOutput::SchedulingPolicy::Auto, false, false}; + MixingOutput _mixing_output{"PWM_SIM", MAX_ACTUATORS, *this, MixingOutput::SchedulingPolicy::Auto, false, false}; uORB::SubscriptionInterval _parameter_update_sub{ORB_ID(parameter_update), 1_s}; }; diff --git a/src/drivers/px4io/px4io.cpp b/src/drivers/px4io/px4io.cpp index 8dc09e4b46..9b7663d624 100644 --- a/src/drivers/px4io/px4io.cpp +++ b/src/drivers/px4io/px4io.cpp @@ -235,7 +235,7 @@ private: bool _test_fmu_fail{false}; ///< To test what happens if IO loses FMU bool _in_test_mode{false}; ///< true if PWM_SERVO_ENTER_TEST_MODE is active - MixingOutput _mixing_output{PX4IO_MAX_ACTUATORS, *this, MixingOutput::SchedulingPolicy::Auto, true}; + MixingOutput _mixing_output{"PWM_MAIN", PX4IO_MAX_ACTUATORS, *this, MixingOutput::SchedulingPolicy::Auto, true}; bool _pwm_min_configured{false}; bool _pwm_max_configured{false}; diff --git a/src/drivers/tap_esc/TAP_ESC.cpp b/src/drivers/tap_esc/TAP_ESC.cpp index 72caf5b058..cca2219384 100644 --- a/src/drivers/tap_esc/TAP_ESC.cpp +++ b/src/drivers/tap_esc/TAP_ESC.cpp @@ -36,7 +36,7 @@ TAP_ESC::TAP_ESC(char const *const device, uint8_t channels_count): CDev(TAP_ESC_DEVICE_PATH), OutputModuleInterface(MODULE_NAME, px4::serial_port_to_wq(device)), - _mixing_output{channels_count, *this, MixingOutput::SchedulingPolicy::Auto, true}, + _mixing_output{"TAP_ESC", channels_count, *this, MixingOutput::SchedulingPolicy::Auto, true}, _channels_count(channels_count) { strncpy(_device, device, sizeof(_device) - 1); diff --git a/src/drivers/uavcan/uavcan_main.hpp b/src/drivers/uavcan/uavcan_main.hpp index cdfe5c888d..8ea0e816f9 100644 --- a/src/drivers/uavcan/uavcan_main.hpp +++ b/src/drivers/uavcan/uavcan_main.hpp @@ -104,7 +104,7 @@ private: friend class UavcanNode; pthread_mutex_t &_node_mutex; UavcanEscController &_esc_controller; - MixingOutput _mixing_output{MAX_ACTUATORS, *this, MixingOutput::SchedulingPolicy::Auto, false, false}; + MixingOutput _mixing_output{"UAVCAN_EC", MAX_ACTUATORS, *this, MixingOutput::SchedulingPolicy::Auto, false, false}; }; /** diff --git a/src/drivers/uavcan_v1/Uavcan.hpp b/src/drivers/uavcan_v1/Uavcan.hpp index 9c2ab4c42c..500a5e9845 100644 --- a/src/drivers/uavcan_v1/Uavcan.hpp +++ b/src/drivers/uavcan_v1/Uavcan.hpp @@ -110,7 +110,7 @@ private: pthread_mutex_t &_node_mutex; UavcanEscController &_esc_controller; // UavcanServoController &_servo_controller; - MixingOutput _mixing_output{MAX_ACTUATORS, *this, MixingOutput::SchedulingPolicy::Auto, false, false}; + MixingOutput _mixing_output{"UCAN1_ESC", MAX_ACTUATORS, *this, MixingOutput::SchedulingPolicy::Auto, false, false}; }; class UavcanNode : public ModuleParams, public px4::ScheduledWorkItem diff --git a/src/lib/mixer_module/mixer_module.cpp b/src/lib/mixer_module/mixer_module.cpp index 6ed5d25734..ed24534b16 100644 --- a/src/lib/mixer_module/mixer_module.cpp +++ b/src/lib/mixer_module/mixer_module.cpp @@ -66,7 +66,7 @@ static const FunctionProvider all_function_providers[] = { {OutputFunction::Gimbal_Roll, OutputFunction::Gimbal_Yaw, &FunctionGimbal::allocate}, }; -MixingOutput::MixingOutput(uint8_t max_num_outputs, OutputModuleInterface &interface, +MixingOutput::MixingOutput(const char *param_prefix, uint8_t max_num_outputs, OutputModuleInterface &interface, SchedulingPolicy scheduling_policy, bool support_esc_calibration, bool ramp_up) : ModuleParams(&interface), @@ -80,7 +80,8 @@ _scheduling_policy(scheduling_policy), _support_esc_calibration(support_esc_calibration), _max_num_outputs(max_num_outputs < MAX_ACTUATORS ? max_num_outputs : MAX_ACTUATORS), _interface(interface), -_control_latency_perf(perf_alloc(PC_ELAPSED, "control latency")) +_control_latency_perf(perf_alloc(PC_ELAPSED, "control latency")), +_param_prefix(param_prefix) { output_limit_init(&_output_limit); _output_limit.ramp_up = ramp_up; diff --git a/src/lib/mixer_module/mixer_module.hpp b/src/lib/mixer_module/mixer_module.hpp index 9dfa8dee45..20ef35a9fd 100644 --- a/src/lib/mixer_module/mixer_module.hpp +++ b/src/lib/mixer_module/mixer_module.hpp @@ -101,13 +101,15 @@ public: /** * Contructor + * @param param_prefix for min/max/etc. params, e.g. "PWM_MAIN". This needs to match 'param_prefix' in the module.yaml * @param max_num_outputs maximum number of supported outputs * @param interface Parent module for scheduling, parameter updates and callbacks * @param scheduling_policy * @param support_esc_calibration true if the output module supports ESC calibration via max, then min setting * @param ramp_up true if motor ramp up from disarmed to min upon arming is wanted */ - MixingOutput(uint8_t max_num_outputs, OutputModuleInterface &interface, SchedulingPolicy scheduling_policy, + MixingOutput(const char *param_prefix, uint8_t max_num_outputs, OutputModuleInterface &interface, + SchedulingPolicy scheduling_policy, bool support_esc_calibration, bool ramp_up = true); ~MixingOutput();