diff --git a/README.MD b/README.MD index 4265436..d9964c6 100644 --- a/README.MD +++ b/README.MD @@ -218,7 +218,234 @@ Ursache dafür ist, dass kein Echtzeit-Betriebssystem verwendet wird, bzw. der a ### ROS-Beispiel für Anwendungsschnittstelle +Das vorherige Minimalbeispiel dient hauptsächlich zum Verständnis der Funktionsweise. Mit dem folgenden ROS-Beispiele lassen sich beliebige Signale aus ROS-Messages (für Zeitsignale, z.B. Sollwerte oder zusätzliche Sensorik) oder ROS Dynamic Reconfigure (zur Aktualisierung von Parametern) in das Simulink-Modell einbinden. Auf einige Details des vorherigen Beispiels wird nicht nochmal eingangen (Action Server zur Verwaltung des Zugriffs auf den Controller State, Service zum Setzen des Controller States). Die Details können der [Bachelorarbeit von Lucas Jürgens](#quellen) entnommen werden. + +In dem Beispiel wird ein zweiachsiger Roboter in Simulink simuliert und geregelt. Sollwerte oder Reglerparameter können über ROS eingestellt werden. Die Kommunikation erfolgt dabei, ohne die Echtzeiteigenschaften des Simulink-Modells zu stören. +EtherCAT-Blöcke sind nicht im Beispiel eingebaut, können aber beliebig erweitert werden, z.B. um die simulierte Regelstrecke durch ein echtes System zu ersetzen. +Ordner: `appinterface_ros` + +Der Begriff "pcu" resultiert historisch aus der "Prostesis Control Unit" des [SoftPro](#quellen)-Projekts, lässt sich aber auch als "Prototype Control Unit" verallgemeinern oder an das jeweilige Projekt anpassen, in dem der Code benutzt wird. +Die Dateistuktur ist ähnlich wie im vorherigen Beispiel, aber etwas komplexer: + +``` +appint_ros_example.mdl - Simulink-Modell +appint_ros_example_open.m - Initialisierungsskript zum Öffnen des Simulink-Modells + +ros_rt_interface/ - Entspricht Ordner rt_interface des vorherigen Beispiels: Echtzeit-Schnittstelle (im Simulink-Modell) + ros_rt_core/ - Ordner mit Definitionen auf Simulink-Seite + bus_SL_IN.m, bus_SL_OUT.m - Definition der Ein- und Ausgaben im Simulink-Modells + SL_func.h - Gleiche Definition für die Anwendungsschnittstelle + SL_func_dummy.cpp - Platzhalter-Code für Anwendungsschnittstelle (nur Deklaration, kein Inhalt) + build/ - Enthält Abhängigkeiten zum Kompilieren des Simulink-Modells + generate_block.m - Kompiliert die S-Function für den Simulink-Block der Anwendungsschnittstelle + pcu_ros_load_buses.m - Bus-Definition in Matlab-Workspace laden + Makefile - Wird zum Kompilieren benutzt + +catkin_ws/ - ROS-Workspace (Sammlung mehrere Pakete für ROS) + build/ - Temporärer Ordner zum Kompilieren + devel/ - Wird automatisch bei Initialisierung angelegt + install/ - Dieser Ordner wird auf den Echtzeitrechner kopiert (enthält am Ende alle erzeugten Programme) + install/lib/ - Hierhin wird die Programmbibliothek erstellt, die die Echtzeit-Kommunikation durchführt + scripts/ - Ordner wird auch Echtzeitrechner kopiert + autostart.sh - Dient zum schnellen Start des Modells auf dem Echtzeitrechner + source_ros_install.sh - Dient zum Einrichten der ROS-Umgebung zum Starten des Simulink-Modells + src/ - Quelltext-Ordner im ROS-Workspace + pcu_sl_interface/ - Paket für Simulink-Schnittstelle (der Anwendung) + cfg/ - Definitionen für ROS-Umgebung (Dynamic Reconfigure) + msg/ - Definitionen für ROS-Messages + scripts/ - Testskript + src/ + SL_func.h - Identische Datei wie in ros_rt_interface/ros_rt_core + node.cpp - Code für Anwendungsschnittstelle + test_interface.cpp - Programm zum Testen der Schnittstelle ohne das Simulink-Modell starten zu müssen + srv/ - ROS-Service + pcu_common - Paket für Definitionen von Actions und Bonds +``` + +Die folgenden Abschnitte beschreiben die Kompilierung des Simulink-Modells, der ROS-Pakete und das Starten der Echtzeitschnittstelle auf einen oder zwei Rechnern + +#### Installation von ROS + +Die Anleitung wurde für Ubuntu 18.04 und das dafür passende ROS Melodic erstellt. Für andere Versionen kann die Anleitung geringfügig abweichen. + +Für den Entwicklungsrechner: Installation von `ros-melodic-desktop-full` nach [Standard-Anleitung](http://wiki.ros.org/melodic/Installation/Ubuntu) (ohne Erstellung eines Workspace). Der Befehl `source /opt/ros/melodic/setup.bash` sollte in die .bashrc eingefügt werden. +Für den Echtzeitrechner: `ros-melodic-ros-base` reicht aus. Der Echtzeitrechner sollte auch auf Ubuntu 18.04 oder LUbuntu 18.04 basieren, damit alle Abhängigkeiten vorhanden sind. Auf anderen Linux-Systemen (Debian, Beagle-Board mit YOCTO) ist es auch möglich, aber schwieriger aufzusetzen. + + +#### Einrichtung des Simulink-Modells + +Die Kompilierung der Abhängigkeiten des Simulink-Modells erfolgt genau wie im Minimalbeispiel: + +* `./build_dep_simulink.sh` +* `appint_ros_example_open.m` +* `ros_rt_interface/generate_block.m` +* Kompilieren des Modells `appint_ros_example.mdl` aus Simulink heraus + +#### Testen auf einem einzigen Rechner + +Um zu prüfen, ob die Schnittstelle funktioniert, kann das Programm auf dem Entwicklungsrechner getestet werden. + +In jedem Terminal muss folgender Befehl eingefügt werden (mit angepasstem Pfad): + +``` +source /path/to/etherlab-examples-repo/catkin_ws/devel/setup.bash +``` + +ROS-Workspace kompilieren: +Im Terminal muss vorher in den Ordner `catkin_ws` dieses Repos gewechselt werden. + +```bash +catkin_make +``` + +ROS-Core starten + +``` +roscore +``` + +Simulink-Modell starten + +``` +./appint_ros_example +``` + +Da der Entwicklungsrechner kein Echtzeitrechner ist, ist folgende Ausgabe zu erwarten: + +``` +Sample-Time: 0.001000 +mlockall() failed: Cannot allocate memory +Creating ROS-Node Thread! +[ INFO] [1585756850.994591857]: dynamic reconfigure +[ INFO] [1585756851.006106165]: New ControllerState: 0 +Setting SCHED_FIFO with priority 98 failed: Operation not permitted +Set task prio to 98 +[ INFO] [1585756851.009364613]: ControllerState Override! +[ INFO] [1585756851.009414673]: New ControllerState: 5 +Loop 13825. TOO LATE (1). Threadtime 455396.961141870 s, starttime 455396.961744170 s, diff 602300 ns +``` + +Prüfen, ob die ROS-Verbindung funktioniert: + +Die ROS-Topics q_meas, q_set, qd_meas und qd_set entsprechen den Publishern und Subscribern, die in node.cpp eingestellt werden und werden mit dem Simulink-Modell ausgetauscht. + +``` +$ rostopic list +/SL_RT_CORE/acquire/cancel +... +/SL_RT_CORE/q_meas +/SL_RT_CORE/q_set +/SL_RT_CORE/qd_meas +/SL_RT_CORE/qd_set +``` + +Die Datenrate der ROS-Nachrichten sollte der Abtastzeit des Simulink-Modells entsprechen: + +``` +$ rostopic hz /SL_RT_CORE/q_meas +subscribed to [/SL_RT_CORE/q_meas] +average rate: 1000.067 + min: 0.000s max: 0.002s std dev: 0.00006s window: 997 +``` + +Manuell verschickte ROS-Nachrichten sollten bei Verbindung mit dem Modell aus Matlab heraus direkt in den Scopes sichtbar sein. Zur Verbindung muss unter Code Generation -> Interface die Adresse "'127.0.0.1' 0 17725" eingestellt sein (ohne Anführungszeichen). + +``` +$ rostopic pub /SL_RT_CORE/qd_set pcu_sl_interface/JointsVector '{joint_data: [2, -1]}' -r 1 +``` + +Die Parameter innerhalb des Modells können mit Dynamik Reconfigure z.B. über die GUI einfach getestet werden: + +``` +$ rosrun rqt_gui rqt_gui -s reconfigure +``` + +Bei Erfolg führt ein Setzen der Schieberegler für D_j1, D_j2, K_j1 und K_j2 direkt zu einer Änderung in dem entsprechenden Scope in Simulink. +In der Ausgabe des Terminals mit dem Simulink-Modell erscheint dann die Meldung: + +``` +[ INFO] [1585847084.043018279]: dynamic reconfigure +``` + +Die registrierten ROS-Services sollten ebenfalls mit den in der node.cpp eingetragenen Funktionen konsistent sein: + +``` +$ rosservice list +/SL_RT_CORE/get_loggers +/SL_RT_CORE/set_logger_level +/SL_RT_CORE/set_parameters +/SL_RT_CORE/set_state +``` + + + +#### Ausführen des Simulink-Modells auf dem Echtzeitrechner + +Falls der Entwicklungsrechner bereits ein Echtzeit-Betriebssystem hat mit Anbindung an die EtherCAT-Hardware, reicht prinzipiell obige Anleitung. Sinnvollerweise läuft das Simulink-Modell aber auf dem Echtzeitrechner. + +Vorbereitung des Echtzeitrechners: Es sollten folgende Programme auf dem Echtzeitrechner installiert werden: + +``` +sudo apt-get install tmux +``` + +Vorbereitung des Entwicklungsrechners: Hostnamen des Echtzeitrechners bekanntmachen. Sonst funktioniert die Verbindung zum externen ROS-Master nicht. + +``` +sudo nano /etc/hosts +10.144.130.83 imessmartrtpc1 # Neuer Eintrag mit IP und Hostnamen des Echtzeitrechners, falls abweichend +``` + +Dann wird der ROS-Workspace mit folgendem Befehl kompiliert: + +```bash +build.sh +``` + +Hierfür sind keine zusätzlichen Pfad-Initialisierungen (source ...) notwendig. +Der dadurch erzeugte Ordner "install" enthält alle ausführbaren Dateien der ROS-Packages. Ein Kopieren des Quelltextes auf den Echtzeitrechner und dortiges kompilieren ist nicht notwendig. +Die ausführbaren Dateien werden auf den Echtzeitrechner kopiert. +Das Kopierskript "sync.sh" muss vorher an den Zielrechner angepasst werden (Anpassen des SSH-Verbindungsnamens "imessmartrtpc1_ec" an den in der ~/.ssh/config eingestellten). + +``` +sync.sh +``` + +Die obigen Befehle (`roscore`, `./appint_ros_example`) werden nun auf dem Echtzeitrechner gestartet. In dem Terminal müssen die Pfade für ROS initialisiert werden. +In einem SSH-Terminal auf dem Echtzeitrechner dazu: + +``` +~/app_interface/ros_install/scripts/autostart.sh # Anpassen an eventuell modifizierten Pfad in sync.sh +``` + +Die Programme werden in einem [tmux](https://tmuxcheatsheet.com/)-Terminal gestartet (ähnlich zu screen). +Wie der Name des Skriptes verrät, kann dieses Skript auch dazu dienen, per Autostart des Echtzeitrechners zu starten, damit bei einem Prüfstand automatisch der Regler und die zentrale Steuerung angeschaltet wird. +Die Verbindung erfolgt mit +``` +tmux attach-session -t app +``` +In dem viergeteilten Fenster sollten Diagnose-Ausgaben sichtbar sein. Wichtigste Tasten zur Bedienung der tmux-Anzeige: Strg+B zum Wechseln in den Steuerungsmodus, dann Pfeiltasten um zwischen Fenstern zu wechseln. BIldlauftasten für Hoch- und runterscrollen in der Textausgabe. + +Der ROS-Master läuft jetzt auch auf dem Echtzeitrechner. Im Entwicklungsrechner sind folgende Eingaben in jedem Terminal notwendig, in dem ROS-Befehle laufen: + +``` +source /opt/ros/melodic/setup.bash +source /path/to/etherlab-examples-repo/catkin_ws/devel/setup.bash +export ROS_MASTER_URI=http://10.144.130.83:11311/ # konsistent mit IP des Echtzeitrechners +export ROS_IP=10.144.130.7 # konsistent mit IP des Entwicklungsrechners +``` + +Die Befehle können bei häufiger Benutzung in die .bashrc eingefügt werden. +Der Status der Umgebungsvariablen wird mit `printenv | grep ROS` geprüft. +Die Funktionalität der ROS-Umgebung wird mit den gleichen Befehlen (rostopic, rqt_gui) geprüft wie im vorherigen Abschnitt. + +Bei Änderung des Simulink-Modells oder der ROS-Schnittstelle müssen diese neu auf den Rechner kopiert werden. +Dafür wird `build.sh` und `sync.sh` neu ausgeführt. +Vorher müssen die laufenden Programme mit `tmux kill-session -t app` oder durch Beenden der einzelnen Tasks in der tmux-Konsole geschlossen werden. +Es reicht teilweise aus, nur die Programme neu zu starten, die auch neu kompiliert wurden. + + # Quellen * Bachelorarbeit von Lucas Jürgens. Durchgeführt 2017 am Institut für Regelungstechnik, Leibniz Universität Hannover. Betreuer: Moritz Schappler. Titel der Arbeit: "Implementation and Evaluation of a Prosthesis Control Unit on a mobile ARM-based Computing Platform" -* Projekt SoftPro. Gefördert durch EU Forschungsrahmenprogramm 2020. Bearbeitung am Institut für Regelungstechnik (LUH) 2016-2018 u.a. durch Johannes Kühn, Moritz Schappler (bezogen auf Echtzeit-Regelung). Ziel: Entwicklung einer intelligenten Unterarm-Prothese. +* [Projekt SoftPro](https://softpro.eu/). Gefördert durch das 7. EU Forschungsrahmenprogramm (Horizon 2020). Bearbeitung am Institut für Regelungstechnik (LUH) 2016-2018 u.a. durch Johannes Kühn und Moritz Schappler (bezogen auf Echtzeit-Regelung). Ziel: Entwicklung einer intelligenten Unterarm-Prothese. diff --git a/appinterface_ros/.gitignore b/appinterface_ros/.gitignore new file mode 100644 index 0000000..24b27bb --- /dev/null +++ b/appinterface_ros/.gitignore @@ -0,0 +1,2 @@ +appint_ros_example +results diff --git a/appinterface_ros/appint_ros_example.mdl b/appinterface_ros/appint_ros_example.mdl new file mode 100644 index 0000000..b833ccb --- /dev/null +++ b/appinterface_ros/appint_ros_example.mdl @@ -0,0 +1,4762 @@ +Model { + Name "appint_ros_example" + Version 9.2 + SavedCharacterEncoding "UTF-8" + GraphicalInterface { + NumRootInports 0 + NumRootOutports 0 + ParameterArgumentNames "" + ComputedModelVersion "1.61" + NumModelReferences 0 + NumTestPointedSignals 1 + TestPointedSignal { + SignalName "tau_acc" + FullBlockPath "appint_ros_example/forearmbot_fordyn_fixb_vp1/Sum3" + LogSignal 1 + MaxPoints 5000 + Decimation 2 + } + NumProvidedFunctions 0 + NumRequiredFunctions 0 + NumResetEvents 0 + HasInitializeEvent 0 + HasTerminateEvent 0 + PreCompExecutionDomainType "Unset" + IsExportFunctionModel 0 + NumParameterArguments 0 + NumExternalFileReferences 0 + OrderedModelArguments 1 + } + LogicAnalyzerPlugin "on" + LogicAnalyzerSignalOrdering "12c0b665-86dc-437a-a1c1-0f1ba1b57c4d" + DiagnosticSuppressor "on" + WebScopes_FoundationPlugin "on" + NotesPlugin "on" + SLCCPlugin "on" + ScopeRefreshTime 0.035000 + OverrideScopeRefreshTime on + DisableAllScopes off + DataTypeOverride "UseLocalSettings" + DataTypeOverrideAppliesTo "AllNumericTypes" + MinMaxOverflowLogging "UseLocalSettings" + MinMaxOverflowArchiveMode "Overwrite" + FPTRunName "Run 1" + MaxMDLFileLineLength 120 + LastSavedArchitecture "glnxa64" + Object { + $PropName "BdWindowsInfo" + $ObjectID 1 + $ClassName "Simulink.BDWindowsInfo" + Object { + $PropName "WindowsInfo" + $ObjectID 2 + $ClassName "Simulink.WindowInfo" + IsActive [1] + Location [75.0, 35.0, 1024.0, 768.0] + Object { + $PropName "ModelBrowserInfo" + $ObjectID 3 + $ClassName "Simulink.ModelBrowserInfo" + Visible [0] + DockPosition "Left" + Width [50] + Height [50] + Filter [9] + } + Object { + $PropName "ExplorerBarInfo" + $ObjectID 4 + $ClassName "Simulink.ExplorerBarInfo" + Visible [1] + } + Object { + $PropName "EditorsInfo" + $ObjectID 5 + $ClassName "Simulink.EditorInfo" + IsActive [1] + ViewObjType "SimulinkTopLevel" + LoadSaveID "0" + Extents [986.0, 586.0] + ZoomFactor [1.1057553263279667] + Offset [-776.64623836780675, 395.91550785859465] + } + Object { + $PropName "DockComponentsInfo" + $ObjectID 6 + $ClassName "Simulink.DockComponentInfo" + Type "GLUE2:PropertyInspector" + ID "Property Inspector" + Visible [0] + CreateCallback "" + UserData "" + Floating [0] + DockPosition "Right" + Width [640] + Height [480] + } + WindowState "AAAA/wAAAAD9AAAAAgAAAAAAAAC9AAADivwCAAAAA/sAAAAWAEQAbwBjAGsAVwBpAGQAZwBlAHQAMwEAAAAxAAAB+AAAA" + "AAAAAAA+wAAABYARABvAGMAawBXAGkAZABnAGUAdAA0AAAAAAD/////AAAAAAAAAAD7AAAAUgBHAEwAVQBFADIAIAB0AHIAZQBlACAAYwBvAG0Ac" + "ABvAG4AZQBuAHQALwBHAEwAVQBFADIAIAB0AHIAZQBlACAAYwBvAG0AcABvAG4AZQBuAHQAAAAAQQAAA4oAAABiAP///wAAAAEAAAAAAAAAAPwCA" + "AAAAfsAAABUAEcATABVAEUAMgA6AFAAcgBvAHAAZQByAHQAeQBJAG4AcwBwAGUAYwB0AG8AcgAvAFAAcgBvAHAAZQByAHQAeQAgAEkAbgBzAHAAZ" + "QBjAHQAbwByAAAAAAD/////AAAAOQD///8AAAQAAAACiQAAAAEAAAACAAAAAQAAAAL8AAAAAQAAAAIAAAAP/////wAAAAAA/////wAAAAAAAAAA/" + "////wEAAAAA/////wAAAAAAAAAA/////wAAAAAA/////wAAAAAAAAAA/////wAAAAAA/////wAAAAAAAAAA/////wAAAAAA/////wAAAAAAAAAA/" + "////wEAAACA/////wAAAAAAAAAA/////wEAAADo/////wAAAAAAAAAA/////wAAAAAA/////wAAAAAAAAAA/////wEAAAFo/////wAAAAAAAAAA/" + "////wAAAAAA/////wAAAAAAAAAA/////wAAAAAA/////wAAAAAAAAAA/////wAAAAAA/////wAAAAAAAAAA/////wEAAANF/////wAAAAAAAAAA/" + "////wEAAAN3/////wAAAAAAAAAA/////wAAAAAA/////wAAAAAAAAAA" + } + } + HideAutomaticNames on + Created "Fri Mar 27 09:39:04 2020" + Creator "moritz" + UpdateHistory "UpdateHistoryNever" + ModifiedByFormat "%" + LastModifiedBy "schappler" + ModifiedDateFormat "%" + LastModifiedDate "Tue Mar 31 21:21:12 2020" + RTWModifiedTimeStamp 507590469 + ModelVersionFormat "1.%" + SampleTimeColors off + SampleTimeAnnotations off + LibraryLinkDisplay "all" + WideLines off + ShowLineDimensions on + ShowPortDataTypes on + ShowAllPropagatedSignalLabels off + PortDataTypeDisplayFormat "AliasTypeOnly" + ShowEditTimeErrors on + ShowEditTimeWarnings on + ShowEditTimeAdvisorChecks off + ShowPortUnits off + ShowDesignRanges off + ShowLoopsOnError on + IgnoreBidirectionalLines off + ShowStorageClass off + ShowTestPointIcons on + ShowSignalResolutionIcons on + ShowViewerIcons on + SortedOrder off + VariantCondition off + ShowSubsystemDomainSpec off + ExecutionContextIcon off + ShowLinearizationAnnotations on + ShowVisualizeInsertedRTB on + ShowMarkup on + BlockNameDataTip off + BlockParametersDataTip off + BlockDescriptionStringDataTip off + BlockVariantConditionDataTip off + ToolBar on + StatusBar on + BrowserShowLibraryLinks off + FunctionConnectors off + BrowserLookUnderMasks off + MultiThreadCoSim on + SimulationMode "external" + VisualizeLoggedSignalsWhenLoggingToFile off + PauseTimes "5" + NumberOfSteps 1 + SnapshotBufferSize 10 + SnapshotInterval 10 + NumberOfLastSnapshots 0 + EnablePacing off + PacingRate 1 + LinearizationMsg "none" + Profile off + ParamWorkspaceSource "MATLABWorkspace" + AccelSystemTargetFile "accel.tlc" + AccelTemplateMakefile "accel_default_tmf" + AccelMakeCommand "make_rtw" + TryForcingSFcnDF off + Object { + $PropName "DataLoggingOverride" + $ObjectID 7 + $ClassName "Simulink.SimulationData.ModelLoggingInfo" + model_ "appint_ros_example" + overrideMode_ [0.0] + Array { + Type "Cell" + Dimension 1 + Cell "appint_ros_example" + PropName "logAsSpecifiedByModels_" + } + Array { + Type "Cell" + Dimension 1 + Cell [] + PropName "logAsSpecifiedByModelsSSIDs_" + } + } + Object { + $PropName "InstrumentedSignals" + $ObjectID 8 + $ClassName "Simulink.HMI.InstrumentedSignals" + Array { + Type "Struct" + Dimension 1 + MATStruct { + UUID "12c0b665-86dc-437a-a1c1-0f1ba1b57c4d" + BlockPath_ "forearmbot_fordyn_fixb_vp1/Sum3" + SID_ "173" + SubPath_ "" + OutputPortIndex_ [1.0] + LogicalPortIndex_ [0.0] + SignalName_ "" + SubSysPath_ "" + Decimation_ [1.0] + MaxPoints_ [0.0] + TargetBufferedStreaming_ [0.0] + IsFrameBased_ [0.0] + DomainType_ "" + Array { + Type "Struct" + Dimension 1 + MATStruct { + } + PropName "DomainParams_" + } + VisualType_ "" + } + PropName "Persistence" + } + } + ExtModeBatchMode off + ExtModeEnableFloating on + ExtModeTrigType "manual" + ExtModeTrigMode "normal" + ExtModeTrigPort "1" + ExtModeTrigElement "any" + ExtModeTrigDuration 10000 + ExtModeTrigDurationFloating "auto" + ExtModeTrigHoldOff 0 + ExtModeTrigDelay 0 + ExtModeTrigDirection "rising" + ExtModeTrigLevel 0 + ExtModeArchiveMode "auto" + ExtModeArchiveFileName "measurement_data" + ExtModeArchiveDirName "./results" + ExtModeAutoIncOneShot off + ExtModeIncDirWhenArm off + ExtModeAddSuffixToVar off + ExtModeWriteAllDataToWs off + ExtModeArmWhenConnect on + ExtModeSkipDownloadWhenConnect off + ExtModeLogAll on + ExtModeAutoUpdateStatusClock on + ShowModelReferenceBlockVersion off + ShowModelReferenceBlockIO off + OrderedModelArguments on + Array { + Type "Handle" + Dimension 1 + Simulink.ConfigSet { + $ObjectID 9 + Version "1.18.1" + DisabledProps [] + Description "" + Array { + Type "Handle" + Dimension 9 + Simulink.SolverCC { + $ObjectID 10 + Version "1.18.1" + Array { + Type "Cell" + Dimension 1 + Cell "SolverType" + PropName "DisabledProps" + } + Description "" + StartTime "0.0" + StopTime "inf" + AbsTol "auto" + AutoScaleAbsTol on + FixedStep "1e-3" + InitialStep "auto" + MaxOrder 5 + ZcThreshold "auto" + ConsecutiveZCsStepRelTol "10*128*eps" + MaxConsecutiveZCs "1000" + ExtrapolationOrder 4 + NumberNewtonIterations 1 + MaxStep "auto" + MinStep "auto" + MaxConsecutiveMinStep "1" + RelTol "1e-3" + EnableMultiTasking off + ConcurrentTasks off + Solver "FixedStepDiscrete" + SolverName "FixedStepDiscrete" + SolverJacobianMethodControl "auto" + ShapePreserveControl "DisableAll" + ZeroCrossControl "UseLocalSettings" + ZeroCrossAlgorithm "Nonadaptive" + AlgebraicLoopSolver "TrustRegion" + SolverInfoToggleStatus on + IsAutoAppliedInSIP off + SolverResetMethod "Fast" + PositivePriorityOrder off + AutoInsertRateTranBlk off + SampleTimeConstraint "Unconstrained" + InsertRTBMode "Whenever possible" + SampleTimeProperty [] + DecoupledContinuousIntegration off + MinimalZcImpactIntegration off + } + Simulink.DataIOCC { + $ObjectID 11 + Version "1.18.1" + Array { + Type "Cell" + Dimension 8 + Cell "LoadExternalInput" + Cell "LoadInitialState" + Cell "SaveTime" + Cell "SaveState" + Cell "SaveOutput" + Cell "SaveFinalState" + Cell "SignalLogging" + Cell "LimitDataPoints" + PropName "DisabledProps" + } + Description "" + Decimation "1" + ExternalInput "[t, u]" + FinalStateName "xFinal" + InitialState "xInitial" + LimitDataPoints off + MaxDataPoints "1000" + LoadExternalInput off + LoadInitialState off + SaveFinalState off + SaveCompleteFinalSimState off + SaveFormat "Dataset" + SignalLoggingSaveFormat "Dataset" + SaveOutput off + SaveState off + SignalLogging off + DSMLogging on + InspectSignalLogs off + VisualizeSimOutput on + StreamToWorkspace off + StreamVariableName "streamout" + SaveTime off + ReturnWorkspaceOutputs off + StateSaveName "xout" + TimeSaveName "tout" + OutputSaveName "yout" + SignalLoggingName "logsout" + DSMLoggingName "dsmout" + OutputOption "RefineOutputTimes" + OutputTimes "[]" + ReturnWorkspaceOutputsName "out" + Refine "1" + LoggingToFile off + DatasetSignalFormat "timeseries" + LoggingFileName "out.mat" + LoggingIntervals "[-inf, inf]" + } + Simulink.OptimizationCC { + $ObjectID 12 + Version "1.18.1" + Array { + Type "Cell" + Dimension 8 + Cell "BooleansAsBitfields" + Cell "PassReuseOutputArgsAs" + Cell "PassReuseOutputArgsThreshold" + Cell "ZeroExternalMemoryAtStartup" + Cell "ZeroInternalMemoryAtStartup" + Cell "OptimizeModelRefInitCode" + Cell "NoFixptDivByZeroProtection" + Cell "UseSpecifiedMinMax" + PropName "DisabledProps" + } + Description "" + BlockReduction off + BooleanDataType on + ConditionallyExecuteInputs off + DefaultParameterBehavior "Tunable" + UseDivisionForNetSlopeComputation "off" + UseFloatMulNetSlope off + DefaultUnderspecifiedDataType "double" + UseSpecifiedMinMax off + InlineInvariantSignals off + OptimizeBlockIOStorage off + BufferReuse off + EnhancedBackFolding off + CachingGlobalReferences off + GlobalBufferReuse off + StrengthReduction off + AdvancedOptControl "" + ExpressionFolding off + BooleansAsBitfields off + BitfieldContainerType "uint_T" + EnableMemcpy on + MemcpyThreshold 64 + PassReuseOutputArgsAs "Structure reference" + PassReuseOutputArgsThreshold 12 + ExpressionDepthLimit 128 + LocalBlockOutputs off + RollThreshold 5 + StateBitsets off + DataBitsets off + ActiveStateOutputEnumStorageType "Native Integer" + ZeroExternalMemoryAtStartup on + ZeroInternalMemoryAtStartup on + InitFltsAndDblsToZero off + NoFixptDivByZeroProtection off + EfficientFloat2IntCast off + EfficientMapNaN2IntZero on + LifeSpan "auto" + MaxStackSize "Inherit from target" + BufferReusableBoundary on + SimCompilerOptimization "off" + AccelVerboseBuild off + OptimizeBlockOrder "off" + OptimizeDataStoreBuffers off + BusAssignmentInplaceUpdate off + DifferentSizesBufferReuse off + OptimizationLevel "level2" + OptimizationPriority "Balanced" + OptimizationCustomize on + UseRowMajorAlgorithm off + LabelGuidedReuse off + } + Simulink.DebuggingCC { + $ObjectID 13 + Version "1.18.1" + Array { + Type "Cell" + Dimension 1 + Cell "UseOnlyExistingSharedCode" + PropName "DisabledProps" + } + Description "" + RTPrefix "error" + ConsistencyChecking "none" + ArrayBoundsChecking "none" + SignalInfNanChecking "none" + StringTruncationChecking "error" + SignalRangeChecking "none" + ReadBeforeWriteMsg "UseLocalSettings" + WriteAfterWriteMsg "UseLocalSettings" + WriteAfterReadMsg "UseLocalSettings" + AlgebraicLoopMsg "warning" + ArtificialAlgebraicLoopMsg "warning" + SaveWithDisabledLinksMsg "warning" + SaveWithParameterizedLinksMsg "warning" + CheckSSInitialOutputMsg on + UnderspecifiedInitializationDetection "Simplified" + MergeDetectMultiDrivingBlocksExec "error" + CheckExecutionContextPreStartOutputMsg off + CheckExecutionContextRuntimeOutputMsg off + SignalResolutionControl "UseLocalSettings" + BlockPriorityViolationMsg "warning" + MinStepSizeMsg "warning" + TimeAdjustmentMsg "none" + MaxConsecutiveZCsMsg "error" + MaskedZcDiagnostic "warning" + IgnoredZcDiagnostic "warning" + SolverPrmCheckMsg "none" + InheritedTsInSrcMsg "warning" + MultiTaskDSMMsg "error" + MultiTaskCondExecSysMsg "error" + MultiTaskRateTransMsg "error" + SingleTaskRateTransMsg "none" + TasksWithSamePriorityMsg "warning" + ExportedTasksRateTransMsg "none" + SigSpecEnsureSampleTimeMsg "warning" + CheckMatrixSingularityMsg "none" + IntegerOverflowMsg "warning" + Int32ToFloatConvMsg "warning" + ParameterDowncastMsg "error" + ParameterOverflowMsg "error" + ParameterUnderflowMsg "none" + ParameterPrecisionLossMsg "warning" + ParameterTunabilityLossMsg "warning" + FixptConstUnderflowMsg "none" + FixptConstOverflowMsg "none" + FixptConstPrecisionLossMsg "none" + UnderSpecifiedDataTypeMsg "none" + UnnecessaryDatatypeConvMsg "none" + VectorMatrixConversionMsg "none" + InvalidFcnCallConnMsg "error" + FcnCallInpInsideContextMsg "error" + SignalLabelMismatchMsg "none" + UnconnectedInputMsg "warning" + UnconnectedOutputMsg "warning" + UnconnectedLineMsg "warning" + UseOnlyExistingSharedCode "error" + SFcnCompatibilityMsg "none" + FrameProcessingCompatibilityMsg "error" + UniqueDataStoreMsg "none" + BusObjectLabelMismatch "warning" + RootOutportRequireBusObject "warning" + AssertControl "UseLocalSettings" + AllowSymbolicDim on + RowMajorDimensionSupport off + ModelReferenceIOMsg "none" + ModelReferenceMultiInstanceNormalModeStructChecksumCheck "error" + ModelReferenceVersionMismatchMessage "none" + ModelReferenceIOMismatchMessage "none" + UnknownTsInhSupMsg "warning" + ModelReferenceDataLoggingMessage "warning" + ModelReferenceSymbolNameMessage "warning" + ModelReferenceExtraNoncontSigs "error" + StateNameClashWarn "none" + SimStateInterfaceChecksumMismatchMsg "warning" + SimStateOlderReleaseMsg "error" + ChecksumConsistencyForSSReuse "none" + LibraryContextMissingDiagnostic "warning" + MatchCodeGenerationContextForUpdateDiagram "none" + InitInArrayFormatMsg "warning" + StrictBusMsg "ErrorLevel1" + BusNameAdapt "WarnAndRepair" + NonBusSignalsTreatedAsBus "none" + SymbolicDimMinMaxWarning "warning" + LossOfSymbolicDimsSimulationWarning "warning" + LossOfSymbolicDimsCodeGenerationWarning "error" + SymbolicDimsDataTypeCodeGenerationDiagnostic "error" + BlockIODiagnostic "none" + SFUnusedDataAndEventsDiag "warning" + SFUnexpectedBacktrackingDiag "error" + SFInvalidInputDataAccessInChartInitDiag "warning" + SFNoUnconditionalDefaultTransitionDiag "error" + SFTransitionOutsideNaturalParentDiag "warning" + SFUnreachableExecutionPathDiag "warning" + SFUndirectedBroadcastEventsDiag "warning" + SFTransitionActionBeforeConditionDiag "warning" + SFOutputUsedAsStateInMooreChartDiag "error" + SFTemporalDelaySmallerThanSampleTimeDiag "warning" + SFSelfTransitionDiag "warning" + SFExecutionAtInitializationDiag "warning" + SFMachineParentedDataDiag "warning" + IntegerSaturationMsg "warning" + AllowedUnitSystems "all" + UnitsInconsistencyMsg "warning" + AllowAutomaticUnitConversions on + RCSCRenamedMsg "warning" + RCSCObservableMsg "warning" + ForceCombineOutputUpdateInSim off + UnitDatabase "" + UnderSpecifiedDimensionMsg "none" + } + Simulink.HardwareCC { + $ObjectID 14 + Version "1.18.1" + DisabledProps [] + Description "" + ProdBitPerChar 8 + ProdBitPerShort 16 + ProdBitPerInt 32 + ProdBitPerLong 32 + ProdBitPerLongLong 64 + ProdBitPerFloat 32 + ProdBitPerDouble 64 + ProdBitPerPointer 64 + ProdBitPerSizeT 64 + ProdBitPerPtrDiffT 64 + ProdLargestAtomicInteger "Char" + ProdLargestAtomicFloat "Float" + ProdIntDivRoundTo "Zero" + ProdEndianess "LittleEndian" + ProdWordSize 64 + ProdShiftRightIntArith on + ProdLongLongMode off + ProdHWDeviceType "Intel->x86-64 (Windows64)" + TargetBitPerChar 8 + TargetBitPerShort 16 + TargetBitPerInt 32 + TargetBitPerLong 32 + TargetBitPerLongLong 64 + TargetBitPerFloat 32 + TargetBitPerDouble 64 + TargetBitPerPointer 32 + TargetBitPerSizeT 32 + TargetBitPerPtrDiffT 32 + TargetLargestAtomicInteger "Char" + TargetLargestAtomicFloat "None" + TargetShiftRightIntArith on + TargetLongLongMode off + TargetIntDivRoundTo "Undefined" + TargetEndianess "Unspecified" + TargetWordSize 32 + TargetPreprocMaxBitsSint 32 + TargetPreprocMaxBitsUint 32 + TargetHWDeviceType "Specified" + TargetUnknown off + ProdEqTarget on + UseEmbeddedCoderFeatures on + UseSimulinkCoderFeatures on + } + Simulink.ModelReferenceCC { + $ObjectID 15 + Version "1.18.1" + DisabledProps [] + Description "" + UpdateModelReferenceTargets "IfOutOfDateOrStructuralChange" + EnableRefExpFcnMdlSchedulingChecks on + CheckModelReferenceTargetMessage "error" + EnableParallelModelReferenceBuilds off + ParallelModelReferenceErrorOnInvalidPool on + ParallelModelReferenceMATLABWorkerInit "None" + ModelReferenceNumInstancesAllowed "Multi" + PropagateVarSize "Infer from blocks in model" + ModelDependencies "" + ModelReferencePassRootInputsByReference on + ModelReferenceMinAlgLoopOccurrences off + PropagateSignalLabelsOutOfModel on + SupportModelReferenceSimTargetCustomCode off + } + Simulink.SFSimCC { + $ObjectID 16 + Version "1.18.1" + DisabledProps [] + Description "" + SimCustomSourceCode "" + SimCustomHeaderCode "" + SimCustomInitializer "" + SimCustomTerminator "" + SimReservedNameArray [] + SimUserSources "" + SimUserIncludeDirs "" + SimUserLibraries "" + SimUserDefines "" + SimCustomCompilerFlags "" + SimCustomLinkerFlags "" + SFSimEcho on + SimCtrlC on + SimIntegrity on + SimUseLocalCustomCode off + SimParseCustomCode on + SimAnalyzeCustomCode off + SimBuildMode "sf_incremental_build" + SimGenImportedTypeDefs off + ModelFunctionsGlobalVisibility "on" + CompileTimeRecursionLimit 50 + EnableRuntimeRecursion on + MATLABDynamicMemAlloc on + MATLABDynamicMemAllocThreshold 65536 + CustomCodeFunctionArrayLayout [] + DefaultCustomCodeFunctionArrayLayout "NotSpecified" + } + Simulink.RTWCC { + $BackupClass "Simulink.RTWCC" + $ObjectID 17 + Version "1.18.1" + Array { + Type "Cell" + Dimension 16 + Cell "IncludeHyperlinkInReport" + Cell "GenerateTraceInfo" + Cell "GenerateTraceReport" + Cell "GenerateTraceReportSl" + Cell "GenerateTraceReportSf" + Cell "GenerateTraceReportEml" + Cell "PortableWordSizes" + Cell "GenerateWebview" + Cell "GenerateCodeMetricsReport" + Cell "GenerateCodeReplacementReport" + Cell "GenerateMissedCodeReplacementReport" + Cell "GenerateErtSFunction" + Cell "CreateSILPILBlock" + Cell "CodeExecutionProfiling" + Cell "CodeProfilingSaveOptions" + Cell "CodeProfilingInstrumentation" + PropName "DisabledProps" + } + SystemTargetFile "etherlab.tlc" + HardwareBoard "None" + TLCOptions "" + GenCodeOnly off + MakeCommand "make_rtw" + GenerateMakefile on + PackageGeneratedCodeAndArtifacts off + PackageName "" + TemplateMakefile "etherlab_hrt.tmf" + PostCodeGenCommand "" + Description "EtherLab PREEMT_RT Real-Time Target" + GenerateReport off + RTWVerbose on + RetainRTWFile off + RTWBuildHooks [] + ProfileTLC off + TLCDebug off + TLCCoverage off + TLCAssert off + RTWUseLocalCustomCode off + RTWUseSimCustomCode off + CustomSourceCode "" + CustomHeaderCode "" + CustomInclude "" + CustomSource "" + CustomLibrary "" + CustomDefine "" + CustomBLASCallback "" + CustomLAPACKCallback "" + CustomFFTCallback "" + CustomInitializer "" + CustomTerminator "" + Toolchain "Automatically locate an installed toolchain" + BuildConfiguration "Faster Builds" + CustomToolchainOptions [] + IncludeHyperlinkInReport off + LaunchReport off + PortableWordSizes off + CreateSILPILBlock "None" + CodeExecutionProfiling off + CodeExecutionProfileVariable "executionProfile" + CodeProfilingSaveOptions "SummaryOnly" + CodeProfilingInstrumentation "off" + SILDebugging off + TargetLang "C" + IncludeBusHierarchyInRTWFileBlockHierarchyMap off + GenerateTraceInfo off + GenerateTraceReport off + GenerateTraceReportSl off + GenerateTraceReportSf off + GenerateTraceReportEml off + GenerateWebview off + GenerateCodeMetricsReport off + GenerateCodeReplacementReport off + GenerateMissedCodeReplacementReport off + RTWCompilerOptimization "off" + ObjectivePriorities [] + RTWCustomCompilerOptimizations "" + CheckMdlBeforeBuild "Off" + SharedConstantsCachingThreshold 1024 + Array { + Type "Handle" + Dimension 2 + Simulink.CodeAppCC { + $ObjectID 18 + Version "1.18.1" + Array { + Type "Cell" + Dimension 28 + Cell "IgnoreCustomStorageClasses" + Cell "IgnoreTestpoints" + Cell "BlockCommentType" + Cell "InsertBlockDesc" + Cell "InsertPolySpaceComments" + Cell "SFDataObjDesc" + Cell "MATLABFcnDesc" + Cell "SimulinkDataObjDesc" + Cell "DefineNamingRule" + Cell "SignalNamingRule" + Cell "ParamNamingRule" + Cell "InternalIdentifier" + Cell "InlinedPrmAccess" + Cell "CustomSymbolStr" + Cell "CustomSymbolStrGlobalVar" + Cell "CustomSymbolStrType" + Cell "CustomSymbolStrField" + Cell "CustomSymbolStrFcn" + Cell "CustomSymbolStrModelFcn" + Cell "CustomSymbolStrFcnArg" + Cell "CustomSymbolStrBlkIO" + Cell "CustomSymbolStrTmpVar" + Cell "CustomSymbolStrMacro" + Cell "CustomSymbolStrUtil" + Cell "CustomSymbolStrEmxType" + Cell "CustomSymbolStrEmxFcn" + Cell "CustomUserTokenString" + Cell "ReqsInCode" + PropName "DisabledProps" + } + Description "" + Comment "" + ForceParamTrailComments off + GenerateComments on + CommentStyle "Auto" + IgnoreCustomStorageClasses on + IgnoreTestpoints off + MaxIdLength 31 + PreserveName off + PreserveNameWithParent off + ShowEliminatedStatement off + OperatorAnnotations off + SimulinkDataObjDesc off + SFDataObjDesc off + MATLABFcnDesc off + MangleLength 1 + SharedChecksumLength 8 + CustomSymbolStrGlobalVar "$R$N$M" + CustomSymbolStrType "$N$R$M_T" + CustomSymbolStrField "$N$M" + CustomSymbolStrFcn "$R$N$M$F" + CustomSymbolStrModelFcn "$R$N" + CustomSymbolStrFcnArg "rt$I$N$M" + CustomSymbolStrBlkIO "rtb_$N$M" + CustomSymbolStrTmpVar "$N$M" + CustomSymbolStrMacro "$R$N$M" + CustomSymbolStrUtil "$N$C" + CustomSymbolStrEmxType "emxArray_$M$N" + CustomSymbolStrEmxFcn "emx$M$N" + CustomUserTokenString "" + CustomCommentsFcn "" + DefineNamingRule "None" + DefineNamingFcn "" + ParamNamingRule "None" + ParamNamingFcn "" + SignalNamingRule "None" + SignalNamingFcn "" + InsertBlockDesc off + InsertPolySpaceComments off + SimulinkBlockComments on + BlockCommentType "BlockPathComment" + StateflowObjectComments off + MATLABSourceComments off + EnableCustomComments off + InternalIdentifierFile "" + InternalIdentifier "Shortened" + InlinedPrmAccess "Literals" + ReqsInCode off + UseSimReservedNames off + ReservedNameArray [] + } + Simulink.STFCustomTargetCC { + $BackupClass "Simulink.TargetCC" + $ObjectID 19 + Version "1.18.1" + Array { + Type "Cell" + Dimension 18 + Cell "IncludeMdlTerminateFcn" + Cell "SuppressErrorStatus" + Cell "ERTCustomFileBanners" + Cell "GenerateSampleERTMain" + Cell "ExistingSharedCode" + Cell "GenerateTestInterfaces" + Cell "ModelStepFunctionPrototypeControlCompliant" + Cell "GenerateAllocFcn" + Cell "PurelyIntegerCode" + Cell "SupportComplex" + Cell "SupportAbsoluteTime" + Cell "SupportContinuousTime" + Cell "SupportNonInlinedSFcns" + Cell "RemoveDisableFunc" + Cell "RemoveResetFunc" + Cell "MatFileLogging" + Cell "PreserveStateflowLocalDataDimensions" + Cell "CombineOutputUpdateFcns" + PropName "DisabledProps" + } + Description "" + TargetFcnLib "ansi_tfl_table_tmw.mat" + TargetLibSuffix "" + TargetPreCompLibLocation "" + GenFloatMathFcnCalls "NOT IN USE" + TargetLangStandard "C99 (ISO)" + CodeReplacementLibrary "None" + UtilityFuncGeneration "Auto" + MultiwordTypeDef "System defined" + MultiwordLength 2048 + DynamicStringBufferSize 256 + GenerateFullHeader on + InferredTypesCompatibility off + ExistingSharedCode "" + GenerateSampleERTMain off + GenerateTestInterfaces off + ModelReferenceCompliant off + ParMdlRefBuildCompliant off + CompOptLevelCompliant off + ConcurrentExecutionCompliant off + IncludeMdlTerminateFcn on + GeneratePreprocessorConditionals "Use local settings" + CombineOutputUpdateFcns off + CombineSignalStateStructs off + GroupInternalDataByFunction off + SuppressErrorStatus off + IncludeFileDelimiter "Auto" + ERTCustomFileBanners off + SupportAbsoluteTime on + LogVarNameModifier "rt_" + MatFileLogging off + MultiInstanceERTCode off + CodeInterfacePackaging "Nonreusable function" + PurelyIntegerCode off + SupportNonFinite on + SupportComplex on + SupportContinuousTime on + SupportNonInlinedSFcns on + RemoveDisableFunc off + RemoveResetFunc off + SupportVariableSizeSignals off + ParenthesesLevel "Nominal" + CastingMode "Nominal" + PreserveStateflowLocalDataDimensions off + MATLABClassNameForMDSCustomization "Simulink.SoftwareTarget.GRTCustomization" + ModelStepFunctionPrototypeControlCompliant off + CPPClassGenCompliant off + AutosarCompliant off + MDXCompliant off + GRTInterface on + GenerateAllocFcn off + UseToolchainInfoCompliant off + GenerateSharedConstants on + CoderGroups [] + AccessMethods [] + LookupTableObjectStructAxisOrder "1,2,3,4,..." + LUTObjectStructOrderExplicitValues "Size,Breakpoints,Table" + LUTObjectStructOrderEvenSpacing "Size,Breakpoints,Table" + ArrayLayout "Column-major" + UnsupportedSFcnMsg "error" + ERTHeaderFileRootName "$R$E" + ERTSourceFileRootName "$R$E" + ERTDataFileRootName "$R_data" + SystemTargetFile "etherlab.tlc" + DialogCategory 0 + Array { + Type "Handle" + Dimension 1 + Simulink.GRTTargetCC { + $BackupClass "Simulink.TargetCC" + $ObjectID 20 + Version "1.18.1" + Array { + Type "Cell" + Dimension 19 + Cell "IncludeMdlTerminateFcn" + Cell "SuppressErrorStatus" + Cell "ERTCustomFileBanners" + Cell "GenerateSampleERTMain" + Cell "ExistingSharedCode" + Cell "GenerateTestInterfaces" + Cell "ModelStepFunctionPrototypeControlCompliant" + Cell "GenerateAllocFcn" + Cell "PurelyIntegerCode" + Cell "SupportComplex" + Cell "SupportAbsoluteTime" + Cell "SupportContinuousTime" + Cell "SupportNonInlinedSFcns" + Cell "RemoveDisableFunc" + Cell "RemoveResetFunc" + Cell "RTWCAPISignals" + Cell "RTWCAPIParams" + Cell "MatFileLogging" + Cell "CombineOutputUpdateFcns" + PropName "DisabledProps" + } + Description "" + TargetFcnLib "ansi_tfl_table_tmw.mat" + TargetLibSuffix "" + TargetPreCompLibLocation "" + GenFloatMathFcnCalls "NOT IN USE" + TargetLangStandard "C99 (ISO)" + CodeReplacementLibrary "None" + UtilityFuncGeneration "Auto" + MultiwordTypeDef "System defined" + MultiwordLength 2048 + DynamicStringBufferSize 256 + GenerateFullHeader on + InferredTypesCompatibility off + ExistingSharedCode "" + GenerateSampleERTMain off + GenerateTestInterfaces off + ModelReferenceCompliant off + ParMdlRefBuildCompliant off + CompOptLevelCompliant off + ConcurrentExecutionCompliant off + IncludeMdlTerminateFcn on + GeneratePreprocessorConditionals "Use local settings" + CombineOutputUpdateFcns off + CombineSignalStateStructs off + GroupInternalDataByFunction off + SuppressErrorStatus off + IncludeFileDelimiter "Auto" + ERTCustomFileBanners off + SupportAbsoluteTime on + LogVarNameModifier "rt_" + MatFileLogging off + MultiInstanceERTCode off + CodeInterfacePackaging "Nonreusable function" + PurelyIntegerCode off + SupportNonFinite on + SupportComplex on + SupportContinuousTime on + SupportNonInlinedSFcns on + RemoveDisableFunc off + RemoveResetFunc off + SupportVariableSizeSignals off + ParenthesesLevel "Nominal" + CastingMode "Nominal" + PreserveStateflowLocalDataDimensions off + MATLABClassNameForMDSCustomization "Simulink.SoftwareTarget.GRTCustomization" + ModelStepFunctionPrototypeControlCompliant off + CPPClassGenCompliant off + AutosarCompliant off + MDXCompliant off + GRTInterface on + GenerateAllocFcn off + UseToolchainInfoCompliant off + GenerateSharedConstants on + CoderGroups [] + AccessMethods [] + LookupTableObjectStructAxisOrder "1,2,3,4,..." + LUTObjectStructOrderExplicitValues "Size,Breakpoints,Table" + LUTObjectStructOrderEvenSpacing "Size,Breakpoints,Table" + ArrayLayout "Column-major" + UnsupportedSFcnMsg "error" + ERTHeaderFileRootName "$R$E" + ERTSourceFileRootName "$R$E" + ERTDataFileRootName "$R_data" + UseMalloc off + ExtMode on + ExtModeStaticAlloc on + ExtModeTesting off + ExtModeStaticAllocSize 10000000 + ExtModeTransport 0 + ExtModeMexFile "ext_comm" + ExtModeMexArgs "'10.144.130.83' 0 17725" + ExtModeIntrfLevel "Level1" + RTWCAPISignals on + RTWCAPIParams on + RTWCAPIStates off + RTWCAPIRootIO off + GenerateASAP2 off + MultiInstanceErrorCode "Error" + } + PropName "Components" + } + CustomProperty { + DataType "int32" + Name "BufferTime" + Value 2 + } + CustomProperty { + DataType "int32" + Name "OverrunCount" + Value 1 + } + CustomProperty { + DataType "int32" + Name "StackSize" + Value 2000 + } + CustomProperty { + DataType "string" + Name "ParameterPrefix" + Value "ModelParameter" + } + CustomProperty { + DataType "slbool" + Name "Ethercat32bit" + Value off + } + } + PropName "Components" + } + } + SlCovCC.ConfigComp { + $ObjectID 21 + Version "1.18.1" + DisabledProps [] + Description "Simulink Coverage Configuration Component" + Name "Simulink Coverage" + CovEnable off + CovScope "EntireSystem" + CovIncludeTopModel on + RecordCoverage off + CovPath "/" + CovSaveName "covdata" + CovCompData "" + CovMetricSettings "dwe" + CovFilter "" + CovHTMLOptions "" + CovNameIncrementing off + CovHtmlReporting off + CovForceBlockReductionOff on + CovEnableCumulative on + CovSaveCumulativeToWorkspaceVar off + CovSaveSingleToWorkspaceVar off + CovCumulativeVarName "covCumulativeData" + CovCumulativeReport off + CovSaveOutputData on + CovOutputDir "slcov_output/$ModelName$" + CovDataFileName "$ModelName$_cvdata" + CovShowResultsExplorer on + CovReportOnPause on + CovModelRefEnable "off" + CovModelRefExcluded "" + CovExternalEMLEnable on + CovSFcnEnable on + CovBoundaryAbsTol 1e-05 + CovBoundaryRelTol 0.01 + CovUseTimeInterval off + CovStartTime 0 + CovStopTime 0 + CovMcdcMode "Masking" + } + PropName "Components" + } + Name "Configuration" + ExtraOptions "-aBlockCommentType=\"BlockPathComment\" -aHostCAPINeeded=1 -aIgnoreTestpoints=0 " + CurrentDlgPage "Code Generation/EtherLab C code generation options" + ConfigPrmDlgPosition [ 180, 41, 1100, 681 ] + } + PropName "ConfigurationSets" + } + Simulink.ConfigSet { + $PropName "ActiveConfigurationSet" + $ObjectID 9 + } + Object { + $PropName "DataTransfer" + $ObjectID 22 + $ClassName "Simulink.GlobalDataTransfer" + DefaultTransitionBetweenSyncTasks "Ensure deterministic transfer (maximum delay)" + DefaultTransitionBetweenAsyncTasks "Ensure data integrity only" + DefaultTransitionBetweenContTasks "Ensure deterministic transfer (minimum delay)" + DefaultExtrapolationMethodBetweenContTasks "None" + AutoInsertRateTranBlk [0] + } + ExplicitPartitioning off + BlockDefaults { + ForegroundColor "black" + BackgroundColor "white" + DropShadow off + NamePlacement "normal" + FontName "Helvetica" + FontSize 10 + FontWeight "normal" + FontAngle "normal" + ShowName on + HideAutomaticName on + BlockRotation 0 + BlockMirror off + } + AnnotationDefaults { + HorizontalAlignment "left" + VerticalAlignment "top" + ForegroundColor "black" + BackgroundColor "white" + DropShadow off + FontName "Helvetica" + FontSize 10 + FontWeight "normal" + FontAngle "normal" + MarkupType "model" + UseDisplayTextAsClickCallback off + AnnotationType "note_annotation" + FixedHeight off + FixedWidth off + Interpreter "off" + } + LineDefaults { + FontName "Helvetica" + FontSize 9 + FontWeight "normal" + FontAngle "normal" + } + MaskDefaults { + SelfModifiable "off" + IconFrame "on" + IconOpaque "opaque" + RunInitForIconRedraw "analyze" + IconRotate "none" + PortRotate "default" + IconUnits "autoscale" + } + MaskParameterDefaults { + Evaluate "on" + Tunable "on" + NeverSave "off" + Internal "off" + ReadOnly "off" + Enabled "on" + Visible "on" + ToolTip "on" + } + BlockParameterDefaults { + Block { + BlockType BusCreator + DisplayOption "none" + OutDataTypeStr "Inherit: auto" + NonVirtualBus off + } + Block { + BlockType BusSelector + } + Block { + BlockType Constant + Value "1" + VectorParams1D on + SamplingMode "Sample based" + OutMin "[]" + OutMax "[]" + OutDataTypeStr "Inherit: Inherit from 'Constant value'" + LockScale off + SampleTime "inf" + FramePeriod "inf" + PreserveConstantTs off + } + Block { + BlockType Delay + DelayLengthSource "Dialog" + DelayLength "2" + DelayLengthUpperLimit "100" + InitialConditionSource "Dialog" + InitialCondition "0.0" + ExternalReset "None" + ShowEnablePort off + PreventDirectFeedthrough off + DiagnosticForDelayLength "None" + RemoveDelayLengthCheckInGeneratedCode off + InputProcessing "Elements as channels (sample based)" + UseCircularBuffer off + SampleTime "-1" + StateMustResolveToSignalObject off + CodeGenStateStorageClass "Auto" + } + Block { + BlockType Demux + Outputs "4" + DisplayOption "none" + BusSelectionMode off + } + Block { + BlockType DiscreteIntegrator + IntegratorMethod "Integration: Forward Euler" + gainval "1.0" + ExternalReset "none" + InitialConditionSource "internal" + InitialCondition "0" + InitialConditionSetting "Output" + SampleTime "1" + OutMin "[]" + OutMax "[]" + OutDataTypeStr "Inherit: Inherit via internal rule" + LockScale off + RndMeth "Floor" + SaturateOnIntegerOverflow off + LimitOutput off + UpperSaturationLimit "inf" + LowerSaturationLimit "-inf" + ShowSaturationPort off + ShowStatePort off + IgnoreLimit off + StateMustResolveToSignalObject off + RTWStateStorageClass "Auto" + } + Block { + BlockType Inport + Port "1" + OutputFunctionCall off + OutMin "[]" + OutMax "[]" + OutDataTypeStr "Inherit: auto" + LockScale off + BusOutputAsStruct off + Unit "inherit" + PortDimensions "-1" + VarSizeSig "Inherit" + SampleTime "-1" + SignalType "auto" + SamplingMode "auto" + LatchByDelayingOutsideSignal off + LatchInputForFeedbackSignals off + Interpolate on + } + Block { + BlockType Outport + Port "1" + OutMin "[]" + OutMax "[]" + OutDataTypeStr "Inherit: auto" + LockScale off + BusOutputAsStruct off + Unit "inherit" + PortDimensions "-1" + VarSizeSig "Inherit" + SampleTime "-1" + SignalType "auto" + SamplingMode "auto" + EnsureOutportIsVirtual off + SourceOfInitialOutputValue "Dialog" + OutputWhenDisabled "held" + InitialOutput "[]" + MustResolveToSignalObject off + OutputWhenUnConnected off + OutputWhenUnconnectedValue "0" + VectorParamsAs1DForOutWhenUnconnected off + } + Block { + BlockType Product + Inputs "2" + Multiplication "Element-wise(.*)" + CollapseMode "All dimensions" + CollapseDim "1" + InputSameDT on + OutMin "[]" + OutMax "[]" + OutDataTypeStr "Inherit: Same as first input" + LockScale off + RndMeth "Zero" + SaturateOnIntegerOverflow on + SampleTime "-1" + } + Block { + BlockType RelationalOperator + Operator ">=" + InputSameDT on + OutDataTypeStr "Inherit: Logical (see Configuration Parameters: Optimization)" + ZeroCross on + SampleTime "-1" + RndMeth "Nearest" + } + Block { + BlockType S-Function + FunctionName "system" + SFunctionModules "''" + PortCounts "[]" + MultiThreadCoSim "auto" + } + Block { + BlockType Scope + DefaultConfigurationName "Simulink.scopes.TimeScopeBlockCfg" + } + Block { + BlockType SubSystem + ShowPortLabels "FromPortIcon" + Permissions "ReadWrite" + PermitHierarchicalResolution "All" + TreatAsAtomicUnit off + MinAlgLoopOccurrences off + PropExecContextOutsideSubsystem off + SystemSampleTime "-1" + RTWSystemCode "Auto" + RTWFcnNameOpts "Auto" + RTWFileNameOpts "Auto" + FunctionInterfaceSpec "void_void" + FunctionWithSeparateData off + RTWMemSecFuncInitTerm "Inherit from model" + RTWMemSecFuncExecute "Inherit from model" + RTWMemSecDataConstants "Inherit from model" + RTWMemSecDataInternal "Inherit from model" + RTWMemSecDataParameters "Inherit from model" + SimViewingDevice off + DataTypeOverride "UseLocalSettings" + DataTypeOverrideAppliesTo "AllNumericTypes" + MinMaxOverflowLogging "UseLocalSettings" + Opaque off + MaskHideContents off + SFBlockType "NONE" + VariantControlMode "Expression" + Variant off + GeneratePreprocessorConditionals off + AllowZeroVariantControls off + PropagateVariantConditions off + TreatAsGroupedWhenPropagatingVariantConditions on + ContentPreviewEnabled off + IsWebBlock off + IsObserver off + Latency "0" + AutoFrameSizeCalculation off + IsWebBlockPanel off + } + Block { + BlockType Sum + IconShape "rectangular" + Inputs "++" + CollapseMode "All dimensions" + CollapseDim "1" + InputSameDT on + AccumDataTypeStr "Inherit: Inherit via internal rule" + OutMin "[]" + OutMax "[]" + OutDataTypeStr "Inherit: Same as first input" + LockScale off + RndMeth "Floor" + SaturateOnIntegerOverflow on + SampleTime "-1" + } + Block { + BlockType Switch + Criteria "u2 >= Threshold" + Threshold "0" + InputSameDT on + OutMin "[]" + OutMax "[]" + OutDataTypeStr "Inherit: Inherit via internal rule" + LockScale off + RndMeth "Floor" + SaturateOnIntegerOverflow on + ZeroCross on + SampleTime "-1" + AllowDiffInputSizes off + } + Block { + BlockType Terminator + } + } + System { + Name "appint_ros_example" + Location [75, 35, 1099, 803] + Open on + PortBlocksUseCompactNotation off + SetExecutionDomain off + ExecutionDomainType "Deduce" + ModelBrowserVisibility off + ModelBrowserWidth 200 + ScreenColor "white" + PaperOrientation "landscape" + PaperPositionMode "auto" + PaperType "usletter" + PaperUnits "inches" + TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] + TiledPageScale 1 + ShowPageBoundaries off + ZoomFactor "111" + ReportName "simulink-default.rpt" + SIDHighWatermark "117" + Block { + BlockType BusSelector + Name "Bus\nSelector1" + SID "1" + Ports [1, 5] + Position [450, 36, 455, 274] + ZOrder 22429 + ShowName off + OutputSignals "state,param_D,param_K,q_set,qd_set" + OutputAsBus off + Port { + PortNumber 1 + Name "" + } + Port { + PortNumber 2 + Name "" + } + Port { + PortNumber 3 + Name "" + } + Port { + PortNumber 4 + Name "" + } + Port { + PortNumber 5 + Name "" + } + } + Block { + BlockType BusCreator + Name "Bus_Creator" + SID "5" + Ports [3, 1] + Position [-20, 86, -15, 224] + ZOrder 22493 + Inputs "3" + DisplayOption "bar" + InheritFromInputs on + } + Block { + BlockType Delay + Name "Delay" + SID "2" + Ports [1, 1] + Position [25, 138, 60, 172] + ZOrder 22491 + InputPortMap "u0" + DelayLength "1" + } + Block { + BlockType Delay + Name "Delay1" + SID "95" + Ports [1, 1] + Position [125, 583, 160, 617] + ZOrder 22526 + InputPortMap "u0" + DelayLength "1" + InitialCondition "0" + } + Block { + BlockType Delay + Name "Delay2" + SID "96" + Ports [1, 1] + Position [125, 628, 160, 662] + ZOrder 22527 + InputPortMap "u0" + DelayLength "1" + InitialCondition "0" + } + Block { + BlockType SubSystem + Name "PD_Regler" + SID "35" + Ports [6, 1] + Position [340, 410, 415, 575] + ZOrder 22523 + BlockMirror on + NamePlacement "alternate" + RequestExecContextInheritance off + Object { + $PropName "MaskObject" + $ObjectID 23 + $ClassName "Simulink.Mask" + } + System { + Name "PD_Regler" + Location [330, 79, 1543, 1076] + Open off + PortBlocksUseCompactNotation off + SetExecutionDomain off + ExecutionDomainType "Deduce" + ModelBrowserVisibility off + ModelBrowserWidth 200 + ScreenColor "white" + PaperOrientation "landscape" + PaperPositionMode "auto" + PaperType "usletter" + PaperUnits "inches" + TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] + TiledPageScale 1 + ShowPageBoundaries off + ZoomFactor "150" + Block { + BlockType Inport + Name "q_ist" + SID "36" + Position [30, 88, 60, 102] + ZOrder 3 + IconDisplay "Port number" + PortDimensions "[2 1]" + } + Block { + BlockType Inport + Name "q_soll" + SID "37" + Position [30, 143, 60, 157] + ZOrder 5 + Port "2" + IconDisplay "Port number" + PortDimensions "[2 1]" + } + Block { + BlockType Inport + Name "qD_ist" + SID "38" + Position [30, 243, 60, 257] + ZOrder 8 + Port "3" + IconDisplay "Port number" + PortDimensions "[2 1]" + } + Block { + BlockType Inport + Name "qD_soll" + SID "39" + Position [30, 298, 60, 312] + ZOrder 9 + Port "4" + IconDisplay "Port number" + PortDimensions "[2 1]" + } + Block { + BlockType Inport + Name "k_P" + SID "55" + Position [30, 43, 60, 57] + ZOrder 22 + Port "5" + IconDisplay "Port number" + PortDimensions "[2 1]" + } + Block { + BlockType Inport + Name "k_D" + SID "56" + Position [30, 198, 60, 212] + ZOrder 23 + Port "6" + IconDisplay "Port number" + PortDimensions "[2 1]" + } + Block { + BlockType Sum + Name "Add" + SID "40" + Ports [2, 1] + Position [110, 107, 140, 138] + ZOrder 6 + ShowName off + Inputs "-+" + InputSameDT off + OutDataTypeStr "Inherit: Inherit via internal rule" + SaturateOnIntegerOverflow off + } + Block { + BlockType Sum + Name "Add1" + SID "41" + Ports [2, 1] + Position [110, 262, 140, 293] + ZOrder 10 + ShowName off + Inputs "-+" + InputSameDT off + OutDataTypeStr "Inherit: Inherit via internal rule" + SaturateOnIntegerOverflow off + } + Block { + BlockType Sum + Name "Add2" + SID "42" + Ports [2, 1] + Position [410, 182, 440, 213] + ZOrder 12 + ShowName off + InputSameDT off + OutDataTypeStr "Inherit: Inherit via internal rule" + SaturateOnIntegerOverflow off + } + Block { + BlockType Product + Name "Product" + SID "49" + Ports [2, 1] + Position [245, 87, 275, 118] + ZOrder 1 + ShowName off + InputSameDT off + OutDataTypeStr "Inherit: Inherit via internal rule" + RndMeth "Floor" + SaturateOnIntegerOverflow off + } + Block { + BlockType Product + Name "Product1" + SID "50" + Ports [2, 1] + Position [245, 242, 275, 273] + ZOrder 11 + ShowName off + InputSameDT off + OutDataTypeStr "Inherit: Inherit via internal rule" + RndMeth "Floor" + SaturateOnIntegerOverflow off + } + Block { + BlockType Outport + Name "tau" + SID "52" + Position [530, 185, 545, 215] + ZOrder 4 + IconDisplay "Port number" + } + Line { + ZOrder 23 + SrcBlock "k_P" + SrcPort 1 + Points [101, 0; 0, 45] + DstBlock "Product" + DstPort 1 + } + Line { + ZOrder 4 + SrcBlock "q_soll" + SrcPort 1 + Points [20, 0; 0, -20] + DstBlock "Add" + DstPort 2 + } + Line { + ZOrder 5 + SrcBlock "q_ist" + SrcPort 1 + Points [21, 0; 0, 20] + DstBlock "Add" + DstPort 1 + } + Line { + ZOrder 25 + SrcBlock "k_D" + SrcPort 1 + Points [101, 0; 0, 45] + DstBlock "Product1" + DstPort 1 + } + Line { + ZOrder 7 + SrcBlock "Add1" + SrcPort 1 + Points [28, 0; 0, -15] + DstBlock "Product1" + DstPort 2 + } + Line { + ZOrder 8 + SrcBlock "qD_soll" + SrcPort 1 + Points [20, 0; 0, -20] + DstBlock "Add1" + DstPort 2 + } + Line { + ZOrder 9 + SrcBlock "qD_ist" + SrcPort 1 + Points [21, 0; 0, 20] + DstBlock "Add1" + DstPort 1 + } + Line { + ZOrder 10 + SrcBlock "Product" + SrcPort 1 + Points [63, 0; 0, 85] + DstBlock "Add2" + DstPort 1 + } + Line { + ZOrder 11 + SrcBlock "Product1" + SrcPort 1 + Points [63, 0; 0, -55] + DstBlock "Add2" + DstPort 2 + } + Line { + ZOrder 12 + SrcBlock "Add2" + SrcPort 1 + DstBlock "tau" + DstPort 1 + } + Line { + ZOrder 13 + SrcBlock "Add" + SrcPort 1 + Points [28, 0; 0, -15] + DstBlock "Product" + DstPort 2 + } + } + } + Block { + BlockType Scope + Name "SL_IN_Scope" + SID "6" + Ports [4] + Position [780, 81, 835, 199] + ZOrder 22494 + ScopeSpecificationString "Simulink.scopes.TimeScopeBlockCfg('CurrentConfiguration', extmgr.ConfigurationSet(extm" + "gr.Configuration('Core','General UI',true),extmgr.Configuration('Core','Source UI',true),extmgr.Configuration('S" + "ources','WiredSimulink',true,'DataLoggingSaveFormat','StructureWithTime','DataLoggingDecimation','1','DataLoggin" + "g',true,'DataLoggingVariableName','InputScope'),extmgr.Configuration('Visuals','Time Domain',true,'SerializedDis" + "plays',{struct('MinYLimReal','0.6','MaxYLimReal','0.8','YLabelReal','','MinYLimMag','0.6','MaxYLimMag','0.8','Le" + "gendVisibility','On','XGrid',true,'YGrid',true,'PlotMagPhase',false,'AxesColor',[0 0 0],'AxesTickColor',[0.68627" + "4509803922 0.686274509803922 0.686274509803922],'ColorOrder',[1 1 0.0666666666666667;0.0745098039215686 0.623529" + "411764706 1;1 0.411764705882353 0.16078431372549;0.392156862745098 0.831372549019608 0.0745098039215686;0.717647" + "058823529 0.274509803921569 1;0.0588235294117647 1 1;1 0.0745098039215686 0.650980392156863],'Title','%','LinePropertiesCache',{{}},'UserDefinedChannelNames',{{}},'NumLines',2,'LineNames',{{':1',':2'}},'ShowContent',true,'Placement',1),struct('MinYLimReal','5.00000','MaxYLimReal','155.00000','YLabelReal'" + ",'','MinYLimMag','0','MaxYLimMag','10','LegendVisibility','On','XGrid',true,'YGrid',true,'PlotMagPhase',false,'A" + "xesColor',[0 0 0],'AxesTickColor',[0.686274509803922 0.686274509803922 0.686274509803922],'ColorOrder',[1 1 0.06" + "66666666666667;0.0745098039215686 0.623529411764706 1;1 0.411764705882353 0.16078431372549;0.392156862745098 0.8" + "31372549019608 0.0745098039215686;0.717647058823529 0.274509803921569 1;0.0588235294117647 1 1;1 0.0745098039215" + "686 0.650980392156863],'Title','%','LinePropertiesCache',{{}},'UserDefinedChannelNames',{{}},'NumLi" + "nes',2,'LineNames',{{':1',':2'}},'ShowContent',true,'Placement',2),struct('MinYLimReal','-1.00" + "000','MaxYLimReal','1.00000','YLabelReal','','MinYLimMag','0','MaxYLimMag','10','LegendVisibility','On','XGrid'," + "true,'YGrid',true,'PlotMagPhase',false,'AxesColor',[0 0 0],'AxesTickColor',[0.686274509803922 0.686274509803922 " + "0.686274509803922],'ColorOrder',[1 1 0.0666666666666667;0.0745098039215686 0.623529411764706 1;1 0.4117647058823" + "53 0.16078431372549;0.392156862745098 0.831372549019608 0.0745098039215686;0.717647058823529 0.274509803921569 1" + ";0.0588235294117647 1 1;1 0.0745098039215686 0.650980392156863],'Title','%','LinePropertiesCache',{" + "{}},'UserDefinedChannelNames',{{}},'NumLines',2,'LineNames',{{':1',':2'}},'ShowContent',true,'Plac" + "ement',3),struct('MinYLimReal','-1.00000','MaxYLimReal','1.00000','YLabelReal','','MinYLimMag','0','MaxYLimMag'," + "'10','LegendVisibility','On','XGrid',true,'YGrid',true,'PlotMagPhase',false,'AxesColor',[0 0 0],'AxesTickColor'," + "[0.686274509803922 0.686274509803922 0.686274509803922],'ColorOrder',[1 1 0.0666666666666667;0.0745098039215686 " + "0.623529411764706 1;1 0.411764705882353 0.16078431372549;0.392156862745098 0.831372549019608 0.0745098039215686;" + "0.717647058823529 0.274509803921569 1;0.0588235294117647 1 1;1 0.0745098039215686 0.650980392156863],'Title','%<" + "SignalLabel>','LinePropertiesCache',{{}},'UserDefinedChannelNames',{{}},'NumLines',2,'LineNames',{{':1'," + "':2'}},'ShowContent',true,'Placement',4)},'DisplayPropertyDefaults',struct('YLabelReal','','AxesColor',[" + "0 0 0],'AxesTickColor',[0.686274509803922 0.686274509803922 0.686274509803922],'ColorOrder',[0.0745098039215686 " + "0.623529411764706 1;1 0.411764705882353 0.16078431372549;1 1 0.0666666666666667;0.717647058823529 0.274509803921" + "569 1;0.392156862745098 0.831372549019608 0.0745098039215686;0.0588235294117647 1 1;1 0.0745098039215686 0.65098" + "0392156863]),'DisplayLayoutDimensions',[4 1],'DisplayContentCache',[]),extmgr.Configuration('Tools','Plot Naviga" + "tion',true),extmgr.Configuration('Tools','Measurements',true,'Version','2018b')),'Version','2018b','Position',[1" + "75 476 590 420])" + NumInputPorts "4" + Floating off + } + Block { + BlockType Scope + Name "SL_OUT" + SID "117" + Ports [4] + Position [-320, 481, -265, 599] + ZOrder 22535 + BlockMirror on + NamePlacement "alternate" + ScopeSpecificationString "Simulink.scopes.TimeScopeBlockCfg('CurrentConfiguration', extmgr.ConfigurationSet(extm" + "gr.Configuration('Core','General UI',true),extmgr.Configuration('Core','Source UI',true),extmgr.Configuration('S" + "ources','WiredSimulink',true,'DataLoggingSaveFormat','StructureWithTime','DataLoggingDecimation','1','DataLoggin" + "g',true,'DataLoggingVariableName','OutputScope'),extmgr.Configuration('Visuals','Time Domain',true,'SerializedDi" + "splays',{struct('MinYLimReal','0.6','MaxYLimReal','0.8','YLabelReal','','MinYLimMag','0.6','MaxYLimMag','0.8','L" + "egendVisibility','On','XGrid',true,'YGrid',true,'PlotMagPhase',false,'AxesColor',[0 0 0],'AxesTickColor',[0.6862" + "74509803922 0.686274509803922 0.686274509803922],'ColorOrder',[1 1 0.0666666666666667;0.0745098039215686 0.62352" + "9411764706 1;1 0.411764705882353 0.16078431372549;0.392156862745098 0.831372549019608 0.0745098039215686;0.71764" + "7058823529 0.274509803921569 1;0.0588235294117647 1 1;1 0.0745098039215686 0.650980392156863],'Title','%','LinePropertiesCache',{{}},'UserDefinedChannelNames',{{}},'NumLines',2,'LineNames',{{'q_meas:1','q_meas:2" + "'}},'ShowContent',true,'Placement',1),struct('MinYLimReal','5.00000','MaxYLimReal','155.00000','YLabelReal','','" + "MinYLimMag','0','MaxYLimMag','10','LegendVisibility','On','XGrid',true,'YGrid',true,'PlotMagPhase',false,'AxesCo" + "lor',[0 0 0],'AxesTickColor',[0.686274509803922 0.686274509803922 0.686274509803922],'ColorOrder',[1 1 0.0666666" + "666666667;0.0745098039215686 0.623529411764706 1;1 0.411764705882353 0.16078431372549;0.392156862745098 0.831372" + "549019608 0.0745098039215686;0.717647058823529 0.274509803921569 1;0.0588235294117647 1 1;1 0.0745098039215686 0" + ".650980392156863],'Title','%','LinePropertiesCache',{{}},'UserDefinedChannelNames',{{}},'NumLines'," + "2,'LineNames',{{'qd_meas:1','qd_meas:2'}},'ShowContent',true,'Placement',2),struct('MinYLimReal','-1.00000','Max" + "YLimReal','1.00000','YLabelReal','','MinYLimMag','0','MaxYLimMag','10','LegendVisibility','On','XGrid',true,'YGr" + "id',true,'PlotMagPhase',false,'AxesColor',[0 0 0],'AxesTickColor',[0.686274509803922 0.686274509803922 0.6862745" + "09803922],'ColorOrder',[1 1 0.0666666666666667;0.0745098039215686 0.623529411764706 1;1 0.411764705882353 0.1607" + "8431372549;0.392156862745098 0.831372549019608 0.0745098039215686;0.717647058823529 0.274509803921569 1;0.058823" + "5294117647 1 1;1 0.0745098039215686 0.650980392156863],'Title','%','LinePropertiesCache',{{}},'User" + "DefinedChannelNames',{{}},'NumLines',2,'LineNames',{{'forearmbot_fordyn_fixb_vp1/qDD:1','forearmbot_fordyn_fixb_" + "vp1/qDD:2'}},'ShowContent',true,'Placement',3),struct('MinYLimReal','-1.00000','MaxYLimReal','1.00000','YLabelRe" + "al','','MinYLimMag','0','MaxYLimMag','10','LegendVisibility','On','XGrid',true,'YGrid',true,'PlotMagPhase',false" + ",'AxesColor',[0 0 0],'AxesTickColor',[0.686274509803922 0.686274509803922 0.686274509803922],'ColorOrder',[1 1 0" + ".0666666666666667;0.0745098039215686 0.623529411764706 1;1 0.411764705882353 0.16078431372549;0.392156862745098 " + "0.831372549019608 0.0745098039215686;0.717647058823529 0.274509803921569 1;0.0588235294117647 1 1;1 0.0745098039" + "215686 0.650980392156863],'Title','%','LinePropertiesCache',{{}},'UserDefinedChannelNames',{{}},'Nu" + "mLines',2,'LineNames',{{'PD_Regler:1','PD_Regler:2'}},'ShowContent',true,'Placement',4)},'DisplayPropertyDefault" + "s',struct('YLabelReal','','AxesColor',[0 0 0],'AxesTickColor',[0.686274509803922 0.686274509803922 0.68627450980" + "3922],'ColorOrder',[0.0745098039215686 0.623529411764706 1;1 0.411764705882353 0.16078431372549;1 1 0.0666666666" + "666667;0.717647058823529 0.274509803921569 1;0.392156862745098 0.831372549019608 0.0745098039215686;0.0588235294" + "117647 1 1;1 0.0745098039215686 0.650980392156863]),'DisplayLayoutDimensions',[4 1],'DisplayContentCache',[]),ex" + "tmgr.Configuration('Tools','Plot Navigation',true),extmgr.Configuration('Tools','Measurements',true,'Version','2" + "018b')),'Version','2018b','Position',[170 471 600 420],'VisibleAtModelOpen','on')" + NumInputPorts "4" + Floating off + } + Block { + BlockType SubSystem + Name "forearmbot_fordyn_fixb_vp1" + SID "57" + Ports [1, 3] + Position [55, 482, 225, 558] + ZOrder 22524 + BlockMirror on + NamePlacement "alternate" + RequestExecContextInheritance off + Object { + $PropName "MaskObject" + $ObjectID 24 + $ClassName "Simulink.Mask" + Initialization "NQJ=2;" + Array { + Type "Simulink.MaskParameter" + Dimension 5 + Object { + $ObjectID 25 + Type "edit" + Name "q_t0" + Prompt "q0 (initial pose)" + Value "q_t0" + } + Object { + $ObjectID 26 + Type "edit" + Name "qD_t0" + Prompt "qD0 (initial velocity)" + Value "qD_t0" + } + Object { + $ObjectID 27 + Type "edit" + Name "g_base" + Prompt "g_base" + Value "g_base" + } + Object { + $ObjectID 28 + Type "edit" + Name "pkin" + Prompt "Kinematik-Parameter" + Value "pkin" + } + Object { + $ObjectID 29 + Type "edit" + Name "DynPar1" + Prompt "Dynamik-Parameter (Parametersatz 1)" + Value "DynPar1" + } + PropName "Parameters" + } + Array { + Type "Simulink.dialog.Group" + Dimension 2 + Object { + $ObjectID 30 + Prompt "%" + Object { + $PropName "DialogControls" + $ObjectID 31 + $ClassName "Simulink.dialog.Text" + Prompt "%" + Name "DescTextVar" + } + Name "DescGroupVar" + } + Object { + $ObjectID 32 + Prompt "Robot Parameters" + Array { + Type "Simulink.dialog.parameter.Edit" + Dimension 5 + Object { + $ObjectID 33 + Name "q_t0" + } + Object { + $ObjectID 34 + Name "qD_t0" + } + Object { + $ObjectID 35 + Name "g_base" + } + Object { + $ObjectID 36 + Name "pkin" + } + Object { + $ObjectID 37 + Name "DynPar1" + } + PropName "DialogControls" + } + Name "ParameterGroupVar" + } + PropName "DialogControls" + } + } + Port { + PortNumber 1 + Name "q_meas" + PropagatedSignals "q" + } + Port { + PortNumber 2 + Name "qd_meas" + PropagatedSignals "qD" + } + System { + Name "forearmbot_fordyn_fixb_vp1" + Location [47, 27, 1680, 1050] + Open off + PortBlocksUseCompactNotation off + SetExecutionDomain off + ExecutionDomainType "Deduce" + ModelBrowserVisibility off + ModelBrowserWidth 200 + ScreenColor "white" + PaperOrientation "landscape" + PaperPositionMode "auto" + PaperType "usletter" + PaperUnits "inches" + TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] + TiledPageScale 1 + ShowPageBoundaries off + ZoomFactor "100" + Block { + BlockType Inport + Name "tau_ext\n" + SID "58" + Position [70, 233, 100, 247] + ZOrder 61 + IconDisplay "Port number" + PortDimensions "NQJ" + } + Block { + BlockType Constant + Name "Constant" + SID "59" + Position [685, 340, 740, 370] + ZOrder 236 + BlockMirror on + NamePlacement "alternate" + Value "g_base" + } + Block { + BlockType DiscreteIntegrator + Name "Discrete-Time\nIntegrator" + SID "93" + Ports [1, 1] + Position [335, 82, 370, 118] + ZOrder 237 + InitialCondition "qD_t0" + InitialConditionSetting "Auto" + SampleTime "-1" + ICPrevOutput "DiscIntNeverNeededParam" + ICPrevScaledInput "DiscIntNeverNeededParam" + Port { + PortNumber 1 + Name "qD" + } + } + Block { + BlockType DiscreteIntegrator + Name "Discrete-Time\nIntegrator1" + SID "94" + Ports [1, 1] + Position [450, 82, 485, 118] + ZOrder 238 + InitialCondition "q_t0" + InitialConditionSetting "Auto" + SampleTime "-1" + ICPrevOutput "DiscIntNeverNeededParam" + ICPrevScaledInput "DiscIntNeverNeededParam" + Port { + PortNumber 1 + Name "q" + } + } + Block { + BlockType Sum + Name "Sum3" + SID "62" + Ports [3, 1] + Position [180, 230, 200, 250] + ZOrder 46 + BlockRotation 270 + ShowName off + IconShape "round" + Inputs "+--" + InputSameDT off + OutDataTypeStr "Inherit: Inherit via internal rule" + SaturateOnIntegerOverflow off + Port { + PortNumber 1 + Name "tau_acc" + } + } + Block { + BlockType SubSystem + Name "forearmbot_coriolisvec_fixb" + SID "63" + Ports [2, 1] + Position [305, 210, 370, 270] + ZOrder 234 + BlockMirror on + NamePlacement "alternate" + RequestExecContextInheritance off + Object { + $PropName "MaskObject" + $ObjectID 38 + $ClassName "Simulink.Mask" + Initialization "NQJ=2;\nm = DynPar1.m;\nr_S = DynPar1.r_S;\nI_S = DynPar1.I_S;" + Array { + Type "Simulink.MaskParameter" + Dimension 2 + Object { + $ObjectID 39 + Type "edit" + Name "pkin" + Prompt "Kinematik-Parameter" + Value "pkin" + } + Object { + $ObjectID 40 + Type "edit" + Name "DynPar1" + Prompt "Dynamik-Parameter (Parametersatz 1)" + Value "DynPar1" + } + PropName "Parameters" + } + } + Port { + PortNumber 1 + Name "tau_c" + PropagatedSignals "tauc" + } + System { + Name "forearmbot_coriolisvec_fixb" + Location [330, 79, 1543, 1076] + Open off + PortBlocksUseCompactNotation off + SetExecutionDomain off + ExecutionDomainType "Deduce" + ModelBrowserVisibility off + ModelBrowserWidth 200 + ScreenColor "white" + PaperOrientation "landscape" + PaperPositionMode "auto" + PaperType "usletter" + PaperUnits "inches" + TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] + TiledPageScale 1 + ShowPageBoundaries off + ZoomFactor "100" + Block { + BlockType Inport + Name "qJ" + SID "77" + Position [20, 28, 50, 42] + ZOrder 11 + IconDisplay "Port number" + PortDimensions "NQJ" + } + Block { + BlockType Inport + Name "qJD" + SID "78" + Position [20, 63, 50, 77] + ZOrder 12 + Port "2" + IconDisplay "Port number" + PortDimensions "NQJ" + } + Block { + BlockType Constant + Name "Constant5" + SID "79" + Position [40, 377, 105, 393] + ZOrder 17 + Value "I_S" + } + Block { + BlockType Constant + Name "Constant6" + SID "80" + Position [40, 152, 90, 168] + ZOrder 10 + Value "pkin" + } + Block { + BlockType Constant + Name "Constant7" + SID "81" + Position [35, 242, 100, 258] + ZOrder 15 + Value "m" + } + Block { + BlockType Constant + Name "Constant8" + SID "82" + Position [35, 317, 100, 333] + ZOrder 16 + Value "r_S" + } + Block { + BlockType SubSystem + Name "coriolisvec_fcn" + SID "83" + Ports [6, 1] + Position [200, 17, 320, 418] + ZOrder 1 + LibraryVersion "1.32" + ErrorFcn "Stateflow.Translate.translate" + PermitHierarchicalResolution "ExplicitOnly" + TreatAsAtomicUnit on + RequestExecContextInheritance off + SFBlockType "MATLAB Function" + System { + Name "coriolisvec_fcn" + Location [223, 338, 826, 833] + Open off + PortBlocksUseCompactNotation off + SetExecutionDomain off + ExecutionDomainType "Deduce" + ModelBrowserVisibility off + ModelBrowserWidth 200 + ScreenColor "white" + PaperOrientation "landscape" + PaperPositionMode "auto" + PaperType "usletter" + PaperUnits "inches" + TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] + TiledPageScale 1 + ShowPageBoundaries off + ZoomFactor "100" + SIDHighWatermark "80" + Block { + BlockType Inport + Name "q" + SID "83::1" + Position [20, 101, 40, 119] + ZOrder -1 + IconDisplay "Port number" + } + Block { + BlockType Inport + Name "qD" + SID "83::19" + Position [20, 136, 40, 154] + ZOrder 10 + Port "2" + IconDisplay "Port number" + } + Block { + BlockType Inport + Name "pkin" + SID "83::20" + Position [20, 171, 40, 189] + ZOrder 11 + Port "3" + IconDisplay "Port number" + } + Block { + BlockType Inport + Name "m" + SID "83::26" + Position [20, 206, 40, 224] + ZOrder 17 + Port "4" + IconDisplay "Port number" + } + Block { + BlockType Inport + Name "r_S" + SID "83::72" + Position [20, 246, 40, 264] + ZOrder 24 + Port "5" + IconDisplay "Port number" + } + Block { + BlockType Inport + Name "I_S" + SID "83::73" + Position [20, 281, 40, 299] + ZOrder 25 + Port "6" + IconDisplay "Port number" + } + Block { + BlockType Demux + Name " Demux " + SID "83::79" + Ports [1, 1] + Position [270, 230, 320, 270] + ZOrder 30 + Outputs "1" + } + Block { + BlockType S-Function + Name " SFunction " + SID "83::78" + Tag "Stateflow S-Function appint_ros_example 7" + Ports [6, 2] + Position [180, 102, 230, 243] + ZOrder 29 + FunctionName "sf_sfun" + PortCounts "[6 2]" + SFunctionDeploymentMode off + EnableBusSupport on + SFcnIsStateOwnerBlock off + Port { + PortNumber 2 + Name "tauc" + } + } + Block { + BlockType Terminator + Name " Terminator " + SID "83::80" + Position [460, 241, 480, 259] + ZOrder 31 + } + Block { + BlockType Outport + Name "tauc" + SID "83::5" + Position [460, 101, 480, 119] + ZOrder -5 + IconDisplay "Port number" + } + Line { + ZOrder 10 + SrcBlock "q" + SrcPort 1 + DstBlock " SFunction " + DstPort 1 + } + Line { + ZOrder 11 + SrcBlock "qD" + SrcPort 1 + DstBlock " SFunction " + DstPort 2 + } + Line { + ZOrder 12 + SrcBlock "pkin" + SrcPort 1 + DstBlock " SFunction " + DstPort 3 + } + Line { + ZOrder 13 + SrcBlock "m" + SrcPort 1 + DstBlock " SFunction " + DstPort 4 + } + Line { + ZOrder 14 + SrcBlock "r_S" + SrcPort 1 + DstBlock " SFunction " + DstPort 5 + } + Line { + ZOrder 15 + SrcBlock "I_S" + SrcPort 1 + DstBlock " SFunction " + DstPort 6 + } + Line { + Name "tauc" + ZOrder 16 + Labels [0, 0] + SrcBlock " SFunction " + SrcPort 2 + DstBlock "tauc" + DstPort 1 + } + Line { + ZOrder 17 + SrcBlock " Demux " + SrcPort 1 + DstBlock " Terminator " + DstPort 1 + } + Line { + ZOrder 18 + SrcBlock " SFunction " + SrcPort 1 + DstBlock " Demux " + DstPort 1 + } + } + } + Block { + BlockType Outport + Name "tauJ_c" + SID "84" + Position [515, 195, 530, 225] + ZOrder 13 + NamePlacement "alternate" + IconDisplay "Port number" + PortDimensions "NQJ" + } + Line { + ZOrder 1 + SrcBlock "Constant5" + SrcPort 1 + Points [75, 0] + DstBlock "coriolisvec_fcn" + DstPort 6 + } + Line { + ZOrder 2 + SrcBlock "Constant8" + SrcPort 1 + Points [80, 0] + DstBlock "coriolisvec_fcn" + DstPort 5 + } + Line { + ZOrder 3 + SrcBlock "Constant7" + SrcPort 1 + DstBlock "coriolisvec_fcn" + DstPort 4 + } + Line { + ZOrder 4 + SrcBlock "qJ" + SrcPort 1 + Points [130, 0] + DstBlock "coriolisvec_fcn" + DstPort 1 + } + Line { + ZOrder 5 + SrcBlock "qJD" + SrcPort 1 + Points [130, 0] + DstBlock "coriolisvec_fcn" + DstPort 2 + } + Line { + ZOrder 6 + SrcBlock "Constant6" + SrcPort 1 + Points [90, 0] + DstBlock "coriolisvec_fcn" + DstPort 3 + } + Line { + ZOrder 7 + SrcBlock "coriolisvec_fcn" + SrcPort 1 + Points [0, -10] + DstBlock "tauJ_c" + DstPort 1 + } + } + } + Block { + BlockType SubSystem + Name "forearmbot_gravload" + SID "64" + Ports [2, 1] + Position [315, 310, 355, 370] + ZOrder 235 + BlockMirror on + NamePlacement "alternate" + RequestExecContextInheritance off + Object { + $PropName "MaskObject" + $ObjectID 41 + $ClassName "Simulink.Mask" + Initialization "NQJ=2;\nm = DynPar1.m;\nr_S = DynPar1.r_S;\nI_S = DynPar1.I_S;\n" + Array { + Type "Simulink.MaskParameter" + Dimension 2 + Object { + $ObjectID 42 + Type "edit" + Name "pkin" + Prompt "Kinematik-Parameter" + Value "pkin" + } + Object { + $ObjectID 43 + Type "edit" + Name "DynPar1" + Prompt "Dynamik-Parameter (Parametersatz 1)" + Value "DynPar1" + } + PropName "Parameters" + } + } + Port { + PortNumber 1 + Name "tau_g" + PropagatedSignals "taug" + } + System { + Name "forearmbot_gravload" + Location [330, 79, 1543, 1076] + Open off + PortBlocksUseCompactNotation off + SetExecutionDomain off + ExecutionDomainType "Deduce" + ModelBrowserVisibility off + ModelBrowserWidth 200 + ScreenColor "white" + PaperOrientation "landscape" + PaperPositionMode "auto" + PaperType "usletter" + PaperUnits "inches" + TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] + TiledPageScale 1 + ShowPageBoundaries off + ZoomFactor "100" + Block { + BlockType Inport + Name "qJ" + SID "85" + Position [45, 58, 75, 72] + ZOrder 11 + IconDisplay "Port number" + PortDimensions "NQJ" + } + Block { + BlockType Inport + Name "g_base" + SID "86" + Position [45, 128, 75, 142] + ZOrder 12 + Port "2" + IconDisplay "Port number" + PortDimensions "3" + } + Block { + BlockType Constant + Name "Constant5" + SID "87" + Position [25, 267, 90, 283] + ZOrder 7 + Value "m" + } + Block { + BlockType Constant + Name "Constant6" + SID "88" + Position [35, 197, 85, 213] + ZOrder 10 + Value "pkin" + } + Block { + BlockType Constant + Name "Constant7" + SID "89" + Position [25, 337, 90, 353] + ZOrder 14 + Value "r_S" + } + Block { + BlockType SubSystem + Name "MATLAB Function" + SID "90" + Ports [5, 1] + Position [190, 31, 300, 379] + ZOrder 1 + LibraryVersion "1.32" + ErrorFcn "Stateflow.Translate.translate" + PermitHierarchicalResolution "ExplicitOnly" + TreatAsAtomicUnit on + RequestExecContextInheritance off + SFBlockType "MATLAB Function" + System { + Name "MATLAB Function" + Location [223, 338, 826, 833] + Open off + PortBlocksUseCompactNotation off + SetExecutionDomain off + ExecutionDomainType "Deduce" + ModelBrowserVisibility off + ModelBrowserWidth 200 + ScreenColor "white" + PaperOrientation "landscape" + PaperPositionMode "auto" + PaperType "usletter" + PaperUnits "inches" + TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] + TiledPageScale 1 + ShowPageBoundaries off + ZoomFactor "100" + SIDHighWatermark "63" + Block { + BlockType Inport + Name "q" + SID "90::1" + Position [20, 101, 40, 119] + ZOrder -1 + IconDisplay "Port number" + } + Block { + BlockType Inport + Name "g_base" + SID "90::19" + Position [20, 136, 40, 154] + ZOrder 10 + Port "2" + IconDisplay "Port number" + } + Block { + BlockType Inport + Name "pkin" + SID "90::20" + Position [20, 171, 40, 189] + ZOrder 11 + Port "3" + IconDisplay "Port number" + } + Block { + BlockType Inport + Name "m" + SID "90::26" + Position [20, 206, 40, 224] + ZOrder 17 + Port "4" + IconDisplay "Port number" + } + Block { + BlockType Inport + Name "r_S" + SID "90::56" + Position [20, 246, 40, 264] + ZOrder 21 + Port "5" + IconDisplay "Port number" + } + Block { + BlockType Demux + Name " Demux " + SID "90::62" + Ports [1, 1] + Position [270, 230, 320, 270] + ZOrder 26 + Outputs "1" + } + Block { + BlockType S-Function + Name " SFunction " + SID "90::61" + Tag "Stateflow S-Function appint_ros_example 6" + Ports [5, 2] + Position [180, 100, 230, 220] + ZOrder 25 + FunctionName "sf_sfun" + PortCounts "[5 2]" + SFunctionDeploymentMode off + EnableBusSupport on + SFcnIsStateOwnerBlock off + Port { + PortNumber 2 + Name "taug" + } + } + Block { + BlockType Terminator + Name " Terminator " + SID "90::63" + Position [460, 241, 480, 259] + ZOrder 27 + } + Block { + BlockType Outport + Name "taug" + SID "90::5" + Position [460, 101, 480, 119] + ZOrder -5 + IconDisplay "Port number" + } + Line { + ZOrder 9 + SrcBlock "q" + SrcPort 1 + DstBlock " SFunction " + DstPort 1 + } + Line { + ZOrder 10 + SrcBlock "g_base" + SrcPort 1 + DstBlock " SFunction " + DstPort 2 + } + Line { + ZOrder 11 + SrcBlock "pkin" + SrcPort 1 + DstBlock " SFunction " + DstPort 3 + } + Line { + ZOrder 12 + SrcBlock "m" + SrcPort 1 + DstBlock " SFunction " + DstPort 4 + } + Line { + ZOrder 13 + SrcBlock "r_S" + SrcPort 1 + DstBlock " SFunction " + DstPort 5 + } + Line { + Name "taug" + ZOrder 14 + Labels [0, 0] + SrcBlock " SFunction " + SrcPort 2 + DstBlock "taug" + DstPort 1 + } + Line { + ZOrder 15 + SrcBlock " Demux " + SrcPort 1 + DstBlock " Terminator " + DstPort 1 + } + Line { + ZOrder 16 + SrcBlock " SFunction " + SrcPort 1 + DstBlock " Demux " + DstPort 1 + } + } + } + Block { + BlockType Outport + Name "tau_g" + SID "91" + Position [495, 180, 510, 210] + ZOrder 13 + NamePlacement "alternate" + IconDisplay "Port number" + PortDimensions "NQJ" + } + Line { + ZOrder 1 + SrcBlock "Constant7" + SrcPort 1 + DstBlock "MATLAB Function" + DstPort 5 + } + Line { + ZOrder 2 + SrcBlock "Constant5" + SrcPort 1 + DstBlock "MATLAB Function" + DstPort 4 + } + Line { + ZOrder 3 + SrcBlock "qJ" + SrcPort 1 + DstBlock "MATLAB Function" + DstPort 1 + } + Line { + ZOrder 4 + SrcBlock "g_base" + SrcPort 1 + DstBlock "MATLAB Function" + DstPort 2 + } + Line { + ZOrder 5 + SrcBlock "Constant6" + SrcPort 1 + DstBlock "MATLAB Function" + DstPort 3 + } + Line { + ZOrder 6 + SrcBlock "MATLAB Function" + SrcPort 1 + Points [0, -10] + DstBlock "tau_g" + DstPort 1 + } + } + } + Block { + BlockType SubSystem + Name "forearmbot_inertiaJ" + SID "65" + Ports [1, 1] + Position [95, 67, 155, 103] + ZOrder 233 + RequestExecContextInheritance off + Object { + $PropName "MaskObject" + $ObjectID 44 + $ClassName "Simulink.Mask" + Initialization "NQJ=2;\nm = DynPar1.m;\nr_S = DynPar1.r_S;\nI_S = DynPar1.I_S;" + Array { + Type "Simulink.MaskParameter" + Dimension 2 + Object { + $ObjectID 45 + Type "edit" + Name "pkin" + Prompt "Kinematik-Parameter" + Value "pkin" + } + Object { + $ObjectID 46 + Type "edit" + Name "DynPar1" + Prompt "Dynamik-Parameter (Parametersatz 1)" + Value "DynPar1" + } + PropName "Parameters" + } + } + System { + Name "forearmbot_inertiaJ" + Location [330, 79, 1543, 1076] + Open off + PortBlocksUseCompactNotation off + SetExecutionDomain off + ExecutionDomainType "Deduce" + ModelBrowserVisibility off + ModelBrowserWidth 200 + ScreenColor "white" + PaperOrientation "landscape" + PaperPositionMode "auto" + PaperType "usletter" + PaperUnits "inches" + TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] + TiledPageScale 1 + ShowPageBoundaries off + ZoomFactor "100" + Block { + BlockType Inport + Name "qJ" + SID "70" + Position [50, 83, 80, 97] + ZOrder 11 + IconDisplay "Port number" + PortDimensions "NQJ" + } + Block { + BlockType Constant + Name "Constant6" + SID "71" + Position [40, 172, 90, 188] + ZOrder 10 + Value "pkin" + } + Block { + BlockType Constant + Name "Constant7" + SID "72" + Position [35, 262, 100, 278] + ZOrder 15 + Value "m" + } + Block { + BlockType Constant + Name "Constant8" + SID "73" + Position [35, 352, 100, 368] + ZOrder 16 + Value "r_S" + } + Block { + BlockType Constant + Name "Constant9" + SID "74" + Position [40, 442, 105, 458] + ZOrder 18 + Value "I_S" + } + Block { + BlockType SubSystem + Name "inertiajoint_fcn" + SID "75" + Ports [5, 1] + Position [235, 47, 380, 493] + ZOrder 1 + LibraryVersion "1.32" + ErrorFcn "Stateflow.Translate.translate" + PermitHierarchicalResolution "ExplicitOnly" + TreatAsAtomicUnit on + RequestExecContextInheritance off + SFBlockType "MATLAB Function" + System { + Name "inertiajoint_fcn" + Location [223, 338, 826, 833] + Open off + PortBlocksUseCompactNotation off + SetExecutionDomain off + ExecutionDomainType "Deduce" + ModelBrowserVisibility off + ModelBrowserWidth 200 + ScreenColor "white" + PaperOrientation "landscape" + PaperPositionMode "auto" + PaperType "usletter" + PaperUnits "inches" + TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] + TiledPageScale 1 + ShowPageBoundaries off + ZoomFactor "100" + SIDHighWatermark "68" + Block { + BlockType Inport + Name "q" + SID "75::1" + Position [20, 101, 40, 119] + ZOrder -1 + IconDisplay "Port number" + } + Block { + BlockType Inport + Name "pkin" + SID "75::20" + Position [20, 136, 40, 154] + ZOrder 11 + Port "2" + IconDisplay "Port number" + } + Block { + BlockType Inport + Name "m" + SID "75::26" + Position [20, 171, 40, 189] + ZOrder 17 + Port "3" + IconDisplay "Port number" + } + Block { + BlockType Inport + Name "r_S" + SID "75::60" + Position [20, 206, 40, 224] + ZOrder 27 + Port "4" + IconDisplay "Port number" + } + Block { + BlockType Inport + Name "I_S" + SID "75::61" + Position [20, 246, 40, 264] + ZOrder 28 + Port "5" + IconDisplay "Port number" + } + Block { + BlockType Demux + Name " Demux " + SID "75::67" + Ports [1, 1] + Position [270, 230, 320, 270] + ZOrder 33 + Outputs "1" + } + Block { + BlockType S-Function + Name " SFunction " + SID "75::66" + Tag "Stateflow S-Function appint_ros_example 8" + Ports [5, 2] + Position [180, 100, 230, 220] + ZOrder 32 + FunctionName "sf_sfun" + PortCounts "[5 2]" + SFunctionDeploymentMode off + EnableBusSupport on + SFcnIsStateOwnerBlock off + Port { + PortNumber 2 + Name "Mq" + } + } + Block { + BlockType Terminator + Name " Terminator " + SID "75::68" + Position [460, 241, 480, 259] + ZOrder 34 + } + Block { + BlockType Outport + Name "Mq" + SID "75::5" + Position [460, 101, 480, 119] + ZOrder -5 + IconDisplay "Port number" + } + Line { + ZOrder 9 + SrcBlock "q" + SrcPort 1 + DstBlock " SFunction " + DstPort 1 + } + Line { + ZOrder 10 + SrcBlock "pkin" + SrcPort 1 + DstBlock " SFunction " + DstPort 2 + } + Line { + ZOrder 11 + SrcBlock "m" + SrcPort 1 + DstBlock " SFunction " + DstPort 3 + } + Line { + ZOrder 12 + SrcBlock "r_S" + SrcPort 1 + DstBlock " SFunction " + DstPort 4 + } + Line { + ZOrder 13 + SrcBlock "I_S" + SrcPort 1 + DstBlock " SFunction " + DstPort 5 + } + Line { + Name "Mq" + ZOrder 14 + Labels [0, 0] + SrcBlock " SFunction " + SrcPort 2 + DstBlock "Mq" + DstPort 1 + } + Line { + ZOrder 15 + SrcBlock " Demux " + SrcPort 1 + DstBlock " Terminator " + DstPort 1 + } + Line { + ZOrder 16 + SrcBlock " SFunction " + SrcPort 1 + DstBlock " Demux " + DstPort 1 + } + } + } + Block { + BlockType Outport + Name "M_JJ" + SID "76" + Position [505, 240, 520, 270] + ZOrder 13 + NamePlacement "alternate" + IconDisplay "Port number" + PortDimensions "[NQJ NQJ]" + } + Line { + ZOrder 1 + SrcBlock "Constant9" + SrcPort 1 + DstBlock "inertiajoint_fcn" + DstPort 5 + } + Line { + ZOrder 2 + SrcBlock "Constant8" + SrcPort 1 + DstBlock "inertiajoint_fcn" + DstPort 4 + } + Line { + ZOrder 3 + SrcBlock "Constant7" + SrcPort 1 + DstBlock "inertiajoint_fcn" + DstPort 3 + } + Line { + ZOrder 4 + SrcBlock "qJ" + SrcPort 1 + DstBlock "inertiajoint_fcn" + DstPort 1 + } + Line { + ZOrder 5 + SrcBlock "Constant6" + SrcPort 1 + DstBlock "inertiajoint_fcn" + DstPort 2 + } + Line { + ZOrder 6 + SrcBlock "inertiajoint_fcn" + SrcPort 1 + Points [0, -15] + DstBlock "M_JJ" + DstPort 1 + } + } + } + Block { + BlockType SubSystem + Name "mFcn_Minv" + SID "66" + Ports [2, 1] + Position [205, 71, 290, 124] + ZOrder 144 + LibraryVersion "1.190" + ErrorFcn "Stateflow.Translate.translate" + PermitHierarchicalResolution "ExplicitOnly" + TreatAsAtomicUnit on + RequestExecContextInheritance off + SFBlockType "MATLAB Function" + Port { + PortNumber 1 + Name "qDD" + PropagatedSignals "q_ddot" + } + System { + Name "mFcn_Minv" + Location [223, 338, 826, 833] + Open off + PortBlocksUseCompactNotation off + SetExecutionDomain off + ExecutionDomainType "Deduce" + ModelBrowserVisibility off + ModelBrowserWidth 200 + ScreenColor "white" + PaperOrientation "landscape" + PaperPositionMode "auto" + PaperType "usletter" + PaperUnits "inches" + TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] + TiledPageScale 1 + ShowPageBoundaries off + ZoomFactor "100" + SIDHighWatermark "96" + Block { + BlockType Inport + Name "M" + SID "66::1" + Position [20, 101, 40, 119] + ZOrder -1 + IconDisplay "Port number" + } + Block { + BlockType Inport + Name "tau" + SID "66::21" + Position [20, 136, 40, 154] + ZOrder 7 + Port "2" + IconDisplay "Port number" + } + Block { + BlockType Demux + Name " Demux " + SID "66::95" + Ports [1, 1] + Position [270, 230, 320, 270] + ZOrder 33 + Outputs "1" + } + Block { + BlockType S-Function + Name " SFunction " + SID "66::94" + Tag "Stateflow S-Function appint_ros_example 11" + Ports [2, 2] + Position [180, 100, 230, 160] + ZOrder 32 + FunctionName "sf_sfun" + PortCounts "[2 2]" + SFunctionDeploymentMode off + EnableBusSupport on + SFcnIsStateOwnerBlock off + Port { + PortNumber 2 + Name "q_ddot" + } + } + Block { + BlockType Terminator + Name " Terminator " + SID "66::96" + Position [460, 241, 480, 259] + ZOrder 34 + } + Block { + BlockType Outport + Name "q_ddot" + SID "66::5" + Position [460, 101, 480, 119] + ZOrder -5 + IconDisplay "Port number" + } + Line { + ZOrder 6 + SrcBlock "M" + SrcPort 1 + Points [120, 0] + DstBlock " SFunction " + DstPort 1 + } + Line { + ZOrder 7 + SrcBlock "tau" + SrcPort 1 + DstBlock " SFunction " + DstPort 2 + } + Line { + Name "q_ddot" + ZOrder 8 + Labels [0, 0] + SrcBlock " SFunction " + SrcPort 2 + DstBlock "q_ddot" + DstPort 1 + } + Line { + ZOrder 9 + SrcBlock " Demux " + SrcPort 1 + DstBlock " Terminator " + DstPort 1 + } + Line { + ZOrder 10 + SrcBlock " SFunction " + SrcPort 1 + DstBlock " Demux " + DstPort 1 + } + } + } + Block { + BlockType Outport + Name "qJ" + SID "67" + Position [695, 93, 725, 107] + ZOrder 63 + IconDisplay "Port number" + PortDimensions "NQJ" + } + Block { + BlockType Outport + Name "qJD" + SID "68" + Position [695, 148, 725, 162] + ZOrder 64 + Port "2" + IconDisplay "Port number" + PortDimensions "NQJ" + } + Block { + BlockType Outport + Name "qJDD" + SID "69" + Position [695, 48, 725, 62] + ZOrder 65 + Port "3" + IconDisplay "Port number" + PortDimensions "NQJ" + } + Line { + Name "tau_g" + ZOrder 1 + Labels [0, 0] + SrcBlock "forearmbot_gravload" + SrcPort 1 + Points [-120, 0] + DstBlock "Sum3" + DstPort 2 + } + Line { + Name "q" + ZOrder 24 + Labels [-1, 0] + SrcBlock "Discrete-Time\nIntegrator1" + SrcPort 1 + Points [55, 0] + Branch { + ZOrder 3 + Labels [1, 1] + Points [0, 125] + DstBlock "forearmbot_coriolisvec_fixb" + DstPort 1 + } + Branch { + ZOrder 4 + Labels [2, 1] + Points [0, -64; -465, 0] + DstBlock "forearmbot_inertiaJ" + DstPort 1 + } + Branch { + ZOrder 5 + Labels [1, 1] + Points [67, 0] + Branch { + ZOrder 6 + Labels [1, 1] + Points [0, 225] + DstBlock "forearmbot_gravload" + DstPort 1 + } + Branch { + ZOrder 7 + Labels [1, 1] + DstBlock "qJ" + DstPort 1 + } + } + } + Line { + Name "qDD" + ZOrder 8 + Labels [0, 0] + SrcBlock "mFcn_Minv" + SrcPort 1 + Points [18, 0] + Branch { + ZOrder 21 + DstBlock "Discrete-Time\nIntegrator" + DstPort 1 + } + Branch { + ZOrder 9 + Points [0, -45] + DstBlock "qJDD" + DstPort 1 + } + } + Line { + Name "tau_c" + ZOrder 11 + Labels [-1, 0] + SrcBlock "forearmbot_coriolisvec_fixb" + SrcPort 1 + DstBlock "Sum3" + DstPort 3 + } + Line { + ZOrder 12 + SrcBlock "tau_ext\n" + SrcPort 1 + DstBlock "Sum3" + DstPort 1 + } + Line { + Name "qD" + ZOrder 22 + Labels [1, 1] + SrcBlock "Discrete-Time\nIntegrator" + SrcPort 1 + Points [27, 0] + Branch { + ZOrder 23 + Labels [1, 1] + DstBlock "Discrete-Time\nIntegrator1" + DstPort 1 + } + Branch { + ZOrder 14 + Points [0, 55; 15, 0] + Branch { + ZOrder 15 + Labels [1, 0; -1, 0] + Points [0, 100] + DstBlock "forearmbot_coriolisvec_fixb" + DstPort 2 + } + Branch { + ZOrder 16 + DstBlock "qJD" + DstPort 1 + } + } + } + Line { + Name "tau_acc" + ZOrder 18 + Labels [0, 0] + SrcBlock "Sum3" + SrcPort 1 + DstBlock "mFcn_Minv" + DstPort 2 + } + Line { + ZOrder 19 + SrcBlock "forearmbot_inertiaJ" + SrcPort 1 + DstBlock "mFcn_Minv" + DstPort 1 + } + Line { + ZOrder 20 + SrcBlock "Constant" + SrcPort 1 + DstBlock "forearmbot_gravload" + DstPort 2 + } + } + } + Block { + BlockType S-Function + Name "ros_rt_interface_pcu" + SID "116" + Ports [1, 1] + Position [80, 140, 365, 170] + ZOrder 22534 + FunctionName "ros_rt_interface_pcu" + SFunctionDeploymentMode off + EnableBusSupport off + SFcnIsStateOwnerBlock off + Object { + $PropName "MaskObject" + $ObjectID 47 + $ClassName "Simulink.Mask" + Type "Legacy Function" + Description "This block allows you to call the legacy functions specified by the following Legacy Code Tool definiti" + "on:\ndef.SFunctionName = 'ros_rt_interface_pcu';\ndef.OutputFcnSpec = 'void SL_io_func(SL_OUT_type u1[1], SL_IN_type " + "y1[1])';\ndef.StartFcnSpec = 'void SL_start_func()';\ndef.TerminateFcnSpec = 'void SL_terminate_func()';\ndef.HeaderF" + "iles = {'SL_func.h'};\ndef.SourceFiles = {'../ros_rt_interface/ros_rt_core/SL_func_dummy.cpp'};\ndef.TargetLibFiles =" + " {'libros_sl_interface.so'};\ndef.IncPaths = {'../ros_rt_interface/ros_rt_core'};\n" + Help "

This block was generated automatically by the Legacy Code Tool. For detailed help on this tool, call legacy_code('help').

" + SelfModifiable "on" + Display "fprintf('void SL_io_func(SL_OUT_type u1[1], SL_IN_type y1[1])');" + IconRotate "port" + IconUnits "normalized" + Array { + Type "Simulink.MaskParameter" + Dimension 2 + Object { + $ObjectID 48 + Type "edit" + Name "SFunctionSpec" + Prompt "SFunctionSpec" + Value "void SL_io_func(SL_OUT_type u1[1], SL_IN_type y1[1])" + Evaluate "off" + Tunable "off" + Visible "off" + } + Object { + $ObjectID 49 + Type "checkbox" + Name "ShowSpec" + Prompt "Display function specification" + Value "on" + Callback "if strcmp(get_param(gcbh, 'ShowSpec'), 'on')\n set_param(gcbh, 'MaskDisplay', sprintf('fprintf(''" + "%s'');', get_param(gcbh, 'SFunctionSpec')));\nelse\n set_param(gcbh, 'MaskDisplay', sprintf('fprintf(''%s'');', " + "get_param(gcbh, 'FunctionName')));\nend" + } + PropName "Parameters" + } + } + } + Block { + BlockType SubSystem + Name "state_manager_dummy" + SID "100" + Ports [1, 1] + Position [310, 739, 485, 811] + ZOrder 22531 + BlockMirror on + NamePlacement "alternate" + RequestExecContextInheritance off + ContentPreviewEnabled on + Port { + PortNumber 1 + Name "sl_state" + } + System { + Name "state_manager_dummy" + Location [1680, 0, 2704, 768] + Open off + PortBlocksUseCompactNotation off + SetExecutionDomain off + ExecutionDomainType "Deduce" + ModelBrowserVisibility off + ModelBrowserWidth 200 + ScreenColor "white" + PaperOrientation "landscape" + PaperPositionMode "auto" + PaperType "usletter" + PaperUnits "inches" + TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000] + TiledPageScale 1 + ShowPageBoundaries off + ZoomFactor "150" + Block { + BlockType Inport + Name "state_request" + SID "101" + Position [-50, 658, -20, 672] + ZOrder 22531 + IconDisplay "Port number" + OutDataTypeStr "uint8" + Port { + PortNumber 1 + PropagatedSignals "state" + ShowPropagatedSignals "on" + } + } + Block { + BlockType Constant + Name "Constant" + SID "99" + Position [-80, 820, -50, 850] + ZOrder 22530 + Value "42" + OutDataTypeStr "uint8" + } + Block { + BlockType Constant + Name "Constant1" + SID "109" + Position [90, 850, 120, 880] + ZOrder 22539 + Value "5" + OutDataTypeStr "uint8" + } + Block { + BlockType RelationalOperator + Name "Relational\nOperator1" + SID "98" + Ports [2, 1] + Position [80, 757, 110, 788] + ZOrder 22529 + Operator "==" + InputSameDT off + OutDataTypeStr "boolean" + RndMeth "Simplest" + } + Block { + BlockType Switch + Name "Switch2" + SID "97" + Position [255, 755, 305, 795] + ZOrder 22528 + NamePlacement "alternate" + Criteria "u2 > Threshold" + InputSameDT off + SaturateOnIntegerOverflow off + } + Block { + BlockType Outport + Name "state" + SID "106" + Position [400, 768, 430, 782] + ZOrder 22536 + IconDisplay "Port number" + OutDataTypeStr "uint8" + } + Line { + ZOrder 173 + SrcBlock "Constant1" + SrcPort 1 + Points [63, 0; 0, -75] + DstBlock "Switch2" + DstPort 3 + } + Line { + ZOrder 170 + SrcBlock "state_request" + SrcPort 1 + Points [51, 0; 0, 27] + Branch { + ZOrder 175 + Points [147, 0; 0, 68] + DstBlock "Switch2" + DstPort 1 + } + Branch { + ZOrder 174 + Points [0, 73] + DstBlock "Relational\nOperator1" + DstPort 1 + } + } + Line { + ZOrder 167 + SrcBlock "Switch2" + SrcPort 1 + DstBlock "state" + DstPort 1 + } + Line { + ZOrder 171 + SrcBlock "Constant" + SrcPort 1 + Points [79, 0; 0, -55] + DstBlock "Relational\nOperator1" + DstPort 2 + } + Line { + ZOrder 172 + SrcBlock "Relational\nOperator1" + SrcPort 1 + DstBlock "Switch2" + DstPort 2 + } + Annotation { + SID "115" + Name "Dieser Block ist aktuell nur ein Dummy-Block. Hier könnten bspw verschiedene Regler-Modi umgeschaltet we" + "rden\n(z.B. zwischen verschiedenen Reglern wie GravKomp, PD, ... umschalten). Dafür sollte man eine gewisse Logik " + "einbauen." + Position [-37, 598, 505, 626] + InternalMargins [0, 0, 0, 0] + ZOrder -1 + } + } + } + Line { + ZOrder 191 + SrcBlock "Delay" + SrcPort 1 + DstBlock "ros_rt_interface_pcu" + DstPort 1 + } + Line { + ZOrder 12 + SrcBlock "Bus_Creator" + SrcPort 1 + DstBlock "Delay" + DstPort 1 + } + Line { + ZOrder 192 + SrcBlock "ros_rt_interface_pcu" + SrcPort 1 + DstBlock "Bus\nSelector1" + DstPort 1 + } + Line { + ZOrder 119 + SrcBlock "PD_Regler" + SrcPort 1 + Points [-88, 0; 0, 25; -2, 0] + Branch { + ZOrder 225 + Points [0, 165; -305, 0; 0, -100] + DstBlock "SL_OUT" + DstPort 4 + } + Branch { + ZOrder 224 + DstBlock "forearmbot_fordyn_fixb_vp1" + DstPort 1 + } + } + Line { + Name "q_meas" + ZOrder 120 + SrcBlock "forearmbot_fordyn_fixb_vp1" + SrcPort 1 + Points [-52, 0] + Branch { + ZOrder 140 + Points [0, 105] + DstBlock "Delay1" + DstPort 1 + } + Branch { + ZOrder 139 + Points [-145, 0] + Branch { + ZOrder 218 + DstBlock "SL_OUT" + DstPort 1 + } + Branch { + ZOrder 217 + Labels [2, 1] + Points [0, -340] + DstBlock "Bus_Creator" + DstPort 2 + } + } + } + Line { + Name "qd_meas" + ZOrder 121 + SrcBlock "forearmbot_fordyn_fixb_vp1" + SrcPort 2 + Points [-68, 0] + Branch { + ZOrder 143 + Points [0, 125] + DstBlock "Delay2" + DstPort 1 + } + Branch { + ZOrder 142 + Points [-74, 0] + Branch { + ZOrder 222 + Labels [2, 1] + Points [0, -320] + DstBlock "Bus_Creator" + DstPort 3 + } + Branch { + ZOrder 221 + Points [0, 5] + DstBlock "SL_OUT" + DstPort 2 + } + } + } + Line { + ZOrder 141 + SrcBlock "Delay1" + SrcPort 1 + Points [315, 0; 0, -170] + DstBlock "PD_Regler" + DstPort 1 + } + Line { + ZOrder 144 + SrcBlock "Delay2" + SrcPort 1 + Points [329, 0; 0, -165] + DstBlock "PD_Regler" + DstPort 3 + } + Line { + Name "" + ZOrder 145 + Labels [0, 0] + SrcBlock "Bus\nSelector1" + SrcPort 4 + Points [153, 0] + Branch { + ZOrder 194 + Points [0, -45] + DstBlock "SL_IN_Scope" + DstPort 3 + } + Branch { + ZOrder 171 + Points [0, 255] + DstBlock "PD_Regler" + DstPort 2 + } + } + Line { + Name "" + ZOrder 146 + Labels [0, 0] + SrcBlock "Bus\nSelector1" + SrcPort 5 + Points [139, 0] + Branch { + ZOrder 196 + Points [0, -60] + DstBlock "SL_IN_Scope" + DstPort 4 + } + Branch { + ZOrder 173 + Points [0, 260] + DstBlock "PD_Regler" + DstPort 4 + } + } + Line { + Name "" + ZOrder 147 + Labels [0, 0] + SrcBlock "Bus\nSelector1" + SrcPort 2 + Points [120, 0] + Branch { + ZOrder 193 + Points [0, -15] + DstBlock "SL_IN_Scope" + DstPort 1 + } + Branch { + ZOrder 168 + Points [0, 445] + DstBlock "PD_Regler" + DstPort 6 + } + } + Line { + Name "" + ZOrder 148 + Labels [0, 0] + SrcBlock "Bus\nSelector1" + SrcPort 3 + Points [106, 0] + Branch { + ZOrder 195 + Points [0, -30] + DstBlock "SL_IN_Scope" + DstPort 2 + } + Branch { + ZOrder 169 + Points [0, 375] + DstBlock "PD_Regler" + DstPort 5 + } + } + Line { + Name "" + ZOrder 162 + Labels [0, 0] + SrcBlock "Bus\nSelector1" + SrcPort 1 + Points [48, 0; 0, 710] + DstBlock "state_manager_dummy" + DstPort 1 + } + Line { + Name "sl_state" + ZOrder 163 + Labels [3, 1] + SrcBlock "state_manager_dummy" + SrcPort 1 + Points [-411, 0; 0, -665] + DstBlock "Bus_Creator" + DstPort 1 + } + Line { + ZOrder 223 + SrcBlock "forearmbot_fordyn_fixb_vp1" + SrcPort 3 + Points [-23, 0; 0, 10] + DstBlock "SL_OUT" + DstPort 3 + } + Annotation { + SID "112" + Name "Regler" + Position [320, 371, 455, 586] + InternalMargins [0, 0, 0, 0] + FixedHeight on + FixedWidth on + ForegroundColor "[0.901961, 0.901961, 1.000000]" + BackgroundColor "[0.901961, 0.901961, 1.000000]" + DropShadow on + AnnotationType "area_annotation" + ZOrder 257 + FontSize 12 + } + Annotation { + SID "4" + Name "Interface ROS - Simulink" + Position [71, 120, 376, 200] + InternalMargins [0, 0, 0, 0] + FixedHeight on + FixedWidth on + ForegroundColor "[0.901961, 0.901961, 1.000000]" + BackgroundColor "[0.901961, 0.901961, 1.000000]" + DropShadow on + AnnotationType "area_annotation" + ZOrder 256 + FontSize 12 + } + Annotation { + SID "113" + Name "Strecke (Simulation)" + Position [35, 434, 260, 574] + InternalMargins [0, 0, 0, 0] + FixedHeight on + FixedWidth on + ForegroundColor "[0.901961, 0.901961, 1.000000]" + BackgroundColor "[0.901961, 0.901961, 1.000000]" + DropShadow on + AnnotationType "area_annotation" + ZOrder 258 + FontSize 12 + } + Annotation { + SID "114" + Name "Regler Zustandsmaschine" + Position [255, 704, 520, 824] + InternalMargins [0, 0, 0, 0] + FixedHeight on + FixedWidth on + ForegroundColor "[0.901961, 0.901961, 1.000000]" + BackgroundColor "[0.901961, 0.901961, 1.000000]" + DropShadow on + AnnotationType "area_annotation" + ZOrder 259 + FontSize 12 + } + } +} +#Finite State Machines +# +# Stateflow 80000014 +# +# +Stateflow { + machine { + id 1 + name "appint_ros_example" + created "27-Mar-2020 09:50:40" + isLibrary 0 + sfVersion 80000014 + firstTarget 44 + } + chart { + id 2 + machine 1 + name "forearmbot_fordyn_fixb_vp1/forearmbot_gravload/MATLAB Function" + windowPosition [422 539.941 189 413] + viewLimits [0 156.75 0 153.75] + screen [1 1 3600 1200 1.180555555555556] + treeNode [0 3 0 0] + viewObj 2 + ssIdHighWaterMark 15 + decomposition CLUSTER_CHART + type EML_CHART + chartFileNumber 6 + disableImplicitCasting 1 + eml { + name "gravload" + } + firstData 4 + firstTransition 11 + firstJunction 10 + } + state { + id 3 + labelString "eML_blk_kernel()" + position [18 64.5 118 66] + fontSize 12 + chart 2 + treeNode [2 0 0 0] + superState SUBCHART + subviewer 2 + ssIdNumber 1 + type FUNC_STATE + decomposition CLUSTER_STATE + eml { + isEML 1 + script "function taug = gravload(q, g_base, pkin, m, r_S)\n%#codegen\ntaug = forearmbot_gravloadJ_floatb_" + "twist_slag_vp1(q, g_base, pkin, m, r_S);\n\nend\n\nfunction taug = forearmbot_gravloadJ_floatb_twist_slag_vp1(qJ" + ", g, ...\n pkin, m, rSges)\n\n%% Symbolic Calculation\n% From gravload_joint_floatb_twist_par1_matlab.m\n% Opti" + "mizationMode: 2\n% StartTime: 2020-03-31 10:54:15\n% EndTime: 2020-03-31 10:54:15\n% DurationCPUTime: 0.11s\n% C" + "omputational Cost: add. (1->1), mult. (6->5), div. (0->0), fcn. (2->2), ass. (0->1)\nt1 = [(m(2) * sin(qJ(1)) * " + "rSges(2,1) + m(3) * cos(qJ(1)) * pkin(1)) * g(3), 0];\ntaug = t1(:);\n\nend" + editorLayout "100 M4x1[10 5 700 500]" + } + } + data { + id 4 + ssIdNumber 4 + name "q" + scope INPUT_DATA + machine 1 + props { + array { + size "-1" + } + type { + method SF_INHERITED_TYPE + primitive SF_DOUBLE_TYPE + } + complexity SF_COMPLEX_INHERITED + unit { + name "inherit" + } + } + dataType "Inherit: Same as Simulink" + linkNode [2 0 5] + } + data { + id 5 + ssIdNumber 5 + name "taug" + scope OUTPUT_DATA + machine 1 + props { + array { + size "-1" + } + type { + method SF_INHERITED_TYPE + primitive SF_DOUBLE_TYPE + } + complexity SF_COMPLEX_INHERITED + frame SF_FRAME_NO + unit { + name "inherit" + } + } + dataType "Inherit: Same as Simulink" + linkNode [2 4 6] + } + data { + id 6 + ssIdNumber 6 + name "g_base" + scope INPUT_DATA + machine 1 + props { + array { + size "-1" + } + type { + method SF_INHERITED_TYPE + primitive SF_DOUBLE_TYPE + isSigned 1 + wordLength "16" + } + complexity SF_COMPLEX_INHERITED + frame SF_FRAME_INHERITED + unit { + name "inherit" + } + } + dataType "Inherit: Same as Simulink" + linkNode [2 5 7] + } + data { + id 7 + ssIdNumber 7 + name "pkin" + scope INPUT_DATA + machine 1 + props { + array { + size "-1" + } + type { + method SF_INHERITED_TYPE + primitive SF_DOUBLE_TYPE + isSigned 1 + wordLength "16" + } + complexity SF_COMPLEX_INHERITED + frame SF_FRAME_INHERITED + unit { + name "inherit" + } + } + dataType "Inherit: Same as Simulink" + linkNode [2 6 8] + } + data { + id 8 + ssIdNumber 13 + name "m" + scope INPUT_DATA + machine 1 + props { + array { + size "-1" + } + type { + method SF_INHERITED_TYPE + primitive SF_DOUBLE_TYPE + isSigned 1 + wordLength "16" + } + complexity SF_COMPLEX_INHERITED + frame SF_FRAME_INHERITED + unit { + name "inherit" + } + } + dataType "Inherit: Same as Simulink" + linkNode [2 7 9] + } + data { + id 9 + ssIdNumber 14 + name "r_S" + scope INPUT_DATA + machine 1 + props { + array { + size "-1" + } + type { + method SF_INHERITED_TYPE + primitive SF_DOUBLE_TYPE + isSigned 1 + wordLength "16" + } + complexity SF_COMPLEX_INHERITED + frame SF_FRAME_INHERITED + unit { + name "inherit" + } + } + dataType "Inherit: Same as Simulink" + linkNode [2 8 0] + } + junction { + id 10 + position [23.5747 49.5747 7] + chart 2 + subviewer 2 + ssIdNumber 3 + type CONNECTIVE_JUNCTION + linkNode [2 0 0] + } + transition { + id 11 + labelString "{eML_blk_kernel();}" + labelPosition [28.125 13.875 102.544 14.964] + fontSize 12 + src { + intersection [0 0 1 0 23.5747 14.625 0 0] + } + dst { + id 10 + intersection [1 0 -1 0 23.5747 42.5747 0 0] + } + midPoint [23.5747 24.9468] + chart 2 + dataLimits [21.175 25.975 14.625 42.575] + subviewer 2 + drawStyle SMART + slide { + sticky BOTH_STICK + } + executionOrder 1 + ssIdNumber 2 + linkNode [2 0 0] + } + instance { + id 12 + machine 1 + name "forearmbot_fordyn_fixb_vp1/forearmbot_gravload/MATLAB Function" + chart 2 + } + chart { + id 13 + machine 1 + name "forearmbot_fordyn_fixb_vp1/forearmbot_coriolisvec_fixb/coriolisvec_fcn" + windowPosition [422 539.941 189 413] + viewLimits [0 156.75 0 153.75] + screen [1 1 3600 1200 1.180555555555556] + treeNode [0 14 0 0] + viewObj 13 + ssIdHighWaterMark 16 + decomposition CLUSTER_CHART + type EML_CHART + chartFileNumber 7 + disableImplicitCasting 1 + eml { + name "coriolis" + } + firstData 15 + firstTransition 23 + firstJunction 22 + } + state { + id 14 + labelString "eML_blk_kernel()" + position [18 64.5 118 66] + fontSize 12 + chart 13 + treeNode [13 0 0 0] + superState SUBCHART + subviewer 13 + ssIdNumber 1 + type FUNC_STATE + decomposition CLUSTER_STATE + eml { + isEML 1 + script "function tauc = coriolis(q, qD, pkin, m, r_S, I_S)\n%#codegen\ntauc = forearmbot_coriolisvecJ_fix" + "b_slag_vp1(q, qD, pkin, m, r_S, I_S);\n\nend\n\nfunction tauc = forearmbot_coriolisvecJ_fixb_slag_vp1(qJ, qJD, ." + "..\n pkin, m, rSges, Icges)\n\n%% Symbolic Calculation\n% From coriolisvec_joint_fixb_par1_matlab.m\n% Optimiza" + "tionMode: 2\n% StartTime: 2020-03-31 10:54:15\n% EndTime: 2020-03-31 10:54:16\n% DurationCPUTime: 0.75s\n% Compu" + "tational Cost: add. (228->55), mult. (1048->101), div. (0->0), fcn. (610->4), ass. (0->47)\nt27 = sin(qJ(1));\nt" + "26 = sin(qJ(2));\nt28 = cos(qJ(2));\nt46 = Icges(3,1) - Icges(3,2);\nt65 = t46 * t28 * t26;\nt15 = t27 * t65;\nt" + "22 = t26 ^ 2;\nt24 = t28 ^ 2;\nt39 = Icges(3,1) * t24 + Icges(3,2) * t22;\nt64 = 2 * qJD(2);\nt36 = -Icges(3,3) " + "+ t39;\nt66 = t27 * t36;\nt23 = t27 ^ 2;\nt29 = cos(qJ(1));\nt25 = t29 ^ 2;\nt16 = Icges(3,3) * t25 + t39 * t23;" + "\nt62 = t27 / 0.2e1;\nt61 = -t29 / 0.2e1;\nt60 = t29 / 0.2e1;\nt11 = t29 * t66;\nt59 = t11 * t27;\nt58 = t11 * t" + "29;\nt14 = t29 * t65;\nt57 = t14 * t29;\nt56 = t15 * t27;\nt55 = t16 * t27;\nt17 = t23 * Icges(3,3) + t25 * t39;" + "\nt54 = t17 * t29;\nt47 = qJD(1) * t29;\nt13 = t14 * qJD(1);\nt33 = t46 * (t22 - t24);\nt32 = qJD(2) * t33;\nt4 " + "= t27 * t32 - t13;\nt37 = qJD(1) * t65;\nt5 = t27 * t37 + t29 * t32;\nt40 = -t5 * t27 + t4 * t29;\nt38 = qJD(2) " + "* t65;\nt12 = t27 * t14;\nt35 = (t16 * t29 - t59) * qJD(2);\nt34 = (-t17 * t27 + t58) * qJD(2);\nt10 = t33 * t29" + ";\nt9 = t33 * t27;\nt8 = -t16 + t17;\nt3 = -t12 * t64 + (-t23 + t25) * qJD(1) * t36;\nt2 = -t15 * qJD(1) + t35;\n" + "t1 = -t13 + t34;\nt6 = [(t2 * t62 - t13 * t61 + t1 * t60 + ((-t27 * t8 - t55 + t58) * t61 + (t29 * t8 - t54 + t5" + "9) * t62) * qJD(2) + (0.3e1 / 0.2e1 * t56 + t57 + 0.2e1 * t65) * qJD(1) + t40) * qJD(2); qJD(1) * ((t56 + t57) *" + " qJD(1) + t40) / 0.2e1 - (t5 * qJD(1) + (-0.2e1 * t27 * (-t25 * t38 - t47 * t66) + t3 * t29 + (-t54 - t59) * qJD" + "(1)) * t64) * t27 / 0.2e1 + (t4 * qJD(1) + (0.2e1 * t29 * (qJD(1) * t11 - t23 * t38) - t3 * t27 + (-t55 - t58) *" + " qJD(1)) * t64) * t60 - (t1 + t34) * t47 / 0.2e1 + ((t9 * qJD(1) + (t12 * t27 - t23 * t14) * t64) * t61 + (t10 *" + " qJD(1) + (-t12 * t29 + t15 * t25) * t64) * t62) * qJD(2) - (0.2e1 * t37 + (t2 + t35) * t27 + (-t10 * t27 + t9 *" + " t29) * qJD(2)) * qJD(1) / 0.2e1;];\ntauc = t6(:);\nend" + editorLayout "100 M4x1[10 5 700 500]" + } + } + data { + id 15 + ssIdNumber 4 + name "q" + scope INPUT_DATA + machine 1 + props { + array { + size "-1" + } + type { + method SF_INHERITED_TYPE + primitive SF_DOUBLE_TYPE + } + complexity SF_COMPLEX_INHERITED + unit { + name "inherit" + } + } + dataType "Inherit: Same as Simulink" + linkNode [13 0 16] + } + data { + id 16 + ssIdNumber 5 + name "tauc" + scope OUTPUT_DATA + machine 1 + props { + array { + size "-1" + } + type { + method SF_INHERITED_TYPE + primitive SF_DOUBLE_TYPE + } + complexity SF_COMPLEX_INHERITED + frame SF_FRAME_NO + unit { + name "inherit" + } + } + dataType "Inherit: Same as Simulink" + linkNode [13 15 17] + } + data { + id 17 + ssIdNumber 6 + name "qD" + scope INPUT_DATA + machine 1 + props { + array { + size "-1" + } + type { + method SF_INHERITED_TYPE + primitive SF_DOUBLE_TYPE + isSigned 1 + wordLength "16" + } + complexity SF_COMPLEX_INHERITED + frame SF_FRAME_INHERITED + unit { + name "inherit" + } + } + dataType "Inherit: Same as Simulink" + linkNode [13 16 18] + } + data { + id 18 + ssIdNumber 7 + name "pkin" + scope INPUT_DATA + machine 1 + props { + array { + size "-1" + } + type { + method SF_INHERITED_TYPE + primitive SF_DOUBLE_TYPE + isSigned 1 + wordLength "16" + } + complexity SF_COMPLEX_INHERITED + frame SF_FRAME_INHERITED + unit { + name "inherit" + } + } + dataType "Inherit: Same as Simulink" + linkNode [13 17 19] + } + data { + id 19 + ssIdNumber 13 + name "m" + scope INPUT_DATA + machine 1 + props { + array { + size "-1" + } + type { + method SF_INHERITED_TYPE + primitive SF_DOUBLE_TYPE + isSigned 1 + wordLength "16" + } + complexity SF_COMPLEX_INHERITED + frame SF_FRAME_INHERITED + unit { + name "inherit" + } + } + dataType "Inherit: Same as Simulink" + linkNode [13 18 20] + } + data { + id 20 + ssIdNumber 14 + name "r_S" + scope INPUT_DATA + machine 1 + props { + array { + size "-1" + } + type { + method SF_INHERITED_TYPE + primitive SF_DOUBLE_TYPE + isSigned 1 + wordLength "16" + } + complexity SF_COMPLEX_INHERITED + frame SF_FRAME_INHERITED + unit { + name "inherit" + } + } + dataType "Inherit: Same as Simulink" + linkNode [13 19 21] + } + data { + id 21 + ssIdNumber 15 + name "I_S" + scope INPUT_DATA + machine 1 + props { + array { + size "-1" + } + type { + method SF_INHERITED_TYPE + primitive SF_DOUBLE_TYPE + isSigned 1 + wordLength "16" + } + complexity SF_COMPLEX_INHERITED + frame SF_FRAME_INHERITED + unit { + name "inherit" + } + } + dataType "Inherit: Same as Simulink" + linkNode [13 20 0] + } + junction { + id 22 + position [23.5747 49.5747 7] + chart 13 + subviewer 13 + ssIdNumber 3 + type CONNECTIVE_JUNCTION + linkNode [13 0 0] + } + transition { + id 23 + labelString "{eML_blk_kernel();}" + labelPosition [28.125 13.875 102.544 14.964] + fontSize 12 + src { + intersection [0 0 1 0 23.5747 14.625 0 0] + } + dst { + id 22 + intersection [1 0 -1 0 23.5747 42.5747 0 0] + } + midPoint [23.5747 24.9468] + chart 13 + dataLimits [21.175 25.975 14.625 42.575] + subviewer 13 + drawStyle SMART + slide { + sticky BOTH_STICK + } + executionOrder 1 + ssIdNumber 2 + linkNode [13 0 0] + } + instance { + id 24 + machine 1 + name "forearmbot_fordyn_fixb_vp1/forearmbot_coriolisvec_fixb/coriolisvec_fcn" + chart 13 + } + chart { + id 25 + machine 1 + name "forearmbot_fordyn_fixb_vp1/forearmbot_inertiaJ/inertiajoint_fcn" + windowPosition [422 539.941 189 413] + viewLimits [0 156.75 0 153.75] + screen [1 1 3600 1200 1.180555555555556] + treeNode [0 26 0 0] + viewObj 25 + ssIdHighWaterMark 16 + decomposition CLUSTER_CHART + type EML_CHART + chartFileNumber 8 + disableImplicitCasting 1 + eml { + name "inertia" + } + firstData 27 + firstTransition 34 + firstJunction 33 + } + state { + id 26 + labelString "eML_blk_kernel()" + position [18 64.5 118 66] + fontSize 12 + chart 25 + treeNode [25 0 0 0] + superState SUBCHART + subviewer 25 + ssIdNumber 1 + type FUNC_STATE + decomposition CLUSTER_STATE + eml { + isEML 1 + script "function Mq = inertia(q, pkin, m, r_S, I_S)\n%#codegen\nMq = forearmbot_inertiaJ_slag_vp1(q, pkin" + ", m, r_S, I_S);\n\nend\n\nfunction Mq = forearmbot_inertiaJ_slag_vp1(qJ, ...\n pkin, m, rSges, Icges)\n\n%% Sym" + "bolic Calculation\n% From inertia_joint_joint_floatb_twist_par1_matlab.m\n% OptimizationMode: 2\n% StartTime: 20" + "20-03-31 10:54:15\n% EndTime: 2020-03-31 10:54:15\n% DurationCPUTime: 0.17s\n% Computational Cost: add. (20->7)," + " mult. (84->15), div. (0->0), fcn. (52->4), ass. (0->7)\nt7 = sin(qJ(1));\nt3 = t7 ^ 2;\nt9 = cos(qJ(1));\nt5 = " + "t9 ^ 2;\nt8 = cos(qJ(2));\nt6 = sin(qJ(2));\nt1 = [t6 ^ 2 * Icges(3,1) + t8 ^ 2 * Icges(3,2) + Icges(2,3) + (m(2" + ") * rSges(2,1) ^ 2 + m(3) * pkin(1) ^ 2) * (t3 + t5); 0; (t5 ^ 2 + (0.2e1 * t5 + t3) * t3) * Icges(3,3);];\n%% P" + "ostprocessing: Reshape Output\n% From vec2symmat_2_matlab.m\nres = [t1(1), t1(2); t1(2), t1(3);];\nMq = res;\n\n" + "end" + editorLayout "100 M4x1[10 5 700 500]" + } + } + data { + id 27 + ssIdNumber 4 + name "q" + scope INPUT_DATA + machine 1 + props { + array { + size "-1" + } + type { + method SF_INHERITED_TYPE + primitive SF_DOUBLE_TYPE + } + complexity SF_COMPLEX_INHERITED + unit { + name "inherit" + } + } + dataType "Inherit: Same as Simulink" + linkNode [25 0 28] + } + data { + id 28 + ssIdNumber 5 + name "Mq" + scope OUTPUT_DATA + machine 1 + props { + array { + size "-1" + } + type { + method SF_INHERITED_TYPE + primitive SF_DOUBLE_TYPE + } + complexity SF_COMPLEX_INHERITED + frame SF_FRAME_NO + unit { + name "inherit" + } + } + dataType "Inherit: Same as Simulink" + linkNode [25 27 29] + } + data { + id 29 + ssIdNumber 7 + name "pkin" + scope INPUT_DATA + machine 1 + props { + array { + size "-1" + } + type { + method SF_INHERITED_TYPE + primitive SF_DOUBLE_TYPE + isSigned 1 + wordLength "16" + } + complexity SF_COMPLEX_INHERITED + frame SF_FRAME_INHERITED + unit { + name "inherit" + } + } + dataType "Inherit: Same as Simulink" + linkNode [25 28 30] + } + data { + id 30 + ssIdNumber 13 + name "m" + scope INPUT_DATA + machine 1 + props { + array { + size "-1" + } + type { + method SF_INHERITED_TYPE + primitive SF_DOUBLE_TYPE + isSigned 1 + wordLength "16" + } + complexity SF_COMPLEX_INHERITED + frame SF_FRAME_INHERITED + unit { + name "inherit" + } + } + dataType "Inherit: Same as Simulink" + linkNode [25 29 31] + } + data { + id 31 + ssIdNumber 14 + name "r_S" + scope INPUT_DATA + machine 1 + props { + array { + size "-1" + } + type { + method SF_INHERITED_TYPE + primitive SF_DOUBLE_TYPE + isSigned 1 + wordLength "16" + } + complexity SF_COMPLEX_INHERITED + frame SF_FRAME_INHERITED + unit { + name "inherit" + } + } + dataType "Inherit: Same as Simulink" + linkNode [25 30 32] + } + data { + id 32 + ssIdNumber 15 + name "I_S" + scope INPUT_DATA + machine 1 + props { + array { + size "-1" + } + type { + method SF_INHERITED_TYPE + primitive SF_DOUBLE_TYPE + isSigned 1 + wordLength "16" + } + complexity SF_COMPLEX_INHERITED + frame SF_FRAME_INHERITED + unit { + name "inherit" + } + } + dataType "Inherit: Same as Simulink" + linkNode [25 31 0] + } + junction { + id 33 + position [23.5747 49.5747 7] + chart 25 + subviewer 25 + ssIdNumber 3 + type CONNECTIVE_JUNCTION + linkNode [25 0 0] + } + transition { + id 34 + labelString "{eML_blk_kernel();}" + labelPosition [28.125 13.875 102.544 14.964] + fontSize 12 + src { + intersection [0 0 1 0 23.5747 14.625 0 0] + } + dst { + id 33 + intersection [1 0 -1 0 23.5747 42.5747 0 0] + } + midPoint [23.5747 24.9468] + chart 25 + dataLimits [21.175 25.975 14.625 42.575] + subviewer 25 + drawStyle SMART + slide { + sticky BOTH_STICK + } + executionOrder 1 + ssIdNumber 2 + linkNode [25 0 0] + } + instance { + id 35 + machine 1 + name "forearmbot_fordyn_fixb_vp1/forearmbot_inertiaJ/inertiajoint_fcn" + chart 25 + } + chart { + id 36 + machine 1 + name "forearmbot_fordyn_fixb_vp1/mFcn_Minv" + windowPosition [357.331 483.407 167 391] + viewLimits [0 156.75 0 153.75] + screen [1 1 1280 1024 1.041050272174191] + treeNode [0 37 0 0] + viewObj 36 + ssIdHighWaterMark 6 + decomposition CLUSTER_CHART + type EML_CHART + chartFileNumber 11 + disableImplicitCasting 1 + eml { + name "fcn" + } + firstData 38 + firstTransition 42 + firstJunction 41 + } + state { + id 37 + labelString "eML_blk_kernel()" + position [18 64.5 118 66] + fontSize 12 + chart 36 + treeNode [36 0 0 0] + superState SUBCHART + subviewer 36 + ssIdNumber 1 + type FUNC_STATE + decomposition CLUSTER_STATE + eml { + isEML 1 + script "function q_ddot = fcn(M,tau)\n%#codegen\nq_ddot=M\\tau;" + editorLayout "100 M4x1[10 5 700 500]" + } + } + data { + id 38 + ssIdNumber 4 + name "M" + scope INPUT_DATA + machine 1 + props { + array { + size "-1" + } + type { + method SF_INHERITED_TYPE + primitive SF_DOUBLE_TYPE + } + complexity SF_COMPLEX_INHERITED + unit { + name "inherit" + } + } + dataType "Inherit: Same as Simulink" + linkNode [36 0 39] + } + data { + id 39 + ssIdNumber 5 + name "q_ddot" + scope OUTPUT_DATA + machine 1 + props { + array { + size "-1" + } + type { + method SF_INHERITED_TYPE + primitive SF_DOUBLE_TYPE + } + complexity SF_COMPLEX_INHERITED + frame SF_FRAME_NO + unit { + name "inherit" + } + } + dataType "Inherit: Same as Simulink" + linkNode [36 38 40] + } + data { + id 40 + ssIdNumber 6 + name "tau" + scope INPUT_DATA + machine 1 + props { + array { + size "-1" + } + type { + method SF_INHERITED_TYPE + primitive SF_DOUBLE_TYPE + isSigned 1 + wordLength "16" + } + complexity SF_COMPLEX_INHERITED + frame SF_FRAME_INHERITED + unit { + name "inherit" + } + } + dataType "Inherit: Same as Simulink" + linkNode [36 39 0] + } + junction { + id 41 + position [23.5747 49.5747 7] + chart 36 + subviewer 36 + ssIdNumber 3 + type CONNECTIVE_JUNCTION + linkNode [36 0 0] + } + transition { + id 42 + labelString "{eML_blk_kernel();}" + labelPosition [32.125 19.875 102.544 14.964] + fontSize 12 + src { + intersection [0 0 1 0 23.5747 14.625 0 0] + } + dst { + id 41 + intersection [1 0 -1 0 23.5747 42.5747 0 0] + } + midPoint [23.5747 24.9468] + chart 36 + dataLimits [21.175 25.975 14.625 42.575] + subviewer 36 + drawStyle SMART + slide { + sticky BOTH_STICK + } + executionOrder 1 + ssIdNumber 2 + linkNode [36 0 0] + } + instance { + id 43 + machine 1 + name "forearmbot_fordyn_fixb_vp1/mFcn_Minv" + chart 36 + } + target { + id 44 + machine 1 + name "sfun" + description "Default Simulink S-Function Target." + linkNode [1 0 45] + } + target { + id 45 + machine 1 + name "rtw" + linkNode [1 44 0] + } +} diff --git a/appinterface_ros/appint_ros_example_open.m b/appinterface_ros/appint_ros_example_open.m new file mode 100644 index 0000000..b536711 --- /dev/null +++ b/appinterface_ros/appint_ros_example_open.m @@ -0,0 +1,29 @@ +% Öffne Beispielmodell für Schnittstelle ROS-Simulink +% Modell basiert auf der Simulation eines zweiachsigen Roboters. +% Das Dynamikmodell wird mit der Definition aus example_data/robot_env +% generiert (HybrDyn-Toolbox). + +% Moritz Schappler, moritz.schappler@imes.uni-hannover.de, 2020-03 +% (C) Institut für Mechatronische Systeme, Leibniz Universität Hannover + +clear +clc + +% Pfade für Modell initialisieren +this_path = fileparts(which(mfilename)); +cd(this_path); +addpath(fullfile(this_path, 'ros_rt_interface')); +addpath(fullfile(this_path, 'ros_rt_interface', 'build')); +% Bus-Definitionen für Simulink laden +run(fullfile(this_path, 'ros_rt_interface', 'pcu_ros_load_buses.m')); +% Definitionen für das Beispielmodell laden +DynPar1 = struct( ... + 'm', [0;1;2], ... % Masse eines zweiachsigen Unterarm-Roboters + 'r_S', [[0,0,0]; [0.2,0,0]; [0,0,0]], ... % Schwerpunkte der Segmente + 'I_S', [[0,0,0,0,0,0]; [0,0.1,0.1,0,0,0]; [0.2,0.2,0.2,0,0,0]]); % Trägheitsmomente +pkin = 0.4; % Länge des Beispiel-Roboters +g_base = [0;0;-9.81]; % G-Vektor +q_t0 = zeros(2,1); % Anfangswerte der Integratoren der simulierten Strecke +qD_t0 = zeros(2,1); +% Simulink-Modell öffnen +open_system('./appint_ros_example.mdl') diff --git a/appinterface_ros/build.sh b/appinterface_ros/build.sh new file mode 100755 index 0000000..c5166f4 --- /dev/null +++ b/appinterface_ros/build.sh @@ -0,0 +1,10 @@ +#!/bin/bash -e +# ROS-Workspace kompilieren + +# Moritz Schappler, moritz.schappler@imes.uni-hannover.de, 2020-03 +# (C) Institut für Mechatronische Systeme, Leibniz Universität Hannover + +source /opt/ros/melodic/setup.bash +source catkin_ws/devel/setup.bash +cd catkin_ws +catkin_make install diff --git a/appinterface_ros/build_dep_simulink.sh b/appinterface_ros/build_dep_simulink.sh new file mode 100755 index 0000000..b9bc5f3 --- /dev/null +++ b/appinterface_ros/build_dep_simulink.sh @@ -0,0 +1,12 @@ +#!/bin/bash -e +# ROS-Echtzeit-Interface für Simulink bauen +# Dieses Skript muss aus dem Verzeichnis aufgerufen werden, in dem es liegt. + +# Moritz Schappler, moritz.schappler@imes.uni-hannover.de, 2020-03 +# (C) Institut für Mechatronische Systeme, Leibniz Universität Hannover + +cd ros_rt_interface +rm -rf build +mkdir -p build +make +cd .. diff --git a/appinterface_ros/catkin_ws/.gitignore b/appinterface_ros/catkin_ws/.gitignore new file mode 100644 index 0000000..f216102 --- /dev/null +++ b/appinterface_ros/catkin_ws/.gitignore @@ -0,0 +1,5 @@ +build +devel +install +.catkin_workspace +src/CMakeLists.txt diff --git a/appinterface_ros/catkin_ws/scripts/autostart.sh b/appinterface_ros/catkin_ws/scripts/autostart.sh new file mode 100755 index 0000000..b221243 --- /dev/null +++ b/appinterface_ros/catkin_ws/scripts/autostart.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +# Initialisierung aller Programme für das Beispiel zur Kommunikation +# zwischen ROS und Simulink +# Starte alles in einer tmux-Konsole + +# Lucas Jürgens, BA bei Moritz Schappler, 2017-04 +# (C) Institut für Regelungstechnik, Leibniz Universität Hannover +# moritz.schappler@imes.uni-hannover.de, Überarbeitung 2020-03 + +# ROS initialisieren +INIT1="/opt/ros/melodic/setup.bash" +# Hierhin muss der ROS-Workspace installiert worden sein +INIT2="/home/ec/app_interface/ros_install/scripts/source_ros_install.sh" +# Init-Befehl +INITCMD="source $INIT1 && source $INIT2" + +# Neue tmux-Session starten +tmux new-session -d -s app + +# Programm 1: Konsolen-Task Manager unter Linux: Prozessorauslastung der Programme +tmux send-keys "top" C-m + +tmux split-window -h # nächstes Fenster ist rechts +# Programm 2: Kernel-Log anzeigen +tmux send-keys "watch -n1 \"dmesg | tail -n60\"" C-m + +tmux split-window -v # nächstes Fenster ist unten +# Programm 3: ROS Core starten (entfällt, falls roslaunch oder rosrun gemacht wird) +tmux send-keys "$INITCMD" C-m "roscore" C-m + +tmux select-pane -t 0 # wechsele wieder in erste Spalte +tmux split-window -v # nächstes Fenster in erster Spalte unten +# Programm 4: Simulink-Modell starten +tmux send-keys "$INITCMD" C-m "/home/ec/rtmdl/appint_ros_example" C-m diff --git a/appinterface_ros/catkin_ws/scripts/source_ros_install.sh b/appinterface_ros/catkin_ws/scripts/source_ros_install.sh new file mode 100755 index 0000000..1a39ad7 --- /dev/null +++ b/appinterface_ros/catkin_ws/scripts/source_ros_install.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +# Initialisierung des installierten ROS-Workspace +# (durch Kopieren des Ordners install aus einem vollen catkin-Workspace) + +# Lucas Jürgens, BA bei Moritz Schappler, 2017-04 +# (C) Institut für Regelungstechnik, Leibniz Universität Hannover +# moritz.schappler@imes.uni-hannover.de, Überarbeitung 2020-03 + + +# Verzeichnis des ROS-Workspace +prefix=/home/ec/app_interface/ros_install/install + +# Befehl zum Hinzufügen einer Umgebungsvariablen definieren +addenv () { + if ! eval "echo \$$1" | /bin/grep -Eq "(^|:)$2($|:)" ; then + export $1="$2:$(eval "echo \$$1")" + fi +} +# Umgebungsvariablen für den installierten ROS-Workspace einrichten (ohne src, devel und build) +addenv ROS_PACKAGE_PATH $prefix/share +addenv LD_LIBRARY_PATH $prefix/lib +addenv PYTHONPATH $prefix/lib/python2.7/site-packages +addenv PKG_CONFIG_PATH $prefix/lib/pkgconfig +addenv CMAKE_PREFIX_PATH $prefix diff --git a/appinterface_ros/catkin_ws/src/pcu_common/CMakeLists.txt b/appinterface_ros/catkin_ws/src/pcu_common/CMakeLists.txt new file mode 100644 index 0000000..1f2f5eb --- /dev/null +++ b/appinterface_ros/catkin_ws/src/pcu_common/CMakeLists.txt @@ -0,0 +1,40 @@ +cmake_minimum_required(VERSION 2.8.3) +project(pcu_common) + +find_package(catkin REQUIRED COMPONENTS + roscpp + rospy + std_msgs + message_generation + genmsg actionlib_msgs actionlib +) + + + +add_service_files( + FILES + SetInt.srv + SetFloat.srv + SetString.srv + GetBond.srv +) + +add_action_files(DIRECTORY action FILES AcquireRessource.action) + +catkin_python_setup() + +generate_messages( + DEPENDENCIES + std_msgs + actionlib + actionlib_msgs +) + +catkin_package( + CATKIN_DEPENDS message_runtime actionlib actionlib_msgs +) + + +include_directories( + ${catkin_INCLUDE_DIRS} +) diff --git a/appinterface_ros/catkin_ws/src/pcu_common/action/AcquireRessource.action b/appinterface_ros/catkin_ws/src/pcu_common/action/AcquireRessource.action new file mode 100644 index 0000000..017b123 --- /dev/null +++ b/appinterface_ros/catkin_ws/src/pcu_common/action/AcquireRessource.action @@ -0,0 +1,3 @@ + +--- +--- diff --git a/appinterface_ros/catkin_ws/src/pcu_common/package.xml b/appinterface_ros/catkin_ws/src/pcu_common/package.xml new file mode 100644 index 0000000..e849c36 --- /dev/null +++ b/appinterface_ros/catkin_ws/src/pcu_common/package.xml @@ -0,0 +1,25 @@ + + + pcu_common + 1.0.0 + Common dependencies for the PCU environment + user + MIT + message_generation + message_runtime + catkin + roscpp + rospy + std_msgs + roscpp + rospy + std_msgs + + actionlib + actionlib_msgs + actionlib + actionlib_msgs + + + + diff --git a/appinterface_ros/catkin_ws/src/pcu_common/setup.py b/appinterface_ros/catkin_ws/src/pcu_common/setup.py new file mode 100644 index 0000000..bcb9a5a --- /dev/null +++ b/appinterface_ros/catkin_ws/src/pcu_common/setup.py @@ -0,0 +1,15 @@ +## ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD + +from distutils.core import setup +from catkin_pkg.python_setup import generate_distutils_setup + + +# fetch values from package.xml +setup_args = generate_distutils_setup( + packages=['pcu_common_utils'], + package_dir={'': 'src'}, +) + + +setup(**setup_args) + diff --git a/appinterface_ros/catkin_ws/src/pcu_common/src/pcu_common_utils/AcquireRessource.py b/appinterface_ros/catkin_ws/src/pcu_common/src/pcu_common_utils/AcquireRessource.py new file mode 100644 index 0000000..e319803 --- /dev/null +++ b/appinterface_ros/catkin_ws/src/pcu_common/src/pcu_common_utils/AcquireRessource.py @@ -0,0 +1,117 @@ +#!/usr/bin/env python +# Action Server zur Organisation der Client-Verbindung zum Simulink-Modell + +# Lucas Jürgens (BA), lucas.juergens@zubox.de, 2017-02 +# Moritz Schappler, schappler@irt.uni-hannover.de +# (C) Institut für Regelungstechnik, Leibniz Universität Hannover + +import rospy +import actionlib + +import threading +from Queue import Queue + +from pcu_common.msg import AcquireRessourceAction, AcquireRessourceGoal + +class AcquirableRessource(): + def __init__(self, action_topic): + + self.acquired = False + + self._as = actionlib.SimpleActionServer(action_topic, AcquireRessourceAction, auto_start=False) + + self._as.register_goal_callback(self._goal_cb) + self._as.register_preempt_callback(self._preempt_cb) + + self._as.start() + + self._aborted_cb = None + self._acquired_cb = None + + t = threading.Thread(target=self._check_for_abort) + t.start() + + def register_acquired_cb(self, cb): + self._acquired_cb = cb + + def register_aborted_cb(self, cb): + self._aborted_cb = cb + + def _check_for_abort(self): + rate = rospy.Rate(50) + + while not rospy.is_shutdown(): + if self.acquired: + if not self._as.is_active(): + self.acquired = False + if self._aborted_cb: + self._aborted_cb() + rate.sleep() + + def break_acquirement(self): + if self.acquired: + self._as.set_aborted() + acquired = False + + def _goal_cb(self): + self._as.accept_new_goal() + self.acquired = True + if self._acquired_cb: + self._acquired_cb() + + + def _preempt_cb(self): + self._as.set_aborted() + +class AcquireRessource(): + def __init__(self, action_topic): + self._ac = actionlib.SimpleActionClient(action_topic, AcquireRessourceAction) + self._queue = Queue() # Using a queue here, because python 2 doesnt know a timeout for semaphore.wait + self._lost_cb = None + + self._timed_out = False + self.is_acquired = False + + def register_lost_callback(self, cb): + self._lost_cb = cb + + def release(self): + if self.is_acquired: + self._ac.cancel_all_goals() + self.is_acquired = False + + def acquire(self, timeout): + if self.is_acquired: + return False + + self._timed_out = False + if not self._ac.wait_for_server(rospy.Duration(timeout)): + self._timed_out = True + return False + + goal = AcquireRessourceGoal() + self._ac.send_goal(goal, self._done_cb, self._active_cb) + + try: + self._queue.get(True, timeout) + except: + self._timed_out = True + return False + + return True + + + def _done_cb(self, a, b): + if self.is_acquired: + self.is_acquired = False + if self._lost_cb: + t = threading.Thread(target=self._lost_cb) + t.start() + + def _active_cb(self): + if not self._timed_out: + self.is_acquired = True + self._queue.put(None) + else: + self._ac.cancel_goal() + diff --git a/appinterface_ros/catkin_ws/src/pcu_common/src/pcu_common_utils/__init__.py b/appinterface_ros/catkin_ws/src/pcu_common/src/pcu_common_utils/__init__.py new file mode 100644 index 0000000..ac690b1 --- /dev/null +++ b/appinterface_ros/catkin_ws/src/pcu_common/src/pcu_common_utils/__init__.py @@ -0,0 +1,4 @@ +import random, string + +def genId(): + return ''.join(random.SystemRandom().choice(string.ascii_uppercase + string.digits) for _ in range(20)) diff --git a/appinterface_ros/catkin_ws/src/pcu_common/srv/GetBond.srv b/appinterface_ros/catkin_ws/src/pcu_common/srv/GetBond.srv new file mode 100644 index 0000000..689ed77 --- /dev/null +++ b/appinterface_ros/catkin_ws/src/pcu_common/srv/GetBond.srv @@ -0,0 +1,3 @@ +string id +--- +bool success diff --git a/appinterface_ros/catkin_ws/src/pcu_common/srv/SetFloat.srv b/appinterface_ros/catkin_ws/src/pcu_common/srv/SetFloat.srv new file mode 100644 index 0000000..e7b83e8 --- /dev/null +++ b/appinterface_ros/catkin_ws/src/pcu_common/srv/SetFloat.srv @@ -0,0 +1,4 @@ +float32 data +--- +bool success +string message diff --git a/appinterface_ros/catkin_ws/src/pcu_common/srv/SetInt.srv b/appinterface_ros/catkin_ws/src/pcu_common/srv/SetInt.srv new file mode 100644 index 0000000..ead7b28 --- /dev/null +++ b/appinterface_ros/catkin_ws/src/pcu_common/srv/SetInt.srv @@ -0,0 +1,4 @@ +int32 data +--- +bool success +string message diff --git a/appinterface_ros/catkin_ws/src/pcu_common/srv/SetString.srv b/appinterface_ros/catkin_ws/src/pcu_common/srv/SetString.srv new file mode 100644 index 0000000..b0de4d8 --- /dev/null +++ b/appinterface_ros/catkin_ws/src/pcu_common/srv/SetString.srv @@ -0,0 +1,4 @@ +string data +--- +bool success +string message diff --git a/appinterface_ros/catkin_ws/src/pcu_sl_interface/.gitignore b/appinterface_ros/catkin_ws/src/pcu_sl_interface/.gitignore new file mode 100644 index 0000000..924a8eb --- /dev/null +++ b/appinterface_ros/catkin_ws/src/pcu_sl_interface/.gitignore @@ -0,0 +1,3 @@ +build +bin +lib diff --git a/appinterface_ros/catkin_ws/src/pcu_sl_interface/CMakeLists.txt b/appinterface_ros/catkin_ws/src/pcu_sl_interface/CMakeLists.txt new file mode 100644 index 0000000..1edf546 --- /dev/null +++ b/appinterface_ros/catkin_ws/src/pcu_sl_interface/CMakeLists.txt @@ -0,0 +1,49 @@ +cmake_minimum_required(VERSION 2.8.3) +project(pcu_sl_interface) + +find_package(catkin REQUIRED COMPONENTS + roscpp + rospy + std_msgs + message_generation + dynamic_reconfigure + pcu_common +) + +generate_dynamic_reconfigure_options(cfg/model.cfg) + +#add_action_files(DIRECTORY action FILES CollectFeatureData.action) +#add_action_files(DIRECTORY action FILES AquireRessource.action) +add_message_files(FILES ControllerState.msg JointsVector.msg) +add_service_files(FILES SetState.srv) + + +# make sure configure headers are built before any node using them +# add_dependencies(example_node ${PROJECT_NAME}_gencfg) + +generate_messages(DEPENDENCIES std_msgs) + +catkin_package(CATKIN_DEPENDS message_runtime pcu_common) + +include_directories( + ${catkin_INCLUDE_DIRS} +) + +add_library(ros_sl_interface src/node.cpp) +target_link_libraries(ros_sl_interface ${catkin_LIBRARIES}) +add_dependencies(ros_sl_interface pcu_common_gencpp) + +add_executable(test_interface src/test_interface.cpp) +target_link_libraries(test_interface ros_sl_interface ${catkin_LIBRARIES}) + +#add_executable(test2 src/test.cpp) +#target_link_libraries(test2 ${catkin_LIBRARIES}) + +install(TARGETS ros_sl_interface test_interface + ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} + RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} +) +catkin_install_python(PROGRAMS scripts/client_test.py + DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}) + diff --git a/appinterface_ros/catkin_ws/src/pcu_sl_interface/cfg/model.cfg b/appinterface_ros/catkin_ws/src/pcu_sl_interface/cfg/model.cfg new file mode 100755 index 0000000..19e647c --- /dev/null +++ b/appinterface_ros/catkin_ws/src/pcu_sl_interface/cfg/model.cfg @@ -0,0 +1,13 @@ +#!/usr/bin/env python +PACKAGE = "pcu_sl_interface" + +from dynamic_reconfigure.parameter_generator_catkin import * + +gen = ParameterGenerator() + +gen.add("D_j1",double_t,0,"Attenuation Joint 1",0.7, 0,1) +gen.add("D_j2",double_t,0,"Attenuation Joint 2",0.7, 0,1) +gen.add("K_j1",double_t,0,"Stiffness Joint 1",140, 0,500) +gen.add("K_j2",double_t,0,"Stiffness Joint 2",20, 0,50) + +exit(gen.generate(PACKAGE, "pcu_sl_interface", "model")) diff --git a/appinterface_ros/catkin_ws/src/pcu_sl_interface/msg/ControllerState.msg b/appinterface_ros/catkin_ws/src/pcu_sl_interface/msg/ControllerState.msg new file mode 100644 index 0000000..c939c11 --- /dev/null +++ b/appinterface_ros/catkin_ws/src/pcu_sl_interface/msg/ControllerState.msg @@ -0,0 +1,6 @@ +uint8 state +uint8 OFF=0 +uint8 STANDBY=1 +uint8 GRAVCOM=2 +uint8 TRA_VELOCITY=3 +uint8 TRA_POSITION=4 diff --git a/appinterface_ros/catkin_ws/src/pcu_sl_interface/msg/JointsVector.msg b/appinterface_ros/catkin_ws/src/pcu_sl_interface/msg/JointsVector.msg new file mode 100644 index 0000000..877236c --- /dev/null +++ b/appinterface_ros/catkin_ws/src/pcu_sl_interface/msg/JointsVector.msg @@ -0,0 +1 @@ +float64[2] joint_data diff --git a/appinterface_ros/catkin_ws/src/pcu_sl_interface/package.xml b/appinterface_ros/catkin_ws/src/pcu_sl_interface/package.xml new file mode 100644 index 0000000..85cb84d --- /dev/null +++ b/appinterface_ros/catkin_ws/src/pcu_sl_interface/package.xml @@ -0,0 +1,30 @@ + + + pcu_sl_interface + 1.0.0 + ROS-Interface for Simulink + + + user + MIT + + catkin + roscpp + rospy + std_msgs + roscpp + rospy + std_msgs + + message_generation + message_runtime + + pcu_common + pcu_common + + dynamic_reconfigure + dynamic_reconfigure + + + + diff --git a/appinterface_ros/catkin_ws/src/pcu_sl_interface/scripts/client_test.py b/appinterface_ros/catkin_ws/src/pcu_sl_interface/scripts/client_test.py new file mode 100755 index 0000000..57c86f8 --- /dev/null +++ b/appinterface_ros/catkin_ws/src/pcu_sl_interface/scripts/client_test.py @@ -0,0 +1,106 @@ +#!/usr/bin/env python + +import sys +import time + +import rospy + +import threading + +from pcu_common_utils.AcquireRessource import AcquireRessource +from pcu_sl_interface.srv import SetState +from pcu_sl_interface.msg import ControllerState, JointsVector + + +class Node: + def __init__(self): + self.sema = threading.Semaphore(0) + + self.ar = AcquireRessource("/SL_RT_CORE/acquire") + + self.srv_set_state = rospy.ServiceProxy("/SL_RT_CORE/set_state", SetState) + + print("waiting for service...") + self.srv_set_state.wait_for_service() + print("ok!") + + + self.qd_pub = rospy.Publisher("/SL_RT_CORE/qd_set", JointsVector, queue_size=1) + + def aq(self): + print("Aquiring Core") + if self.ar.acquire(1.0): + print("Aquired!") + else: + print("timeout!") + + + def run(self): + + + #self.done = false + self.setState(ControllerState.STANDBY) + + self.aq() + + self.setState(ControllerState.TRA_VELOCITY) + + rate = rospy.Rate(10) + c = 0 + + #time.sleep(2) + + + + while self.ar.is_acquired and not rospy.is_shutdown(): + c += 0.1 + jv = JointsVector() + jv.joint_data = [c, c*3.3] + + self.qd_pub.publish(jv) + rate.sleep() + + + self.ar.release() + + print("Broken") + + def setState(self, nr): + cs = ControllerState() + cs.state = nr + if not self.srv_set_state(cs).success: + print("Failed to set State.") + else: + print("Setting state ok.") + +rospy.init_node('client_test', anonymous=True) +node = Node() + +t = threading.Thread(target=node.run) +t.start() + +#node.run() +rospy.spin() + + + + + + + + + + +""" + + +id = generate_unique_id() +# Sends id to B using an action or a service +bond = bondpy.Bond("example_bond_topic", id) +bond.start() +if not bond.wait_until_formed(rospy.Duration(1.0)): + raise Exception('Bond could not be formed') +# ... do things with B ... +bond.wait_until_broken() +print "B has broken the bond" +""" diff --git a/appinterface_ros/catkin_ws/src/pcu_sl_interface/src/SL_func.h b/appinterface_ros/catkin_ws/src/pcu_sl_interface/src/SL_func.h new file mode 100644 index 0000000..62f3f61 --- /dev/null +++ b/appinterface_ros/catkin_ws/src/pcu_sl_interface/src/SL_func.h @@ -0,0 +1,45 @@ +/* +Definition der Ein- und Ausgabedaten für die Echtzeitschnittstelle zu Simulink +Diese Datei gilt für die Anwendungsseite und muss identisch auf der Simulink-Seite existieren + +* Lucas Jürgens, BA bei Moritz Schappler, 2017-04 +* (C) Institut für Regelungstechnik, Leibniz Universität Hannover +* moritz.schappler@imes.uni-hannover.de +*/ + +#ifndef SL_FUNC_H +#define SL_FUNC_H + +#ifdef __cplusplus +extern "C" { +#endif + +// Eingaben in Simulink-Modell (=Ausgabe aus dem SFcn-Block) +typedef struct{ + double q_set[2]; + double qd_set[2]; + + double param_D[2]; + double param_K[2]; + + unsigned char state; + +} SL_IN_type; + +// Ausgaben aus Simulink-Modell (=Eingabe in den SFcn-Block) +typedef struct{ + double q_meas[2]; + double qd_meas[2]; + unsigned char sl_state; + +} SL_OUT_type; + +void SL_io_func(SL_OUT_type* sl_out, SL_IN_type* sl_in); +void SL_start_func(); +void SL_terminate_func(); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/appinterface_ros/catkin_ws/src/pcu_sl_interface/src/node.cpp b/appinterface_ros/catkin_ws/src/pcu_sl_interface/src/node.cpp new file mode 100644 index 0000000..c420e8c --- /dev/null +++ b/appinterface_ros/catkin_ws/src/pcu_sl_interface/src/node.cpp @@ -0,0 +1,381 @@ +/* +Mit dieser Klasse ist eine Echtzeit-Kommunikation mit Simulink-Modellen möglich. +Details, siehe BA von Lucas Jürgens (Kap. 6.3.2) und Dokumentation des Beispiels. +Diese Datei stellt ein Minimalbeispiel ohne die Abhängigkeit zu ROS dar. + +Allgemein: +* Die mit SL_ beginnenden Funktionen werden durch das Simulink-Modell aufgerufen + +* Lucas Jürgens, BA bei Moritz Schappler, 2017-04 +* (C) Institut für Regelungstechnik, Leibniz Universität Hannover +* moritz.schappler@imes.uni-hannover.de, Überarbeitung 2020-03 +*/ + +#include +#include +#include + +#include "ros/ros.h" + +#include + +#include "std_msgs/Float64.h" +#include "std_msgs/String.h" +#include "pcu_common/AcquireRessourceAction.h" +#include "pcu_sl_interface/JointsVector.h" +#include "pcu_sl_interface/SetState.h" +#include "pcu_sl_interface/ControllerState.h" + +#include +#include + +#include "SL_func.h" + +class SLNode +{ +protected: + + sem_t sem_out_newdata_; // Semaphore für Synchronisation der Ausgabedaten von Simulink + pthread_mutex_t mut_out_; // Schutz der gemeinsamen Variable sl_out_buffer_ + pthread_mutex_t mut_in_; // Schutz der gemeinsamen Variable sl_in_buffer_ + pthread_mutexattr_t mutattr_prioinherit_; // Eigenschafts-Objekt für mutex-Variablen + pthread_mutex_t mut_state_; // TODO: Braucht man das? + + // Structures holding Simulink Signals , corresponding to Simulink Busses + SL_OUT_type sl_out_buffer_; + SL_IN_type sl_in_buffer_; + + int current_state_; + int state_requested_; + + + bool was_acquired_; // gibt an, ob eine Verbindung erstellt ist und Sollwerte geschrieben werden dürfen + + int publish_decimation_value_; // Reduktion der an den nicht-Echtzeitbereich zu sendenden Daten + bool is_stopped_; + + // Deklaration von ROS-bezogenen Handles + ros::NodeHandle nh_; + ros::AsyncSpinner spinner_; + // Deklaration des Action-Servers (für Bond-Primitive) + actionlib::SimpleActionServer as_acquire_; + // Deklaration der Services + ros::ServiceServer srvServer_setState_; + // Deklaration von ROS Subscribern und Publisher + ros::Subscriber sub_q_set_; + ros::Subscriber sub_qd_set_; + ros::Publisher pub_q_meas_; + ros::Publisher pub_qd_meas_; + ros::Publisher pub_controller_state_; + // Deklaration von Dynamic Reconfigure + dynamic_reconfigure::Server dyn_server_; + dynamic_reconfigure::Server::CallbackType dynCB_; + + +public: + + SLNode(): + as_acquire_(nh_, ros::this_node::getName() + "/acquire", false), + spinner_(1), + current_state_(0), + is_stopped_(false), + state_requested_(0), + was_acquired_(false) // Start ohne Verbindung zu Client +{ + // Initialisiere Synchronisationsmittel (Mutex, Semaphore) + //ROS_ASSERT(!sem_init(&sem_init_finished, 0, 0)); + ROS_ASSERT(!sem_init(&sem_out_newdata_, 0, 0)); + ROS_ASSERT(!pthread_mutexattr_init(&mutattr_prioinherit_)); + // Eigenschaft PRIO_INHERIT setzen, um Prioritätsinversion zu verhindern (siehe BA Jürgens, S. 70) + ROS_ASSERT(!pthread_mutexattr_setprotocol(&mutattr_prioinherit_, PTHREAD_PRIO_INHERIT)); + ROS_ASSERT(!pthread_mutex_init(&mut_in_, &mutattr_prioinherit_)); + ROS_ASSERT(!pthread_mutex_init(&mut_out_, &mutattr_prioinherit_)); + ROS_ASSERT(!pthread_mutex_init(&mut_state_, NULL)); // TODO: Braucht man das? + + nh_ = ros::NodeHandle("~"); + // Initialisiere Action Server + as_acquire_.registerGoalCallback(boost::bind(&SLNode::as_acquire_goal_cb_, this)); + as_acquire_.registerPreemptCallback(boost::bind(&SLNode::as_acquire_preempted_cb_, this)); + // Initialisiere Service + srvServer_setState_ = nh_.advertiseService("set_state", &SLNode::srv_setState_cb, this); + // Initialisiere ROS-Subscriber + sub_q_set_ = nh_.subscribe("q_set", 1, &SLNode::sub_q_set_cb, this); + sub_qd_set_ = nh_.subscribe("qd_set", 1, &SLNode::sub_qd_set_cb, this); + // Initialisiere ROS-Publisher + pub_q_meas_ = nh_.advertise("q_meas", 1); + pub_qd_meas_ = nh_.advertise("qd_meas", 1); + pub_controller_state_ = nh_.advertise("controller_state", 1, true); + // Parametriere Publisher + nh_.param("publish_decimation", publish_decimation_value_, 1); + // Initialisiere Dynamic Reconfigure + dynCB_ = boost::bind(&SLNode::dynamic_reconfigure_cb, this, _1, _2); + dyn_server_.setCallback(dynCB_); + // Weitere Initialisierung + as_acquire_.start(); + + spinner_.start(); + + changedState(pcu_sl_interface::ControllerState::OFF); + +} + + ~SLNode(void) + { + if(as_acquire_.isActive()) + as_acquire_.setAborted(); // Unterbreche Verbindung zu Client über Action Server, falls existent + } + + + + void SL_io_func(SL_OUT_type* sl_out, SL_IN_type* sl_in){ + // Diese Funktion wird vom Simulink-Modell im Echtzeit-Teil aufgerufen + int val = 1; + + // Eingabedaten für Simulinkmodell ("ROS to Simulink") + pthread_mutex_lock(&mut_in_); // Sperre Zugriff auf sl_in_buffer_ + memcpy((void *)sl_in, (void *)&sl_in_buffer_, sizeof(SL_IN_type)); // Daten kopieren (sl_in sind die Daten aus Simulink) + pthread_mutex_unlock(&mut_in_); // Freigabe von sl_in_buffer_ + + // Ausgabedaten aus dem Simulinkmodell ("Simulink to ROS") + sem_getvalue(&sem_out_newdata_, &val); // Semaphore für Daten-Ein-/Ausgabe zu Simulink + if(val == 0){ // Zugriff auf Daten ist möglich + pthread_mutex_lock(&mut_out_); // Sperre Zugriff auf sl_out_buffer_ + memcpy((void *)&sl_out_buffer_, (void *)sl_out, sizeof(SL_OUT_type)); // Daten kopieren (sl_out wird nach Simulink geschrieben) + pthread_mutex_unlock(&mut_out_); // Freigabe von sl_out_buffer_ + sem_post(&sem_out_newdata_); // Increments value of sem_out_newdata + } + } + + void run(){ + + int decimation_counter = 0; + + int sl_state = 0; // Hilfsvariable für Eingabevariable sl_state in den SFcn-Block + int sl_state_last = 0; // Altwert dazu + + sem_wait(&sem_out_newdata_); + while (ros::ok() && !is_stopped_) + { + + // Definitionen für Daten aus Simulink-Modell + pcu_sl_interface::JointsVector q_meas; + pcu_sl_interface::JointsVector qd_meas; + + pthread_mutex_lock(&mut_out_); // Warte auf Freigabe des Simulink-Buffers (erteilt durch SL_io_func) + // Daten aus Simulink-Buffer holen (in lokale Variablen schreiben) + q_meas.joint_data[0] = sl_out_buffer_.q_meas[0]; + q_meas.joint_data[1] = sl_out_buffer_.q_meas[1]; + qd_meas.joint_data[0] = sl_out_buffer_.qd_meas[0]; + qd_meas.joint_data[1] = sl_out_buffer_.qd_meas[1]; + sl_state_last = sl_state; + sl_state = sl_out_buffer_.sl_state; + + pthread_mutex_unlock(&mut_out_); // Gebe Simulink-Buffer wieder frei + + + decimation_counter = (decimation_counter+1)%publish_decimation_value_; + // von Simulink erhaltene Daten publishen + if(decimation_counter==0){ + pub_q_meas_.publish(q_meas); + pub_qd_meas_.publish(qd_meas); + } + + sem_wait(&sem_out_newdata_); + + if(sl_state != sl_state_last){ + // Der Controller-State wurde vom Simulink-Modell geändert. + // Ursache z.B. aktivierte Sicherheitsfunktion (z.B. Kollisionserkennung) + if(sl_state != state_requested_){ + ROS_INFO("ControllerState Override!"); + if(as_acquire_.isActive()){ + // Unterbreche Verbindung zum Client + breakActiveAcquirement(); + } + requestState(sl_state); + } + changedState(sl_state); + } + + ros::spinOnce(); + + //When a client acquired control and released it, set current_state to STANDBY, of not OFF. + if(was_acquired_){ + if(!as_acquire_.isActive()){ + was_acquired_ = false; + ROS_INFO("Client released"); + if(sl_state != pcu_sl_interface::ControllerState::OFF) + requestState(pcu_sl_interface::ControllerState::STANDBY); + } + } + } + } + + void stop(){ + is_stopped_ = true; + sem_post(&sem_out_newdata_); + } + + +private: + + void as_acquire_goal_cb_() + { + // Callback für Goal beim Action Server + // Von einem Client wird eine Verbindung hergestellt + ROS_INFO("New Client Acquiring!"); + as_acquire_.acceptNewGoal(); + was_acquired_ = true; + } + + void as_acquire_preempted_cb_() + { + // Callback, falls über Action-Server der Zugriff als unterbrochen angezeigt wird. + as_acquire_.setAborted(); + } + + bool srv_setState_cb(pcu_sl_interface::SetState::Request &req, + pcu_sl_interface::SetState::Response &res ) + { + // Verlange Wechsel des Controller-States. Anfrage wird nur an das + // Simulink-Modell weitergegeben, wenn ein Verbindung über den Action + // Server hergestellt wurde. Ansonsten verweigert der Service die Anfrage. + res.success = false; + + if(as_acquire_.isActive()) + res.success = true; + else{ + if(current_state_ == pcu_sl_interface::ControllerState::OFF && req.state.state == pcu_sl_interface::ControllerState::STANDBY) + res.success = true; // Gehe von OFF in STANDBY + else if(current_state_ == pcu_sl_interface::ControllerState::STANDBY && req.state.state == pcu_sl_interface::ControllerState::OFF) + res.success = true; // Gehe von STANDBY in OFF + } + + if(!res.success == true){ + ROS_WARN("Client failed to set ControllerState!"); + } + else{ + requestState(req.state.state); + } + + return true; + } + + void breakActiveAcquirement(){ + // Verbindung zu vorhandem Client über den Action Server unterbrechen + if(as_acquire_.isActive()) + as_acquire_.setAborted(); + was_acquired_ = false; + } + + void changedState(int new_state){ + // Sendet eine ROS-Message bei Wechsel des Controller-States + current_state_ = new_state; + ROS_INFO("New ControllerState: %d", current_state_); + + pcu_sl_interface::ControllerState cs; + cs.state = current_state_; + pub_controller_state_.publish(cs); + } + + void requestState(int req_state){ + // Funktion zum Definieren eines neuen Zustands für den SL-Eingang state + if(req_state != current_state_){ + pthread_mutex_lock(&mut_in_); + sl_in_buffer_.state = req_state; + pthread_mutex_unlock(&mut_in_); + } + state_requested_ = req_state; + } + + + void sub_q_set_cb(const pcu_sl_interface::JointsVector::ConstPtr& msg) + { + // Callback-Funktion für Subscriber von q_set + // Wird aufgerufen, wenn neue ROS-Message dafür ankommt + pthread_mutex_lock(&mut_in_); // Sperre Zugriff auf sl_in_buffer_ + sl_in_buffer_.q_set[0] = msg->joint_data[0]; // Daten von ROS-Message in Buffer schreiben + sl_in_buffer_.q_set[1] = msg->joint_data[1]; + pthread_mutex_unlock(&mut_in_); // Freigabe von sl_in_buffer_ + } + + void sub_qd_set_cb(const pcu_sl_interface::JointsVector::ConstPtr& msg) + { + // Callback-Funktion für Subscriber von qd_set + pthread_mutex_lock(&mut_in_); + sl_in_buffer_.qd_set[0] = msg->joint_data[0]; + sl_in_buffer_.qd_set[1] = msg->joint_data[1]; + pthread_mutex_unlock(&mut_in_); + } + + void dynamic_reconfigure_cb(pcu_sl_interface::modelConfig &config, uint32_t level){ + // Callback-Funktion für Dynamic Reconfigure. + ROS_INFO("dynamic reconfigure"); + + pthread_mutex_lock(&mut_in_); // Sperre Zugriff auf sl_in_buffer_ + sl_in_buffer_.param_D[0] = config.D_j1; + sl_in_buffer_.param_D[1] = config.D_j2; + sl_in_buffer_.param_K[0] = config.K_j1; + sl_in_buffer_.param_K[1] = config.K_j2; + pthread_mutex_unlock(&mut_in_); // Freigabe von sl_in_buffer_ + } + +}; + +pthread_t ros_thread; // definiert Thread, in dem der ROS-Teil läuft +void *ros_thread_fn(void* arg); // Startet ROS-Thread unten + +sem_t sem_init_finished; // Semaphore zur Synchronisation der Initialisierung + +SLNode* slNode; + +void SL_io_func(SL_OUT_type* sl_out, SL_IN_type* sl_in){ + // Wird bei Aufrufen des Simulink-Blocks zu jedem Zeitschritt ausgeführt + // (Einstellung in Matlab über legacy_code, OutputFcnSpec in generate_block.m) + slNode->SL_io_func(sl_out, sl_in); +} + +void SL_start_func(){ + // Wird bei Modell-Initialisierung aufgerufen + // (Einstellung in Matlab über legacy_code, StartFcnSpec in generate_block.m) + std::cout << "Creating ROS-Node Thread!" << std::endl; + + ROS_ASSERT(!sem_init(&sem_init_finished, 0, 0)); // Initialisierung der Semaphore + pthread_create(&ros_thread, NULL, &ros_thread_fn, NULL); + sem_wait(&sem_init_finished); //Wait for Initialization of the ROS-Node in main-thread. Wait, because dynamic-reconfigure presets values +} + +void SL_terminate_func(){ + // Wird bei Beenden des Modells ausgeführt + // (Einstellung in Matlab über legacy_code, TerminateFcnSpec in generate_block.m) + std::cout << "Terminating ROS-Node Thread!" << std::endl; + + slNode->stop(); + pthread_join(ros_thread, NULL); +} + +void *ros_thread_fn(void* arg) +{ + int argc = 0; + char **argv = NULL; + + // Set Threads Priority FIXME: Priority adjustable + // set it prior to the ROS-initialisation. ROS-threads inherit the priority + struct sched_param param = {}; + param.sched_priority = 90; + if (sched_setscheduler (0, SCHED_RR, ¶m) == -1){/*empty*/}; + // ROS-Node initialisieren + ros::init(argc, argv, "SL_RT_CORE", ros::init_options::NoSigintHandler); + + slNode = new SLNode(); + + sem_post(&sem_init_finished); // Gebe Semaphore für Initialisierung frei. Vorher wird die SL_start_func zurückgehalten. + + slNode->run(); // Läuft so lange als Endlosschleife, bis das Programm abbricht. + + delete(slNode); + ros::shutdown(); + + ROS_INFO("OUT!"); + + return 0; +} diff --git a/appinterface_ros/catkin_ws/src/pcu_sl_interface/src/test_interface.cpp b/appinterface_ros/catkin_ws/src/pcu_sl_interface/src/test_interface.cpp new file mode 100644 index 0000000..079aa9d --- /dev/null +++ b/appinterface_ros/catkin_ws/src/pcu_sl_interface/src/test_interface.cpp @@ -0,0 +1,76 @@ +/* +Dieses Testskript dient nur zur Prüfung, ob die Simulink-Schnittstelle kompiliert. +Hiermit können einzelne Details der Klasse SLNode aus node.cpp getestet werden. +Eine Kommunikation mit dem Simulink-Modell ist nicht möglich! + +* Lucas Jürgens, BA bei Moritz Schappler, 2017-04 +* (C) Institut für Regelungstechnik, Leibniz Universität Hannover +* moritz.schappler@imes.uni-hannover.de, Überarbeitung 2020-03 +*/ + +#include +#include +#include +#include +#include +#include + +#include "SL_func.h" + + +bool do_shutdown = false; + +SL_OUT_type sl_out; +SL_IN_type sl_in; + +void my_siginthandler(int s){ + do_shutdown = true; +} + +int main(){ + struct sigaction sigIntHandler; + sigIntHandler.sa_handler = my_siginthandler; + sigemptyset(&sigIntHandler.sa_mask); + sigIntHandler.sa_flags = 0; + sigaction(SIGINT, &sigIntHandler, NULL); + + SL_start_func(); + + int testcnt = 0; + + double test_double = 0; + + while(!do_shutdown){ + SL_io_func(&sl_out, &sl_in); + //printf("i:%d, qd1: %f; state: %d\n", testcnt, sl_in.qd_set[0], sl_in.state); + + + test_double += 0.01; + if(test_double > 1.0) + test_double = 0.0; + + sl_out.q_meas[0] = 1.0 - test_double*0.5; + sl_out.q_meas[1] = test_double; + + + + /*switch(testcnt++){ + case 100: + sl_out.state_override = 2; + printf("\n\nOVERRIDE-Test!\n"); + break; + case 110: + sl_out.state_override = 0; + break; + } + */ + + sl_out.sl_state = sl_in.state; + + usleep(100000); // 0.1 Sekunde Pause + } + + SL_terminate_func(); + + return 0; +} diff --git a/appinterface_ros/catkin_ws/src/pcu_sl_interface/srv/SetState.srv b/appinterface_ros/catkin_ws/src/pcu_sl_interface/srv/SetState.srv new file mode 100644 index 0000000..5144fd1 --- /dev/null +++ b/appinterface_ros/catkin_ws/src/pcu_sl_interface/srv/SetState.srv @@ -0,0 +1,3 @@ +pcu_sl_interface/ControllerState state +--- +bool success diff --git a/appinterface_ros/example_data/robot_env_forearmbot b/appinterface_ros/example_data/robot_env_forearmbot new file mode 100644 index 0000000..c327591 --- /dev/null +++ b/appinterface_ros/example_data/robot_env_forearmbot @@ -0,0 +1,27 @@ +# Einfaches zweiachsiges System +# Prothese 2 DOF + +robot_name := "forearmbot": + +NJ := 2: +NQJ := 2: + +qoffset := Matrix(2,1,[-(1/2)*Pi, 0]): +alpha := Matrix(2,1,[-(1/2)*Pi, -(1/2)*Pi]): +d := Matrix(2,1,[ 0, d2]): +a := Matrix(2,1,[0, 0]): +v := Matrix(2,1,[0, 1]): +b := Matrix(2,1,[0, 0]): +beta := Matrix(2,1,[0, 0]): +theta := qJ_t+qoffset: + +# Tischaufbau: Schwerkraft in nur eine Richtung +g_world := <0;0;g3>: + +# Setze Massen (Basis masselos. Ist aber sowieso egal). +user_M := <0;M1;M2>: +# Setze Schwerpunkt (nur auf Segment) +user_CoM := <<0;0;0> | | <0;0;0>>: +# Setze Trägheitsmomente: Reihenfolge: XX;XY,XZ,YY,YZ,ZZ +# Annahme: Dünner Stab (in x-Richtung des Körper-KS). Dann Kugel für zweites Segment am Ende +user_inertia := <<0;0;0;0;0;0>| <0;0;0;YYC1;0;ZZC1>| >: diff --git a/appinterface_ros/ros_rt_interface/.gitignore b/appinterface_ros/ros_rt_interface/.gitignore new file mode 100644 index 0000000..567609b --- /dev/null +++ b/appinterface_ros/ros_rt_interface/.gitignore @@ -0,0 +1 @@ +build/ diff --git a/appinterface_ros/ros_rt_interface/Makefile b/appinterface_ros/ros_rt_interface/Makefile new file mode 100644 index 0000000..e7a3833 --- /dev/null +++ b/appinterface_ros/ros_rt_interface/Makefile @@ -0,0 +1,18 @@ +# Make-File für das ROS-Simulink-Interface + +# Lucas Jürgens (BA), lucas.juergens@zubox.de, 2017-02 +# Moritz Schappler, schappler@irt.uni-hannover.de +# (c) Institut für Regelungstechnik, Universität Hannover + + +BUILDDIR=build +ROS_NODE_DIR=ros_rt_core +# ROS_PATH=$OECORE_TARGET_SYSROOT/opt/ros/indigo +ROS_NODE_FILE=SL_func_dummy +LIB_NAME=libros_sl_interface.so + +all: roslib + +roslib: $(BUILDDIR)/$(roslib.a) + ${CXX} -fPIC -c -DDUMMY $(ROS_NODE_DIR)/$(ROS_NODE_FILE).cpp -o $(BUILDDIR)/$(ROS_NODE_FILE).o -Wall -shared + ${CXX} -shared -fPIC -Wl,-soname,$(LIB_NAME) -o $(BUILDDIR)/$(LIB_NAME) $(BUILDDIR)/$(ROS_NODE_FILE).o -lc diff --git a/appinterface_ros/ros_rt_interface/generate_block.m b/appinterface_ros/ros_rt_interface/generate_block.m new file mode 100644 index 0000000..4ca5e1f --- /dev/null +++ b/appinterface_ros/ros_rt_interface/generate_block.m @@ -0,0 +1,42 @@ +% Erstelle den Block zur Kommunikation mit der ROS-Seite des App-Interface +% Dieser Block muss jedes Mal neu generiert werden, wenn sich der Bus SL_IN +% oder SL_out ändert. +% Der Ordner ros_rt_interface muss im Matlab-Pfad sein. +% Ein Ersetzen des Blocks AppInterface in der Library ist nicht notwendig. +% Im Simulink-Modell wird nur der hier erzeugte Code aufgerufen (libros_sl_interface.so, SL_func.h,SL_func_dummy.cpp). + +% Lucas Jürgens (BA), lucas.juergens@zubox.de, 2017-02 +% Moritz Schappler, schappler@irt.uni-hannover.de +% (c) Institut für Regelungstechnik, Universität Hannover + +[folder, name, ext] = fileparts(which(mfilename)); +builddir = fullfile(folder, 'build'); % build-Ordner im selben Verzeichnis wie dieses Skript +mkdir(builddir); +cd(builddir); + +try + def = legacy_code('initialize') + def.SourceFiles = {'../ros_rt_interface/ros_rt_core/SL_func_dummy.cpp'}; % Die Angabe dieser Datei ist trotz der shared Library nötig, da diese ja nur mit ARM kompatibel ist. + def.HeaderFiles = {'SL_func.h'}; + def.IncPaths = {'../ros_rt_interface/ros_rt_core'}; + def.TargetLibFiles = {'libros_sl_interface.so'}; + def.LibPaths = {'../build'}; + + def.SFunctionName = 'ros_rt_interface_pcu'; + + def.StartFcnSpec = 'void SL_start_func()'; + def.OutputFcnSpec = 'void SL_io_func(SL_OUT_type u1[1], SL_IN_type y1[1])'; + def.TerminateFcnSpec = 'void SL_terminate_func()'; + + legacy_code('sfcn_cmex_generate', def); + legacy_code('compile', def, '-DDUMMY'); % Erstellt MEX-File. Ist leider nötig + legacy_code('sfcn_tlc_generate', def); + legacy_code('rtwmakecfg_generate', def); + legacy_code('slblock_generate', def); + +catch ME + cd(folder); + rethrow(ME) +end + +cd(folder); diff --git a/appinterface_ros/ros_rt_interface/pcu_ros_load_buses.m b/appinterface_ros/ros_rt_interface/pcu_ros_load_buses.m new file mode 100644 index 0000000..9d1c25c --- /dev/null +++ b/appinterface_ros/ros_rt_interface/pcu_ros_load_buses.m @@ -0,0 +1,14 @@ +% Erstelle Bus-Objekte zum Kompilieren des PCU-App-Interface im Matlab-Workspace +% Wird zum Kompilieren der PCU-Simulinkmodelle benötigt +% +% Führe dieses Skript direkt aus und nicht zeilenweise (damit der Pfad bestimmt werden kann) + +% Lucas Jürgens (BA), lucas.juergens@zubox.de, 2017-02 +% Moritz Schappler, schappler@irt.uni-hannover.de +% (c) Institut für Regelungstechnik, Universität Hannover + +[folder, ~, ~] = fileparts(which(mfilename)); +filedir = fullfile(folder, 'ros_rt_core'); + +run(fullfile(filedir, 'bus_SL_IN.m')) +run(fullfile(filedir, 'bus_SL_OUT.m')) diff --git a/appinterface_ros/ros_rt_interface/ros_rt_core/SL_func.h b/appinterface_ros/ros_rt_interface/ros_rt_core/SL_func.h new file mode 100644 index 0000000..2894106 --- /dev/null +++ b/appinterface_ros/ros_rt_interface/ros_rt_core/SL_func.h @@ -0,0 +1,43 @@ +/* +Definition der Ein- und Ausgabedaten für die S-Function der Simulink-Schnittstelle +Muss identisch auf der Anwendungsseite existieren + +* Lucas Jürgens, BA bei Moritz Schappler, 2017-04 +* (C) Institut für Regelungstechnik, Leibniz Universität Hannover +* moritz.schappler@imes.uni-hannover.de +*/ + +#ifndef SL_FUNC_H +#define SL_FUNC_H + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct{ + double q_set[2]; + double qd_set[2]; + + double param_D[2]; + double param_K[2]; + + unsigned char state; + +} SL_IN_type; + +typedef struct{ + double q_meas[2]; + double qd_meas[2]; + unsigned char sl_state; + +} SL_OUT_type; + +void SL_io_func(SL_OUT_type* sl_out, SL_IN_type* sl_in); +void SL_start_func(); +void SL_terminate_func(); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/appinterface_ros/ros_rt_interface/ros_rt_core/SL_func_dummy.cpp b/appinterface_ros/ros_rt_interface/ros_rt_core/SL_func_dummy.cpp new file mode 100644 index 0000000..f574044 --- /dev/null +++ b/appinterface_ros/ros_rt_interface/ros_rt_core/SL_func_dummy.cpp @@ -0,0 +1,20 @@ +/* +Dummy-Code zur Definition der Funktionen für die Simulink-S-Function. +Zum Kompilierzeitpunkt muss der Inhalt der Funktionen nicht bekannt sein. +Die Funktionen werden später über eine Programmbibliothek eingebunden. + +* Lucas Jürgens, BA bei Moritz Schappler, 2017-04 +* (C) Institut für Regelungstechnik, Leibniz Universität Hannover +* moritz.schappler@imes.uni-hannover.de +*/ + +#ifdef DUMMY + +#include "SL_func.h" + + +void SL_io_func(SL_OUT_type* sl_out, SL_IN_type* sl_in){} +void SL_start_func(){} +void SL_terminate_func(){} + +#endif diff --git a/appinterface_ros/ros_rt_interface/ros_rt_core/bus_SL_IN.m b/appinterface_ros/ros_rt_interface/ros_rt_core/bus_SL_IN.m new file mode 100644 index 0000000..0589849 --- /dev/null +++ b/appinterface_ros/ros_rt_interface/ros_rt_core/bus_SL_IN.m @@ -0,0 +1,39 @@ +function cellInfo = bus_SL_IN(varargin) +% BUS_SL_IN returns a cell array containing bus object information +% +% Optional Input: 'false' will suppress a call to Simulink.Bus.cellToObject +% when the MATLAB file is executed. +% The order of bus element attributes is as follows: +% ElementName, Dimensions, DataType, SampleTime, Complexity, SamplingMode, DimensionsMode, Min, Max, DocUnits, Description + +% Lucas Jürgens (BA), lucas.juergens@zubox.de, 2017-02 +% Moritz Schappler, schappler@irt.uni-hannover.de +% (C) Institut für Regelungstechnik, Universität Hannover + +suppressObject = false; +if nargin == 1 && islogical(varargin{1}) && varargin{1} == false + suppressObject = true; +elseif nargin > 1 + error('Invalid input argument(s) encountered'); +end + +cellInfo = { ... + { ... + 'SL_IN_type', ... + 'SL_func.h', ... + '', ... + 'Auto', ... + '-1', {... +{'state', 1, 'uint8', -1, 'real', 'Sample', 'Fixed', [], [], '', ''}; ... +{'param_D', 2, 'double', -1, 'real', 'Sample', 'Fixed', [], [], '', ''}; ... +{'param_K', 2, 'double', -1, 'real', 'Sample', 'Fixed', [], [], '', ''}; ... +{'q_set', 2, 'double', -1, 'real', 'Sample', 'Fixed', [], [], '', ''}; ... +{'qd_set', 2, 'double', -1, 'real', 'Sample', 'Fixed', [], [], '', ''}; ... +} ... + } ... +}'; + +if ~suppressObject + % Create bus objects in the MATLAB base workspace + Simulink.Bus.cellToObject(cellInfo) +end diff --git a/appinterface_ros/ros_rt_interface/ros_rt_core/bus_SL_OUT.m b/appinterface_ros/ros_rt_interface/ros_rt_core/bus_SL_OUT.m new file mode 100644 index 0000000..f7a652d --- /dev/null +++ b/appinterface_ros/ros_rt_interface/ros_rt_core/bus_SL_OUT.m @@ -0,0 +1,37 @@ +function cellInfo = bus_SL_OUT(varargin) +% BUS_SL_OUT returns a cell array containing bus object information +% +% Optional Input: 'false' will suppress a call to Simulink.Bus.cellToObject +% when the MATLAB file is executed. +% The order of bus element attributes is as follows: +% ElementName, Dimensions, DataType, SampleTime, Complexity, SamplingMode, DimensionsMode, Min, Max, DocUnits, Description + +% Lucas Jürgens (BA), lucas.juergens@zubox.de, 2017-02 +% Moritz Schappler, schappler@irt.uni-hannover.de +% (C) Institut für Regelungstechnik, Universität Hannover + +suppressObject = false; +if nargin == 1 && islogical(varargin{1}) && varargin{1} == false + suppressObject = true; +elseif nargin > 1 + error('Invalid input argument(s) encountered'); +end + +cellInfo = { ... + { ... + 'SL_OUT_type', ... + 'SL_func.h', ... + '', ... + 'Auto', ... + '-1', {... +{'sl_state', 1, 'uint8', -1, 'real', 'Sample', 'Fixed', [], [], '', ''}; ... +{'q_meas', 2, 'double', -1, 'real', 'Sample', 'Fixed', [], [], '', ''}; ... +{'qd_meas', 2, 'double', -1, 'real', 'Sample', 'Fixed', [], [], '', ''}; ... + } ... + } ... +}'; + +if ~suppressObject + % Create bus objects in the MATLAB base workspace + Simulink.Bus.cellToObject(cellInfo) +end diff --git a/appinterface_ros/sync.sh b/appinterface_ros/sync.sh new file mode 100755 index 0000000..4bfa115 --- /dev/null +++ b/appinterface_ros/sync.sh @@ -0,0 +1,14 @@ +#!/bin/bash -e +# Beispiel auf Testrechner kopieren. +# Der Rechner imessmartrtpc1_ec ist in der ~/.ssh/config eingetragen +# Dieses Skript muss aus dem Verzeichnis aufgerufen werden, in dem es liegt. + +# Moritz Schappler, moritz.schappler@imes.uni-hannover.de, 2020-03 +# (C) Institut für Mechatronische Systeme, Leibniz Universität Hannover + +# Simulink-Modell kopieren +scp appint_ros_example imessmartrtpc1_ec:rtmdl/ +# ROS-Workspace (Installationsordner) kopieren +ssh imessmartrtpc1_ec 'mkdir -p ~/app_interface/ros_install' +cd catkin_ws +rsync -rltv --delete install scripts imessmartrtpc1_ec:~/app_interface/ros_install