FlightModeManager: publish takeoff status

This commit is contained in:
Matthias Grob
2021-01-26 10:46:12 +01:00
committed by Lorenz Meier
parent b30bd7f589
commit fbd64fbdd8
6 changed files with 34 additions and 5 deletions
@@ -577,6 +577,16 @@ void FlightModeManager::generateTrajectorySetpoint(const float dt,
}
_old_landing_gear_position = landing_gear.landing_gear;
// Publish takeoff status
takeoff_status_s takeoff_status;
takeoff_status.takeoff_state = static_cast<uint8_t>(_takeoff.getTakeoffState());
if (takeoff_status.takeoff_state != _old_takeoff_state) {
takeoff_status.timestamp = hrt_absolute_time();
_takeoff_status_pub.publish(takeoff_status);
_old_takeoff_state = takeoff_status.takeoff_state;
}
}
void FlightModeManager::limitAltitude(vehicle_local_position_setpoint_s &setpoint,