PX4 Firmware
PX4 Autopilot Software http://px4.io
standard.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 standard.h
36 * VTOL with fixed multirotor motor configurations (such as quad) and a pusher
37 * (or puller aka tractor) motor for forward flight.
38 *
39 * @author Simon Wilks <simon@uaventure.com>
40 * @author Roman Bapst <bapstroman@gmail.com>
41 * @author Andreas Antener <andreas@uaventure.com>
42 * @author Sander Smeets <sander@droneslab.com>
43 *
44 */
45 
46 #ifndef STANDARD_H
47 #define STANDARD_H
48 #include "vtol_type.h"
49 #include <parameters/param.h>
50 #include <drivers/drv_hrt.h>
51 
52 class Standard : public VtolType
53 {
54 
55 public:
56 
57  Standard(VtolAttitudeControl *_att_controller);
58  ~Standard() override = default;
59 
60  void update_vtol_state() override;
61  void update_transition_state() override;
62  void update_fw_state() override;
63  void update_mc_state() override;
64  void fill_actuator_outputs() override;
65  void waiting_on_tecs() override;
66 
67 private:
68 
69  struct {
78 
79  struct {
88 
89  enum class vtol_mode {
90  MC_MODE = 0,
93  FW_MODE
94  };
95 
96  struct {
97  vtol_mode flight_mode; // indicates in which mode the vehicle is in
98  hrt_abstime transition_start; // at what time did we start a transition (front- or backtransition)
100 
101  float _pusher_throttle{0.0f};
102  float _reverse_output{0.0f};
104 
105  void parameters_update() override;
106 };
107 #endif
float reverse_delay
Definition: standard.h:76
float _airspeed_trans_blend_margin
Definition: standard.h:103
vtol_mode flight_mode
Definition: standard.h:97
void waiting_on_tecs() override
Special handling opportunity for the time right after transition to FW before TECS is running...
Definition: standard.cpp:486
float _reverse_output
Definition: standard.h:102
param_t pusher_ramp_dt
Definition: standard.h:80
float down_pitch_max
Definition: standard.h:72
float pusher_ramp_dt
Definition: standard.h:70
struct Standard::@138 _vtol_schedule
hrt_abstime transition_start
Definition: standard.h:98
High-resolution timer with callouts and timekeeping.
Global flash based parameter store.
param_t reverse_output
Definition: standard.h:85
param_t forward_thrust_scale
Definition: standard.h:83
void update_vtol_state() override
Update vtol state.
Definition: standard.cpp:108
param_t back_trans_ramp
Definition: standard.h:81
void update_fw_state() override
Update fixed wing state.
Definition: standard.cpp:400
float _pusher_throttle
Definition: standard.h:101
void parameters_update() override
Definition: standard.cpp:73
void update_mc_state() override
Update multicopter state.
Definition: standard.cpp:324
struct Standard::@137 _params_handles_standard
struct Standard::@136 _params_standard
__BEGIN_DECLS typedef uint64_t hrt_abstime
Absolute time, in microsecond units.
Definition: drv_hrt.h:58
float forward_thrust_scale
Definition: standard.h:73
float reverse_output
Definition: standard.h:75
float back_trans_ramp
Definition: standard.h:71
void fill_actuator_outputs() override
Prepare message to acutators with data from mc and fw attitude controllers.
Definition: standard.cpp:409
param_t down_pitch_max
Definition: standard.h:82
param_t reverse_delay
Definition: standard.h:86
float pitch_setpoint_offset
Definition: standard.h:74
~Standard() override=default
param_t pitch_setpoint_offset
Definition: standard.h:84
uint32_t param_t
Parameter handle.
Definition: param.h:98
void update_transition_state() override
Update transition state.
Definition: standard.cpp:236
Standard(VtolAttitudeControl *_att_controller)
Definition: standard.cpp:51