/robowaifu/ - DIY Robot Wives

Advancing robotics to a point where anime catgrill meidos in tiny miniskirts are a reality.

Disappearing posts should be fixed. Let me know if the issue persists on irc.rizon.net @ #julayworld.


Warrant canary has FINALLY been updated.


Roadmap: file restoration script within a few days, Final Solution alpha in a couple weeks.

Sorry for not being around for so long, will start getting back to it soon.

Max message length: 6144

Drag files to upload or
click here to select them

Maximum 5 files / Maximum size: 20.00 MB

More

(used to delete files and postings)


Open file (457.29 KB 1600x1067 yummy_sepplesberries.jpg)
Open file (15.07 KB 306x344 ISO_C++_Logo.png)
Haute Sepplesberry Cuisine TBH Robowaifu Technician 09/04/2020 (Fri) 20:10:50 No.4969
Good morning /robowaifu/. For today's cooking-lesson class, we'll be baking up some delicious Sepplesberry Pies. First we prepare some crispy and light Pi crusts and get them just right, then we'll load them up with tons and tonnes of succulent and Juci Sepplesberrys. We'll also mix in lots of other tasty goodness then pop them into the oven and after a couple hours, voilà! delightful Sepplesberry Pies. >tl;dr ITT we mek C++ dev boxes from RaspberryPi computers >C++ development main thread >>4895 Embedded processors and integrated systems programming naturally go hand-in-hand for /robowaifu/. The RaspberryPi and C++ are natural baseline choices for each of these categories. At this point in time they are both popular concerns with large communities behind them, and each bring objective benefits for us as robowaifu technicians. For the Pis they are quite powerful relatively speaking, and inexpensive as well. For C++ it has great performance and other characteristics when used correctly, with generic abstraction mechanisms second to none. In an attempt to dovetail the two areas we're going to be going through setting up Raspberry Pis as little computers for learning the C++ programming language on. This should help every anon on /robowaifu/ that follows along to be on the same basic page for both embedded and programming. Once we're finished each of you will have your own little development exploration box you can literally carry around in your pocket. It will be self-contained, independent, and won't interfere with your other computing/vidya platforms. It will offer you a convenient way to begin controlling embedded hardware directly on the same machine that you write software for it on. This is a pretty compelling scenario IMO, and should serve us all as a good base from which we can branch out and grow from there. Working with other hardware and software will flow naturally from this project, and will give each of us a common experience from which we can build together and keep moving forward. So let's get started /robowaifu/.
Okay, I'm to busy with other stuff, but curious: What are you going to do with it exactly? ROS? Control of motors?
>>4973 >In an attempt to dovetail the two areas we're going to be going through setting up Raspberry Pis as little computers for learning the C++ programming language on. >ROS? Control of motors? ROS is definitely not in the plan for these little boxes, but stepper control is definitely on the list.
Nice, really appreciate it. Btw some other boards like Nvidia Jetson Nano, when I bought it they gave a disk image to download that's pretty much complete. I haven't booted it since before the pandemic and I don't remember if the disk image already had Tensorflow pre-installed, but basically they enroll you in a couple of courses that are free with the purchase, it seems that there are already a couple of built-in AI functionality which you access through JupyterLab. Of course, they want you to be beholden to their system. Perhaps later on with this R Pi-based system we can have a shareable disk image that will contain the essentials.
>>4982 >Of course, they want you to be beholden to their system. Jen-Hsun Huang needs a new black leather jacket bro! >Perhaps later on with this R Pi-based system we can have a shareable disk image that will contain the essentials. Very good idea Anon. Definitely on the TODO: list now. :^)
Open file (77.77 KB 658x611 Selection_005.png)
>Help! I want to learn too, but I don't have an RPi board yet. Nprb Fam, /robowaifu/ has you covered. Raspberry Pi offers a desktop spin of their platform. Since we'll have a standardized platform here, we'll be able to set them up identically and you can follow along with everyone who has their boards already. However, later on we'll be controlling the actual GPIO hardware pins themselves with C++, so you'll need to arrange to get yourself an RPi board by that point in time ofc (as well as a couple of inexpensive servos, etc.) The spin comes as a bootable ISO image that you install as a virtual machine on your normal computer. You should be using a (real, non-VM) Linux along with all of us as your base machine to do this. I'll be demonstrating setting up the RPi Desktop image running under QEMU/KVM, on the Arch Linux derivative Manjaro. If you're still on Windows or macOS, then you can just use VirtualBox to do the setup. First things first, go and grab a copy of 3GB image 2020-02-12-rpd-x86-buster.iso from www.raspberrypi.org/downloads/raspberry-pi-desktop/ and we'll get started.
To setup QEMU, etc., on your Manjaro Linux machine just follow the instructions on this wiki page: https://wiki.manjaro.org/index.php?title=Virt-manager Namely, enter: sudo pacman -S virt-manager qemu vde2 ebtables dnsmasq bridge-utils openbsd-netcat then run libvirt: sudo systemctl enable libvirtd.service sudo systemctl start libvirtd.service That will get you up and running with QEMU and the Virtual Machine Manager front-end.
Open file (76.32 KB 413x569 Workspace 1_011.png)
Open file (17.59 KB 380x167 Workspace 1_014.png)
Open file (28.28 KB 504x530 New VM_015.png)
Open file (25.59 KB 504x530 New VM_016.png)
1. You can find the Virtual Machine Manager under Manjaro's System menu. 2. Double-click the User session item to connect. 3. Click the '+' to create a new virtual machine. 4. Choose Local install media. 5. Browse local to the downloaded ISO image.
1. Enter Debian 10 in the 'Choose the operating system' field. 2. Just click-through steps 3 & 4, then enter RPi_Desktop in the 'Name' field. 3. Use the arrow key and arrow-down to 'Graphical Install' . -NOTE: Left-ctrl + Left-alt will give you back the mouse cursor. 4. Resize the window by View > Resize to VM, and click 'Continue' . 5. Choose 'Guided - use entire disk' .
1. Continue 2. Continue 3. Continue 4. Choose 'Yes' 5. Go grab some coffee or tea. :^)
1. Choose 'Yes' 2. Choose '/dev/vda' 3. Continue 4. Just let it reboot into 'Debian GNU/Linux' or as I’ve recently taken to calling it, GNU plus Linux :^) 5. Resize the window again View > Resize to VM . Congrats Anon! You have Raspberry Pi up and running on your machine w/o having to have the embedded board.
An additional alternative (that we'll specifically be using later on when we no longer need/want a GUI on the target hardware) is to use the raspi-lite setup to run under QEMU: Raspbian Lite zip-archive: https://downloads.raspberrypi.org/raspbian_lite/images/raspbian_lite-2020-02-14/2020-02-13-raspbian-buster-lite.zip Kernel image: https://github.com/dhruvvyas90/qemu-rpi-kernel/blob/master/kernel-qemu-5.4.51-buster Device tree blob: https://github.com/dhruvvyas90/qemu-rpi-kernel/blob/master/versatile-pb-buster-5.4.51.dtb
Time for the real hardware, Anon. Alright, we're going to go ahead and set up the real RaspberryPi hardware for our C++ Learning Project now. I looked around in my pile of gear and found an older RPi device. It's an RPi 2b v1.1, copyright 2014. This is a 900Mhz device, 4 cores, with 1GB of RAM. If we can manage our little programming class project successfully on this older hardware, then we can surely do it on your newer Raspberry Pi of today, Anon. :^) I'm planning to work with this hardware headless (no monitor), attached directly via Ethernet to my main box. The main box will be providing network access for the RPi hardware through the Shared to other computers method via it's Ethernet port out to the RPi. I'll be using a separate, inexpensive (~ US$20.00 ) keyboard with a built-in touchpad to run the RPi (just until we get the VNC server set up properly). This keyboard provides a mouse+keyboard dongle that we'll plug into one of the RPi's USB ports. I'll be using an 8GB MicroSD card to hold the RPi system. A larger one would be fine, but it'd be best if you don't try to use a smaller one. > #1 Insert it into it's adapter (as needed) and put it into your main box > #2 Let's go ahead and download the ~2.5GB zip file we'll be using for our real hardware image, saving it onto our main box. https://www.raspberrypi.org/downloads/raspberry-pi-os/ We'll use the '...with desktop and recommended softfware' version. > #3 Then cd into it's download directory from the terminal shell. Now that we have the file downloaded, we can write it out to our MicroSD card using the linux command dd. IMPORTANT: Figure out ahead of time exactly what the name of the MicroSD device is on your system. https://www.raspberrypi.org/documentation/installation/installing-images/linux.md An alternative to the instructions in the above link is just to use GParted to determine the MicroSD device name. Since we're going to use GParted later on with the actual RPi system, we'll go ahead and use that: > #4 -It's also convenient enough to just unmount the device directly inside GParted as needed. > #5
>>5165 As mentioned, we'll use dd to write the downloaded image out to the MicroSD disk. https://tldp.org/LDP/abs/html/extmisc.html I'm going to combine unzip and write in one Bash statement, so in my specific case, the command is: unzip -p 2020-08-20-raspios-buster-armhf-full.zip | sudo dd of=/dev/mmcblk0 bs=4M conv=fsync > #1 In a few minutes the image should be written out to the device. > #2 Checking again with GParted, we see you now have a fat32 /boot partition, and an ext4 /rootfs partition. > #3 Because of a setting with the bootloader (in regards to the next step), let's go ahead and move /rootfs to the end of the drive space. This will take several minutes to finish. > #4 There is an unallocated block of 668MB, so we may as well go ahead and create a swap file there. > #5 >=== -'/rootfs' instead -add code-block
Edited last time by Chobitsu on 10/02/2020 (Fri) 01:58:29.
Open file (1.20 MB 2560x1600 20200915_031829.jpg)
Open file (798.42 KB 2560x1600 20200915_044816.jpg)
>>5166 Turn swapon. > #1 Unmount the partitions, and eject the MicroSD card from your main box, then insert it into the RPi hardware drive slot (from the bottom side of the board). > #2 Connect the Ethernet cable, HDMI video cable, mouse+keyboard dongle, and then power it up. Once it boots up, click the Cancel button on the initial 'Welcome to Raspberry Pi' dialog that first pops up. We'll deal with updates a little later. > #3
>>5167 Alright that's it for today class. If you've followed along successfully, congrats. You've begun a journey into embedded computing. :^) We'll continue on with the RPi preliminaries soon. As always, if you get stuck or have any questions just ask ITT. Cheers
Open file (71.94 KB 407x481 Workspace 1_069.png)
Open file (53.34 KB 627x469 Workspace 1_070.png)
Open file (133.35 KB 1366x768 Workspace 1_044.png)
Alright, there are a couple of things to get set up on the main box as well so we can work with our SepplesberryPi w/o having to use either a monitor, keyboard, or mouse connected to it. We'll connect it directly to our main box with an Ethernet cable for it's networking. IIRC, I think W*ndows calls this Internet Connection Sharing, but ofc we'll be using Linux instead. So, I use the WiFi for my main box's Internet access. This leaves the Ethernet wired port available. And it's this port we'll set up for the RPi to get out to the network with. You configure the settings on your main box to bridge the two connections (and this will also provide DHCP settings for any incoming clients connecting through the Ethernet port). For the RPi, you don't have to do anything special, it just werks. BTW, YMMV. This setup is workable for my specific situation. You may want to connect yours straight into your router, or across the WiFi, etc. Just make sure you can figure out what it's IP address is afterwards b/c you'll need it for the other step. Then, we'll use VNC to control our RPi remotely. The RPi has the VNC server software already installed, but we'll need to install the viewer software on our main box. Once everything's set up, you'll no longer need to use those other peripherals to work on your RPi dev box. Go ahead and plug the two boxes together with the Ethernet cable in between. On your main machine, choose 'Advanced Network Configuration'. > #1 Select the Ethernet connection, then click the little gear for 'Edit the selected connection'. > #2 Choose IPv4 Settings > Method > Shared to other computers then save. > #3 That should be all that's needed. Power cycle your RPi and it should now have an IP address given to it by your main box, and should be able to get out to the Internet as normal also. If things don't quite work for you at first, you might check the ip addresses on your main box with ifconfig, and also try pinging some known-good domain to make sure there's not any issues with the main box itself. As always, you can ask questions ITT.
>>5214 On the RPi, we see scrot is already installed by default, and that we have only 408 MB free on the drive. We'll free some space up before we're done. Let's go ahead and set up VNC then we'll no longer need the physical keyboard+mouse, nor the HDMI monitor attached to our RPi hardware. Select [RPi Menu] > Preferences > Raspberry Pi Configuration > #1 Enable SSH & VNC. > #2 Now check your IP address under the VNC Server applet, you'll need this address for the viewer on your main box. > #3
>>5216 Alright, that's got the VNC server running on the RPi sorted, now let's get the client up on our main box. I'm just going to use the Pamac graphical software installer tool for it. > #1 Start the viewer software and then enter the IP address from the RPi you got in the previous step. The client software will warn you this is an unrecognized server, click 'Continue' . > #2 Congrats Anon, you're now jacked in: > #3
>>5257 Alright, now that we have everything working for us to remote into the RPi, I'm going to go headless with mine. After powering the RPi box down, I'm unplugging the keyboard, mouse, and HDMI monitor connection. I'm also going to unplug the Ethernet cable, b/c in my final setup, I'll be moving the RPi to the server room and connecting it directly into my internal router. I'll still use my main box to run it remotely by using it's new IP address. In your case, you can feel free to continue using your 'Shared to other computers' connection, and that way if you don't have a router handy your RPi can run that way. So, once I moved the RPi and got the new IP address to use for a new VNC client connection, I see this: > #1 Other than the obvious security warning, you notice that the screen dimensions have also gotten much smaller (they previously auto-adjusted to the HDMI monitor I had plugged in for the initial RPi setup). Click 'OK', then select Select [RPi Menu] > Preferences > Raspberry Pi Configuration > Change Password > #2 While we're in here, we may as well go ahead and fix the display too. Display > Set Resolution 1280x720 will be good enough in my case. > #3 Now drag the dialog up as far as you can, to just be able to see the 'OK' button hiding at the bottom... > #4 ...and click it to reboot, enter your new password, and see the new changes. Change your [RPi Menu] > Preferences > Appearance Settings > Picture to something better and click OK. > #5 There, that's better! :^)
As mentioned, we'll free some space up on our RPis. We should also update them as well. Ever have to juggle apps on your phone's limited space? This is a little like that. Also, if anyone has good advice here on this general topic of system/storage cleanup, please speak up here ITT. :^) So, on my RPi, I'm going to purge unused locales and LibreOffice. In a terminal, run sudo apt-get install localepurge then select 'OK' > #1 Since en_GB.UTF-8 is already selected (by default), just go ahead and select 'OK' again to purge everything. Select 'Yes' when asked about the dpkg setting. Then we can remove the locale files themselves: sudo rm -rf /usr/share/locale > #2 That will free a few hundred meg. Let's purge LibreOffice to free more: sudo apt-get remove --purge libreoffice* sudo apt-get clean sudo apt-get autoremove So, altogether that gives us a little more than a gig free. > #3 UPDATE >Read the full post before proceeding Anon... That should be enough room, so let's go ahead and upgrade everything now: (this will take a good while, probably around 60 minutes. start htop in another terminal tab if you'd like to watch over the system during this period) sudo apt-get update && sudo apt-get upgrade -Update: Turns out, 1.1GB wasn't enough to upgrade Wolfram along with everything else (no space left on device error). :/ > #4 I planned on removing it and other software on my RPi anyway (since it's not about learning C++) so I'll go ahead and remove it and other programs to free up even more room, and we'll try again.
Open file (571.33 KB 1284x726 1.png)
Open file (608.80 KB 1366x768 2.png)
Open file (627.34 KB 1366x768 3.png)
>>5264 Alright, I'm going to go ahead and remove several of the programming systems to free up room, in particular Wolfram is quite large for our small system. Pick and choose your own choices for deletion, ofc. (In particular, if you've never programmed before, I'd recommend looking at Scratch as well as taking our C++ class). sudo apt-get remove --purge wolfram* sudo apt-get remove --purge bluej* sudo apt-get remove --purge thonny* sudo apt-get remove --purge greenfoot* Then, do another autoremove to pick up stragglers: sudo apt-get clean sudo apt-get autoremove That gives us over 3 gigs free now. > #1 NOTE: If you didn't run this from the previous post b/c you saw the update about the issue with wolfram, then you should run this now: sudo apt-get update && sudo apt-get upgrade Remember, that swap partition on the drive from before? Let's go ahead and activate it now. I'll use GParted installed right on the RPi itself this time. sudo apt-get install gparted After installation, you can find it in [RPi Menu] > System Tools > GParted Highlite the 668MB partition and choose 'Swapon' > #2 You can quickly check that you have the 768M swap now with htop > #3 Alright, that gives us plenty of room for our next steps, setting up a powerful C++ tooling system on our RPi box. We'll do that next. >=== >-removed Scratch from the deletion list, since there was enough room for it after all >-added note about running upgrade
Edited last time by Chobitsu on 09/23/2020 (Wed) 10:33:02.
Alright first things first, we'll set up the prerequisites for my favorite open-source C++ IDE on Linux. https://gitlab.com/cppit/jucipp > #1 sudo apt-get install libclang-dev liblldb-dev || sudo apt-get install libclang-6.0-dev liblldb-6.0-dev || sudo apt-get install libclang-4.0-dev liblldb-4.0-dev || sudo apt-get install libclang-3.8-dev liblldb-3.8-dev sudo apt-get install universal-ctags || sudo apt-get install exuberant-ctags sudo apt-get install git cmake make g++ clang-format pkg-config libboost-filesystem-dev libboost-serialization-dev libgtksourceviewmm-3.0-dev aspell-en libaspell-dev libgit2-dev We can go ahead and install Mesonbuild as well. sudo apt-get install meson Now, let's pull the repo, then build and install juCi++ itself. (this will take a good long while (~30min) to finish during the make step, you might want an htop tab open again. also, ensure your big swapfile is on, you might just need it! :^) git clone --recursive https://gitlab.com/cppit/jucipp mkdir jucipp/build cd jucipp/build cmake -DCMAKE_CXX_COMPILER=g++ .. make -j2 sudo make install The installed executable name is simply juci > #2 Use mousepad editor to edit the ~/.juci/config/config.json file with these edits: "variant": "dark" and "style": "juci-dark-blue" and "font": "Noto Sans Mono 16" > #3 Then restart and you should have a nice dark theme. Create a simple C++ project, then Project > Compile and Run > #4 #5 You should see why I appreciate this simple-looking IDE soon I imagine. Well, I think that's more than enough for today's class, and a good stopping point. So we'll pick up with the rest of the tooling setup next time (we're almost there). Cheers.
>>5270 Quick update I noticed afterwards looking at #4 & #5 that the source font wasn't monospaced. Checking further, sure enough Noto Sans Mono font was missing (probably wiped during the LibreOffice purge). So we'll go ahead and grab all those fonts again. -On the RPi box, start Chromium and go to: https://www.google.com/get/noto/ filter for Noto Sans Mono and then download the zip file > #1 -Extract the fonts out > #2 -Then start a terminal and enter cd /usr/share/fonts/truetype/noto sudo cp /home/pi/Downloads/NotoSansMono*.ttf . sudo chmod 644 *.ttf ls -lah > #3 -Now restart juci and confirm the source editor pane is in fact now using the Noto Sans Mono font > #4 Sorry about that little oversight class. :^)
>>5289 Additional minor update Looking at the screen capture from this post, I wasn't too pleased with the font rendering inside the editor. I managed a minor improvement for it by setting the [RPi Menu] > Preferences > Appearance Settings > Defaults to the 'For medium screens:' selection. > #1
I'm also going to turn on the 80-char indicator, and add a shortcut keys for Zen mode to juci. Use mousepad editor to edit the ~/.juci/config/config.json file with these edits: "show_right_margin": true "window_toggle_zen_mode": "<primary><alt>z" Here's the zen mode activated: > #2 Even more simple focus with juci F-11'd > #3
>>5292 >>5291 I also noticed that I could further improve the font rendering in the editor if I changed the font in the gtk_theme section as well: "font": "Arial 16" > #1 To my eye, it seems to crispen up the entire window's fonts for some reason. > #2
OK, let's finish setting up the tooling for our SepplesberryPi machines, and then we can move on with the beginnings of our C++ class instead of all this boring sysadmin-type stuff! :^) Let's go ahead and install a package manager called synaptic onto our RPis first: sudo apt-get install synaptic Once it's installed, you can find it under [RPi Menu] > Preferences > Synaptic Package Manager > #1 It's a convenient tool for getting quick insights into package's installation status, etc. For example, let's search for the llvm-toolchain tool clang-format: > #2 You can see that clang-format-7 has been installed already, but we actually want the newer version 9 instead. So, we can use synaptic to remove the old version and install the new version in it's place. -Select the two installed versions (ctrl+click), then right-click and choose Mark for Complete Removal. > #3 -Then select clang-format-9, right-click and Mark for installation -Click 'Apply' (it's the little paper airplane icon) Once everything's completed you should see this: > #4 clang-format version 9 is installed now. But we still need to set up a symlink for the new version so we can use just the shortcut name clang-format w/o having to pay attention to the version number. First out of curiosity, we can see what's listed for the tool now: ls -lah /usr/bin | grep 'clang-format' and see it's a symlink: clang-format-9 -> ../lib/llvm-9/bin/clang-format Now let's create a new one for the shortcut term: sudo ln -sf /usr/bin/clang-format-9 /usr/bin/clang-format Now we can check the version with the short name and see everything's updated for the new version now: > #5
>>5309 OK, now let's basically repeat the entire process to setup another powerful llvm-toolchain tool, clang-tidy. -Search 'clang-tidy' in Synaptic: > #1 -Mark clang-tidy-9 for installation and accept the additional changes: > #2 -Apply the changes. Let's see what version is installed on the system now, from the terminal: ls -lah /usr/bin | grep 'clang-tidy' > #3 -Let's create the shortcut name symlink and check the version number as well. sudo ln -sf /usr/bin/clang-tidy-9 /usr/bin/clang-tidy clang-tidy --version > #4
>>5310 Alright, let's finish up installs for now by adding a few useful utilities, and the amazing text editor Vim into the mix. sudo apt-get install iftop nethogs tmux vim > #1 If you're new to Vim, be sure to try the vimtutor 30minute tutorial first, Anon! vimtutor > #2
Alright, let's create a couple of config files and we should be all set for C++ class this weekend. Clang-tidy is a powerful linting tool that helps uncover buggy code. Don't leave home without it. :^) https://releases.llvm.org/9.0.0/tools/clang/tools/extra/docs/clang-tidy/index.html Let's use it to create an initial config file, which we can then tweak. We'll create both files in our pi home directory. cd then clang-tidy --format-style=chromium --dump-config > .clang-tidy Let's have a look inside the file that was created. mousepad .clang-tidy > #1 You don't have to understand any of this atp, and the only thing we're interested in for now is the very first key value in the file: Checks Checks: 'clang-diagnostic-*,clang-analyzer-*'' We're going to add several entries in addition to the two there now. The easiest way for you to do this will simply be to hilight the whole line #2, then copy+paste all this text over top of it: Checks: 'clang-diagnostic-*, clang-analyzer-*, modernize-*, -modernize-use-trailing-return-type, cppcoreguidelines-*, -cppcoreguidelines-avoid-magic-numbers, bugprone-*, readability-*, -readability-magic-numbers, cert-*, misc-*, performance-*, hicpp-*' So, if you've done it right, then your .clang-tidy file will now look like this. > #2 Be sure to save it. >=== The other important tool we need a config file for is clang-format. It's a remarkable tool to always keep the C++ software code files you (or others) create looking consistent, and formatted properly. https://releases.llvm.org/9.0.0/tools/clang/docs/ClangFormat.html Creating a config file for it is similar to clang-tidy. Enter this in the terminal: clang-format -style=chromium -dump-config > .clang-format > #3 and we'll just leave that one as is for now (but feel free to look inside it ofc).
Well, believe it or not we're finally done >implying Heh, at least that should be enough for us to go on with for now. :^) I may redo this entire thread one day from the lessons I learned creating it to make it more straightforward and easier to work through. My apologies for it being the mess that it is try to do better next time. Anyways, onward!! >>4895
>>5313 Thanks anon, this should save me a bit more money in my robowaifu endeavors, btw is it possible to implement this into a raspberry pi tower?
>>5320 nprb, y/w. >RPi tower if i understand you correctly, then yes. there are numerous examples of RPi Beowulf clusters out there. our Robowaifu-OS & Robowaifu-Brain(cluster) thread talks about it. >>201
Not too surprisingly, I forgot at least one step, namely we need short name symlinks for the clang compilers and debugger. from the terminal: sudo ln -sf /usr/bin/clang-9 /usr/bin/clang sudo ln -sf /usr/bin/clang++-9 /usr/bin/clang++ sudo ln -sf /usr/bin/lldb-9 /usr/bin/lldb Now we can check the versions: > #1
>>5270 One thing I didn't go over for when it's needed, is how to update a local git repo and rebuild/reinstall it (whenever the source repo is updated with new software for example). Switch into the same local repo and git pull: cd jucipp git pull Since this is a repo with submodules, you should update those as well for good measure: git submodule update --init --recursive git submodule foreach --recursive git fetch git submodule foreach git merge origin master Then do the typical cmake/make dance again: cd build cmake -DCMAKE_CXX_COMPILER=g++ .. make -j2 sudo make install And actually, since we switched the llvm-toolchain dev libraries over to version 9 earlier, you should go ahead and rebuild your juci IDE anyway since it depends on those libs.
BTW, I'd suggest you regularly update your system yourself. My impression is that the Raspberry Pi Foundation's approach to this is a bit lax. sudo apt-get update && sudo apt-get upgrade
>>5313 Thanks mate, great tutorial! Apologies, I only just had a look at it. I picked a some things that I'll take away, like VNC and the juci IDE. Have you used Code Blocks? That's the one I use for C development (the subleq assembler) at the moment. Not sure how the two compare, but I'll give it a go later. C++ is definitely attractive, as long as I can optimise it sufficiently. Having namespaces would be REALLY nice XD Thanks again anon!
>>5426 Sure thing, you're welcome mate. >Have you used Code Blocks? Yes, I've both used it, and it's available in the RPi (Buster) repos at v17. Give it a try on the RPi if you'd like (I'd suggest trying Geany first though). Juci++ does a much better job of supporting the llvm/clang toolchain directly, which IMO is basically indispensable ATP. It also directly supports both CMake and the more modern Meson build systems, again, an indispensable item on the checklist. Plus for my tastes, I much prefer the simplified interface for the IDE the guys have chosen to implement for it. It's not perfect, but it's definitely my favorite IDE for writing C or C++ code on Linux with. I think we'll pretty much show that modern C++ brings a lot of benefits to the table for embedded development.
>>5427 >Juci++ does a much better job of supporting the llvm/clang toolchain directly, which IMO is basically indispensable ATP. It also directly supports both CMake and the more modern Meson build systems, again, an indispensable item on the checklist. Plus for my tastes, I much prefer the simplified interface for the IDE the guys have chosen to implement for it. It's not perfect, but it's definitely my favorite IDE for writing C or C++ code on Linux with. Sure, no you definitely sold juci for me ;) >I think we'll pretty much show that modern C++ brings a lot of benefits to the table for embedded development. Actually watched a lecture by this training company (duolos) on embedded c++, and saw some really good features, some of which C seems to have taken. Definitely replacing preprocessor directives with constants and inline functions will save time and hassle as the compiler can help you. Not sure about the iostreams though, seems to be very (and perhaps too much for embedded) complex. Basically one needs to write it much more carefully than on a general computer, as I can see memory requirements become very large.
>>5430 >Not sure about the iostreams though, seems to be very (and perhaps too much for embedded) complex. I get you on that. But one of the great features about C++ streams is they are both type-aware and type-safe. They also have quite sophisticated transformations built right it. But yes, not all embedded devices will afford us the luxury of the SBC-class machines, and for them, avoiding the use of streams makes sense. One very nice thing about C++ from the very beginning is the principle You don't pay for what you don't use ( the zero-overhead principle https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#inaims-aims ).
>>5432 *very* interesting....thanks anon. Now you made me want to read the c++ books damn it XD
>>5434 Haha, no need to rush Anon. I expect the C++ learning thread will go on for at least one year, Lord willing. I think you'll pick it up rather organically if you follow along with us (at least that's one of my goals in doing it). Take your time.
OK, Anon very graciously offered to make the effort to port his amazing WaifuSynth & Clipchan projects over to mlpack so anons can use them on older/smaller hardware, and to be freed from Big Tech stranglehold on our robowaifus. >>5718 >In a few months I'll definitely see if I can port Spleeter and WaifuSynth to mlpack. That would completely disentangle ourselves from Facebook and Google and be a huge step forward to keeping AI open. So, in an effort to both encourage him in this big undertaking, and to make a simple validation of the basic idea on our little RPi boxes, let's install mlpack and create the basic Nearest Neighbor 'hello world' test project for it. -Open synaptic & search 'mlpack'. Mark all 4 items that show up for installation. You can examine all the things with the 'Show Details' button. > #1 #2 -Visit mlpack.org and you'll see they have the basic example right on the front page. We'll use this as copypasta for our own project. > #3 -Fire up Juci and create a project. I'm naming mine 'mlpack_test' > #4 -Delete the .clang-format file from the project, so it uses our better one in our home directory. -Open the CMakeLists.txt file and make these three changes: -change -std=c++1y to -std=c++17 -add -fopenmp flag -add mlpack target_link_libraries line > #5
>>5730 Be sure your swapfile is on anon, you'll need it heh! :^) > #1 Replace the basic main.cpp code with the example code from mlpack.org, and build (ctrl+enter). This will take a while b/c raisins, and you'll get a number of 'parameter passing changed in GCC 7.1' alerts. You can gnore them. If all went well, you should see pic related. > #2 Nearest neighbor of point 0 is point 3 and the distance is 0.449757. Nearest neighbor of point 1 is point 2 and the distance is 0.918409. Nearest neighbor of point 2 is point 1 and the distance is 0.918409. Nearest neighbor of point 3 is point 0 and the distance is 0.449757. We can see these outputs precisely match the test values on their website. Congrats Anon, you now have the power of AI in your hands on your SepplesberryPi! :^) >=== -add 'ctrl+enter' note -minor prose edit
Edited last time by Chobitsu on 10/16/2020 (Fri) 21:41:06.
>>5731 >main.cpp // This is an interactive demo, so feel free to change the code and click the // 'Run' button. // This simple program uses the mlpack::neighbor::NeighborSearch object // to find the nearest neighbor of each point in a dataset using the L1 metric, // and then print the index of the neighbor and the distance of it to stdout. #include <mlpack/core.hpp> #include <mlpack/methods/neighbor_search/neighbor_search.hpp> using namespace mlpack; using namespace mlpack::neighbor; // NeighborSearch and NearestNeighborSort using namespace mlpack::metric; // ManhattanDistance int main() { // Load the data from data.csv (hard-coded). Use CLI for simple command-line // parameter handling. arma::mat data( "0.339406815,0.843176636,0.472701471; \ 0.212587646,0.351174901,0.81056695; \ 0.160147626,0.255047893,0.04072469; \ 0.564535197,0.943435462,0.597070812"); data = data.t(); // Use templates to specify that we want a NeighborSearch object which uses // the Manhattan distance. NeighborSearch<NearestNeighborSort, ManhattanDistance> nn(data); // Create the object we will store the nearest neighbors in. arma::Mat<size_t> neighbors; arma::mat distances; // We need to store the distance too. // Compute the neighbors. nn.Search(1, neighbors, distances); // Write each neighbor and distance using Log. for (size_t i = 0; i < neighbors.n_elem; ++i) { std::cout << "Nearest neighbor of point " << i << " is point " << neighbors[i] << " and the distance is " << distances[i] << "." << std::endl; } return 0; } >CMakeLists.txt cmake_minimum_required(VERSION 2.8) project(mlpack_test) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -Wall -Wextra -fopenmp") add_executable(mlpack_test main.cpp) target_link_libraries(mlpack_test mlpack)
Alert There's a 0-day software exploit that's been discovered regarding the FreeType library. >>6004 Your RPi machines are vulnerable to this, so please follow the instructions Anon generously provided in that post (download the zip, unzip, cd into that directory, &tc). Just change the last confirmation command to this instead as your filename is different on your RPis: ldd /usr/lib/chromium-browser/chromium-browser | grep freetype
>>6009 BTW, as already mentioned ITT, but worth mentioning again here, you ought to regularly keep your RPis updated manually, as they aren't very good at keeping themselves up to date currently. sudo apt-get update && sudo apt-get upgrade

Report/Delete/Moderation Forms
Delete
Report

Captcha (required for reports)

no cookies?