Changes for page LEGO Mindstorms with leJOS and SCCharts
Last modified by Alexander Schulz-Rosengarten on 2023/09/11 16:17
Summary
-
Page properties (1 modified, 0 added, 0 removed)
-
Objects (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -77,11 +77,9 @@ 77 77 78 78 If you have an **NXT** **brick**, install the **leJOS NXJ** Plug-in. If you have an **EV3 brick**, install the **leJOS EV3** plugin. 79 79 80 -[[image:attach:Screenshot_20171016_130805.png]] 81 - 82 82 **Tip:** To speed up the installation, uncheck the option "Contact all update sites during install to find required software". This will reduce the installation time from drastically (around 30 seconds instead 10 minutes). 83 83 84 - \\82 +[[image:attach:lejos_eclipse_plugin.png]] 85 85 86 86 After the installation, the plugin requires a **little configuration**. Go to //Window > Preferences > leJOS NXJ// (//Window > Preferences > leJOS EV3 //respectively) and enter the base directory of your **leJOS** **installation** in the **NXJ_HOME field**. 87 87 ... ... @@ -100,7 +100,7 @@ 100 100 1. The project wizard from the leJOS plugin opens. Set the project name to //Flashlight// and click //finish//. 101 101 1. The project is created and the model file is opened in an editor (This might take a few seconds). 102 102 103 -=== Edit the Model: ===101 +=== Edit the model: === 104 104 105 105 Change the contents of the model file to the following code and save it. 106 106 ... ... @@ -125,7 +125,7 @@ 125 125 126 126 The annotations on the input and output variable are used to define which wrapper code is used to set / read them. **@Wrapper TouchSensor, S4** will set the input variable to true iff the touch sensor on the port S4 is pressed. **@Wrapper Floodlight, S1** on the output variable will turn on the red led of the light sensor that is attatched to port S1 iff the variable is true. 127 127 128 -The available wrapper code snippets are defined in the //assets/snippets//in ftl files (FreeMarker template files). The table below gives an overview of the available wrapper code snippets.126 +The available wrapper code snippets are defined in the //snippets// directory of the project in ftl files (FreeMarker template files). The table below gives an overview of the available wrapper code snippets. 129 129 130 130 **Note:** The Floodlight of the EV3 has a pretty high latency when switching between on and off. 131 131 ... ... @@ -132,31 +132,17 @@ 132 132 **Note: **To view ftl files with highlighting, you may want to install the //FreeMarker IDE// feature from the JBoss Tools. However, this is not necessary to work with KIELER. JBoss Tools is available in the Eclipse Market Place and via update site. The update site for stable releases is [[http:~~/~~/download.jboss.org/jbosstools/neon/stable/updates/ >>url:http://download.jboss.org/jbosstools/neon/stable/updates/||shape="rect"]]. Note that only the //FreeMarker IDE// feature is required (Abridged JBoss Tools > FreeMarker IDE).** 133 133 ** 134 134 135 -=== BuildtheProject: ===133 +=== Launch the project: === 136 136 137 - The modelis now readyto becompiled.Compilationis done in thebackground when theprojectis built. Therearetwo ways to build aproject:manuallyusing//Project > Build Project//,or automatically via //Project>BuildAutomatically//.Iftheautomatic build is enabled, resources are builtwhenthey are saved.135 +With the mouse over the SCT file in the project explorer, perform //Right Click > Run As > KiCo Compilation.// 138 138 139 - Building theprojectwillcreatea new folder//kieler-gen// inwhichall resultsaresaved.This includesthecompiledcode from themodel,anexecutable simulationforthe modelandwrappercodethat isreadyto bedeployed to the MindstormsBrick.137 +A launch config is created, which compiles the model to Java code and creates wrapper code from the annotations in the model file. Afterwards this output is compiled and deployed to the Mindstorms brick, by using the launch shortcut from the leJOS plugin. If any errors occur, you can see them in the Console View. 140 140 141 - ThesimulationissavedasJAR filein//kieler-gen/sim/bin//and canbe startedvia//Right Click>Runas>KIELER Simulation//.Modelsand variablesofa runningmulationreisplayed in theData Pool View.139 +For a deeper understanding of the project launch and initialization, take a look at the [[wiki page for Prom>>url:http://rtsys.informatik.uni-kiel.de/confluence/pages/viewpage.action?pageId=13762626||shape="rect"]]. 142 142 143 -[[image:attach:Screenshot_20171016_110005.png]] 144 - 145 -Besides the simulation, the finished wrapper code that can be uploaded to the Mindstorms brick is created as part of the project build. It is saved in //kieler-gen/model//. To upload it to the Mindstorms brick, use //Right Click > Run as > leJOS NXT Program//. 146 - 147 -[[image:attach:Screenshot_20171016_120554.png]] 148 - 149 -==== Excluding the Simulation from the NXT Build ==== 150 - 151 -It is necessary to exclude the simulation directory and org.json directory inside kieler-gen from the NXT project specific build via //Right Click > Build Path > Exclude//. Afterwards the project has to be build again to remove all error markers in these directories. 152 - 153 -[[image:attach:Screenshot_20171016_105821.png]] 154 - 155 -Normally the NXT project attempts to compile all Java files in the kieler-gen directory for the platform. However, the simulation that is generated is not targeted at the Mindstorms brick and has compilation errors. It is compiled separately by KIELER. 156 - 157 157 === Available Wrapper Code Snippets === 158 158 159 -There are several wrapper code snippets that can be used as annotations on input and output variables in the model file. These snippets are inserted in the main file template as part of the project build. The available snippets are listed below.143 +There are several wrapper code snippets that can be used as annotations on input and output variables in the model file. These snippets are inserted in the main file template as part of the project launch. The available snippets are listed below. 160 160 161 161 For sensors, the port has to be on of S1, S2, S3, S4. 162 162 ... ... @@ -718,3 +718,5 @@ 718 718 \\ 719 719 720 720 \\ 705 + 706 +input
- Confluence.Code.ConfluencePageClass[0]
-
- Id
-
... ... @@ -1,1 +1,1 @@ 1 -3 78142871 +33259848 - URL
-
... ... @@ -1,1 +1,1 @@ 1 -https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/3 7814287/LEGO Mindstorms with leJOS and SCCharts1 +https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/KIELER/pages/33259848/LEGO Mindstorms with leJOS and SCCharts