set lon/lat/alt/hdg

This commit is contained in:
matt
2020-11-13 07:06:02 +08:00
parent 1d30e71492
commit c4aa86795e
16 changed files with 6782 additions and 5526 deletions
+3
View File
@@ -67,6 +67,7 @@ SIL/otherFiles/mav_param_set_decode_wrapper.c
SIL/otherFiles/mav_param_value_encode_wrapper.c
SIL/otherFiles/mav_parser_wrapper.c
SIL/otherFiles/mav_rc_channels_override_decode_wrapper.c
SIL/otherFiles/mav_scaled_pressure_encode_wrapper.c
SIL/otherFiles/mav_ins1_encode_wrapper.c
SIL/otherFiles/mav_ins2_encode_wrapper.c
SIL/otherFiles/mav_emb_atmo_com_encode_wrapper.c
@@ -105,6 +106,8 @@ SIL/work/slprj/ert_shrlib/_sharedutils/rt_forwardsubrr_dbl.c
SIL/work/slprj/ert_shrlib/_sharedutils/rt_invd3x3_snf.c
SIL/work/slprj/ert_shrlib/_sharedutils/rt_lu_real.c
SIL/work/slprj/ert_shrlib/_sharedutils/rt_matrixlib_dbl.c
SIL/work/slprj/ert_shrlib/_sharedutils/rt_matrixlib_dbl.c
SIL/work/slprj/ert_shrlib/_sharedutils/rt_modd_snf.c
SIL/work/slprj/ert_shrlib/_sharedutils/rt_mrdivide_U1d1x3_U2d3x3_Yd1x3_snf.c
SIL/work/slprj/ert_shrlib/_sharedutils/rt_nonfinite.c
SIL/work/slprj/ert_shrlib/_sharedutils/rt_powd_snf.c
@@ -0,0 +1,45 @@
/*
* Include Files
*
*/
#if defined(MATLAB_MEX_FILE)
#include "tmwtypes.h"
#include "simstruc_types.h"
#else
#include "rtwtypes.h"
#endif
#include "mav_stat_def.h"
/* %%%-SFUNWIZ_wrapper_includes_Changes_BEGIN --- EDIT HERE TO _END */
/* %%%-SFUNWIZ_wrapper_includes_Changes_END --- EDIT HERE TO _BEGIN */
#define u_width 1
#define y_width 1
/*
* Create external references here.
*
*/
/* %%%-SFUNWIZ_wrapper_externs_Changes_BEGIN --- EDIT HERE TO _END */
/* %%%-SFUNWIZ_wrapper_externs_Changes_END --- EDIT HERE TO _BEGIN */
/*
* Output function
*
*/
void mav_scaled_pressure_encode_Outputs_wrapper(const mavlink_scaled_pressure_t *obj,
const uint8_T *sys_id,
const uint8_T *comp_id,
const uint8_T *channel,
mavlink_message_t *msg)
{
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_BEGIN --- EDIT HERE TO _END */
mavlink_msg_scaled_pressure_encode_chan(sys_id[0], comp_id[0], channel[0], msg, obj);
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_END --- EDIT HERE TO _BEGIN */
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+117 -105
View File
@@ -3,9 +3,9 @@
*
* Code generated for Simulink model 'SIL'.
*
* Model version : 1.472
* Model version : 1.473
* Simulink Coder version : 9.0 (R2018b) 24-May-2018
* C/C++ source code generated on : Mon Oct 26 16:36:21 2020
* C/C++ source code generated on : Fri Nov 13 06:18:31 2020
*
* Target selection: ert_shrlib.tlc
* Embedded hardware selection: Intel->x86-64 (Windows64)
@@ -136,103 +136,111 @@ static const rtwCAPI_ModelParameters rtModelParameters[] = {
{ 41, TARGET_STRING("force_CG_pos_m"), 0, 0, 0 },
{ 42, TARGET_STRING("hground"), 0, 2, 0 },
{ 42, TARGET_STRING("CLa"), 1, 2, 0 },
{ 43, TARGET_STRING("CLa"), 1, 2, 0 },
{ 43, TARGET_STRING("Clda_lst"), 1, 3, 0 },
{ 44, TARGET_STRING("Clda_lst"), 1, 3, 0 },
{ 44, TARGET_STRING("Clp_lst"), 1, 3, 0 },
{ 45, TARGET_STRING("Clp_lst"), 1, 3, 0 },
{ 45, TARGET_STRING("Cmde_lst"), 1, 3, 0 },
{ 46, TARGET_STRING("Cmde_lst"), 1, 3, 0 },
{ 46, TARGET_STRING("Cmq_lst"), 1, 3, 0 },
{ 47, TARGET_STRING("Cmq_lst"), 1, 3, 0 },
{ 47, TARGET_STRING("Ixx"), 1, 2, 0 },
{ 48, TARGET_STRING("Ixx"), 1, 2, 0 },
{ 48, TARGET_STRING("Iyy"), 1, 2, 0 },
{ 49, TARGET_STRING("Iyy"), 1, 2, 0 },
{ 49, TARGET_STRING("Ma_lst"), 1, 3, 0 },
{ 50, TARGET_STRING("Ma_lst"), 1, 3, 0 },
{ 50, TARGET_STRING("RefArea"), 1, 2, 0 },
{ 51, TARGET_STRING("RefArea"), 1, 2, 0 },
{ 51, TARGET_STRING("RefLen"), 1, 2, 0 },
{ 52, TARGET_STRING("RefLen"), 1, 2, 0 },
{ 52, TARGET_STRING("RefSpan"), 1, 2, 0 },
{ 53, TARGET_STRING("RefSpan"), 1, 2, 0 },
{ 53, TARGET_STRING("aoa_scale"), 1, 2, 0 },
{ 54, TARGET_STRING("dal0"), 1, 2, 0 },
{ 54, TARGET_STRING("aos_scale"), 1, 2, 0 },
{ 55, TARGET_STRING("dar0"), 1, 2, 0 },
{ 55, TARGET_STRING("dal0"), 1, 2, 0 },
{ 56, TARGET_STRING("del0"), 1, 2, 0 },
{ 56, TARGET_STRING("dar0"), 1, 2, 0 },
{ 57, TARGET_STRING("der0"), 1, 2, 0 },
{ 57, TARGET_STRING("del0"), 1, 2, 0 },
{ 58, TARGET_STRING("dr0"), 1, 2, 0 },
{ 58, TARGET_STRING("der0"), 1, 2, 0 },
{ 59, TARGET_STRING("h_thr2rpm"), 1, 0, 0 },
{ 59, TARGET_STRING("dr0"), 1, 2, 0 },
{ 60, TARGET_STRING("k_dal"), 1, 2, 0 },
{ 60, TARGET_STRING("h_thr2rpm"), 1, 0, 0 },
{ 61, TARGET_STRING("k_dar"), 1, 2, 0 },
{ 61, TARGET_STRING("k_dal"), 1, 2, 0 },
{ 62, TARGET_STRING("k_del"), 1, 2, 0 },
{ 62, TARGET_STRING("k_dar"), 1, 2, 0 },
{ 63, TARGET_STRING("k_der"), 1, 2, 0 },
{ 63, TARGET_STRING("k_del"), 1, 2, 0 },
{ 64, TARGET_STRING("k_dr"), 1, 2, 0 },
{ 64, TARGET_STRING("k_der"), 1, 2, 0 },
{ 65, TARGET_STRING("ksi_v2tht"), 1, 2, 0 },
{ 65, TARGET_STRING("k_dr"), 1, 2, 0 },
{ 66, TARGET_STRING("m"), 1, 2, 0 },
{ 66, TARGET_STRING("ksi_v2tht"), 1, 2, 0 },
{ 67, TARGET_STRING("max_az"), 1, 2, 0 },
{ 67, TARGET_STRING("m"), 1, 2, 0 },
{ 68, TARGET_STRING("max_da"), 1, 2, 0 },
{ 68, TARGET_STRING("max_az"), 1, 2, 0 },
{ 69, TARGET_STRING("max_de"), 1, 2, 0 },
{ 69, TARGET_STRING("max_da"), 1, 2, 0 },
{ 70, TARGET_STRING("max_dr"), 1, 2, 0 },
{ 70, TARGET_STRING("max_de"), 1, 2, 0 },
{ 71, TARGET_STRING("max_hdot"), 1, 2, 0 },
{ 71, TARGET_STRING("max_dr"), 1, 2, 0 },
{ 72, TARGET_STRING("max_p"), 1, 2, 0 },
{ 72, TARGET_STRING("max_hdot"), 1, 2, 0 },
{ 73, TARGET_STRING("max_phi"), 1, 2, 0 },
{ 73, TARGET_STRING("max_p"), 1, 2, 0 },
{ 74, TARGET_STRING("max_q"), 1, 2, 0 },
{ 74, TARGET_STRING("max_phi"), 1, 2, 0 },
{ 75, TARGET_STRING("max_rpm"), 1, 0, 0 },
{ 75, TARGET_STRING("max_q"), 1, 2, 0 },
{ 76, TARGET_STRING("max_thr"), 1, 2, 0 },
{ 76, TARGET_STRING("max_rpm"), 1, 0, 0 },
{ 77, TARGET_STRING("max_tht"), 1, 2, 0 },
{ 77, TARGET_STRING("max_thr"), 1, 2, 0 },
{ 78, TARGET_STRING("min_de"), 1, 2, 0 },
{ 78, TARGET_STRING("max_tht"), 1, 2, 0 },
{ 79, TARGET_STRING("min_hdot"), 1, 2, 0 },
{ 79, TARGET_STRING("min_de"), 1, 2, 0 },
{ 80, TARGET_STRING("min_rpm"), 1, 0, 0 },
{ 80, TARGET_STRING("min_hdot"), 1, 2, 0 },
{ 81, TARGET_STRING("min_tht"), 1, 2, 0 },
{ 81, TARGET_STRING("min_rpm"), 1, 0, 0 },
{ 82, TARGET_STRING("recovery_ias"), 1, 2, 0 },
{ 82, TARGET_STRING("min_tht"), 1, 2, 0 },
{ 83, TARGET_STRING("w_as"), 1, 2, 0 },
{ 83, TARGET_STRING("recovery_ias"), 1, 2, 0 },
{ 84, TARGET_STRING("w_v2tht"), 1, 2, 0 },
{ 84, TARGET_STRING("w_as"), 1, 2, 0 },
{ 85, TARGET_STRING("w_x"), 1, 2, 0 },
{ 85, TARGET_STRING("w_v2tht"), 1, 2, 0 },
{ 86, TARGET_STRING("w_y"), 1, 2, 0 },
{ 86, TARGET_STRING("w_x"), 1, 2, 0 },
{ 87, TARGET_STRING("washout_r_den"), 1, 4, 0 },
{ 87, TARGET_STRING("w_y"), 1, 2, 0 },
{ 88, TARGET_STRING("washout_r_num"), 1, 4, 0 },
{ 88, TARGET_STRING("washout_r_den"), 1, 0, 0 },
{ 89, TARGET_STRING("system_id"), 2, 2, 0 },
{ 89, TARGET_STRING("washout_r_num"), 1, 4, 0 },
{ 90, TARGET_STRING("transrate"), 3, 2, 0 },
{ 90, TARGET_STRING("system_id"), 2, 2, 0 },
{ 91, TARGET_STRING("Att0"), 0, 0, 0 },
{ 92, TARGET_STRING("X0"), 0, 0, 0 },
{ 93, TARGET_STRING("hground"), 0, 2, 0 },
{ 94, TARGET_STRING("transrate"), 3, 2, 0 },
{ 0, (NULL), 0, 0, 0 }
};
@@ -283,55 +291,59 @@ static void* rtDataAddrMap[] = {
&SIL_P.engine_pos_m[0], /* 39: Model Parameter */
&SIL_P.force_CG, /* 40: Model Parameter */
&SIL_P.force_CG_pos_m[0], /* 41: Model Parameter */
&SIL_P.hground, /* 42: Model Parameter */
&SIL_P.CLa, /* 43: Model Parameter */
&SIL_P.Clda_lst[0], /* 44: Model Parameter */
&SIL_P.Clp_lst[0], /* 45: Model Parameter */
&SIL_P.Cmde_lst[0], /* 46: Model Parameter */
&SIL_P.Cmq_lst[0], /* 47: Model Parameter */
&SIL_P.Ixx, /* 48: Model Parameter */
&SIL_P.Iyy, /* 49: Model Parameter */
&SIL_P.Ma_lst[0], /* 50: Model Parameter */
&SIL_P.RefArea, /* 51: Model Parameter */
&SIL_P.RefLen, /* 52: Model Parameter */
&SIL_P.RefSpan, /* 53: Model Parameter */
&SIL_P.dal0, /* 54: Model Parameter */
&SIL_P.dar0, /* 55: Model Parameter */
&SIL_P.del0, /* 56: Model Parameter */
&SIL_P.der0, /* 57: Model Parameter */
&SIL_P.dr0, /* 58: Model Parameter */
&SIL_P.h_thr2rpm[0], /* 59: Model Parameter */
&SIL_P.k_dal, /* 60: Model Parameter */
&SIL_P.k_dar, /* 61: Model Parameter */
&SIL_P.k_del, /* 62: Model Parameter */
&SIL_P.k_der, /* 63: Model Parameter */
&SIL_P.k_dr, /* 64: Model Parameter */
&SIL_P.ksi_v2tht, /* 65: Model Parameter */
&SIL_P.m, /* 66: Model Parameter */
&SIL_P.max_az, /* 67: Model Parameter */
&SIL_P.max_da, /* 68: Model Parameter */
&SIL_P.max_de, /* 69: Model Parameter */
&SIL_P.max_dr, /* 70: Model Parameter */
&SIL_P.max_hdot, /* 71: Model Parameter */
&SIL_P.max_p, /* 72: Model Parameter */
&SIL_P.max_phi, /* 73: Model Parameter */
&SIL_P.max_q, /* 74: Model Parameter */
&SIL_P.max_rpm[0], /* 75: Model Parameter */
&SIL_P.max_thr, /* 76: Model Parameter */
&SIL_P.max_tht, /* 77: Model Parameter */
&SIL_P.min_de, /* 78: Model Parameter */
&SIL_P.min_hdot, /* 79: Model Parameter */
&SIL_P.min_rpm[0], /* 80: Model Parameter */
&SIL_P.min_tht, /* 81: Model Parameter */
&SIL_P.recovery_ias, /* 82: Model Parameter */
&SIL_P.w_as, /* 83: Model Parameter */
&SIL_P.w_v2tht, /* 84: Model Parameter */
&SIL_P.w_x, /* 85: Model Parameter */
&SIL_P.w_y, /* 86: Model Parameter */
&SIL_P.washout_r_den[0], /* 87: Model Parameter */
&SIL_P.washout_r_num[0], /* 88: Model Parameter */
&SIL_P.system_id, /* 89: Model Parameter */
&transrate, /* 90: Model Parameter */
&SIL_P.CLa, /* 42: Model Parameter */
&SIL_P.Clda_lst[0], /* 43: Model Parameter */
&SIL_P.Clp_lst[0], /* 44: Model Parameter */
&SIL_P.Cmde_lst[0], /* 45: Model Parameter */
&SIL_P.Cmq_lst[0], /* 46: Model Parameter */
&SIL_P.Ixx, /* 47: Model Parameter */
&SIL_P.Iyy, /* 48: Model Parameter */
&SIL_P.Ma_lst[0], /* 49: Model Parameter */
&SIL_P.RefArea, /* 50: Model Parameter */
&SIL_P.RefLen, /* 51: Model Parameter */
&SIL_P.RefSpan, /* 52: Model Parameter */
&SIL_P.aoa_scale, /* 53: Model Parameter */
&SIL_P.aos_scale, /* 54: Model Parameter */
&SIL_P.dal0, /* 55: Model Parameter */
&SIL_P.dar0, /* 56: Model Parameter */
&SIL_P.del0, /* 57: Model Parameter */
&SIL_P.der0, /* 58: Model Parameter */
&SIL_P.dr0, /* 59: Model Parameter */
&SIL_P.h_thr2rpm[0], /* 60: Model Parameter */
&SIL_P.k_dal, /* 61: Model Parameter */
&SIL_P.k_dar, /* 62: Model Parameter */
&SIL_P.k_del, /* 63: Model Parameter */
&SIL_P.k_der, /* 64: Model Parameter */
&SIL_P.k_dr, /* 65: Model Parameter */
&SIL_P.ksi_v2tht, /* 66: Model Parameter */
&SIL_P.m, /* 67: Model Parameter */
&SIL_P.max_az, /* 68: Model Parameter */
&SIL_P.max_da, /* 69: Model Parameter */
&SIL_P.max_de, /* 70: Model Parameter */
&SIL_P.max_dr, /* 71: Model Parameter */
&SIL_P.max_hdot, /* 72: Model Parameter */
&SIL_P.max_p, /* 73: Model Parameter */
&SIL_P.max_phi, /* 74: Model Parameter */
&SIL_P.max_q, /* 75: Model Parameter */
&SIL_P.max_rpm[0], /* 76: Model Parameter */
&SIL_P.max_thr, /* 77: Model Parameter */
&SIL_P.max_tht, /* 78: Model Parameter */
&SIL_P.min_de, /* 79: Model Parameter */
&SIL_P.min_hdot, /* 80: Model Parameter */
&SIL_P.min_rpm[0], /* 81: Model Parameter */
&SIL_P.min_tht, /* 82: Model Parameter */
&SIL_P.recovery_ias, /* 83: Model Parameter */
&SIL_P.w_as, /* 84: Model Parameter */
&SIL_P.w_v2tht, /* 85: Model Parameter */
&SIL_P.w_x, /* 86: Model Parameter */
&SIL_P.w_y, /* 87: Model Parameter */
&SIL_P.washout_r_den[0], /* 88: Model Parameter */
&SIL_P.washout_r_num[0], /* 89: Model Parameter */
&SIL_P.system_id, /* 90: Model Parameter */
Att0, /* 91: Model Parameter */
X0, /* 92: Model Parameter */
&hground, /* 93: Model Parameter */
&transrate, /* 94: Model Parameter */
};
/* Declare Data Run-Time Dimension Buffer Addresses statically */
@@ -422,7 +434,7 @@ static rtwCAPI_ModelMappingStaticInfo mmiStatic = {
(NULL), 0 },
{ rtBlockParameters, 0,
rtModelParameters, 91 },
rtModelParameters, 95 },
{ (NULL), 0 },
@@ -430,10 +442,10 @@ static rtwCAPI_ModelMappingStaticInfo mmiStatic = {
rtElementMap, rtSampleTimeMap, rtDimensionArray },
"float",
{ 2979056592U,
3736830732U,
845784224U,
1771781300U },
{ 2705174784U,
75527174U,
4116828136U,
1947562345U },
(NULL), 0,
0
};
+2 -2
View File
@@ -3,9 +3,9 @@
*
* Code generated for Simulink model 'SIL'.
*
* Model version : 1.472
* Model version : 1.473
* Simulink Coder version : 9.0 (R2018b) 24-May-2018
* C/C++ source code generated on : Mon Oct 26 16:36:21 2020
* C/C++ source code generated on : Fri Nov 13 06:18:31 2020
*
* Target selection: ert_shrlib.tlc
* Embedded hardware selection: Intel->x86-64 (Windows64)
+86 -292
View File
@@ -3,9 +3,9 @@
*
* Code generated for Simulink model 'SIL'.
*
* Model version : 1.472
* Model version : 1.473
* Simulink Coder version : 9.0 (R2018b) 24-May-2018
* C/C++ source code generated on : Mon Oct 26 16:36:21 2020
* C/C++ source code generated on : Fri Nov 13 06:18:31 2020
*
* Target selection: ert_shrlib.tlc
* Embedded hardware selection: Intel->x86-64 (Windows64)
@@ -18,173 +18,21 @@
/* Invariant block signals (default storage) */
const ConstB_SIL_T SIL_ConstB = {
218.8095957, /* '<S260>/Bias' */
218.8095957, /* '<S260>/Math Function1' */
38.809595699999988, /* '<S260>/Bias1' */
38.8095957, /* '<S260>/Abs' */
38.8095957, /* '<S260>/Switch' */
1.0, /* '<S257>/Sign1' */
38.8095957, /* '<S257>/Abs1' */
-51.1904043, /* '<S257>/Bias' */
51.1904043, /* '<S257>/Gain' */
141.1904043, /* '<S257>/Bias1' */
141.1904043, /* '<S257>/Divide1' */
38.8095957, /* '<S257>/Switch' */
0.67735522633283352, /* '<S251>/Unit Conversion' */
0.62673432341692492, /* '<S226>/sincos1' */
0.77923301255216937, /* '<S226>/sincos1' */
{ 0.0, 0.0 }, /* '<S226>/Product3' */
0.804296421380075, /* '<S226>/Trigonometric Function1' */
0.99664718933525254, /* '<S226>/Sum' */
0.798912155510646, /* '<S226>/Product2' */
0.67407727032898734, /* '<S226>/Trigonometric Function2' */
38.621782655550049, /* '<S252>/Unit Conversion' */
0.67407727032898734, /* '<S256>/Unit Conversion' */
0.62417666933359317, /* '<S255>/Trigonometric Function' */
0.99664718933525254, /* '<S255>/Sum' */
0.99330562000985867, /* '<S255>/Product4' */
1.0067394967422765, /* '<S255>/Product1' */
0.006739496742276474, /* '<S255>/Sum1' */
0.0026256844405471444, /* '<S255>/Product2' */
1.0026256844405472, /* '<S255>/Sum2' */
4.0574096816069789E+13, /* '<S255>/Product3' */
6.36977996606396E+6, /* '<S255>/sqrt' */
0.62417666933359317, /* '<S226>/sincos' */
0.7812832299874497, /* '<S226>/sincos' */
{ 3.9758680436056508E+6, 4.9766022661957992E+6 },/* '<S226>/Product1' */
{ 3.9758680436056508E+6, 4.9766022661957992E+6 },/* '<S226>/Sum1' */
0.67407727032898723, /* '<S226>/Trigonometric Function3' */
38.621782655550042, /* '<S253>/Unit Conversion' */
0.0, /* '<S227>/Switch1' */
105.5849123, /* '<S227>/Sum' */
285.5849123, /* '<S258>/Bias' */
285.5849123, /* '<S258>/Math Function1' */
105.58491229999998, /* '<S258>/Bias1' */
105.5849123, /* '<S258>/Abs' */
105.5849123, /* '<S258>/Switch' */
{ 0.67407727032898723, 1.8428043600644588 },/* '<S249>/Unit Conversion' */
{ 0.62417666933359317, 0.96323334807022543 },/* '<S225>/sincos' */
{ 0.78128322998744981, -0.268666181655645 },/* '<S225>/sincos' */
-0.16769516242839461, /* '<S240>/u(1)*u(4)' */
0.16769516242839461, /* '<S240>/Unary Minus' */
-0.96323334807022543, /* '<S243>/Unary Minus' */
-0.20990438219231725, /* '<S246>/u(3)*u(4)' */
0.20990438219231725, /* '<S246>/Unary Minus' */
0.601227782989519, /* '<S241>/u(1)*u(2)' */
-0.601227782989519, /* '<S241>/Unary Minus' */
0.75255806141193127, /* '<S247>/u(2)*u(3)' */
-0.75255806141193127, /* '<S247>/Unary Minus' */
-0.62417666933359317, /* '<S248>/Unary Minus' */
{ 0.16769516242839461, -0.96323334807022543, 0.20990438219231725,
-0.601227782989519, -0.268666181655645, -0.75255806141193127,
0.78128322998744981, 0.0, -0.62417666933359317 },/* '<S250>/Vector Concatenate' */
{ 0.16769516242839461, -0.601227782989519, 0.78128322998744981,
-0.96323334807022543, -0.268666181655645, 0.0, 0.20990438219231725,
-0.75255806141193127, -0.62417666933359317 },/* '<S222>/Math Function1' */
0.67407727032898723, /* '<S263>/Unit Conversion' */
0.62417666933359317, /* '<S228>/Trigonometric Function' */
0.99664718933525254, /* '<S228>/Sum' */
0.99330562000985867, /* '<S228>/Product4' */
1.0067394967422765, /* '<S228>/Product1' */
0.006739496742276474, /* '<S228>/Sum1' */
0.0026256844405471444, /* '<S228>/Product2' */
1.0026256844405472, /* '<S228>/Sum2' */
4.0574096816069789E+13, /* '<S228>/Product3' */
6.36977996606396E+6, /* '<S228>/sqrt' */
-6.36977996606396E+6, /* '<S222>/Unary Minus' */
{ 0.0, 0.0, -6.36977996606396E+6 }, /* synthesized block */
{ -1.3370447284776552E+6, 4.7936292628816515E+6, 3.9758680436056508E+6 },/* '<S222>/Product1' */
{ 0.67735522633283352, 1.8428043600644588 },/* '<S238>/Unit Conversion' */
{ 0.62673432341692492, 0.96323334807022543 },/* '<S224>/sincos' */
{ 0.77923301255216937, -0.268666181655645 },/* '<S224>/sincos' */
-0.16838231758495931, /* '<S229>/u(1)*u(4)' */
0.16838231758495931, /* '<S229>/Unary Minus' */
-0.96323334807022543, /* '<S232>/Unary Minus' */
-0.20935355810241663, /* '<S235>/u(3)*u(4)' */
0.20935355810241663, /* '<S235>/Unary Minus' */
0.603691400695412, /* '<S230>/u(1)*u(2)' */
-0.603691400695412, /* '<S230>/Unary Minus' */
0.75058322360747409, /* '<S236>/u(2)*u(3)' */
-0.75058322360747409, /* '<S236>/Unary Minus' */
-0.62673432341692492, /* '<S237>/Unary Minus' */
{ 0.16838231758495931, -0.96323334807022543, 0.20935355810241663,
-0.603691400695412, -0.268666181655645, -0.75058322360747409,
0.77923301255216937, 0.0, -0.62673432341692492 },/* '<S239>/Vector Concatenate' */
{ 0.16838231758495931, -0.603691400695412, 0.77923301255216937,
-0.96323334807022543, -0.268666181655645, 0.0, 0.20935355810241663,
-0.75058322360747409, -0.62673432341692492 },/* '<S222>/Math Function' */
-1425.7, /* '<S222>/Unary Minus1' */
{ 0.0, 0.0, -1425.7 }, /* synthesized block */
{ -298.47536778661538, 1070.1065018971758, 893.53512489550985 },/* '<S222>/Product' */
{ -1.3373432038454418E+6, 4.7946993693835484E+6, 3.9767615787305464E+6 },/* '<S222>/Sum' */
0.99664718933525254, /* '<S287>/Sum1' */
6.3567523142451793E+6, /* '<S117>/Product1' */
0.99330562000985867, /* '<S288>/Product2' */
0.00669437999014133, /* '<S288>/Sum1' */
0.99330562000985867, /* '<S286>/Sum1' */
0.0067394967422764488, /* '<S286>/Product2' */
{ -1.047120418848168, 0.273, 0.0 }, /* synthesized block */
{ -0.86598683503409657, 0.26962154475039685, 0.0 },/* '<S127>/sincos' */
{ 0.50006679708577773, 0.962966366290334, 1.0 },/* '<S127>/sincos' */
0.48154750649213718, /* '<S127>/Fcn11' */
0.86598683503409657, /* '<S127>/Fcn21' */
0.13482878230865064, /* '<S127>/Fcn31' */
-0.83391619578805087, /* '<S127>/Fcn12' */
0.50006679708577773, /* '<S127>/Fcn22' */
-0.23348870819540021, /* '<S127>/Fcn32' */
-0.26962154475039685, /* '<S127>/Fcn13' */
0.0, /* '<S127>/Fcn23' */
0.962966366290334, /* '<S127>/Fcn33' */
{ 0.48154750649213718, 0.86598683503409657, 0.13482878230865064,
-0.83391619578805087, 0.50006679708577773, -0.23348870819540021,
-0.26962154475039685, 0.0, 0.962966366290334 },/* '<S218>/Vector Concatenate' */
{ 0.67735522633283352, 1.8428043600644588 },/* '<S149>/Unit Conversion' */
{ 0.62673432341692492, 0.96323334807022543 },/* '<S123>/sincos' */
{ 0.77923301255216937, -0.268666181655645 },/* '<S123>/sincos' */
-0.16838231758495931, /* '<S140>/u(1)*u(4)' */
0.16838231758495931, /* '<S140>/Unary Minus' */
-0.96323334807022543, /* '<S143>/Unary Minus' */
-0.20935355810241663, /* '<S146>/u(3)*u(4)' */
0.20935355810241663, /* '<S146>/Unary Minus' */
0.603691400695412, /* '<S141>/u(1)*u(2)' */
-0.603691400695412, /* '<S141>/Unary Minus' */
0.75058322360747409, /* '<S147>/u(2)*u(3)' */
-0.75058322360747409, /* '<S147>/Unary Minus' */
-0.62673432341692492, /* '<S148>/Unary Minus' */
{ 0.16838231758495931, -0.96323334807022543, 0.20935355810241663,
-0.603691400695412, -0.268666181655645, -0.75058322360747409,
0.77923301255216937, 0.0, -0.62673432341692492 },/* '<S150>/Vector Concatenate' */
{ 0.82789374471474875, -0.33586414493458272, 0.44920732808977226,
0.13571239966033527, -0.65713984237132461, -0.74145085619117346,
0.54421879059861955, 0.67480553029413759, -0.49846103583311674 },/* '<S111>/Product2' */
-0.3277071334896926, /* '<S170>/Add' */
0.99664718933525254, /* '<S296>/Sum' */
0.99330562000985867, /* '<S296>/Product3' */
0.00669437999014133, /* '<S296>/Sum2' */
@@ -200,75 +48,11 @@ const ConstB_SIL_T SIL_ConstB = {
{ -0.5, -0.5, 0.6 }, /* '<S316>/Selector2' */
{ 0.82789374471474875, 0.13571239966033527, 0.54421879059861955,
-0.33586414493458272, -0.65713984237132461, 0.67480553029413759,
0.44920732808977226, -0.74145085619117346, -0.49846103583311674 },/* '<S196>/Math Function' */
{ 1.0000000000000002, -5.5511151231257827E-17, 2.7755575615628914E-17,
-5.5511151231257827E-17, 1.0, 5.5511151231257827E-17, 2.7755575615628914E-17,
5.5511151231257827E-17, 1.0 }, /* '<S196>/Product' */
{ 2.2204460492503131E-16, -5.5511151231257827E-17, 2.7755575615628914E-17,
-5.5511151231257827E-17, 0.0, 5.5511151231257827E-17, 2.7755575615628914E-17,
5.5511151231257827E-17, 0.0 }, /* '<S196>/Bias1' */
{ 2.2204460492503131E-16, 5.5511151231257827E-17, 2.7755575615628914E-17,
5.5511151231257827E-17, 0.0, 5.5511151231257827E-17, 2.7755575615628914E-17,
5.5511151231257827E-17, 0.0 }, /* '<S196>/Abs2' */
0.27118372136176283, /* '<S203>/Product' */
-0.41422433117604673, /* '<S203>/Product1' */
0.022720317117939086, /* '<S203>/Product2' */
0.041138172539505656, /* '<S203>/Product3' */
0.13552504097057749, /* '<S203>/Product4' */
-0.16064905107004665, /* '<S203>/Product5' */
1.0000000000000002, /* '<S203>/Sum' */
2.2204460492503131E-16, /* '<S197>/Bias' */
2.2204460492503131E-16, /* '<S197>/Abs1' */
2.9834946229191903, /* '<S179>/Add' */
1.7272795439416258, /* '<S171>/sqrt' */
{ 0.5, 1.7272795439416258 }, /* '<S178>/Switch' */
0.28947254180930526, /* '<S178>/Product' */
-0.20015174527424745, /* '<S177>/Add' */
0.99342611868839181, /* '<S175>/Add' */
1.416256386485311, /* '<S176>/Add' */
{ -0.05793843445210501, 0.28756958367648133, 0.40996733604956481 },/* '<S171>/Product' */
0.99342611868839181, /* '<S185>/Add' */
-0.066645325897035868, /* '<S186>/Add' */
0.471576544594918, /* '<S187>/Add' */
0.33078506182345913, /* '<S189>/Add' */
0.57513916735296255, /* '<S173>/sqrt' */
{ 0.5, 0.57513916735296255 }, /* '<S188>/Switch' */
0.86935480729162429, /* '<S188>/Product' */
{ 0.8636397719708131, -0.057938434452105114, 0.409967336049565 },/* '<S173>/Product' */
-0.20015174527424745, /* '<S182>/Add' */
-0.066645325897035868, /* '<S181>/Add' */
-0.095011462508847289, /* '<S180>/Add' */
0.01342744874704338, /* '<S184>/Add' */
0.1158768689042096, /* '<S172>/sqrt' */
{ 0.5, 0.1158768689042096 }, /* '<S183>/Switch' */
4.314925012457218, /* '<S183>/Product' */
{ -0.86363977197081609, -0.28756958367648283, -0.40996733604956637 },/* '<S172>/Product' */
0.6722928665103074, /* '<S168>/Sum' */
0.81993467209912974, /* '<S168>/sqrt' */
1.6398693441982595, /* '<S168>/Gain1' */
1.416256386485311, /* '<S191>/Add' */
-0.095011462508847289, /* '<S190>/Add' */
0.471576544594918, /* '<S192>/Add' */
{ 0.0, 0.0, 0.0 }, /* '<S12>/BusConversion_InsertedFor_atmosphere_at_inport_0' */
{ 0.0, 0.0, 0.0 }, /* '<S12>/BusConversion_InsertedFor_atmosphere_at_inport_0' */
1.0, /* '<S36>/Selector4' */
1.0, /* '<S27>/Selector4' */
0, /* '<S261>/Compare' */
0, /* '<S259>/Compare' */
0, /* '<S262>/Compare' */
1 /* '<S315>/Compare' */
};
@@ -484,90 +268,95 @@ P_SIL_T SIL_P = {
*/
{ 0.0, 0.0, 0.0 },
/* Variable: hground
* Referenced by: '<Root>/Constant1'
*/
1425.0,
/* Variable: CLa
* Referenced by: '<S1006>/Constant1'
* Referenced by: '<S1021>/Constant1'
*/
4.0F,
/* Variable: Clda_lst
* Referenced by: '<S1010>/Clda'
* Referenced by: '<S1025>/Clda'
*/
{ -0.0533F, -0.0548F, -0.0566F, -0.0604F, -0.0624F, -0.0438F, -0.0311F,
-0.0278F, -0.0222F, -0.0161F, -0.0099F },
/* Variable: Clp_lst
* Referenced by: '<S1010>/Clp'
* Referenced by: '<S1025>/Clp'
*/
{ -0.3028F, -0.3136F, -0.3218F, -0.3548F, -0.3874F, -0.3523F, -0.3341F,
-0.3235F, -0.3086F, -0.2863F, -0.2472F },
/* Variable: Cmde_lst
* Referenced by: '<S1009>/Cmde1'
* Referenced by: '<S1024>/Cmde1'
*/
{ -0.9966F, -1.0408F, -1.0628F, -1.1017F, -1.166F, -1.1862F, -1.1456F,
-1.1158F, -1.0376F, -0.97F, -0.8407F },
/* Variable: Cmq_lst
* Referenced by: '<S1009>/Cmq'
* Referenced by: '<S1024>/Cmq'
*/
{ -7.4817F, -8.353F, -8.0743F, -8.6229F, -9.981F, -9.5258F, -8.6237F, -8.736F,
-8.521F, -8.2233F, -7.7842F },
/* Variable: Ixx
* Referenced by: '<S1010>/Constant'
* Referenced by: '<S1025>/Constant'
*/
5.5F,
/* Variable: Iyy
* Referenced by: '<S1009>/Constant'
* Referenced by: '<S1024>/Constant'
*/
255.0F,
/* Variable: Ma_lst
* Referenced by:
* '<S1009>/Cmde1'
* '<S1009>/Cmq'
* '<S1010>/Clda'
* '<S1010>/Clp'
* '<S1024>/Cmde1'
* '<S1024>/Cmq'
* '<S1025>/Clda'
* '<S1025>/Clp'
*/
{ 0.2F, 0.3F, 0.6F, 0.8F, 0.9F, 0.95F, 1.05F, 1.1F, 1.2F, 1.3F, 1.5F },
/* Variable: RefArea
* Referenced by:
* '<S1006>/Sc_Iyy'
* '<S1009>/Sc_Iyy'
* '<S1010>/Sc_Iyy'
* '<S1021>/Sc_Iyy'
* '<S1024>/Sc_Iyy'
* '<S1025>/Sc_Iyy'
*/
0.919F,
/* Variable: RefLen
* Referenced by:
* '<S1009>/Constant3'
* '<S1009>/Sc_Iyy'
* '<S1024>/Constant3'
* '<S1024>/Sc_Iyy'
*/
0.659F,
/* Variable: RefSpan
* Referenced by:
* '<S1010>/Constant2'
* '<S1010>/Sc_Iyy'
* '<S1025>/Constant2'
* '<S1025>/Sc_Iyy'
*/
1.7F,
/* Variable: aoa_scale
* Referenced by: '<S1027>/Gain'
*/
1.0F,
/* Variable: aos_scale
* Referenced by: '<S1027>/Gain1'
*/
1.0F,
/* Variable: dal0
* Referenced by: '<S514>/Constant4'
*/
0.0F,
-0.0218F,
/* Variable: dar0
* Referenced by: '<S514>/Constant5'
*/
0.0F,
-0.0209F,
/* Variable: del0
* Referenced by: '<S514>/Constant'
@@ -577,7 +366,7 @@ P_SIL_T SIL_P = {
/* Variable: der0
* Referenced by: '<S514>/Constant2'
*/
0.0F,
0.0061F,
/* Variable: dr0
* Referenced by: '<S514>/Constant3'
@@ -586,11 +375,11 @@ P_SIL_T SIL_P = {
/* Variable: h_thr2rpm
* Referenced by:
* '<S789>/max_rpm'
* '<S789>/min_rpm'
* '<S791>/max_rpm'
* '<S792>/max_rpm'
* '<S792>/min_rpm'
* '<S804>/max_rpm'
* '<S804>/min_rpm'
* '<S806>/max_rpm'
* '<S807>/max_rpm'
* '<S807>/min_rpm'
*/
{ 0.0F, 3000.0F, 10000.0F },
@@ -599,14 +388,14 @@ P_SIL_T SIL_P = {
* '<S5>/Constant7'
* '<S514>/Gain3'
*/
-1.0F,
-1.1214F,
/* Variable: k_dar
* Referenced by:
* '<S5>/Constant8'
* '<S514>/Gain4'
*/
-1.0F,
-1.117F,
/* Variable: k_del
* Referenced by:
@@ -630,12 +419,12 @@ P_SIL_T SIL_P = {
-1.0F,
/* Variable: ksi_v2tht
* Referenced by: '<S1004>/Constant1'
* Referenced by: '<S1019>/Constant1'
*/
0.8F,
/* Variable: m
* Referenced by: '<S1006>/Constant'
* Referenced by: '<S1021>/Constant'
*/
200.0F,
@@ -646,32 +435,35 @@ P_SIL_T SIL_P = {
/* Variable: max_da
* Referenced by:
* '<S1010>/Constant1'
* '<S631>/gain1'
* '<S632>/gain1'
* '<S636>/gain1'
* '<S637>/gain1'
* '<S1025>/Constant1'
* '<S672>/gain1'
* '<S643>/gain1'
* '<S644>/gain1'
* '<S648>/gain1'
* '<S649>/gain1'
*/
0.4363F,
/* Variable: max_de
* Referenced by:
* '<S1009>/Constant1'
* '<S631>/gain'
* '<S632>/gain'
* '<S636>/gain'
* '<S637>/gain'
* '<S1024>/Constant1'
* '<S672>/gain'
* '<S643>/gain'
* '<S644>/gain'
* '<S648>/gain'
* '<S649>/gain'
*/
0.4363F,
0.349F,
/* Variable: max_dr
* Referenced by:
* '<S631>/gain2'
* '<S632>/gain2'
* '<S636>/gain2'
* '<S637>/gain2'
* '<S672>/gain2'
* '<S643>/gain2'
* '<S644>/gain2'
* '<S648>/gain2'
* '<S649>/gain2'
*/
0.4363F,
0.349F,
/* Variable: max_hdot
* Referenced by: '<S518>/Constant9'
@@ -695,9 +487,9 @@ P_SIL_T SIL_P = {
/* Variable: max_rpm
* Referenced by:
* '<S789>/max_rpm'
* '<S791>/max_rpm'
* '<S792>/max_rpm'
* '<S804>/max_rpm'
* '<S806>/max_rpm'
* '<S807>/max_rpm'
*/
{ 46000.0F, 46000.0F, 46000.0F },
@@ -712,9 +504,9 @@ P_SIL_T SIL_P = {
0.34904F,
/* Variable: min_de
* Referenced by: '<S1009>/Constant2'
* Referenced by: '<S1024>/Constant2'
*/
-0.34904F,
-0.349F,
/* Variable: min_hdot
* Referenced by: '<S518>/Constant10'
@@ -723,8 +515,8 @@ P_SIL_T SIL_P = {
/* Variable: min_rpm
* Referenced by:
* '<S789>/min_rpm'
* '<S792>/min_rpm'
* '<S804>/min_rpm'
* '<S807>/min_rpm'
*/
{ 20000.0F, 30000.0F, 38000.0F },
@@ -734,7 +526,9 @@ P_SIL_T SIL_P = {
-0.2F,
/* Variable: recovery_ias
* Referenced by: '<S592>/Constant'
* Referenced by:
* '<S595>/Constant'
* '<S654>/Constant'
*/
85.0F,
@@ -744,7 +538,7 @@ P_SIL_T SIL_P = {
0.5F,
/* Variable: w_v2tht
* Referenced by: '<S1004>/Constant'
* Referenced by: '<S1019>/Constant'
*/
0.4F,
@@ -761,28 +555,28 @@ P_SIL_T SIL_P = {
/* Variable: washout_r_den
* Referenced by: '<S518>/Constant3'
*/
{ 1.0F, -0.995F },
{ 1.0F, -1.802F, 0.8025F },
/* Variable: washout_r_num
* Referenced by: '<S518>/Constant4'
*/
{ 1.0F, -1.0F },
{ 0.193F, -0.193F },
/* Variable: system_id
* Referenced by:
* '<S6>/Constant'
* '<S919>/system_id'
* '<S927>/Chart_proc_mission_clr_all'
* '<S928>/Chart'
* '<S929>/Chart'
* '<S930>/Chart_proc_mission_req'
* '<S931>/Chart_proc_mission_req_lst'
* '<S932>/Chart'
* '<S968>/Chart'
* '<S969>/Chart_proc_param_req_read'
* '<S970>/Chart_proc_param_set'
* '<S998>/system_id'
* '<S1000>/system_id'
* '<S934>/system_id'
* '<S942>/Chart_proc_mission_clr_all'
* '<S943>/Chart'
* '<S944>/Chart'
* '<S945>/Chart_proc_mission_req'
* '<S946>/Chart_proc_mission_req_lst'
* '<S947>/Chart'
* '<S983>/Chart'
* '<S984>/Chart_proc_param_req_read'
* '<S985>/Chart_proc_param_set'
* '<S1013>/system_id'
* '<S1015>/system_id'
*/
1U
};
+30 -8
View File
@@ -3,9 +3,9 @@
*
* Code generated for Simulink model 'SIL'.
*
* Model version : 1.472
* Model version : 1.473
* Simulink Coder version : 9.0 (R2018b) 24-May-2018
* C/C++ source code generated on : Mon Oct 26 16:36:21 2020
* C/C++ source code generated on : Fri Nov 13 06:18:31 2020
*
* Target selection: ert_shrlib.tlc
* Embedded hardware selection: Intel->x86-64 (Windows64)
@@ -199,6 +199,9 @@ extern const uint8_T rtCP_pooled_mhMab4fllVU3;
#define rtCP_Bias1_Bias rtCP_pooled_FEWufo6vVHrj /* Expression: -eye(3)
* Referenced by: '<S158>/Bias1'
*/
#define rtCP_Bias1_Bias_n rtCP_pooled_FEWufo6vVHrj /* Expression: -eye(3)
* Referenced by: '<S196>/Bias1'
*/
#define rtCP_Constant_Value_d rtCP_pooled_B5TQ9jFT4w0p /* Expression: [0 0 0]
* Referenced by: '<S316>/Constant'
*/
@@ -686,16 +689,16 @@ extern const uint8_T rtCP_pooled_mhMab4fllVU3;
* Referenced by: '<S518>/IAS_lookup'
*/
#define rtCP_uDLookupTable_tableData_n rtCP_pooled_HF8NWw8ahBZB /* Computed Parameter: rtCP_uDLookupTable_tableData_n
* Referenced by: '<S1010>/1-D Lookup Table'
* Referenced by: '<S1025>/1-D Lookup Table'
*/
#define rtCP_uDLookupTable_bp01Data_d rtCP_pooled_NsfoROSYwB8n /* Computed Parameter: rtCP_uDLookupTable_bp01Data_d
* Referenced by: '<S1010>/1-D Lookup Table'
* Referenced by: '<S1025>/1-D Lookup Table'
*/
#define rtCP_uDLookupTable_tableData_m rtCP_pooled_HF8NWw8ahBZB /* Computed Parameter: rtCP_uDLookupTable_tableData_m
* Referenced by: '<S1009>/1-D Lookup Table'
* Referenced by: '<S1024>/1-D Lookup Table'
*/
#define rtCP_uDLookupTable_bp01Data_a rtCP_pooled_NsfoROSYwB8n /* Computed Parameter: rtCP_uDLookupTable_bp01Data_a
* Referenced by: '<S1009>/1-D Lookup Table'
* Referenced by: '<S1024>/1-D Lookup Table'
*/
#define rtCP_table2D_CL_base_maxIndex rtCP_pooled_qhm2sJNkM8ZA /* Computed Parameter: rtCP_table2D_CL_base_maxIndex
* Referenced by: '<S50>/table2D_CL_base'
@@ -815,7 +818,7 @@ extern const uint8_T rtCP_pooled_mhMab4fllVU3;
* Referenced by: '<S302>/table3D_cft'
*/
#define rtCP_mav_parser_P1 rtCP_pooled_e6HU8n7YauPz /* Expression: Channel
* Referenced by: '<S915>/mav_parser'
* Referenced by: '<S930>/mav_parser'
*/
#define rtCP_ConstantBP_Value_h rtCP_pooled_mhMab4fllVU3 /* Computed Parameter: rtCP_ConstantBP_Value_h
* Referenced by: '<S6>/Constant BP'
@@ -1313,6 +1316,26 @@ extern "C" {
extern "C" {
#endif
extern void mav_scaled_pressure_encode_Start_wrapper(void);
extern void mav_scaled_pressure_encode_Outputs_wrapper(const
mavlink_scaled_pressure_t *obj,
const uint8_T *sys_id,
const uint8_T *comp_id,
const uint8_T *channel,
mavlink_message_t *msg);
extern void mav_scaled_pressure_encode_Terminate_wrapper(void);
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
extern "C" {
#endif
extern void mav_heartbeat_encode_Start_wrapper(void);
@@ -1952,7 +1975,6 @@ extern void SIL_theta2_Init(DW_theta2_SIL_T *localDW);
extern void SIL_theta2_Reset(DW_theta2_SIL_T *localDW);
extern real32_T SIL_theta2(real32_T rtu_y, real32_T rtu_max_tht, real32_T
rtu_tht0, DW_theta2_SIL_T *localDW, real32_T rtp_Ts);
extern void SIL_fixtype(uint32_T rtu_stat, ENUM_GPS_FIXTYPE *rty_fixtype);
extern void SIL_dummyclear_mission(uint8_T rtu_type, uint8_T *rty_ack);
extern void SIL_find_val_Start(void);
extern void SIL_find_val(uint16_T rtu_idx, uint8_T rty_name[16], uint8_T
+26 -2
View File
@@ -3,9 +3,9 @@
*
* Code generated for Simulink model 'SIL'.
*
* Model version : 1.472
* Model version : 1.473
* Simulink Coder version : 9.0 (R2018b) 24-May-2018
* C/C++ source code generated on : Mon Oct 26 16:36:21 2020
* C/C++ source code generated on : Fri Nov 13 06:18:31 2020
*
* Target selection: ert_shrlib.tlc
* Embedded hardware selection: Intel->x86-64 (Windows64)
@@ -570,6 +570,18 @@ typedef enum {
#endif
#ifndef DEFINED_TYPEDEF_FOR_ENUM_BIT_MODE_
#define DEFINED_TYPEDEF_FOR_ENUM_BIT_MODE_
/* BIT Modes */
typedef enum {
ENUM_BIT_MODE_IDLE = 0, /* Default value */
ENUM_BIT_MODE_MANUAL,
ENUM_BIT_MODE_STAB
} ENUM_BIT_MODE;
#endif
#ifndef DEFINED_TYPEDEF_FOR_C2_
#define DEFINED_TYPEDEF_FOR_C2_
@@ -762,6 +774,18 @@ typedef struct {
/* 回收 */
uint8_T recovery;
/* 大气机mos控制 */
uint8_T SDAS_MOS[4];
/* 迎角中位 */
real32_T trim_aoa;
/* 侧滑角中位 */
real32_T trim_aos;
/* BIT模式 */
ENUM_BIT_MODE BIT_MODE;
} C2;
#endif
Binary file not shown.
+2 -2
View File
@@ -3,9 +3,9 @@
*
* Code generated for Simulink model 'SIL'.
*
* Model version : 1.472
* Model version : 1.473
* Simulink Coder version : 9.0 (R2018b) 24-May-2018
* C/C++ source code generated on : Mon Oct 26 16:36:21 2020
* C/C++ source code generated on : Fri Nov 13 06:18:31 2020
*
* Target selection: ert_shrlib.tlc
* Embedded hardware selection: Intel->x86-64 (Windows64)
Binary file not shown.
@@ -0,0 +1,56 @@
/*
* File: rt_modd_snf.c
*
* Code generated for Simulink model 'SIL'.
*
* Model version : 1.473
* Simulink Coder version : 9.0 (R2018b) 24-May-2018
* C/C++ source code generated on : Fri Nov 13 06:18:31 2020
*/
#include "rtwtypes.h"
#include "rtGetNaN.h"
#include "rt_nonfinite.h"
#include <float.h>
#include <math.h>
#include "rt_modd_snf.h"
real_T rt_modd_snf(real_T u0, real_T u1)
{
real_T y;
boolean_T yEq;
real_T q;
y = u0;
if (rtIsNaN(u0) || rtIsInf(u0) || (rtIsNaN(u1) || rtIsInf(u1))) {
if (u1 != 0.0) {
y = (rtNaN);
}
} else if (u0 == 0.0) {
y = u1 * 0.0;
} else {
if (u1 != 0.0) {
y = fmod(u0, u1);
yEq = (y == 0.0);
if ((!yEq) && (u1 > floor(u1))) {
q = fabs(u0 / u1);
yEq = (fabs(q - floor(q + 0.5)) <= DBL_EPSILON * q);
}
if (yEq) {
y = u1 * 0.0;
} else {
if ((u0 < 0.0) != (u1 < 0.0)) {
y += u1;
}
}
}
}
return y;
}
/*
* File trailer for generated code.
*
* [EOF]
*/
@@ -0,0 +1,23 @@
/*
* File: rt_modd_snf.h
*
* Code generated for Simulink model 'SIL'.
*
* Model version : 1.473
* Simulink Coder version : 9.0 (R2018b) 24-May-2018
* C/C++ source code generated on : Fri Nov 13 06:18:31 2020
*/
#ifndef SHARE_rt_modd_snf
#define SHARE_rt_modd_snf
#include "rtwtypes.h"
extern real_T rt_modd_snf(real_T u0, real_T u1);
#endif
/*
* File trailer for generated code.
*
* [EOF]
*/
+64 -8
View File
@@ -115,6 +115,9 @@ MainWindow::MainWindow(QWidget *parent)
u = (ExtU_SIL_T *)mdl->resolve("SIL_U");
y = (ExtY_SIL_T *)mdl->resolve("SIL_Y");
m = (RT_MODEL_SIL_T *)mdl->resolve("SIL_M_");
X0 = (real_T *)mdl->resolve("X0");
Att0 = (real_T *)mdl->resolve("Att0");
hground = (real_T *)mdl->resolve("hground");
}
else
{
@@ -123,19 +126,27 @@ MainWindow::MainWindow(QWidget *parent)
getmap_func = &SIL_GetCAPIStaticMap;
u = &SIL_U;
y = &SIL_Y;
X0 = ::X0;
Att0 = ::Att0;
hground = &::hground;
}
if (init_func && step_func && u && y && getmap_func)
ui->pushButton->setText(QString("Fail"));
stage = 0;
if (init_func && step_func && u && y && getmap_func && X0 && Att0 && hground)
{
ui->lineEditLat->setText(QString("%1").arg(X0[0]));
ui->lineEditLon->setText(QString("%1").arg(X0[1]));
ui->lineEditAlt->setText(QString("%1").arg(*hground));
ui->lineEditHdg->setText(QString("%1").arg(Att0[2]*57.3));
gear_height = X0[2] - *hground;
qgc_sock = new QUdpSocket(this);
if (qgc_sock->bind(QHostAddress::LocalHost, 6061))
{
(*init_func)();
seq = 0;
timer200Hz = new QTimer(this);
connect(timer200Hz, SIGNAL(timeout()), this, SLOT(update200Hz()));
timer200Hz->start(5);
ui->pushButton->setText(QString("Start"));
stage = 1;
}
}
}
@@ -171,5 +182,50 @@ void MainWindow::update200Hz(void)
void MainWindow::onFire()
{
u->launch_trigger = 1.0;
if (stage == 1)
{
bool ok;
real_T val;
val = ui->lineEditLat->text().toDouble(&ok);
if (ok)
{
X0[0] = val;
}
val = ui->lineEditLon->text().toDouble(&ok);
if (ok)
{
X0[1] = val;
}
val = ui->lineEditAlt->text().toDouble(&ok);
if (ok)
{
X0[2] = val+gear_height;
*hground = val;
}
val = ui->lineEditHdg->text().toDouble(&ok);
if (ok)
{
Att0[2] = val/57.3;
}
(*init_func)();
seq = 0;
timer200Hz = new QTimer(this);
connect(timer200Hz, SIGNAL(timeout()), this, SLOT(update200Hz()));
timer200Hz->start(5);
stage = 2;
ui->pushButton->setText(QString("Launch"));
}
else if (stage == 2)
{
u->launch_trigger = 1.0;
ui->pushButton->setText(QString("Flying"));
stage = 3;
}
}
+6
View File
@@ -43,6 +43,12 @@ private:
ExtY_SIL_T *y;
RT_MODEL_SIL_T *m;
real_T *Att0;
real_T *X0;
real_T *hground;
int stage;
real_T gear_height;
void setup_param(const QVector<QString> &head, const QVector<double> &onecase);
uint8_t seq;