| 1 | /*************************************************************************** |
| 2 | |
| 3 | TITLE: uiuc_aero |
| 4 | |
| 5 | ---------------------------------------------------------------------------- |
| 6 | |
| 7 | FUNCTION: aerodynamics, engine and gear model |
| 8 | |
| 9 | ---------------------------------------------------------------------------- |
| 10 | |
| 11 | MODULE STATUS: developmental |
| 12 | |
| 13 | ---------------------------------------------------------------------------- |
| 14 | |
| 15 | GENEALOGY: Equations based on Part 1 of Roskam's S&C text |
| 16 | |
| 17 | ---------------------------------------------------------------------------- |
| 18 | |
| 19 | DESIGNED BY: Bipin Sehgal |
| 20 | |
| 21 | CODED BY: Bipin Sehgal |
| 22 | |
| 23 | MAINTAINED BY: Rob Deters and Glen Dimock |
| 24 | |
| 25 | ---------------------------------------------------------------------------- |
| 26 | |
| 27 | MODIFICATION HISTORY: |
| 28 | |
| 29 | DATE PURPOSE BY |
| 30 | 3/17/00 Initial test release |
| 31 | 3/09/01 Added callout to UIUC gear function. (DPM) |
| 32 | 6/18/01 Added call out to UIUC record routine (RD) |
| 33 | 11/12/01 Changed from uiuc_init_aeromodel() to uiuc_initial_init(). (RD) |
| 34 | 2/24/02 Added uiuc_network_routine() (GD) |
| 35 | 12/11/02 Divided uiuc_network_routine into uiuc_network_recv_routine and |
| 36 | uiuc_network_send_routine (RD) |
| 37 | |
| 38 | ---------------------------------------------------------------------------- |
| 39 | |
| 40 | CALLED BY: |
| 41 | |
| 42 | ---------------------------------------------------------------------------- |
| 43 | |
| 44 | CALLS TO: |
| 45 | |
| 46 | ---------------------------------------------------------------------------- |
| 47 | |
| 48 | INPUTS: |
| 49 | |
| 50 | ---------------------------------------------------------------------------- |
| 51 | |
| 52 | OUTPUTS: |
| 53 | |
| 54 | --------------------------------------------------------------------------*/ |
| 55 | |
| 56 | #include "config.h" |
| 57 | |
| 58 | #ifdef ENABLE_UIUC_MODEL |
| 59 | |
| 60 | #include <math.h> |
| 61 | #include "ls_types.h" |
| 62 | #include "ls_generic.h" |
| 63 | #include "ls_constants.h" |
| 64 | #include "ls_cockpit.h" |
| 65 | #include <FDM/UIUCModel/uiuc_wrapper.h> |
| 66 | |
| 67 | |
| 68 | void uiuc_init_2_wrapper() |
| 69 | { |
| 70 | static int init = 0; |
| 71 | |
| 72 | // On first time through initialize UIUC aircraft model |
| 73 | if (init==0) { |
| 74 | init=-1; |
| 75 | uiuc_defaults_inits(); |
| 76 | uiuc_init_aeromodel(); |
| 77 | } |
| 78 | |
| 79 | // Re-initialize velocities and euler angles since LaRCsim tends |
| 80 | // to change them |
| 81 | uiuc_initial_init(); |
| 82 | } |
| 83 | |
| 84 | void uiuc_local_vel_init() |
| 85 | { |
| 86 | uiuc_vel_init(); |
| 87 | } |
| 88 | |
| 89 | void uiuc_aero_2_wrapper( SCALAR dt, int Initialize ) |
| 90 | { |
| 91 | uiuc_force_moment(dt); |
| 92 | } |
| 93 | |
| 94 | |
| 95 | void uiuc_wind_2_wrapper( SCALAR dt, int Initialize ) |
| 96 | { |
| 97 | if (Initialize == 0) |
| 98 | uiuc_wind_routine(); |
| 99 | } |
| 100 | |
| 101 | void uiuc_engine_2_wrapper( SCALAR dt, int Initialize ) |
| 102 | { |
| 103 | |
| 104 | uiuc_engine_routine(); |
| 105 | } |
| 106 | |
| 107 | |
| 108 | void uiuc_gear_2_wrapper () |
| 109 | { |
| 110 | uiuc_gear_routine(); |
| 111 | } |
| 112 | |
| 113 | void uiuc_record_2_wrapper(SCALAR dt) |
| 114 | { |
| 115 | uiuc_record_routine(dt); |
| 116 | } |
| 117 | |
| 118 | void uiuc_network_recv_2_wrapper() |
| 119 | { |
| 120 | uiuc_network_recv_routine(); |
| 121 | } |
| 122 | |
| 123 | void uiuc_network_send_2_wrapper() |
| 124 | { |
| 125 | uiuc_network_send_routine(); |
| 126 | } |
| 127 | |
| 128 | #endif // ENABLE_UIUC_MODEL |