MAV'RIC
/home/travis/build/lis-epfl/MAVRIC_Library/control/unsupported/stabilisation_wing.hpp
00001 /*******************************************************************************
00002  * Copyright (c) 2009-2016, MAV'RIC Development Team
00003  * All rights reserved.
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions are met:
00007  *
00008  * 1. Redistributions of source code must retain the above copyright notice,
00009  * this list of conditions and the following disclaimer.
00010  *
00011  * 2. Redistributions in binary form must reproduce the above copyright notice,
00012  * this list of conditions and the following disclaimer in the documentation
00013  * and/or other materials provided with the distribution.
00014  *
00015  * 3. Neither the name of the copyright holder nor the names of its contributors
00016  * may be used to endorse or promote products derived from this software without
00017  * specific prior written permission.
00018  *
00019  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00020  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00021  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00022  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
00023  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00024  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00025  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00026  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00027  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00028  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00029  * POSSIBILITY OF SUCH DAMAGE.
00030  ******************************************************************************/
00031 
00032 /*******************************************************************************
00033  * \file stabilisation_wing.hpp
00034  *
00035  * \author MAV'RIC Team
00036  * \author Simon Pyroth
00037  *
00038  * \brief This file handles the stabilization of the platform
00039  *
00040  ******************************************************************************/
00041 
00042 
00043 #ifndef STABILISATION_WING_HPP_
00044 #define STABILISATION_WING_HPP_
00045 
00046 #include "mission/navigation.hpp"
00047 #include "control/stabilisation.hpp"
00048 #include "sensing/imu.hpp"
00049 #include "sensing/ins.hpp"
00050 #include "drivers/airspeed_analog.hpp"
00051 #include "control/control_command.hpp"
00052 
00053 
00057 typedef struct
00058 {
00059     stabiliser_t rate_stabiliser;                               
00060     stabiliser_t attitude_stabiliser;                           
00061     stabiliser_t velocity_stabiliser;                           
00062     stabiliser_t position_stabiliser;                           
00063 } stabiliser_stack_wing_t;
00064 
00068 typedef struct
00069 {
00070     stabiliser_stack_wing_t stabiliser_stack;                   
00071     control_command_t* controls;                                
00072     torque_command_t* torque_command;                           
00073     thrust_command_t* thrust_command;                           
00074     const Imu* imu;                                             
00075     const ahrs_t* ahrs;                                         
00076     const INS* ins;                                             
00077     const Airspeed_analog* airspeed_analog;                     
00078     const Navigation* navigation;                               
00079     const Gps* gps;                                             
00080     float thrust_apriori;                                       
00081     float pitch_angle_apriori;                                  
00082     float pitch_angle_apriori_gain;                             
00083     float max_roll_angle;                                       
00084     float take_off_thrust;                                      
00085     float take_off_pitch;                                       
00086     float landing_pitch;                                        
00087     float landing_max_roll;                                     
00088     float dt_s;                                                 
00089     float last_update_s;                                        
00090 } stabilisation_wing_t;
00091 
00095 typedef struct
00096 {
00097     float thrust_apriori;                                       
00098     float pitch_angle_apriori;                                  
00099     float pitch_angle_apriori_gain;                             
00100     float max_roll_angle;                                       
00101     float take_off_thrust;                                      
00102     float take_off_pitch;                                       
00103     float landing_pitch;                                        
00104     float landing_max_roll;                                     
00105     stabiliser_stack_wing_t stabiliser_stack;                   
00106 } stabilisation_wing_conf_t;
00107 
00124 bool stabilisation_wing_init(stabilisation_wing_t* stabilisation_wing, const stabilisation_wing_conf_t stabiliser_conf, control_command_t* controls, torque_command_t* torque_command, thrust_command_t* thrust_command, const Imu* imu, const ahrs_t* ahrs, const Position_estimation* pos_est, const Airspeed_analog* airspeed_analog, const Navigation* navigation, const Gps* gps);
00125 
00131 void stabilisation_wing_cascade_stabilise(stabilisation_wing_t* stabilisation_wing);
00132 
00133 
00134 #endif /* STABILISATION_WING_HPP_ */
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines