Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
rotwing_state.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2023 Dennis van Wijngaarden <D.C.vanWijngaarden@tudelft.nl>
3  *
4  * This file is part of paparazzi
5  *
6  * paparazzi is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * paparazzi is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with paparazzi; see the file COPYING. If not, see
18  * <http://www.gnu.org/licenses/>.
19  */
20 
26 #ifndef ROTWING_STATE_H
27 #define ROTWING_STATE_H
28 
29 #include "std.h"
30 
33 #define ROTWING_STATE_HOVER 0 // Wing is skewed in 0 degrees (quad)
34 #define ROTWING_STATE_SKEWING 1 // WIng is skewing
35 #define ROTWING_STATE_FW 2 // Wing is skewed at 90 degrees (fixed wing), hover motors have full authority
36 #define ROTWING_STATE_FW_HOV_MOT_IDLE 3 // Wing is skewed at 90 degrees (fixed wing), hover motors are forced to idle
37 #define ROTWING_STATE_FW_HOV_MOT_OFF 4 // Wing is skewed at 90 degrees (fixed wubg), hover motors are switched off
38 #define ROTWING_STATE_FREE 5 // This is a desired state for which the controller has to decide the desired state itself
39 
42 #define ROTWING_CONFIGURATION_HOVER 0 // UAV is in hover
43 #define ROTWING_CONFIGURATION_HYBRID 1 // UAV can fly forward and hover if airspeed low, hover motors on
44 #define ROTWING_CONFIGURATION_EFFICIENT 2 // UAV flies efficiently forward (FW)
45 
46 struct RotwingState {
49 };
50 
51 #define ROTWING_STATE_WING_QUAD_SETTING 0 // Wing skew at 0 degrees
52 #define ROTWING_STATE_WING_SCHEDULING_SETTING 1 // Wing skew handled by airspeed scheduler
53 #define ROTWING_STATE_WING_FW_SETTING 2 // Wing skew at 90 degrees
54 
55 #define ROTWING_STATE_PITCH_QUAD_SETTING 0 // Pitch at prefered hover
56 #define ROTWING_STATE_PITCH_TRANSITION_SETTING 1 // Pitch scheduled
57 #define ROTWING_STATE_PITCH_FW_SETTING 2 // Pitch at prefered forward
58 
66  float max_v_climb;
69 };
70 
72  float wing_angle_deg_sp; // Wing angle setpoint in deg
73  float wing_angle_deg; // Wing angle from sensor in deg
74  int32_t servo_pprz_cmd; // Wing rotation servo pprz cmd
75  bool airspeed_scheduling; // Airspeed scheduling on or off
76  bool force_rotation_angle; // Setting to force wing_angle_deg_sp
77 };
78 
79 extern struct RotwingState rotwing_state;
82 
84 
85 extern bool hover_motors_active;
86 extern bool bool_disable_hover_motors;
87 
88 extern void init_rotwing_state(void);
89 extern void periodic_rotwing_state(void);
91 extern void rotwing_request_configuration(uint8_t configuration);
92 extern void rotwing_state_skew_actuator_periodic(void);
93 
94 #endif // ROTWING_STATE_H
struct State state
Definition: state.c:36
uint8_t current_state
Definition: rotwing_state.h:47
void init_rotwing_state(void)
struct RotWingStateSettings rotwing_state_settings
void rotwing_state_skew_actuator_periodic(void)
void request_rotwing_state(uint8_t state)
struct RotwingState rotwing_state
uint8_t desired_state
Definition: rotwing_state.h:48
float rotwing_state_max_hover_speed
struct RotWingStateSkewing rotwing_state_skewing
bool bool_disable_hover_motors
bool hover_motors_active
void rotwing_request_configuration(uint8_t configuration)
void periodic_rotwing_state(void)
int int32_t
Typedef defining 32 bit int type.
Definition: vl53l1_types.h:83
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
Definition: vl53l1_types.h:98