Skip to content

Commit

Permalink
VTOL: remove _dt passing as it's no longer used (and was wrong)
Browse files Browse the repository at this point in the history
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
  • Loading branch information
sfuhrer committed May 22, 2024
1 parent dccde94 commit ee1feaa
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 17 deletions.
7 changes: 0 additions & 7 deletions src/modules/vtol_att_control/vtol_att_control_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,6 @@ VtolAttitudeControl::Run()
return;
}

const hrt_abstime now = hrt_absolute_time();

#if !defined(ENABLE_LOCKSTEP_SCHEDULER)

// prevent excessive scheduling (> 500 Hz)
Expand All @@ -295,9 +293,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()) {
Expand All @@ -309,8 +304,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);
Expand Down
2 changes: 0 additions & 2 deletions src/modules/vtol_att_control/vtol_att_control_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 0 additions & 8 deletions src/modules/vtol_att_control/vtol_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,6 @@ class VtolType : public ModuleParams

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.
Expand Down Expand Up @@ -326,8 +320,6 @@ class VtolType : public ModuleParams
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};
Expand Down

0 comments on commit ee1feaa

Please sign in to comment.