@@ -78,10 +78,7 @@ void AutogyroTakeoff::update(const hrt_abstime &now, float airspeed, float rotor
78
78
double current_lat, double current_lon, orb_advert_t *mavlink_log_pub)
79
79
{
80
80
_climbout = true ;
81
- autogyro_takeoff_status_s autogyro_takeoff_status = {};
82
-
83
-
84
- autogyro_takeoff_status.rpm = false ;
81
+ takeoff_status_s takeoff_status = {};
85
82
86
83
switch (_state) {
87
84
/*
@@ -105,7 +102,6 @@ void AutogyroTakeoff::update(const hrt_abstime &now, float airspeed, float rotor
105
102
case AutogyroTakeoffState::PRE_TAKEOFF_PREROTATE_START:
106
103
107
104
if (rotor_rpm > _param_ag_prerotator_minimal_rpm.get ()) {
108
- autogyro_takeoff_status.rpm = true ;
109
105
110
106
// Eletrical prerotator, controlled from autopilot
111
107
if (_param_ag_prerotator_type.get () == AutogyroTakeoffType::ELPREROT_PLATFORM
@@ -140,7 +136,6 @@ void AutogyroTakeoff::update(const hrt_abstime &now, float airspeed, float rotor
140
136
case AutogyroTakeoffState::PRE_TAKEOFF_PREROTATE: // 1
141
137
142
138
if (rotor_rpm > _param_ag_prerotator_target_rpm.get ()) {
143
- autogyro_takeoff_status.rpm = true ;
144
139
_state = AutogyroTakeoffState::PRE_TAKEOFF_DONE;
145
140
_time_in_state = now;
146
141
play_next_tone ();
@@ -160,7 +155,6 @@ void AutogyroTakeoff::update(const hrt_abstime &now, float airspeed, float rotor
160
155
bool ready_for_release = true ;
161
156
162
157
if (rotor_rpm < _param_ag_rotor_flight_rpm.get ()) {
163
- autogyro_takeoff_status.rpm = true ;
164
158
ready_for_release = false ;
165
159
166
160
// Some histesis needs to be applied for the start interrupt procedure.
@@ -204,8 +198,6 @@ void AutogyroTakeoff::update(const hrt_abstime &now, float airspeed, float rotor
204
198
play_release_tone ();
205
199
}
206
200
207
- autogyro_takeoff_status.rpm = true ;
208
-
209
201
if (alt_agl > _param_rwto_nav_alt.get ()) {
210
202
mavlink_log_info (mavlink_log_pub, " Climbout" );
211
203
_state = AutogyroTakeoffState::TAKEOFF_CLIMBOUT;
@@ -228,8 +220,6 @@ void AutogyroTakeoff::update(const hrt_abstime &now, float airspeed, float rotor
228
220
OUT: Mission continue
229
221
*/
230
222
case AutogyroTakeoffState::TAKEOFF_CLIMBOUT:
231
- autogyro_takeoff_status.rpm = true ;
232
-
233
223
if (alt_agl > _param_fw_clmbout_diff.get ()) {
234
224
_climbout = false ;
235
225
_state = AutogyroTakeoffState::FLY;
@@ -249,10 +239,9 @@ void AutogyroTakeoff::update(const hrt_abstime &now, float airspeed, float rotor
249
239
250
240
251
241
252
- autogyro_takeoff_status.time_in_state = hrt_elapsed_time (&_time_in_state);
253
- autogyro_takeoff_status.state = (int ) _state;
254
- autogyro_takeoff_status.climbout = _climbout;
255
- _autogyro_takeoff_status_pub.publish (autogyro_takeoff_status);
242
+ takeoff_status.time_in_state = hrt_elapsed_time (&_time_in_state);
243
+ takeoff_status.takeoff_state = (int ) _state;
244
+ _takeoff_status_pub.publish (takeoff_status);
256
245
257
246
if (hrt_elapsed_time (&_last_sent_release_status) > 1_s / 4 || _state != _state_last) {
258
247
_last_sent_release_status = now;
0 commit comments