VTOL: remove _dt passing as it's no longer used (and was wrong)

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
Silvan Fuhrer 2024-05-22 16:53:23 +02:00
parent f8fe7c7aa3
commit 032ae69eee
3 changed files with 5 additions and 18 deletions

View File

@ -284,10 +284,10 @@ VtolAttitudeControl::Run()
return;
}
const hrt_abstime now = hrt_absolute_time();
#if !defined(ENABLE_LOCKSTEP_SCHEDULER)
const hrt_abstime now = hrt_absolute_time();
// prevent excessive scheduling (> 500 Hz)
if (now - _last_run_timestamp < 2_ms) {
return;
@ -295,9 +295,6 @@ VtolAttitudeControl::Run()
#endif // !ENABLE_LOCKSTEP_SCHEDULER
const float dt = math::min((now - _last_run_timestamp) / 1e6f, kMaxVTOLAttitudeControlTimeStep);
_last_run_timestamp = now;
if (!_initialized) {
if (_vtol_type->init()) {
@ -309,8 +306,6 @@ VtolAttitudeControl::Run()
}
}
_vtol_type->setDt(dt);
perf_begin(_loop_perf);
bool updated_fw_in = _vehicle_torque_setpoint_virtual_fw_sub.update(&_vehicle_torque_setpoint_virtual_fw);

View File

@ -92,8 +92,6 @@ using namespace time_literals;
extern "C" __EXPORT int vtol_att_control_main(int argc, char *argv[]);
static constexpr float kMaxVTOLAttitudeControlTimeStep = 0.1f; // max time step [s]
class VtolAttitudeControl : public ModuleBase<VtolAttitudeControl>, public ModuleParams, public px4::WorkItem
{
public:
@ -211,7 +209,9 @@ private:
float _air_density{atmosphere::kAirDensitySeaLevelStandardAtmos}; // [kg/m^3]
hrt_abstime _last_run_timestamp{0};
#if !defined(ENABLE_LOCKSTEP_SCHEDULER)
hrt_abstime _last_run_timestamp {0};
#endif // !ENABLE_LOCKSTEP_SCHEDULER
/* For multicopters it is usual to have a non-zero idle speed of the engines
* for fixed wings we want to have an idle speed of zero since we do not want

View File

@ -251,12 +251,6 @@ public:
virtual void parameters_update() = 0;
/**
* @brief Set current time delta
*
* @param dt Current time delta [s]
*/
void setDt(float dt) {_dt = dt; }
/**
* @brief Resets the transition timer states.
@ -326,8 +320,6 @@ protected:
bool isFrontTransitionCompleted();
virtual bool isFrontTransitionCompletedBase();
float _dt{0.0025f}; // time step [s]
float _local_position_z_start_of_transition{0.f}; // altitude at start of transition
int _altitude_reset_counter{0};