MIT_MatlabToolbox/trunk/matlab/Simulation/DroneRS_Compensator_ert_shrlib_rtw/DroneRS_Compensator.c
/* Initial conditions for atomic system: '<Root>/DroneRS_Compensator' */
Initial conditions for atomic system: '/DroneRS_Compensator'
Initial conditions for atomic system : ' / DroneRS_Compensator '
void DroneR_DroneRS_Compensator_Init(DW_DroneRS_Compensator_DroneR_T *localDW,
  P_DroneRS_Compensator_DroneRS_T *localP)
{
  int32_T i;
  localDW->FIRaccelero_circBuf = 0;
  for (i = 0; i < 15; i++) {
    localDW->FIRaccelero_states[i] = localP->FIRaccelero_InitialStates;
  }
  for (i = 0; i < 5; i++) {
    localDW->IIRgyroz_states[i] = localP->IIRgyroz_InitialStates;
  }
  localDW->yaw_cur = 0.0;
  localDW->pitch_cur = 0.0;
  localDW->roll_cur = 0.0;
  localDW->Delay_DSTATE[0] = localP->Delay_InitialCondition;
  localDW->Delay_DSTATE[1] = localP->Delay_InitialCondition;
  for (i = 0; i < 10; i++) {
    localDW->IIRgyroz_states_n[i] = localP->IIRgyroz_InitialStates_c;
  }
  localDW->UD_DSTATE[0] = localP->DiscreteDerivative_ICPrevScaled;
  localDW->UD_DSTATE[1] = localP->DiscreteDerivative_ICPrevScaled;
  localDW->Delay2_DSTATE = localP->Delay2_InitialCondition;
  for (i = 0; i < 5; i++) {
    localDW->IIRprs_states[i] = localP->IIRprs_InitialStates;
    localDW->IIRsonar_states[i] = localP->IIRsonar_InitialStates;
  }
  localDW->icLoad = 1U;
  localDW->Delay_DSTATE_l[0] = localP->Delay_InitialCondition_n;
  localDW->Delay_DSTATE_l[1] = localP->Delay_InitialCondition_n;
  localDW->icLoad_c = 1U;
  localDW->Delay1_DSTATE[0] = localP->Delay1_InitialCondition;
  localDW->Delay1_DSTATE[1] = localP->Delay1_InitialCondition;
  localDW->icLoad_e = 1U;
  localDW->SimplyIntegrateVelocity_DSTATE[0] =
    localP->SimplyIntegrateVelocity_IC;
  localDW->SimplyIntegrateVelocity_DSTATE[1] =
    localP->SimplyIntegrateVelocity_IC;
  localDW->SimplyIntegrateVelocity_PrevRes = 2;
}
void DroneR_DroneRS_Compensator_Init ( DW_DroneRS_Compensator_DroneR_T * localDW , P_DroneRS_Compensator_DroneRS_T * localP ) { int32_T i ; localDW -> FIRaccelero_circBuf = 0 ; for ( i = 0 ; i < 15 ; i ++ ) { localDW -> FIRaccelero_states [ i ] = localP -> FIRaccelero_InitialStates ; } for ( i = 0 ; i < 5 ; i ++ ) { localDW -> IIRgyroz_states [ i ] = localP -> IIRgyroz_InitialStates ; } localDW -> yaw_cur = 0.0 ; localDW -> pitch_cur = 0.0 ; localDW -> roll_cur = 0.0 ; localDW -> Delay_DSTATE [ 0 ] = localP -> Delay_InitialCondition ; localDW -> Delay_DSTATE [ 1 ] = localP -> Delay_InitialCondition ; for ( i = 0 ; i < 10 ; i ++ ) { localDW -> IIRgyroz_states_n [ i ] = localP -> IIRgyroz_InitialStates_c ; } localDW -> UD_DSTATE [ 0 ] = localP -> DiscreteDerivative_ICPrevScaled ; localDW -> UD_DSTATE [ 1 ] = localP -> DiscreteDerivative_ICPrevScaled ; localDW -> Delay2_DSTATE = localP -> Delay2_InitialCondition ; for ( i = 0 ; i < 5 ; i ++ ) { localDW -> IIRprs_states [ i ] = localP -> IIRprs_InitialStates ; localDW -> IIRsonar_states [ i ] = localP -> IIRsonar_InitialStates ; } localDW -> icLoad = 1U ; localDW -> Delay_DSTATE_l [ 0 ] = localP -> Delay_InitialCondition_n ; localDW -> Delay_DSTATE_l [ 1 ] = localP -> Delay_InitialCondition_n ; localDW -> icLoad_c = 1U ; localDW -> Delay1_DSTATE [ 0 ] = localP -> Delay1_InitialCondition ; localDW -> Delay1_DSTATE [ 1 ] = localP -> Delay1_InitialCondition ; localDW -> icLoad_e = 1U ; localDW -> SimplyIntegrateVelocity_DSTATE [ 0 ] = localP -> SimplyIntegrateVelocity_IC ; localDW -> SimplyIntegrateVelocity_DSTATE [ 1 ] = localP -> SimplyIntegrateVelocity_IC ; localDW -> SimplyIntegrateVelocity_PrevRes = 2 ; }
Initial conditions for atomic system: '<Root>/DroneRS_Compensator'
Initial conditions for atomic system : ' <Root > / DroneRS_Compensator '
/* InitializeConditions for DiscreteFir: '<S27>/FIRaccelero' */ /* End of InitializeConditions for DiscreteFir: '<S27>/FIRaccelero' */ /* InitializeConditions for DiscreteFilter: '<S27>/IIRgyroz' */ /* End of InitializeConditions for DiscreteFilter: '<S27>/IIRgyroz' */ /* InitializeConditions for MATLAB Function: '<S5>/EstimatorAttitude' */ /* InitializeConditions for Delay: '<S83>/Delay' */ /* InitializeConditions for DiscreteFilter: '<S86>/IIRgyroz' */ /* End of InitializeConditions for DiscreteFilter: '<S86>/IIRgyroz' */ /* InitializeConditions for UnitDelay: '<S133>/UD' */ /* InitializeConditions for Delay: '<S24>/Delay2' */ /* InitializeConditions for DiscreteFilter: '<S29>/IIRprs' */ /* InitializeConditions for DiscreteFilter: '<S29>/IIRsonar' */ /* InitializeConditions for Delay: '<S28>/MemoryX' */ /* InitializeConditions for Delay: '<S82>/Delay' */ /* InitializeConditions for Delay: '<S85>/MemoryX' */ /* InitializeConditions for Delay: '<S5>/Delay1' */ /* InitializeConditions for Delay: '<S145>/MemoryX' */ /* InitializeConditions for DiscreteIntegrator: '<S83>/SimplyIntegrateVelocity' */