]> rtime.felk.cvut.cz Git - eurobot/public.git/commitdiff
Matlab: Added controller with MCL feedback model
authorMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 25 Apr 2008 06:43:05 +0000 (08:43 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 25 Apr 2008 06:43:05 +0000 (08:43 +0200)
src/mcl/matlab/reg_mcl.mdl [new file with mode: 0644]

diff --git a/src/mcl/matlab/reg_mcl.mdl b/src/mcl/matlab/reg_mcl.mdl
new file mode 100644 (file)
index 0000000..22e3bfc
--- /dev/null
@@ -0,0 +1,2028 @@
+Model {
+  Name                   "reg_mcl"
+  Version                6.6
+  MdlSubVersion                  0
+  GraphicalInterface {
+    NumRootInports         0
+    NumRootOutports        0
+    ParameterArgumentNames  ""
+    ComputedModelVersion    "1.260"
+    NumModelReferences     0
+    NumTestPointedSignals   0
+  }
+  SavedCharacterEncoding  "iso-8859-2"
+  PreLoadFcn             "init"
+  PostLoadFcn            "figure(2); hold off\nfigure(1);\nsim('reg_test', 0)"
+"; % show figures"
+  SaveDefaultBlockParams  on
+  SampleTimeColors       off
+  LibraryLinkDisplay     "none"
+  WideLines              off
+  ShowLineDimensions     on
+  ShowPortDataTypes      off
+  ShowLoopsOnError       on
+  IgnoreBidirectionalLines off
+  ShowStorageClass       off
+  ShowTestPointIcons     on
+  ShowViewerIcons        on
+  SortedOrder            off
+  ExecutionContextIcon   off
+  ShowLinearizationAnnotations on
+  ScopeRefreshTime       0.035000
+  OverrideScopeRefreshTime on
+  DisableAllScopes       off
+  DataTypeOverride       "UseLocalSettings"
+  MinMaxOverflowLogging          "UseLocalSettings"
+  MinMaxOverflowArchiveMode "Overwrite"
+  BlockNameDataTip       off
+  BlockParametersDataTip  off
+  BlockDescriptionStringDataTip        off
+  ToolBar                on
+  StatusBar              on
+  BrowserShowLibraryLinks off
+  BrowserLookUnderMasks          off
+  InitFcn                "figure(2); hold off\nfigure(1);"
+  Created                "Thu Mar 29 23:35:11 2007"
+  Creator                "wsh"
+  UpdateHistory                  "UpdateHistoryNever"
+  ModifiedByFormat       "%<Auto>"
+  LastModifiedBy         "wsh"
+  ModifiedDateFormat     "%<Auto>"
+  LastModifiedDate       "Fri Apr 25 08:39:02 2008"
+  ModelVersionFormat     "1.%<AutoIncrement:260>"
+  ConfigurationManager   "None"
+  SimulationMode         "normal"
+  LinearizationMsg       "none"
+  Profile                off
+  ParamWorkspaceSource   "MATLABWorkspace"
+  AccelSystemTargetFile          "accel.tlc"
+  AccelTemplateMakefile          "accel_default_tmf"
+  AccelMakeCommand       "make_rtw"
+  AccelVerboseBuild      off
+  TryForcingSFcnDF       off
+  RecordCoverage         off
+  CovPath                "/"
+  CovSaveName            "covdata"
+  CovMetricSettings      "dw"
+  CovNameIncrementing    off
+  CovHtmlReporting       on
+  covSaveCumulativeToWorkspaceVar on
+  CovSaveSingleToWorkspaceVar on
+  CovCumulativeVarName   "covCumulativeData"
+  CovCumulativeReport    off
+  CovReportOnPause       on
+  ExtModeBatchMode       off
+  ExtModeEnableFloating          on
+  ExtModeTrigType        "manual"
+  ExtModeTrigMode        "normal"
+  ExtModeTrigPort        "1"
+  ExtModeTrigElement     "any"
+  ExtModeTrigDuration    1000
+  ExtModeTrigDurationFloating "auto"
+  ExtModeTrigHoldOff     0
+  ExtModeTrigDelay       0
+  ExtModeTrigDirection   "rising"
+  ExtModeTrigLevel       0
+  ExtModeArchiveMode     "off"
+  ExtModeAutoIncOneShot          off
+  ExtModeIncDirWhenArm   off
+  ExtModeAddSuffixToVar          off
+  ExtModeWriteAllDataToWs off
+  ExtModeArmWhenConnect          on
+  ExtModeSkipDownloadWhenConnect off
+  ExtModeLogAll                  on
+  ExtModeAutoUpdateStatusClock off
+  BufferReuse            on
+  ProdHWDeviceType       "32-bit Generic"
+  ShowModelReferenceBlockVersion off
+  ShowModelReferenceBlockIO off
+  Array {
+    Type                   "Handle"
+    Dimension              1
+    Simulink.ConfigSet {
+      $ObjectID                      1
+      Version                "1.2.0"
+      Array {
+       Type                    "Handle"
+       Dimension               7
+       Simulink.SolverCC {
+         $ObjectID               2
+         Version                 "1.2.0"
+         StartTime               "0.0"
+         StopTime                "100"
+         AbsTol                  "auto"
+         FixedStep               "0.05"
+         InitialStep             "auto"
+         MaxNumMinSteps          "-1"
+         MaxOrder                5
+         ConsecutiveZCsStepRelTol "10*128*eps"
+         MaxConsecutiveZCs       "1000"
+         ExtrapolationOrder      4
+         NumberNewtonIterations  1
+         MaxStep                 "auto"
+         MinStep                 "auto"
+         MaxConsecutiveMinStep   "1"
+         RelTol                  "1e-3"
+         SolverMode              "Auto"
+         Solver                  "ode45"
+         SolverName              "ode45"
+         ZeroCrossControl        "UseLocalSettings"
+         AlgebraicLoopSolver     "TrustRegion"
+         SolverResetMethod       "Fast"
+         PositivePriorityOrder   off
+         AutoInsertRateTranBlk   off
+         SampleTimeConstraint    "Unconstrained"
+         RateTranMode            "Deterministic"
+       }
+       Simulink.DataIOCC {
+         $ObjectID               3
+         Version                 "1.2.0"
+         Decimation              "1"
+         ExternalInput           "[t, u]"
+         FinalStateName          "xFinal"
+         InitialState            "xInitial"
+         LimitDataPoints         on
+         MaxDataPoints           "1000"
+         LoadExternalInput       off
+         LoadInitialState        off
+         SaveFinalState          off
+         SaveFormat              "Array"
+         SaveOutput              on
+         SaveState               off
+         SignalLogging           on
+         InspectSignalLogs       off
+         SaveTime                on
+         StateSaveName           "xout"
+         TimeSaveName            "tout"
+         OutputSaveName          "yout"
+         SignalLoggingName       "logsout"
+         OutputOption            "RefineOutputTimes"
+         OutputTimes             "[]"
+         Refine                  "1"
+       }
+       Simulink.OptimizationCC {
+         $ObjectID               4
+         Array {
+           Type                    "Cell"
+           Dimension               5
+           Cell                    "ZeroExternalMemoryAtStartup"
+           Cell                    "ZeroInternalMemoryAtStartup"
+           Cell                    "InitFltsAndDblsToZero"
+           Cell                    "OptimizeModelRefInitCode"
+           Cell                    "NoFixptDivByZeroProtection"
+           PropName                "DisabledProps"
+         }
+         Version                 "1.2.0"
+         BlockReduction          on
+         BooleanDataType         on
+         ConditionallyExecuteInputs on
+         InlineParams            off
+         InlineInvariantSignals  off
+         OptimizeBlockIOStorage  on
+         BufferReuse             on
+         EnforceIntegerDowncast  on
+         ExpressionFolding       on
+         ExpressionDepthLimit    2147483647
+         FoldNonRolledExpr       on
+         LocalBlockOutputs       on
+         RollThreshold           5
+         SystemCodeInlineAuto    off
+         StateBitsets            off
+         DataBitsets             off
+         UseTempVars             off
+         ZeroExternalMemoryAtStartup on
+         ZeroInternalMemoryAtStartup on
+         InitFltsAndDblsToZero   on
+         NoFixptDivByZeroProtection off
+         EfficientFloat2IntCast  off
+         OptimizeModelRefInitCode off
+         LifeSpan                "inf"
+         BufferReusableBoundary  on
+       }
+       Simulink.DebuggingCC {
+         $ObjectID               5
+         Version                 "1.2.0"
+         RTPrefix                "error"
+         ConsistencyChecking     "none"
+         ArrayBoundsChecking     "none"
+         SignalInfNanChecking    "none"
+         ReadBeforeWriteMsg      "UseLocalSettings"
+         WriteAfterWriteMsg      "UseLocalSettings"
+         WriteAfterReadMsg       "UseLocalSettings"
+         AlgebraicLoopMsg        "warning"
+         ArtificialAlgebraicLoopMsg "warning"
+         CheckSSInitialOutputMsg on
+         CheckExecutionContextPreStartOutputMsg off
+         CheckExecutionContextRuntimeOutputMsg off
+         SignalResolutionControl "TryResolveAllWithWarning"
+         BlockPriorityViolationMsg "warning"
+         MinStepSizeMsg          "warning"
+         TimeAdjustmentMsg       "none"
+         MaxConsecutiveZCsMsg    "error"
+         SolverPrmCheckMsg       "warning"
+         InheritedTsInSrcMsg     "warning"
+         DiscreteInheritContinuousMsg "warning"
+         MultiTaskDSMMsg         "error"
+         MultiTaskCondExecSysMsg "error"
+         MultiTaskRateTransMsg   "error"
+         SingleTaskRateTransMsg  "none"
+         TasksWithSamePriorityMsg "warning"
+         SigSpecEnsureSampleTimeMsg "warning"
+         CheckMatrixSingularityMsg "none"
+         IntegerOverflowMsg      "warning"
+         Int32ToFloatConvMsg     "warning"
+         ParameterDowncastMsg    "error"
+         ParameterOverflowMsg    "error"
+         ParameterUnderflowMsg   "none"
+         ParameterPrecisionLossMsg "warning"
+         ParameterTunabilityLossMsg "warning"
+         UnderSpecifiedDataTypeMsg "none"
+         UnnecessaryDatatypeConvMsg "none"
+         VectorMatrixConversionMsg "none"
+         InvalidFcnCallConnMsg   "error"
+         FcnCallInpInsideContextMsg "Use local settings"
+         SignalLabelMismatchMsg  "none"
+         UnconnectedInputMsg     "warning"
+         UnconnectedOutputMsg    "warning"
+         UnconnectedLineMsg      "warning"
+         SFcnCompatibilityMsg    "none"
+         UniqueDataStoreMsg      "none"
+         BusObjectLabelMismatch  "warning"
+         RootOutportRequireBusObject "warning"
+         AssertControl           "UseLocalSettings"
+         EnableOverflowDetection off
+         ModelReferenceIOMsg     "none"
+         ModelReferenceVersionMismatchMessage "none"
+         ModelReferenceIOMismatchMessage "none"
+         ModelReferenceCSMismatchMessage "none"
+         ModelReferenceSimTargetVerbose off
+         UnknownTsInhSupMsg      "warning"
+         ModelReferenceDataLoggingMessage "warning"
+         ModelReferenceSymbolNameMessage "warning"
+         ModelReferenceExtraNoncontSigs "error"
+         StateNameClashWarn      "warning"
+         StrictBusMsg            "Warning"
+       }
+       Simulink.HardwareCC {
+         $ObjectID               6
+         Version                 "1.2.0"
+         ProdBitPerChar          8
+         ProdBitPerShort         16
+         ProdBitPerInt           32
+         ProdBitPerLong          32
+         ProdIntDivRoundTo       "Undefined"
+         ProdEndianess           "Unspecified"
+         ProdWordSize            32
+         ProdShiftRightIntArith  on
+         ProdHWDeviceType        "32-bit Generic"
+         TargetBitPerChar        8
+         TargetBitPerShort       16
+         TargetBitPerInt         32
+         TargetBitPerLong        32
+         TargetShiftRightIntArith on
+         TargetIntDivRoundTo     "Undefined"
+         TargetEndianess         "Unspecified"
+         TargetWordSize          32
+         TargetTypeEmulationWarnSuppressLevel 0
+         TargetPreprocMaxBitsSint 32
+         TargetPreprocMaxBitsUint 32
+         TargetHWDeviceType      "Specified"
+         TargetUnknown           off
+         ProdEqTarget            on
+       }
+       Simulink.ModelReferenceCC {
+         $ObjectID               7
+         Version                 "1.2.0"
+         UpdateModelReferenceTargets "IfOutOfDateOrStructuralChange"
+         CheckModelReferenceTargetMessage "error"
+         ModelReferenceNumInstancesAllowed "Multi"
+         ModelReferencePassRootInputsByReference on
+         ModelReferenceMinAlgLoopOccurrences off
+       }
+       Simulink.RTWCC {
+         $BackupClass            "Simulink.RTWCC"
+         $ObjectID               8
+         Array {
+           Type                    "Cell"
+           Dimension               1
+           Cell                    "IncludeHyperlinkInReport"
+           PropName                "DisabledProps"
+         }
+         Version                 "1.2.0"
+         SystemTargetFile        "grt.tlc"
+         GenCodeOnly             off
+         MakeCommand             "make_rtw"
+         GenerateMakefile        on
+         TemplateMakefile        "grt_default_tmf"
+         GenerateReport          off
+         SaveLog                 off
+         RTWVerbose              on
+         RetainRTWFile           off
+         ProfileTLC              off
+         TLCDebug                off
+         TLCCoverage             off
+         TLCAssert               off
+         ProcessScriptMode       "Default"
+         ConfigurationMode       "Optimized"
+         ConfigAtBuild           off
+         IncludeHyperlinkInReport off
+         LaunchReport            off
+         TargetLang              "C"
+         IncludeBusHierarchyInRTWFileBlockHierarchyMap off
+         IncludeERTFirstTime     off
+         Array {
+           Type                    "Handle"
+           Dimension               2
+           Simulink.CodeAppCC {
+             $ObjectID               9
+             Array {
+               Type                    "Cell"
+               Dimension               16
+               Cell                    "IgnoreCustomStorageClasses"
+               Cell                    "InsertBlockDesc"
+               Cell                    "SFDataObjDesc"
+               Cell                    "SimulinkDataObjDesc"
+               Cell                    "DefineNamingRule"
+               Cell                    "SignalNamingRule"
+               Cell                    "ParamNamingRule"
+               Cell                    "InlinedPrmAccess"
+               Cell                    "CustomSymbolStr"
+               Cell                    "CustomSymbolStrGlobalVar"
+               Cell                    "CustomSymbolStrType"
+               Cell                    "CustomSymbolStrField"
+               Cell                    "CustomSymbolStrFcn"
+               Cell                    "CustomSymbolStrBlkIO"
+               Cell                    "CustomSymbolStrTmpVar"
+               Cell                    "CustomSymbolStrMacro"
+               PropName                "DisabledProps"
+             }
+             Version                 "1.2.0"
+             ForceParamTrailComments off
+             GenerateComments        on
+             IgnoreCustomStorageClasses on
+             IncHierarchyInIds       off
+             MaxIdLength             31
+             PreserveName            off
+             PreserveNameWithParent  off
+             ShowEliminatedStatement off
+             IncAutoGenComments      off
+             SimulinkDataObjDesc     off
+             SFDataObjDesc           off
+             IncDataTypeInIds        off
+             PrefixModelToSubsysFcnNames on
+             MangleLength            1
+             CustomSymbolStrGlobalVar "$R$N$M"
+             CustomSymbolStrType     "$N$R$M"
+             CustomSymbolStrField    "$N$M"
+             CustomSymbolStrFcn      "$R$N$M$F"
+             CustomSymbolStrBlkIO    "rtb_$N$M"
+             CustomSymbolStrTmpVar   "$N$M"
+             CustomSymbolStrMacro    "$R$N$M"
+             DefineNamingRule        "None"
+             ParamNamingRule         "None"
+             SignalNamingRule        "None"
+             InsertBlockDesc         off
+             SimulinkBlockComments   on
+             EnableCustomComments    off
+             InlinedPrmAccess        "Literals"
+             ReqsInCode              off
+           }
+           Simulink.GRTTargetCC {
+             $BackupClass            "Simulink.TargetCC"
+             $ObjectID               10
+             Array {
+               Type                    "Cell"
+               Dimension               13
+               Cell                    "IncludeMdlTerminateFcn"
+               Cell                    "CombineOutputUpdateFcns"
+               Cell                    "SuppressErrorStatus"
+               Cell                    "ERTCustomFileBanners"
+               Cell                    "GenerateSampleERTMain"
+               Cell                    "GenerateTestInterfaces"
+               Cell                    "MultiInstanceERTCode"
+               Cell                    "PurelyIntegerCode"
+               Cell                    "SupportNonFinite"
+               Cell                    "SupportComplex"
+               Cell                    "SupportAbsoluteTime"
+               Cell                    "SupportContinuousTime"
+               Cell                    "SupportNonInlinedSFcns"
+               PropName                "DisabledProps"
+             }
+             Version                 "1.2.0"
+             TargetFcnLib            "ansi_tfl_tmw.mat"
+             TargetLibSuffix         ""
+             TargetPreCompLibLocation ""
+             GenFloatMathFcnCalls    "ANSI_C"
+             UtilityFuncGeneration   "Auto"
+             GenerateFullHeader      on
+             GenerateSampleERTMain   off
+             GenerateTestInterfaces  off
+             IsPILTarget             off
+             ModelReferenceCompliant on
+             IncludeMdlTerminateFcn  on
+             CombineOutputUpdateFcns off
+             SuppressErrorStatus     off
+             IncludeFileDelimiter    "Auto"
+             ERTCustomFileBanners    off
+             SupportAbsoluteTime     on
+             LogVarNameModifier      "rt_"
+             MatFileLogging          on
+             MultiInstanceERTCode    off
+             SupportNonFinite        on
+             SupportComplex          on
+             PurelyIntegerCode       off
+             SupportContinuousTime   on
+             SupportNonInlinedSFcns  on
+             EnableShiftOperators    on
+             ParenthesesLevel        "Nominal"
+             PortableWordSizes       off
+             ModelStepFunctionPrototypeControlCompliant off
+             ExtMode                 off
+             ExtModeStaticAlloc      off
+             ExtModeTesting          off
+             ExtModeStaticAllocSize  1000000
+             ExtModeTransport        0
+             ExtModeMexFile          "ext_comm"
+             ExtModeIntrfLevel       "Level1"
+             RTWCAPISignals          off
+             RTWCAPIParams           off
+             RTWCAPIStates           off
+             GenerateASAP2           off
+           }
+           PropName                "Components"
+         }
+       }
+       PropName                "Components"
+      }
+      Name                   "Configuration"
+      CurrentDlgPage         "Solver"
+    }
+    PropName               "ConfigurationSets"
+  }
+  Simulink.ConfigSet {
+    $PropName              "ActiveConfigurationSet"
+    $ObjectID              1
+  }
+  WSDataSource           "M-Code"
+  BlockDefaults {
+    Orientation                    "right"
+    ForegroundColor        "black"
+    BackgroundColor        "white"
+    DropShadow             off
+    NamePlacement          "normal"
+    FontName               "Arial"
+    FontSize               10
+    FontWeight             "normal"
+    FontAngle              "normal"
+    ShowName               on
+  }
+  BlockParameterDefaults {
+    Block {
+      BlockType                      Clock
+      DisplayTime            off
+    }
+    Block {
+      BlockType                      Constant
+      Value                  "1"
+      VectorParams1D         on
+      SamplingMode           "Sample based"
+      OutDataTypeMode        "Inherit from 'Constant value'"
+      OutDataType            "sfix(16)"
+      ConRadixGroup          "Use specified scaling"
+      OutScaling             "2^0"
+      SampleTime             "inf"
+      FramePeriod            "inf"
+    }
+    Block {
+      BlockType                      Display
+      Format                 "short"
+      Decimation             "10"
+      Floating               off
+      SampleTime             "-1"
+    }
+    Block {
+      BlockType                      Gain
+      Gain                   "1"
+      Multiplication         "Element-wise(K.*u)"
+      ParameterDataTypeMode   "Same as input"
+      ParameterDataType              "sfix(16)"
+      ParameterScalingMode    "Best Precision: Matrix-wise"
+      ParameterScaling       "2^0"
+      OutDataTypeMode        "Same as input"
+      OutDataType            "sfix(16)"
+      OutScaling             "2^0"
+      LockScale                      off
+      RndMeth                "Floor"
+      SaturateOnIntegerOverflow        on
+      SampleTime             "-1"
+    }
+    Block {
+      BlockType                      Inport
+      Port                   "1"
+      UseBusObject           off
+      BusObject                      "BusObject"
+      BusOutputAsStruct              off
+      PortDimensions         "-1"
+      SampleTime             "-1"
+      DataType               "auto"
+      OutDataType            "sfix(16)"
+      OutScaling             "2^0"
+      SignalType             "auto"
+      SamplingMode           "auto"
+      LatchByDelayingOutsideSignal off
+      LatchByCopyingInsideSignal off
+      Interpolate            on
+    }
+    Block {
+      BlockType                      Integrator
+      ExternalReset          "none"
+      InitialConditionSource  "internal"
+      InitialCondition       "0"
+      LimitOutput            off
+      UpperSaturationLimit    "inf"
+      LowerSaturationLimit    "-inf"
+      ShowSaturationPort      off
+      ShowStatePort          off
+      AbsoluteTolerance              "auto"
+      IgnoreLimit            off
+      ZeroCross                      on
+      ContinuousStateAttributes        "''"
+    }
+    Block {
+      BlockType                      MATLABFcn
+      MATLABFcn                      "sin"
+      OutputDimensions       "-1"
+      OutputSignalType       "auto"
+      Output1D               on
+      SampleTime             "-1"
+    }
+    Block {
+      BlockType                      "M-S-Function"
+      FunctionName           "mlfile"
+      DisplayMFileStacktrace  on
+    }
+    Block {
+      BlockType                      Mux
+      Inputs                 "4"
+      DisplayOption          "none"
+      UseBusObject           off
+      BusObject                      "BusObject"
+      NonVirtualBus          off
+    }
+    Block {
+      BlockType                      Outport
+      Port                   "1"
+      UseBusObject           off
+      BusObject                      "BusObject"
+      BusOutputAsStruct              off
+      PortDimensions         "-1"
+      SampleTime             "-1"
+      DataType               "auto"
+      OutDataType            "sfix(16)"
+      OutScaling             "2^0"
+      SignalType             "auto"
+      SamplingMode           "auto"
+      OutputWhenDisabled      "held"
+      InitialOutput          "[]"
+    }
+    Block {
+      BlockType                      RandomNumber
+      Mean                   "0"
+      Variance               "1"
+      Seed                   "0"
+      SampleTime             "-1"
+      VectorParams1D         on
+    }
+    Block {
+      BlockType                      RateTransition
+      Integrity                      on
+      Deterministic          on
+      X0                     "0"
+      OutPortSampleTime              "-1"
+    }
+    Block {
+      BlockType                      RateLimiter
+      RisingSlewLimit        "1"
+      FallingSlewLimit       "-1"
+      SampleTimeMode         "continuous"
+      InitialCondition       "0"
+      LinearizeAsGain        on
+    }
+    Block {
+      BlockType                      Saturate
+      UpperLimit             "0.5"
+      LowerLimit             "-0.5"
+      LinearizeAsGain        on
+      ZeroCross                      on
+      SampleTime             "-1"
+    }
+    Block {
+      BlockType                      Scope
+      ModelBased             off
+      TickLabels             "OneTimeTick"
+      ZoomMode               "on"
+      Grid                   "on"
+      TimeRange                      "auto"
+      YMin                   "-5"
+      YMax                   "5"
+      SaveToWorkspace        off
+      SaveName               "ScopeData"
+      LimitDataPoints        on
+      MaxDataPoints          "5000"
+      Decimation             "1"
+      SampleInput            off
+      SampleTime             "-1"
+    }
+    Block {
+      BlockType                      Selector
+      NumberOfDimensions      "1"
+      IndexMode                      "One-based"
+      InputPortWidth         "-1"
+      SampleTime             "-1"
+    }
+    Block {
+      BlockType                      "S-Function"
+      FunctionName           "system"
+      SFunctionModules       "''"
+      PortCounts             "[]"
+    }
+    Block {
+      BlockType                      SubSystem
+      ShowPortLabels         "FromPortIcon"
+      Permissions            "ReadWrite"
+      PermitHierarchicalResolution "All"
+      TreatAsAtomicUnit              off
+      SystemSampleTime       "-1"
+      RTWFcnNameOpts         "Auto"
+      RTWFileNameOpts        "Auto"
+      RTWMemSecFuncInitTerm   "Inherit from model"
+      RTWMemSecFuncExecute    "Inherit from model"
+      RTWMemSecDataConstants  "Inherit from model"
+      RTWMemSecDataInternal   "Inherit from model"
+      RTWMemSecDataParameters "Inherit from model"
+      SimViewingDevice       off
+      DataTypeOverride       "UseLocalSettings"
+      MinMaxOverflowLogging   "UseLocalSettings"
+    }
+    Block {
+      BlockType                      Sum
+      IconShape                      "rectangular"
+      Inputs                 "++"
+      CollapseMode           "All dimensions"
+      CollapseDim            "1"
+      InputSameDT            on
+      OutDataTypeMode        "Same as first input"
+      OutDataType            "sfix(16)"
+      OutScaling             "2^0"
+      LockScale                      off
+      RndMeth                "Floor"
+      SaturateOnIntegerOverflow        on
+      SampleTime             "-1"
+    }
+    Block {
+      BlockType                      Switch
+      Criteria               "u2 >= Threshold"
+      Threshold                      "0"
+      InputSameDT            on
+      OutDataTypeMode        "Inherit via internal rule"
+      RndMeth                "Floor"
+      SaturateOnIntegerOverflow        on
+      ZeroCross                      on
+      SampleTime             "-1"
+    }
+    Block {
+      BlockType                      ToWorkspace
+      VariableName           "simulink_output"
+      MaxDataPoints          "1000"
+      Decimation             "1"
+      SampleTime             "0"
+      FixptAsFi                      off
+    }
+    Block {
+      BlockType                      UnitDelay
+      X0                     "0"
+      SampleTime             "1"
+      StateMustResolveToSignalObject off
+      RTWStateStorageClass    "Auto"
+    }
+  }
+  AnnotationDefaults {
+    HorizontalAlignment            "center"
+    VerticalAlignment      "middle"
+    ForegroundColor        "black"
+    BackgroundColor        "white"
+    DropShadow             off
+    FontName               "Arial"
+    FontSize               10
+    FontWeight             "normal"
+    FontAngle              "normal"
+    UseDisplayTextAsClickCallback off
+  }
+  LineDefaults {
+    FontName               "Arial"
+    FontSize               9
+    FontWeight             "normal"
+    FontAngle              "normal"
+  }
+  System {
+    Name                   "reg_mcl"
+    Location               [1684, 55, 2539, 624]
+    Open                   on
+    ModelBrowserVisibility  off
+    ModelBrowserWidth      200
+    ScreenColor                    "white"
+    PaperOrientation       "landscape"
+    PaperPositionMode      "auto"
+    PaperType              "A4"
+    PaperUnits             "centimeters"
+    TiledPaperMargins      [0.500000, 0.500000, 0.500000, 0.500000]
+    TiledPageScale         1
+    ShowPageBoundaries     off
+    ZoomFactor             "100"
+    ReportName             "simulink-default.rpt"
+    Block {
+      BlockType                      SubSystem
+      Name                   " "
+      Ports                  []
+      Position               [25, 14, 95, 48]
+      OpenFcn                "path=diag([area.w area.h])*rand(2,8)\nsim('reg_"
+"test',0)                   "
+      MinAlgLoopOccurrences   off
+      RTWSystemCode          "Auto"
+      FunctionWithSeparateData off
+      MaskHideContents       off
+      MaskDisplay            "disp('Random path')"
+      MaskIconFrame          on
+      MaskIconOpaque         on
+      MaskIconRotate         "none"
+      MaskIconUnits          "autoscale"
+      System {
+       Name                    " "
+       Location                [433, 403, 931, 703]
+       Open                    off
+       ModelBrowserVisibility  off
+       ModelBrowserWidth       200
+       ScreenColor             "white"
+       PaperOrientation        "landscape"
+       PaperPositionMode       "auto"
+       PaperType               "A4"
+       PaperUnits              "centimeters"
+       TiledPaperMargins       [0.500000, 0.500000, 0.500000, 0.500000]
+       TiledPageScale          1
+       ShowPageBoundaries      off
+       ZoomFactor              "100"
+      }
+    }
+    Block {
+      BlockType                      Clock
+      Name                   "Clock"
+      Position               [465, 70, 485, 90]
+      Decimation             "10"
+    }
+    Block {
+      BlockType                      "S-Function"
+      Name                   "Controller"
+      Ports                  [2, 1]
+      Position               [175, 88, 235, 177]
+      BackgroundColor        "green"
+      FunctionName           "sf_posreg"
+      Parameters             "[2 2 10],1/20"
+      MaskDisplay            "port_label('input', 1, 'ref')\nport_label('inpu"
+"t', 2, 'pos')\nport_label('output', 1, '(w1,w2)')"
+      MaskIconFrame          on
+      MaskIconOpaque         on
+      MaskIconRotate         "none"
+      MaskIconUnits          "autoscale"
+    }
+    Block {
+      BlockType                      Display
+      Name                   "Display"
+      Ports                  [1]
+      Position               [515, 66, 600, 94]
+      Lockdown               off
+    }
+    Block {
+      BlockType                      Gain
+      Name                   "Gain"
+      Position               [260, 120, 290, 150]
+      Gain                   "[1 1]/desc.robot.wheelr"
+      ParameterDataTypeMode   "Inherit via internal rule"
+      OutDataTypeMode        "Inherit via internal rule"
+      SaturateOnIntegerOverflow        off
+    }
+    Block {
+      BlockType                      SubSystem
+      Name                   "Graphs"
+      Ports                  [2]
+      Position               [720, 210, 820, 270]
+      MinAlgLoopOccurrences   off
+      RTWSystemCode          "Auto"
+      FunctionWithSeparateData off
+      MaskHideContents       off
+      System {
+       Name                    "Graphs"
+       Location                [478, 120, 998, 439]
+       Open                    off
+       ModelBrowserVisibility  off
+       ModelBrowserWidth       200
+       ScreenColor             "white"
+       PaperOrientation        "landscape"
+       PaperPositionMode       "auto"
+       PaperType               "A4"
+       PaperUnits              "centimeters"
+       TiledPaperMargins       [0.500000, 0.500000, 0.500000, 0.500000]
+       TiledPageScale          1
+       ShowPageBoundaries      off
+       ZoomFactor              "100"
+       Block {
+         BlockType               Inport
+         Name                    "Pos"
+         Position                [25, 108, 55, 122]
+         IconDisplay             "Port number"
+       }
+       Block {
+         BlockType               Inport
+         Name                    "Est pos"
+         Position                [25, 223, 55, 237]
+         Port                    "2"
+         IconDisplay             "Port number"
+       }
+       Block {
+         BlockType               Scope
+         Name                    "Angle"
+         Ports                   [1]
+         Position                [410, 109, 440, 141]
+         Floating                off
+         Location                [437, 662, 1088, 1030]
+         Open                    on
+         NumInputPorts           "1"
+         List {
+           ListType                AxesTitles
+           axes1                   "%<SignalLabel>"
+         }
+         TimeRange               "100"
+         YMin                    "-1000"
+         YMax                    "8000"
+         SaveName                "ScopeData1"
+         DataFormat              "StructureWithTime"
+         SampleTime              "0"
+       }
+       Block {
+         BlockType               Gain
+         Name                    "Gain"
+         Position                [295, 109, 330, 141]
+         Gain                    "180/pi"
+         ParameterDataTypeMode   "Inherit via internal rule"
+         OutDataTypeMode         "Inherit via internal rule"
+         SaturateOnIntegerOverflow off
+         Port {
+           PortNumber              1
+           Name                    "Angle [deg]"
+           RTWStorageClass         "Auto"
+           DataLoggingNameMode     "SignalName"
+         }
+       }
+       Block {
+         BlockType               Mux
+         Name                    "Mux"
+         Ports                   [2, 1]
+         Position                [250, 46, 255, 84]
+         ShowName                off
+         Inputs                  "2"
+         DisplayOption           "bar"
+         Port {
+           PortNumber              1
+           Name                    "Position [m]"
+           RTWStorageClass         "Auto"
+           DataLoggingNameMode     "SignalName"
+         }
+       }
+       Block {
+         BlockType               Mux
+         Name                    "Mux1"
+         Ports                   [2, 1]
+         Position                [250, 106, 255, 144]
+         ShowName                off
+         Inputs                  "2"
+         DisplayOption           "bar"
+       }
+       Block {
+         BlockType               Selector
+         Name                    "Selector"
+         Ports                   [1, 1]
+         Position                [110, 36, 150, 74]
+         IndexOptions            "Index vector (dialog)"
+         Indices                 "[1 2]"
+         OutputSizes             "1"
+         InputPortWidth          "3"
+       }
+       Block {
+         BlockType               Selector
+         Name                    "Selector1"
+         Ports                   [1, 1]
+         Position                [110, 96, 150, 134]
+         IndexOptions            "Index vector (dialog)"
+         Indices                 "3"
+         OutputSizes             "1"
+         InputPortWidth          "3"
+       }
+       Block {
+         BlockType               Selector
+         Name                    "Selector2"
+         Ports                   [1, 1]
+         Position                [110, 236, 150, 274]
+         IndexOptions            "Index vector (dialog)"
+         Indices                 "3"
+         OutputSizes             "1"
+         InputPortWidth          "3"
+       }
+       Block {
+         BlockType               Selector
+         Name                    "Selector3"
+         Ports                   [1, 1]
+         Position                [110, 171, 150, 209]
+         IndexOptions            "Index vector (dialog)"
+         Indices                 "[1 2]"
+         OutputSizes             "1"
+         InputPortWidth          "3"
+       }
+       Block {
+         BlockType               Scope
+         Name                    "XY"
+         Ports                   [1]
+         Position                [410, 49, 440, 81]
+         Floating                off
+         Location                [441, 56, 1084, 453]
+         Open                    on
+         NumInputPorts           "1"
+         ZoomMode                "xonly"
+         List {
+           ListType                AxesTitles
+           axes1                   "%<SignalLabel>"
+         }
+         TimeRange               "100"
+         YMin                    "-0.5"
+         YMax                    "4"
+         DataFormat              "StructureWithTime"
+         SampleTime              "0"
+       }
+       Line {
+         Name                    "Angle [deg]"
+         Labels                  [0, 0]
+         SrcBlock                "Gain"
+         SrcPort                 1
+         DstBlock                "Angle"
+         DstPort                 1
+       }
+       Line {
+         SrcBlock                "Selector2"
+         SrcPort                 1
+         Points                  [80, 0]
+         DstBlock                "Mux1"
+         DstPort                 2
+       }
+       Line {
+         SrcBlock                "Selector1"
+         SrcPort                 1
+         DstBlock                "Mux1"
+         DstPort                 1
+       }
+       Line {
+         SrcBlock                "Mux1"
+         SrcPort                 1
+         DstBlock                "Gain"
+         DstPort                 1
+       }
+       Line {
+         SrcBlock                "Selector3"
+         SrcPort                 1
+         Points                  [40, 0; 0, -115]
+         DstBlock                "Mux"
+         DstPort                 2
+       }
+       Line {
+         Name                    "Position [m]"
+         Labels                  [0, 0]
+         SrcBlock                "Mux"
+         SrcPort                 1
+         DstBlock                "XY"
+         DstPort                 1
+       }
+       Line {
+         SrcBlock                "Selector"
+         SrcPort                 1
+         DstBlock                "Mux"
+         DstPort                 1
+       }
+       Line {
+         SrcBlock                "Est pos"
+         SrcPort                 1
+         Points                  [0, -15; 15, 0]
+         Branch {
+           Points                  [0, 40]
+           DstBlock                "Selector2"
+           DstPort                 1
+         }
+         Branch {
+           Points                  [0, -25]
+           DstBlock                "Selector3"
+           DstPort                 1
+         }
+       }
+       Line {
+         SrcBlock                "Pos"
+         SrcPort                 1
+         Points                  [15, 0]
+         Branch {
+           DstBlock                "Selector1"
+           DstPort                 1
+         }
+         Branch {
+           Points                  [0, -60]
+           DstBlock                "Selector"
+           DstPort                 1
+         }
+       }
+      }
+    }
+    Block {
+      BlockType                      "M-S-Function"
+      Name                   "Level-2 M-file\nS-Function"
+      Ports                  [2]
+      Position               [725, 124, 785, 171]
+      BackgroundColor        "cyan"
+      FunctionName           "sfdrawrobot"
+      Parameters             "desc,0"
+      MaskDisplay            "disp('Drawer')\nport_label('input', 1, 'x')\npo"
+"rt_label('input', 2, 'y')\n"
+      MaskIconFrame          on
+      MaskIconOpaque         on
+      MaskIconRotate         "none"
+      MaskIconUnits          "autoscale"
+    }
+    Block {
+      BlockType                      "M-S-Function"
+      Name                   "Level-2 M-file\nS-Function1"
+      Ports                  [2]
+      Position               [725, 293, 790, 337]
+      ForegroundColor        "blue"
+      FunctionName           "sfdrawrobot"
+      Parameters             "desc,'--b'"
+      MaskDisplay            "disp('Drawer')\nport_label('input', 1, 'x')\npo"
+"rt_label('input', 2, 'y')\n"
+      MaskIconFrame          on
+      MaskIconOpaque         on
+      MaskIconRotate         "none"
+      MaskIconUnits          "autoscale"
+    }
+    Block {
+      BlockType                      "M-S-Function"
+      Name                   "Level-2 M-file\nS-Function2"
+      Ports                  [2]
+      Position               [715, 28, 780, 72]
+      ForegroundColor        "magenta"
+      FunctionName           "sfdrawrobot"
+      Parameters             "desc,'--m'"
+      MaskDisplay            "disp('Drawer')\nport_label('input', 1, 'x')\npo"
+"rt_label('input', 2, 'y')\n"
+      MaskIconFrame          on
+      MaskIconOpaque         on
+      MaskIconRotate         "none"
+      MaskIconUnits          "autoscale"
+    }
+    Block {
+      BlockType                      "S-Function"
+      Name                   "MCL"
+      Ports                  [2, 2]
+      Position               [430, 288, 610, 357]
+      BackgroundColor        "green"
+      ShowName               off
+      FunctionName           "sf_mcl"
+      Parameters             "count, noise_xy, noise_angle, aeval_sigma"
+      MaskPromptString       "Number of samples|Move noise X,Y [m]|Move noise"
+" angle [rad]|Measure dispersion [rad]"
+      MaskStyleString        "edit,edit,edit,edit"
+      MaskTunableValueString  "off,on,on,on"
+      MaskCallbackString      "|||"
+      MaskEnableString       "on,on,on,on"
+      MaskVisibilityString    "on,on,on,on"
+      MaskToolTipString              "on,on,on,on"
+      MaskVarAliasString      ",,,"
+      MaskVariables          "count=@1;noise_xy=@2;noise_angle=@3;aeval_sigma"
+"=@4;"
+      MaskDisplay            "port_label('input', 1, '(dx,dy,da)')\nport_labe"
+"l('input', 2, '(th1,th2,th3)')\nport_label('output', 1, 'est_pos=(x,y,a)')\np"
+"ort_label('output', 2, 'particle bitmap')\ndisp('MCL')"
+      MaskIconFrame          on
+      MaskIconOpaque         on
+      MaskIconRotate         "none"
+      MaskIconUnits          "autoscale"
+      MaskValueString        "3000|0.01|2/180*pi|5/180*pi"
+      MaskTabNameString              ",,,"
+    }
+    Block {
+      BlockType                      Reference
+      Name                   "Manual Switch"
+      Ports                  [2, 1]
+      Position               [125, 137, 155, 173]
+      SourceBlock            "simulink/Signal\nRouting/Manual Switch"
+      SourceType             "Manual Switch"
+      ShowPortLabels         "FromPortIcon"
+      SystemSampleTime       "-1"
+      FunctionWithSeparateData off
+      RTWMemSecFuncInitTerm   "Inherit from model"
+      RTWMemSecFuncExecute    "Inherit from model"
+      RTWMemSecDataConstants  "Inherit from model"
+      RTWMemSecDataInternal   "Inherit from model"
+      RTWMemSecDataParameters "Inherit from model"
+      sw                     "1"
+      action                 "0"
+      varsize                off
+    }
+    Block {
+      BlockType                      SubSystem
+      Name                   "Measurement"
+      Ports                  [1, 1]
+      Position               [205, 397, 280, 433]
+      MinAlgLoopOccurrences   off
+      RTWSystemCode          "Auto"
+      FunctionWithSeparateData off
+      MaskHideContents       off
+      System {
+       Name                    "Measurement"
+       Location                [458, 185, 768, 279]
+       Open                    off
+       ModelBrowserVisibility  off
+       ModelBrowserWidth       200
+       ScreenColor             "white"
+       PaperOrientation        "landscape"
+       PaperPositionMode       "auto"
+       PaperType               "A4"
+       PaperUnits              "centimeters"
+       TiledPaperMargins       [0.500000, 0.500000, 0.500000, 0.500000]
+       TiledPageScale          1
+       ShowPageBoundaries      off
+       ZoomFactor              "100"
+       Block {
+         BlockType               Inport
+         Name                    "Pos"
+         Position                [25, 43, 55, 57]
+         IconDisplay             "Port number"
+       }
+       Block {
+         BlockType               MATLABFcn
+         Name                    "Beacon Angles"
+         Ports                   [1, 1]
+         Position                [125, 35, 185, 65]
+         MATLABFcn               "mod(beacon_angles(u), 2*pi)"
+       }
+       Block {
+         BlockType               Outport
+         Name                    "Angles"
+         Position                [255, 43, 285, 57]
+         IconDisplay             "Port number"
+         BusOutputAsStruct       off
+       }
+       Line {
+         SrcBlock                "Pos"
+         SrcPort                 1
+         DstBlock                "Beacon Angles"
+         DstPort                 1
+       }
+       Line {
+         SrcBlock                "Beacon Angles"
+         SrcPort                 1
+         DstBlock                "Angles"
+         DstPort                 1
+       }
+      }
+    }
+    Block {
+      BlockType                      Reference
+      Name                   "Measurement noise\nstd. deviation [deg]"
+      Ports                  [1, 1]
+      Position               [289, 460, 341, 480]
+      Orientation            "up"
+      NamePlacement          "alternate"
+      SourceBlock            "simulink/Math\nOperations/Slider\nGain"
+      SourceType             "Slider Gain"
+      ShowPortLabels         "FromPortIcon"
+      SystemSampleTime       "-1"
+      FunctionWithSeparateData off
+      RTWMemSecFuncInitTerm   "Inherit from model"
+      RTWMemSecFuncExecute    "Inherit from model"
+      RTWMemSecDataConstants  "Inherit from model"
+      RTWMemSecDataInternal   "Inherit from model"
+      RTWMemSecDataParameters "Inherit from model"
+      low                    "0"
+      gain                   "1"
+      high                   "5"
+    }
+    Block {
+      BlockType                      Constant
+      Name                   "No laser"
+      Position               [220, 369, 280, 391]
+      NamePlacement          "alternate"
+      Value                  "[0 0 0]"
+      SampleTime             "-1"
+    }
+    Block {
+      BlockType                      Constant
+      Name                   "No odometry"
+      Position               [245, 269, 305, 291]
+      NamePlacement          "alternate"
+      Value                  "[0 0 0]"
+      SampleTime             "-1"
+    }
+    Block {
+      BlockType                      SubSystem
+      Name                   "Pos to deltas"
+      Ports                  [1, 1]
+      Position               [210, 296, 305, 334]
+      MinAlgLoopOccurrences   off
+      RTWSystemCode          "Auto"
+      FunctionWithSeparateData off
+      MaskHideContents       off
+      System {
+       Name                    "Pos to deltas"
+       Location                [50, 111, 624, 360]
+       Open                    off
+       ModelBrowserVisibility  off
+       ModelBrowserWidth       200
+       ScreenColor             "white"
+       PaperOrientation        "landscape"
+       PaperPositionMode       "auto"
+       PaperType               "A4"
+       PaperUnits              "centimeters"
+       TiledPaperMargins       [0.500000, 0.500000, 0.500000, 0.500000]
+       TiledPageScale          1
+       ShowPageBoundaries      off
+       ZoomFactor              "100"
+       Block {
+         BlockType               Inport
+         Name                    "Pos"
+         Position                [30, 103, 60, 117]
+         IconDisplay             "Port number"
+       }
+       Block {
+         BlockType               Selector
+         Name                    "Angle"
+         Ports                   [1, 1]
+         Position                [190, 21, 230, 59]
+         IndexOptions            "Index vector (dialog)"
+         Indices                 "3"
+         OutputSizes             "1"
+         InputPortWidth          "3"
+       }
+       Block {
+         BlockType               Reference
+         Name                    "Difference"
+         Ports                   [1, 1]
+         Position                [100, 92, 145, 128]
+         NamePlacement           "alternate"
+         SourceBlock             "simulink/Discrete/Difference"
+         SourceType              "Difference"
+         ShowPortLabels          "FromPortIcon"
+         SystemSampleTime        "-1"
+         FunctionWithSeparateData off
+         RTWMemSecFuncInitTerm   "Inherit from model"
+         RTWMemSecFuncExecute    "Inherit from model"
+         RTWMemSecDataConstants  "Inherit from model"
+         RTWMemSecDataInternal   "Inherit from model"
+         RTWMemSecDataParameters "Inherit from model"
+         ICPrevInput             "0.0"
+         OutputDataTypeScalingMode "Inherit via internal rule"
+         OutDataType             "sfix(16)"
+         OutScaling              "2^-10"
+         LockScale               off
+         RndMeth                 "Floor"
+         DoSatur                 off
+       }
+       Block {
+         BlockType               Gain
+         Name                    "Gain"
+         Position                [250, 24, 285, 56]
+         Gain                    "-1"
+         ParameterDataTypeMode   "Inherit via internal rule"
+         OutDataTypeMode         "Inherit via internal rule"
+         SaturateOnIntegerOverflow off
+       }
+       Block {
+         BlockType               Mux
+         Name                    "Mux1"
+         Ports                   [2, 1]
+         Position                [315, 81, 320, 119]
+         ShowName                off
+         Inputs                  "2"
+         DisplayOption           "bar"
+       }
+       Block {
+         BlockType               Mux
+         Name                    "Mux2"
+         Ports                   [2, 1]
+         Position                [460, 91, 465, 129]
+         ShowName                off
+         Inputs                  "2"
+         DisplayOption           "bar"
+       }
+       Block {
+         BlockType               MATLABFcn
+         Name                    "Rotate XY"
+         Ports                   [1, 1]
+         Position                [350, 83, 435, 117]
+         MATLABFcn               "[cos(u(1)) -sin(u(1)); sin(u(1)) cos(u(1))]"
+"*[u(2); u(3)]"
+       }
+       Block {
+         BlockType               Selector
+         Name                    "Speed XY"
+         Ports                   [1, 1]
+         Position                [190, 91, 230, 129]
+         IndexOptions            "Index vector (dialog)"
+         Indices                 "[1 2]"
+         OutputSizes             "1"
+         InputPortWidth          "3"
+         Port {
+           PortNumber              1
+           Name                    "dx, dy"
+           RTWStorageClass         "Auto"
+           DataLoggingNameMode     "SignalName"
+         }
+       }
+       Block {
+         BlockType               Selector
+         Name                    "Speed angle"
+         Ports                   [1, 1]
+         Position                [190, 151, 230, 189]
+         IndexOptions            "Index vector (dialog)"
+         Indices                 "3"
+         OutputSizes             "1"
+         InputPortWidth          "3"
+         Port {
+           PortNumber              1
+           Name                    "dangle"
+           RTWStorageClass         "Auto"
+           DataLoggingNameMode     "SignalName"
+         }
+       }
+       Block {
+         BlockType               UnitDelay
+         Name                    "Unit Delay"
+         Position                [110, 23, 145, 57]
+         SampleTime              "-1"
+       }
+       Block {
+         BlockType               Outport
+         Name                    "Odometry"
+         Position                [500, 103, 530, 117]
+         IconDisplay             "Port number"
+         BusOutputAsStruct       off
+       }
+       Line {
+         SrcBlock                "Gain"
+         SrcPort                 1
+         Points                  [0, 50]
+         DstBlock                "Mux1"
+         DstPort                 1
+       }
+       Line {
+         SrcBlock                "Angle"
+         SrcPort                 1
+         DstBlock                "Gain"
+         DstPort                 1
+       }
+       Line {
+         SrcBlock                "Unit Delay"
+         SrcPort                 1
+         DstBlock                "Angle"
+         DstPort                 1
+       }
+       Line {
+         SrcBlock                "Difference"
+         SrcPort                 1
+         Points                  [5, 0]
+         Branch {
+           Points                  [0, 60]
+           DstBlock                "Speed angle"
+           DstPort                 1
+         }
+         Branch {
+           DstBlock                "Speed XY"
+           DstPort                 1
+         }
+       }
+       Line {
+         Name                    "dx, dy"
+         Labels                  [0, 0]
+         SrcBlock                "Speed XY"
+         SrcPort                 1
+         DstBlock                "Mux1"
+         DstPort                 2
+       }
+       Line {
+         Name                    "dangle"
+         Labels                  [0, 0]
+         SrcBlock                "Speed angle"
+         SrcPort                 1
+         Points                  [210, 0]
+         DstBlock                "Mux2"
+         DstPort                 2
+       }
+       Line {
+         SrcBlock                "Mux2"
+         SrcPort                 1
+         DstBlock                "Odometry"
+         DstPort                 1
+       }
+       Line {
+         SrcBlock                "Rotate XY"
+         SrcPort                 1
+         DstBlock                "Mux2"
+         DstPort                 1
+       }
+       Line {
+         SrcBlock                "Mux1"
+         SrcPort                 1
+         DstBlock                "Rotate XY"
+         DstPort                 1
+       }
+       Line {
+         SrcBlock                "Pos"
+         SrcPort                 1
+         Points                  [10, 0]
+         Branch {
+           Points                  [0, -70]
+           DstBlock                "Unit Delay"
+           DstPort                 1
+         }
+         Branch {
+           DstBlock                "Difference"
+           DstPort                 1
+         }
+       }
+      }
+    }
+    Block {
+      BlockType                      RandomNumber
+      Name                   "Random\nNumber"
+      Position               [350, 455, 380, 485]
+      Orientation            "down"
+      Variance               "(1/180*pi)^2"
+      Seed                   "abs(rand(3,1)*10000)"
+    }
+    Block {
+      BlockType                      RateTransition
+      Name                   "Rate Transition"
+      Position               [135, 394, 175, 436]
+      OutPortSampleTime              "1/3"
+    }
+    Block {
+      BlockType                      RateTransition
+      Name                   "Rate Transition1"
+      Position               [135, 494, 175, 536]
+      Orientation            "left"
+      X0                     "desc.initpos"
+    }
+    Block {
+      BlockType                      "S-Function"
+      Name                   "S-Function2"
+      Ports                  [0, 1]
+      Position               [55, 94, 115, 126]
+      BackgroundColor        "green"
+      FunctionName           "sf_trgen"
+      Parameters             "path, desc.initpos, desc.wayconstraints"
+      MaskDisplay            "disp('Trajectory\\ngenerator')"
+      MaskIconFrame          on
+      MaskIconOpaque         on
+      MaskIconRotate         "none"
+      MaskIconUnits          "autoscale"
+    }
+    Block {
+      BlockType                      SubSystem
+      Name                   "Subsystem"
+      Ports                  [1, 1]
+      Position               [310, 111, 435, 159]
+      BackgroundColor        "yellow"
+      MinAlgLoopOccurrences   off
+      RTWSystemCode          "Auto"
+      FunctionWithSeparateData off
+      MaskHideContents       off
+      MaskDisplay            "disp('Robot\\n\\n')\nport_label('input', 1, 'u="
+"(w1,w2)')\nport_label('output', 1, 'x=(X,Y,th)')"
+      MaskIconFrame          on
+      MaskIconOpaque         on
+      MaskIconRotate         "none"
+      MaskIconUnits          "autoscale"
+      Port {
+       PortNumber              1
+       Name                    "Real robot position"
+       PropagatedSignals       "x,y,phi [m,m,rad]"
+       RTWStorageClass         "Auto"
+       DataLoggingNameMode     "SignalName"
+      }
+      System {
+       Name                    "Subsystem"
+       Location                [121, 481, 955, 665]
+       Open                    off
+       ModelBrowserVisibility  off
+       ModelBrowserWidth       200
+       ScreenColor             "white"
+       PaperOrientation        "landscape"
+       PaperPositionMode       "auto"
+       PaperType               "A4"
+       PaperUnits              "centimeters"
+       TiledPaperMargins       [0.500000, 0.500000, 0.500000, 0.500000]
+       TiledPageScale          1
+       ShowPageBoundaries      off
+       ZoomFactor              "100"
+       Block {
+         BlockType               Inport
+         Name                    "In1"
+         Position                [15, 38, 45, 52]
+         IconDisplay             "Port number"
+         Port {
+           PortNumber              1
+           Name                    "rad/s"
+           RTWStorageClass         "Auto"
+           DataLoggingNameMode     "SignalName"
+         }
+       }
+       Block {
+         BlockType               Integrator
+         Name                    "Integrator"
+         Ports                   [1, 1]
+         Position                [530, 40, 560, 70]
+         InitialCondition        "desc.initpos"
+         UpperSaturationLimit    "[area.w area.h Inf]"
+         LowerSaturationLimit    "[0 0 -Inf]"
+         IgnoreLimit             off
+         Port {
+           PortNumber              1
+           Name                    "x,y,phi [m,m,rad]"
+           RTWStorageClass         "Auto"
+           DataLoggingNameMode     "SignalName"
+         }
+       }
+       Block {
+         BlockType               Reference
+         Name                    "Manual Switch"
+         Ports                   [2, 1]
+         Position                [250, 27, 280, 63]
+         SourceBlock             "simulink/Signal\nRouting/Manual Switch"
+         SourceType              "Manual Switch"
+         ShowPortLabels          "FromPortIcon"
+         SystemSampleTime        "-1"
+         FunctionWithSeparateData off
+         RTWMemSecFuncInitTerm   "Inherit from model"
+         RTWMemSecFuncExecute    "Inherit from model"
+         RTWMemSecDataConstants  "Inherit from model"
+         RTWMemSecDataInternal   "Inherit from model"
+         RTWMemSecDataParameters "Inherit from model"
+         sw                      "1"
+         action                  "0"
+         varsize                 off
+       }
+       Block {
+         BlockType               Mux
+         Name                    "Mux1"
+         Ports                   [2, 1]
+         Position                [380, 36, 385, 74]
+         ShowName                off
+         Inputs                  "2"
+         DisplayOption           "bar"
+       }
+       Block {
+         BlockType               Selector
+         Name                    "Selector"
+         Ports                   [1, 1]
+         Position                [420, 121, 460, 159]
+         Orientation             "left"
+         IndexOptions            "Index vector (dialog)"
+         Indices                 "[3]"
+         OutputSizes             "1"
+         InputPortWidth          "3"
+         Port {
+           PortNumber              1
+           Name                    "angle"
+           RTWStorageClass         "Auto"
+           DataLoggingNameMode     "SignalName"
+         }
+       }
+       Block {
+         BlockType               Gain
+         Name                    "Wheel\nradius"
+         Position                [90, 27, 135, 63]
+         Gain                    "robot.wheelr"
+         ParameterDataTypeMode   "Inherit via internal rule"
+         OutDataTypeMode         "Inherit via internal rule"
+         SaturateOnIntegerOverflow off
+         Port {
+           PortNumber              1
+           Name                    "m/s"
+           RTWStorageClass         "Auto"
+           DataLoggingNameMode     "SignalName"
+         }
+       }
+       Block {
+         BlockType               MATLABFcn
+         Name                    "kinematics"
+         Ports                   [1, 1]
+         Position                [430, 40, 490, 70]
+         MATLABFcn               "kinematics"
+       }
+       Block {
+         BlockType               RateLimiter
+         Name                    "max acc"
+         Position                [190, 20, 220, 50]
+         RisingSlewLimit         "3"
+         FallingSlewLimit        "-3"
+         SampleTimeMode          "inherited"
+       }
+       Block {
+         BlockType               Saturate
+         Name                    "max m/s"
+         Position                [320, 30, 350, 60]
+         UpperLimit              "2"
+         LowerLimit              "-2"
+       }
+       Block {
+         BlockType               Outport
+         Name                    "Out1"
+         Position                [725, 48, 755, 62]
+         IconDisplay             "Port number"
+         BusOutputAsStruct       off
+       }
+       Line {
+         SrcBlock                "kinematics"
+         SrcPort                 1
+         DstBlock                "Integrator"
+         DstPort                 1
+       }
+       Line {
+         Name                    "x,y,phi [m,m,rad]"
+         SrcBlock                "Integrator"
+         SrcPort                 1
+         Points                  [20, 0]
+         Branch {
+           Points                  [0, 85]
+           DstBlock                "Selector"
+           DstPort                 1
+         }
+         Branch {
+           Labels                  [1, 0; 1, 1]
+           DstBlock                "Out1"
+           DstPort                 1
+         }
+       }
+       Line {
+         SrcBlock                "Mux1"
+         SrcPort                 1
+         DstBlock                "kinematics"
+         DstPort                 1
+       }
+       Line {
+         Name                    "angle"
+         Labels                  [0, 0]
+         SrcBlock                "Selector"
+         SrcPort                 1
+         Points                  [-60, 0; 0, -75]
+         DstBlock                "Mux1"
+         DstPort                 2
+       }
+       Line {
+         Name                    "rad/s"
+         Labels                  [0, 0]
+         SrcBlock                "In1"
+         SrcPort                 1
+         DstBlock                "Wheel\nradius"
+         DstPort                 1
+       }
+       Line {
+         SrcBlock                "max m/s"
+         SrcPort                 1
+         DstBlock                "Mux1"
+         DstPort                 1
+       }
+       Line {
+         SrcBlock                "Manual Switch"
+         SrcPort                 1
+         DstBlock                "max m/s"
+         DstPort                 1
+       }
+       Line {
+         SrcBlock                "max acc"
+         SrcPort                 1
+         DstBlock                "Manual Switch"
+         DstPort                 1
+       }
+       Line {
+         Name                    "m/s"
+         Labels                  [0, 0]
+         SrcBlock                "Wheel\nradius"
+         SrcPort                 1
+         Points                  [20, 0]
+         Branch {
+           Points                  [0, -10]
+           DstBlock                "max acc"
+           DstPort                 1
+         }
+         Branch {
+           Points                  [0, 25; 75, 0]
+           DstBlock                "Manual Switch"
+           DstPort                 2
+         }
+       }
+      }
+    }
+    Block {
+      BlockType                      Sum
+      Name                   "Sum"
+      Ports                  [2, 1]
+      Position               [305, 405, 325, 425]
+      ShowName               off
+      IconShape                      "round"
+      Inputs                 "|++"
+      CollapseMode           "All dimensions"
+      InputSameDT            off
+      OutDataTypeMode        "Inherit via internal rule"
+      SaturateOnIntegerOverflow        off
+    }
+    Block {
+      BlockType                      Reference
+      Name                   "Switch"
+      Ports                  [2, 1]
+      Position               [365, 387, 395, 423]
+      SourceBlock            "simulink/Signal\nRouting/Manual Switch"
+      SourceType             "Manual Switch"
+      ShowPortLabels         "FromPortIcon"
+      SystemSampleTime       "-1"
+      FunctionWithSeparateData off
+      RTWMemSecFuncInitTerm   "Inherit from model"
+      RTWMemSecFuncExecute    "Inherit from model"
+      RTWMemSecDataConstants  "Inherit from model"
+      RTWMemSecDataInternal   "Inherit from model"
+      RTWMemSecDataParameters "Inherit from model"
+      sw                     "0"
+      action                 "0"
+      varsize                off
+    }
+    Block {
+      BlockType                      Reference
+      Name                   "Switch1"
+      Ports                  [2, 1]
+      Position               [345, 287, 375, 323]
+      SourceBlock            "simulink/Signal\nRouting/Manual Switch"
+      SourceType             "Manual Switch"
+      ShowPortLabels         "FromPortIcon"
+      SystemSampleTime       "-1"
+      FunctionWithSeparateData off
+      RTWMemSecFuncInitTerm   "Inherit from model"
+      RTWMemSecFuncExecute    "Inherit from model"
+      RTWMemSecDataConstants  "Inherit from model"
+      RTWMemSecDataInternal   "Inherit from model"
+      RTWMemSecDataParameters "Inherit from model"
+      sw                     "0"
+      action                 "0"
+      varsize                off
+    }
+    Block {
+      BlockType                      ToWorkspace
+      Name                   "To Workspace"
+      Position               [310, 45, 370, 75]
+      VariableName           "trajectory"
+      MaxDataPoints          "inf"
+      SampleTime             "-1"
+      SaveFormat             "Structure With Time"
+    }
+    Block {
+      BlockType                      "M-S-Function"
+      Name                   "draw probability bitmap"
+      Ports                  [1]
+      Position               [725, 393, 815, 427]
+      ForegroundColor        "gray"
+      BackgroundColor        "black"
+      NamePlacement          "alternate"
+      FunctionName           "sfdrawbitmap"
+    }
+    Line {
+      SrcBlock               "Controller"
+      SrcPort                1
+      DstBlock               "Gain"
+      DstPort                1
+    }
+    Line {
+      Name                   "Real robot position"
+      SrcBlock               "Subsystem"
+      SrcPort                1
+      Points                 [20, 0]
+      Branch {
+       Points                  [210, 0]
+       Branch {
+         Labels                  [-1, 1]
+         DstBlock                "Level-2 M-file\nS-Function"
+         DstPort                 1
+       }
+       Branch {
+         Points                  [0, 90]
+         DstBlock                "Graphs"
+         DstPort                 1
+       }
+      }
+      Branch {
+       Labels                  [2, 0]
+       Points                  [0, 70; -360, 0]
+       Branch {
+         Points                  [0, -40]
+         DstBlock                "Manual Switch"
+         DstPort                 2
+       }
+       Branch {
+         Points                  [0, 100]
+         Branch {
+           Points                  [0, 110]
+           DstBlock                "Rate Transition"
+           DstPort                 1
+         }
+         Branch {
+           Points                  [95, 0]
+           DstBlock                "Pos to deltas"
+           DstPort                 1
+         }
+       }
+      }
+    }
+    Line {
+      SrcBlock               "Clock"
+      SrcPort                1
+      DstBlock               "Display"
+      DstPort                1
+    }
+    Line {
+      SrcBlock               "Manual Switch"
+      SrcPort                1
+      DstBlock               "Controller"
+      DstPort                2
+    }
+    Line {
+      SrcBlock               "Rate Transition1"
+      SrcPort                1
+      Points                 [-50, 0; 0, -370]
+      DstBlock               "Manual Switch"
+      DstPort                1
+    }
+    Line {
+      SrcBlock               "Gain"
+      SrcPort                1
+      DstBlock               "Subsystem"
+      DstPort                1
+    }
+    Line {
+      SrcBlock               "MCL"
+      SrcPort                1
+      Points                 [50, 0]
+      Branch {
+       Points                  [0, -50]
+       DstBlock                "Graphs"
+       DstPort                 2
+      }
+      Branch {
+       Points                  [0, 0]
+       Branch {
+         DstBlock                "Level-2 M-file\nS-Function1"
+         DstPort                 1
+       }
+       Branch {
+         Points                  [0, 210]
+         DstBlock                "Rate Transition1"
+         DstPort                 1
+       }
+      }
+    }
+    Line {
+      SrcBlock               "Measurement"
+      SrcPort                1
+      DstBlock               "Sum"
+      DstPort                1
+    }
+    Line {
+      SrcBlock               "Sum"
+      SrcPort                1
+      DstBlock               "Switch"
+      DstPort                2
+    }
+    Line {
+      SrcBlock               "Random\nNumber"
+      SrcPort                1
+      Points                 [0, 5]
+      DstBlock               "Measurement noise\nstd. deviation [deg]"
+      DstPort                1
+    }
+    Line {
+      SrcBlock               "Measurement noise\nstd. deviation [deg]"
+      SrcPort                1
+      DstBlock               "Sum"
+      DstPort                2
+    }
+    Line {
+      SrcBlock               "No laser"
+      SrcPort                1
+      Points                 [65, 0]
+      DstBlock               "Switch"
+      DstPort                1
+    }
+    Line {
+      Labels                 [0, 0]
+      SrcBlock               "Rate Transition"
+      SrcPort                1
+      DstBlock               "Measurement"
+      DstPort                1
+    }
+    Line {
+      SrcBlock               "MCL"
+      SrcPort                2
+      Points                 [15, 0; 0, 70]
+      DstBlock               "draw probability bitmap"
+      DstPort                1
+    }
+    Line {
+      SrcBlock               "Switch"
+      SrcPort                1
+      Points                 [5, 0; 0, -65]
+      Branch {
+       DstBlock                "MCL"
+       DstPort                 2
+      }
+      Branch {
+       Points                  [0, -100; 205, 0; 0, -80]
+       DstBlock                "Level-2 M-file\nS-Function"
+       DstPort                 2
+      }
+    }
+    Line {
+      SrcBlock               "S-Function2"
+      SrcPort                1
+      Points                 [25, 0]
+      Branch {
+       DstBlock                "Controller"
+       DstPort                 1
+      }
+      Branch {
+       Points                  [0, -70; 130, 0]
+       Branch {
+         DstBlock                "Level-2 M-file\nS-Function2"
+         DstPort                 1
+       }
+       Branch {
+         Points                  [0, 20]
+         DstBlock                "To Workspace"
+         DstPort                 1
+       }
+      }
+    }
+    Line {
+      SrcBlock               "Switch1"
+      SrcPort                1
+      DstBlock               "MCL"
+      DstPort                1
+    }
+    Line {
+      SrcBlock               "Pos to deltas"
+      SrcPort                1
+      DstBlock               "Switch1"
+      DstPort                2
+    }
+    Line {
+      SrcBlock               "No odometry"
+      SrcPort                1
+      Points                 [15, 0; 0, 15]
+      DstBlock               "Switch1"
+      DstPort                1
+    }
+  }
+}
+
+# Finite State Machines
+#
+#    Stateflow Version 6.6 (R2007a) dated Jan 30 2007, 01:07:16
+#
+#
+
+Stateflow {
+
+       machine {
+               id                              1
+               name                            "reg_mcl"
+               created                         "29-Mar-2007 23:42:20"
+               isLibrary                       0
+               firstTarget                     2
+               sfVersion                       66014000
+       }
+
+       target {
+               id                                      2
+               name                                    "sfun"
+               description                             "Default Simulink S-Function Target."
+               machine                                 1
+               linkNode                                [1 0 0]
+       }
+}