Skip to content

Commit bf2a08b

Browse files
committed
extend and use takeoff_status message
1 parent b881740 commit bf2a08b

File tree

5 files changed

+7
-25
lines changed

5 files changed

+7
-25
lines changed

msg/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ set(msg_files
5151
airspeed_validated.msg
5252
airspeed_wind.msg
5353
autotune_attitude_control_status.msg
54-
autogyro_takeoff_status.msg
5554
battery_status.msg
5655
button_event.msg
5756
camera_capture.msg

msg/autogyro_takeoff_status.msg

Lines changed: 0 additions & 7 deletions
This file was deleted.

msg/takeoff_status.msg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ uint8 TAKEOFF_STATE_RAMPUP = 4
1010
uint8 TAKEOFF_STATE_FLIGHT = 5
1111

1212
uint8 takeoff_state
13+
uint64 time_in_state
1314

1415
float32 tilt_limit # limited tilt feasability during takeoff, contains maximum tilt otherwise

src/modules/fw_pos_control_l1/autogyro_takeoff/AutogyroTakeoff.cpp

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,7 @@ void AutogyroTakeoff::update(const hrt_abstime &now, float airspeed, float rotor
7878
double current_lat, double current_lon, orb_advert_t *mavlink_log_pub)
7979
{
8080
_climbout = true;
81-
autogyro_takeoff_status_s autogyro_takeoff_status = {};
82-
83-
84-
autogyro_takeoff_status.rpm = false;
81+
takeoff_status_s takeoff_status = {};
8582

8683
switch (_state) {
8784
/*
@@ -105,7 +102,6 @@ void AutogyroTakeoff::update(const hrt_abstime &now, float airspeed, float rotor
105102
case AutogyroTakeoffState::PRE_TAKEOFF_PREROTATE_START:
106103

107104
if (rotor_rpm > _param_ag_prerotator_minimal_rpm.get()) {
108-
autogyro_takeoff_status.rpm = true;
109105

110106
// Eletrical prerotator, controlled from autopilot
111107
if (_param_ag_prerotator_type.get() == AutogyroTakeoffType::ELPREROT_PLATFORM
@@ -140,7 +136,6 @@ void AutogyroTakeoff::update(const hrt_abstime &now, float airspeed, float rotor
140136
case AutogyroTakeoffState::PRE_TAKEOFF_PREROTATE: // 1
141137

142138
if (rotor_rpm > _param_ag_prerotator_target_rpm.get()) {
143-
autogyro_takeoff_status.rpm = true;
144139
_state = AutogyroTakeoffState::PRE_TAKEOFF_DONE;
145140
_time_in_state = now;
146141
play_next_tone();
@@ -160,7 +155,6 @@ void AutogyroTakeoff::update(const hrt_abstime &now, float airspeed, float rotor
160155
bool ready_for_release = true;
161156

162157
if (rotor_rpm < _param_ag_rotor_flight_rpm.get()) {
163-
autogyro_takeoff_status.rpm = true;
164158
ready_for_release = false;
165159

166160
// 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
204198
play_release_tone();
205199
}
206200

207-
autogyro_takeoff_status.rpm = true;
208-
209201
if (alt_agl > _param_rwto_nav_alt.get()) {
210202
mavlink_log_info(mavlink_log_pub, "Climbout");
211203
_state = AutogyroTakeoffState::TAKEOFF_CLIMBOUT;
@@ -228,8 +220,6 @@ void AutogyroTakeoff::update(const hrt_abstime &now, float airspeed, float rotor
228220
OUT: Mission continue
229221
*/
230222
case AutogyroTakeoffState::TAKEOFF_CLIMBOUT:
231-
autogyro_takeoff_status.rpm = true;
232-
233223
if (alt_agl > _param_fw_clmbout_diff.get()) {
234224
_climbout = false;
235225
_state = AutogyroTakeoffState::FLY;
@@ -249,10 +239,9 @@ void AutogyroTakeoff::update(const hrt_abstime &now, float airspeed, float rotor
249239

250240

251241

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);
256245

257246
if (hrt_elapsed_time(&_last_sent_release_status) > 1_s / 4 || _state != _state_last) {
258247
_last_sent_release_status = now;

src/modules/fw_pos_control_l1/autogyro_takeoff/AutogyroTakeoff.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
#include <matrix/math.hpp>
5252

5353
#include <uORB/Publication.hpp>
54-
#include <uORB/topics/autogyro_takeoff_status.h>
54+
#include <uORB/topics/takeoff_status.h>
5555
#include <uORB/topics/debug_value.h>
5656
#include <uORB/topics/tune_control.h>
5757

@@ -135,7 +135,7 @@ class __EXPORT AutogyroTakeoff : public ModuleParams
135135
matrix::Vector2d _takeoff_wp;
136136

137137
uORB::Publication<tune_control_s> _tune_control{ORB_ID(tune_control)};
138-
uORB::Publication<autogyro_takeoff_status_s> _autogyro_takeoff_status_pub{ORB_ID(autogyro_takeoff_status)};
138+
uORB::Publication<takeoff_status_s> _takeoff_status_pub{ORB_ID(takeoff_status)};
139139

140140
// TODO: templorary sollution. Should be replaced with autogyro takeoff status with
141141
// translation into custom mavlink message. Used to inform launch platform to

0 commit comments

Comments
 (0)