Changes for page Dependencies and Compilation
Last modified by Soeren Domroes on 2025/01/30 12:18
Summary
-
Page properties (3 modified, 0 added, 0 removed)
-
Objects (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Parent
-
... ... @@ -1,1 +1,0 @@ 1 -PP18.Pinball Project - Winter Term 201920.Project Documentation.WebHome - Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki.stu12 26121 +XWiki.stu120505 - Content
-
... ... @@ -1,8 +1,8 @@ 1 1 = Building and Running the Pinball Autopilot on the Raspberry Pi = 2 2 3 -The source code lies and building happens inside the folder called {{code language="none"}}pinballProject{{/code}}. For a fresh build, you need a not too old version of {{code language="none"}}make{{/code}}, a C++ compiler (we only tested {{code language="none"}}g++{{/code}}), a ninternet connection (for downloading the Kieler Compiler), the libraries {{code language="none"}}wiringPi{{/code}} and {{code language="none"}}opencv{{/code}} as well as the command-line tools [[mega-cmd>>url:https://mega.nz/cmd||shape="rect"]] and {{code language="none"}}python2{{/code}}. The tool for mega.nz (and also {{code language="none"}}python2{{/code}}) can be omitted (see below on how to compile without them), everything else except for {{code language="none"}}opencv{{/code}} comes pre-installed with Raspbian. For {{code language="none"}}opencv{{/code}} you need a 4.x version, 4.2.0 ought to work for example. Make sure to enable the option that the entries for {{code language="none"}}pkg-config{{/code}} get configured. It can be built from source on the Raspberry Pi in a few hours, make sure not to use too many threads for compilation because of limited RAM, also perhaps increase the swap.3 +The source code lies and building happens inside the folder called {{code language="none"}}pinballProject{{/code}}. For a fresh build, you need a not too old version of {{code language="none"}}make{{/code}}, a C++ compiler (we only tested {{code language="none"}}g++{{/code}}), a internet connection (for downloading the Kieler Compiler), the libraries {{code language="none"}}wiringPi{{/code}} and {{code language="none"}}opencv{{/code}} as well as the command-line tools [[mega-cmd>>url:https://mega.nz/cmd||shape="rect"]] and {{code language="none"}}python2{{/code}}. The tool for mega.nz (and also {{code language="none"}}python2{{/code}}) can be omitted (see below on how to compile without them), everything else except for {{code language="none"}}opencv{{/code}} comes pre-installed with Raspbian. For {{code language="none"}}opencv{{/code}} you need a 4.x version, 4.2.0 ought to work for example. Make sure to enable the option that the entries for {{code language="none"}}pkg-config{{/code}} get configured. It can be built from source on the Raspberry Pi in a few hours, make sure not to use too many threads for compilation because of limited RAM, also perhaps increase the swap. 4 4 5 -With all the prerequisit es met, you can use the {{code language="none"}}Makefile{{/code}} to build everything.5 +With all the pre-requisits met, you can use the {{code language="none"}}Makefile{{/code}} to build everything. 6 6 7 7 (% class="wrapped" %) 8 8 |=((( ... ... @@ -142,15 +142,15 @@ 142 142 143 143 = Setting up the Pi for Better Real Time Performance = 144 144 145 -The program will stick its latency-sensitive threads for controlling the IO pins and for image processing to the cores 3 and 4 of the 4-core Raspberry Pi. To ensure best real-time performance, please configure the kernel parameter (% style="color: rgb(0,0,0);font-family: SFMono-Medium , SF Mono , Segoe UI Mono , Roboto Mono , Ubuntu Mono , Menlo , Courier , monospace;" %)2,3{{code language="none"}}isolcpus={{/code}}(%%) (they count startingfrom 0) to the file {{code language="none"}}/boot/cmdline.txt{{/code}} and reboot. This will make sure that the operating system doesn’t schedule anyother tasks on those cores.145 +The program will stick its latency-sensitive threads for controlling the IO pins and for image processing to the cores 3 and 4 of the 4-core Raspberry Pi. To ensure best real-time performance, please configure the kernel parameter (% style="color: rgb(0,0,0);font-family: SFMono-Medium , SF Mono , Segoe UI Mono , Roboto Mono , Ubuntu Mono , Menlo , Courier , monospace;" %)2,3{{code language="none"}}isolcpus={{/code}}(%%) (they count from 0) to the file {{code language="none"}}/boot/cmdline.txt{{/code}} and reboot. This will make sure that the operating system doesn’t schedule any tasks on those cores. 146 146 147 147 = Building and Running on Any Other Linux Machine = 148 148 149 -The program can be built and partially run on other machines. There you potentially need to install all the requirements yourself. However,{{code language="none"}}wiringPi{{/code}} is not needed. Also don’t use a machine where the current user is called {{code language="none"}}pi{{/code}}, since that would confuse the compilation flags. We’ve observed problems with a too old version for {{code language="none"}}make{{/code}},withoutknowing theexactlowerbound,4.2.1isdefinitelynew enough. Possibly {{code language="none"}}python2{{/code}} needs to be installed on your machine. Compared to a Raspberry Pi, compilation of {{code language="none"}}opencv{{/code}} on your machine is going to be a lot more fun (way faster and no issues with too little RAM).Regarding versions, see the relevant section above;note that {{code language="none"}}pkg-config{{/code}} is needed, too, in case you don’t have thatinstalled already.149 +The program can be built and partially run on other machines. There you potentially need to install all the requirements yourself. Just {{code language="none"}}wiringPi{{/code}} is not needed. Also don’t use a machine where the current user is called {{code language="none"}}pi{{/code}}. We’ve observed problems with a too old version for {{code language="none"}}make{{/code}}, for example 4.2 should be new enough. Possibly {{code language="none"}}python2{{/code}} needs to be installed on your machine. Compared to a Raspberry Pi, compilation of {{code language="none"}}opencv{{/code}} on your machine is going to be a lot more fun (way faster and no issues with too little RAM) Regarding versions, see the relevant section above, note that {{code language="none"}}pkg-config{{/code}} is needed, too, in case you don’t have that already. 150 150 151 -Running the {{code language="none"}}make{{/code}} commandsworks like on the Pi.Just {{code language="none"}}make capture{{/code}} is not available.The main program willbehave differently. It willprompt you for the name (without extension) of a video file in the {{code language="none"}}video{{/code}} folder. Make sure to get some filein there;at the time of writing this, there is a file called {{code language="none"}}1{{/code}}inthe mega.nz-folderthatyou can get via {{code language="none"}}make get{{/code}},as well as a few more namedvideofiles that were created before we had the {{code language="none"}}make capture{{/code}} command.151 +Running works like on the Pi. The main program will prompt you for the name (without extension) of a video file in the {{code language="none"}}video{{/code}} folder. Make sure to get some file, at the time of this writing there is a file called {{code language="none"}}1{{/code}} that you can get via {{code language="none"}}make get{{/code}} as well as a few more named files that were created before we had the {{code language="none"}}make capture{{/code}} command. 152 152 153 -After choosing a video file, the program starts using the video input in “real time”; however,since things are not really real-time, thelogiccontrollerpartdoes not work too well. (Simulating the flow of time properly is not fundamentally a problem but something we didn’t finish implementing.) This means youshouldmostly ignore the debug-printouts about ticks happening. What you canreallytestisthe image processing / ball detection. This works better than on the Pi, because we are providing controls for pausing or changing the playback speed.Press a key while any of the windows opened by the main program is in focus.153 +After choosing a video file, the program starts using the video input in “real time”; since things are not really real-time, the controller does not work too well. (Simulating time properly is not fundamentally a problem but something we didn’t finish implementing.) This means you can mostly ignore the debug-printouts about ticks happening. What you can do is test the image processing / ball detection. This works better than on the Pi, because we are providing controls for pausing or changing the playback speed. 154 154 155 155 (% class="wrapped" %) 156 156 |=((( ... ... @@ -190,5 +190,3 @@ 190 190 ))) 191 191 192 192 If you recalibrate the coordinate system on the Pi, you might want to transfer the config file for the coordinate system (however there is nothing really depending on the coordinate transformation being correct inside the image detection anyways). 193 - 194 -The ability to compiler the whole project off the Pi allows for catching type errors etc. more quickly, since compilation on the Pi tends to be a lot slower and also there‘s not the option to use the Kieler IDE on it (so you’d maybe also need to transfer the code). The {{code language="none"}}pinballProject{{/code}} folder contains an Eclipse project that can be used with Kieler. Building from the Kieler IDE still happens by invoking the Makefile. There should be a build configuration using {{code language="none"}}make{{/code}} included in the project. (I’m only specifying “should” since we didn’t really test the experience of importing the project into a workspace too often.)
- Confluence.Code.ConfluencePageClass[0]
-
- Id
-
... ... @@ -1,1 +1,1 @@ 1 -730727 351 +73072745 - URL
-
... ... @@ -1,1 +1,1 @@ 1 -https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/PP18/pages/730727 35/Dependencies and Compilation1 +https://rtsys.informatik.uni-kiel.de/confluence//wiki/spaces/PP18/pages/73072745/Dependencies and Compilation