mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 12:03:35 +08:00
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:
@@ -284,10 +284,10 @@ VtolAttitudeControl::Run()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const hrt_abstime now = hrt_absolute_time();
|
|
||||||
|
|
||||||
#if !defined(ENABLE_LOCKSTEP_SCHEDULER)
|
#if !defined(ENABLE_LOCKSTEP_SCHEDULER)
|
||||||
|
|
||||||
|
const hrt_abstime now = hrt_absolute_time();
|
||||||
|
|
||||||
// prevent excessive scheduling (> 500 Hz)
|
// prevent excessive scheduling (> 500 Hz)
|
||||||
if (now - _last_run_timestamp < 2_ms) {
|
if (now - _last_run_timestamp < 2_ms) {
|
||||||
return;
|
return;
|
||||||
@@ -295,9 +295,6 @@ VtolAttitudeControl::Run()
|
|||||||
|
|
||||||
#endif // !ENABLE_LOCKSTEP_SCHEDULER
|
#endif // !ENABLE_LOCKSTEP_SCHEDULER
|
||||||
|
|
||||||
const float dt = math::min((now - _last_run_timestamp) / 1e6f, kMaxVTOLAttitudeControlTimeStep);
|
|
||||||
_last_run_timestamp = now;
|
|
||||||
|
|
||||||
if (!_initialized) {
|
if (!_initialized) {
|
||||||
|
|
||||||
if (_vtol_type->init()) {
|
if (_vtol_type->init()) {
|
||||||
@@ -309,8 +306,6 @@ VtolAttitudeControl::Run()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_vtol_type->setDt(dt);
|
|
||||||
|
|
||||||
perf_begin(_loop_perf);
|
perf_begin(_loop_perf);
|
||||||
|
|
||||||
bool updated_fw_in = _vehicle_torque_setpoint_virtual_fw_sub.update(&_vehicle_torque_setpoint_virtual_fw);
|
bool updated_fw_in = _vehicle_torque_setpoint_virtual_fw_sub.update(&_vehicle_torque_setpoint_virtual_fw);
|
||||||
|
|||||||
@@ -92,8 +92,6 @@ using namespace time_literals;
|
|||||||
|
|
||||||
extern "C" __EXPORT int vtol_att_control_main(int argc, char *argv[]);
|
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
|
class VtolAttitudeControl : public ModuleBase<VtolAttitudeControl>, public ModuleParams, public px4::WorkItem
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -211,7 +209,9 @@ private:
|
|||||||
|
|
||||||
float _air_density{atmosphere::kAirDensitySeaLevelStandardAtmos}; // [kg/m^3]
|
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 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
|
* for fixed wings we want to have an idle speed of zero since we do not want
|
||||||
|
|||||||
@@ -251,12 +251,6 @@ public:
|
|||||||
|
|
||||||
virtual void parameters_update() = 0;
|
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.
|
* @brief Resets the transition timer states.
|
||||||
@@ -326,8 +320,6 @@ protected:
|
|||||||
bool isFrontTransitionCompleted();
|
bool isFrontTransitionCompleted();
|
||||||
virtual bool isFrontTransitionCompletedBase();
|
virtual bool isFrontTransitionCompletedBase();
|
||||||
|
|
||||||
float _dt{0.0025f}; // time step [s]
|
|
||||||
|
|
||||||
float _local_position_z_start_of_transition{0.f}; // altitude at start of transition
|
float _local_position_z_start_of_transition{0.f}; // altitude at start of transition
|
||||||
|
|
||||||
int _altitude_reset_counter{0};
|
int _altitude_reset_counter{0};
|
||||||
|
|||||||
Reference in New Issue
Block a user