mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 00:53:34 +08:00
pwm_out_sim: use PWM_FMU for sitl and HIL_ACT for hitl
We might want to change this later, but for now it allows to use the same airframe configs for sitl/real, and independent hitl configuration.
This commit is contained in:
@@ -44,6 +44,13 @@
|
||||
#include <px4_platform_common/time.h>
|
||||
#include <uORB/topics/parameter_update.h>
|
||||
|
||||
#if defined(CONFIG_ARCH_BOARD_PX4_SITL)
|
||||
#define PARAM_PREFIX "PWM_FMU"
|
||||
#else
|
||||
#define PARAM_PREFIX "HIL_ACT"
|
||||
#endif
|
||||
|
||||
|
||||
using namespace time_literals;
|
||||
|
||||
class PWMSim : public cdev::CDev, public ModuleBase<PWMSim>, public OutputModuleInterface
|
||||
@@ -77,7 +84,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{"PWM_SIM", MAX_ACTUATORS, *this, MixingOutput::SchedulingPolicy::Auto, false, false};
|
||||
MixingOutput _mixing_output{PARAM_PREFIX, MAX_ACTUATORS, *this, MixingOutput::SchedulingPolicy::Auto, false, false};
|
||||
uORB::SubscriptionInterval _parameter_update_sub{ORB_ID(parameter_update), 1_s};
|
||||
};
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
module_name: PWM Sim
|
||||
actuator_output:
|
||||
output_groups:
|
||||
- param_prefix: PWM_SIM
|
||||
channel_label: 'PWM Sim'
|
||||
- param_prefix: ${PWM_FMU_OR_HIL}
|
||||
channel_label: ${PWM_FMU_OR_HIL}
|
||||
num_channels: 16
|
||||
|
||||
|
||||
@@ -90,6 +90,7 @@ add_custom_command(OUTPUT ${generated_serial_params_file} ${generated_module_par
|
||||
${added_arguments}
|
||||
--timer-config ${PX4_BOARD_DIR}/src/timer_config.cpp
|
||||
--config-files ${module_config_files} #--verbose
|
||||
--board ${PX4_BOARD}
|
||||
DEPENDS
|
||||
${module_config_files}
|
||||
${jinja_templates}
|
||||
|
||||
Reference in New Issue
Block a user