PX4 Firmware
PX4 Autopilot Software http://px4.io
tailsitter.h
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * Copyright (c) 2015 PX4 Development Team. All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * 1. Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in
13  * the documentation and/or other materials provided with the
14  * distribution.
15  * 3. Neither the name PX4 nor the names of its contributors may be
16  * used to endorse or promote products derived from this software
17  * without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
25  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
26  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
27  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
29  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  *
32  ****************************************************************************/
33 
34 /**
35 * @file tailsitter.h
36 *
37 * @author Roman Bapst <bapstroman@gmail.com>
38 * @author David Vorsin <davidvorsin@gmail.com>
39 *
40 */
41 
42 #ifndef TAILSITTER_H
43 #define TAILSITTER_H
44 
45 #include "vtol_type.h"
46 
47 #include <parameters/param.h>
48 #include <drivers/drv_hrt.h>
49 #include <matrix/matrix/math.hpp>
50 
51 class Tailsitter : public VtolType
52 {
53 
54 public:
55  Tailsitter(VtolAttitudeControl *_att_controller);
56  ~Tailsitter() override = default;
57 
58  void update_vtol_state() override;
59  void update_transition_state() override;
60  void update_fw_state() override;
61  void fill_actuator_outputs() override;
62  void waiting_on_tecs() override;
63 
64 private:
65 
66  struct {
70 
71  struct {
75 
76  enum class vtol_mode {
77  MC_MODE = 0, /**< vtol is in multicopter mode */
78  TRANSITION_FRONT_P1, /**< vtol is in front transition part 1 mode */
79  TRANSITION_BACK, /**< vtol is in back transition mode */
80  FW_MODE /**< vtol is in fixed wing mode */
81  };
82 
83  struct {
84  vtol_mode flight_mode; /**< vtol flight mode, defined by enum vtol_mode */
85  hrt_abstime transition_start; /**< absoulte time at which front transition started */
87 
91 
92  void parameters_update() override;
93 
94 };
95 #endif
vtol is in fixed wing mode
void update_transition_state() override
Update transition state.
Definition: tailsitter.cpp:189
void parameters_update() override
Definition: tailsitter.cpp:69
void waiting_on_tecs() override
Special handling opportunity for the time right after transition to FW before TECS is running...
Definition: tailsitter.cpp:267
param_t fw_pitch_sp_offset
Definition: tailsitter.h:73
matrix::Quatf _q_trans_sp
Definition: tailsitter.h:89
struct Tailsitter::@139 _params_tailsitter
Quaternion class.
Definition: Dcm.hpp:24
float front_trans_dur_p2
Definition: tailsitter.h:67
High-resolution timer with callouts and timekeeping.
Global flash based parameter store.
param_t front_trans_dur_p2
Definition: tailsitter.h:72
float fw_pitch_sp_offset
Definition: tailsitter.h:68
vtol is in front transition part 1 mode
struct Tailsitter::@141 _vtol_schedule
__BEGIN_DECLS typedef uint64_t hrt_abstime
Absolute time, in microsecond units.
Definition: drv_hrt.h:58
vtol is in back transition mode
Tailsitter(VtolAttitudeControl *_att_controller)
Definition: tailsitter.cpp:52
vtol_mode flight_mode
vtol flight mode, defined by enum vtol_mode
Definition: tailsitter.h:84
matrix::Vector3f _trans_rot_axis
Definition: tailsitter.h:90
vtol is in multicopter mode
void update_vtol_state() override
Update vtol state.
Definition: tailsitter.cpp:81
~Tailsitter() override=default
struct Tailsitter::@140 _params_handles_tailsitter
void update_fw_state() override
Update fixed wing state.
Definition: tailsitter.cpp:273
void fill_actuator_outputs() override
Write data to actuator output topic.
Definition: tailsitter.cpp:287
hrt_abstime transition_start
absoulte time at which front transition started
Definition: tailsitter.h:85
uint32_t param_t
Parameter handle.
Definition: param.h:98
matrix::Quatf _q_trans_start
Definition: tailsitter.h:88