mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-21 20:07:36 +08:00
simulator: rename parameter variable according to convention
This commit is contained in:
@@ -286,7 +286,7 @@ private:
|
||||
|
||||
DEFINE_PARAMETERS(
|
||||
(ParamFloat<px4::params::SIM_BAT_DRAIN>) _param_sim_bat_drain, ///< battery drain interval
|
||||
(ParamFloat<px4::params::SIM_BAT_MIN_PCT>) _battery_min_percentage, //< minimum battery percentage
|
||||
(ParamFloat<px4::params::SIM_BAT_MIN_PCT>) _param_bat_min_pct, //< minimum battery percentage
|
||||
(ParamFloat<px4::params::SIM_GPS_NOISE_X>) _param_sim_gps_noise_x,
|
||||
(ParamBool<px4::params::SIM_GPS_BLOCK>) _param_sim_gps_block,
|
||||
(ParamBool<px4::params::SIM_ACCEL_BLOCK>) _param_sim_accel_block,
|
||||
|
||||
@@ -369,7 +369,7 @@ void Simulator::handle_message_hil_sensor(const mavlink_message_t *msg)
|
||||
|
||||
float ibatt = -1.0f; // no current sensor in simulation
|
||||
|
||||
battery_percentage = math::max(battery_percentage, _battery_min_percentage.get() / 100.f);
|
||||
battery_percentage = math::max(battery_percentage, _param_bat_min_pct.get() / 100.f);
|
||||
float vbatt = math::gradual(battery_percentage, 0.f, 1.f, _battery.empty_cell_voltage(), _battery.full_cell_voltage());
|
||||
vbatt *= _battery.cell_count();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user