Skip to content

Commit

Permalink
Copter: move time_to_impact to local float
Browse files Browse the repository at this point in the history
  • Loading branch information
bnsgeyer committed Jan 27, 2024
1 parent b61eee3 commit b2fe6a3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion ArduCopter/mode.h
Original file line number Diff line number Diff line change
Expand Up @@ -1938,7 +1938,6 @@ class ModeAutorotate : public Mode {
bool hover_autorotation;
bool initial_energy_check;
float last_tti;
float time_to_impact;

enum class Autorotation_Phase {
ENTRY,
Expand Down
3 changes: 2 additions & 1 deletion ArduCopter/mode_autorotate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ void ModeAutorotate::run()

float alt = g2.arot.get_ground_distance();
// have autorotation library update estimated radar altitude
g2.arot.update_est_radar_alt();
g2.arot.update_est_rangefinder_alt();
if (alt < copter.rangefinder.max_distance_cm_orient(ROTATION_PITCH_270)) {
g2.arot._using_rfnd = true;
} else {
Expand All @@ -101,6 +101,7 @@ void ModeAutorotate::run()
// Initialise internal variables
float curr_vel_z = inertial_nav.get_velocity_z_up_cms(); // Current vertical descent
//calculate time to impact
float time_to_impact;
if (phase_switch != Autorotation_Phase::TOUCH_DOWN) {
g2.arot.time_to_ground();
time_to_impact = g2.arot.get_time_to_ground();
Expand Down

0 comments on commit b2fe6a3

Please sign in to comment.