Category Archives: Uncategorized

Link Collection

There are so many interesting things in the web that I just want to preserve for later.

Revisit later

Triangula – Create high quality triangulations from images
(https://github.com/RH12503/Triangula)

Raspberry Pi Build HAT – Connect Lego Power Functions to a Raspberry Pi (https://www.raspberrypi.com/products/build-hat/)

Implicitication using moving curves and surfaces (https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.32.7968&rep=rep1&type=pdf)

Lego Microscope (https://github.com/tobetz/LegoMicroscope)

Hardware

Flexible circuit wind generator (https://hackaday.io/project/181882-flexible-circuit-wind-generator)

Adderini – 3D Printed Repeating Slingbow Pistol (https://legolini.com/adderini_pistol.php)

Robotics

Stanley – the capstan based quadruped (https://hackaday.io/project/176726-stanley-the-capstan-based-quadruped)

moteus brushless controller (https://hackaday.io/project/179234-moteus-brushless-controller)

A High Torque 3D Printed Harmonic Drive (https://hackaday.com/2021/05/24/a-high-torque-3d-printed-harmonic-drive/)

Small Robot with Stepper motors (https://github.com/SkyentificGit/SmallRobotArm)

Software

Floppinux – An Embedded 🐧Linux on a Single đŸ’ŸFloppy (https://bits.p1x.in/floppinux-an-embedded-linux-on-a-single-floppy/)

Image to Lithophane Generator (https://lithophanemaker.com/)

Projects

Electrochemical machining

Machining Steel with (Electroplated) Plastic (https://amosdudley.com/weblog/Experiments-with-Desktop-ECM)

Electrochemical machining (https://hackaday.com/2013/10/27/electrochemical-etching-with-a-microcontroller/)

Machining without machines (https://hackaday.com/2020/12/18/machining-without-machines/)

Origami

Origami Starshade template – fold flatpack solar cell to “cube” (https://www.jpl.nasa.gov/edu/pdfs/starshade_template.pdf)

Origami Simulator (https://github.com/amandaghassaei/OrigamiSimulator)

Computer graphics

Approximate Differentiable One-Pixel Point Rendering (https://arxiv.org/abs/2110.06635)

Fast temporal reprojection without motion vectors (JCGT) (https://jcgt.org/published/0010/03/02/)

Fast Volume Rendering with Spatiotemporal Reservoir Resampling (https://dqlin.xyz/pubs/2021-sa-VOR/)

Intersection-free Rigid Body Dynamics (https://ipc-sim.github.io/rigid-ipc/)

Simple Vulcan Path Tracer (https://github.com/nvpro-samples/vk_mini_path_tracer)

Papers by Miles Macklin (http://blog.mmacklin.com/publications/), specifically Local Optimization for Robust Signed Distance Field Collision (https://mmacklin.com/sdfcontact.pdf)

Resources for Computer Graphics, especially Siggraph paper collections (http://kesen.realtimerendering.com/)

A Massively Parallel and Scalable Multi-GPU Material Point Method (https://sites.google.com/view/siggraph2020-multigpu)

Programming

Cmake

Modern CMake (https://cliutils.gitlab.io/modern-cmake/)

Rust

Collection of High Quality Rust libraries (https://jondot.medium.com/12-killer-rust-libraries-you-should-know-c60bab07624f)

C++

Polyscope library for visualization (https://polyscope.run/)

Geometry Central (https://geometry-central.net/)

Concise Result Extraction in Modern C++ (https://davidgorski.ca/posts/concise-result-extraction/)

Using C++17 to Create Composable, Recursive Data Types (https://davidgorski.ca/posts/recursive-data-types-cpp/)

Data structures

Triangle Grids (https://www.boristhebrave.com/2021/05/23/triangle-grids/)

Multidimensional array views (https://gist.github.com/pervognsen/0e1be3b683d62b16fd81381c909bf67e)

SQL

Modern SQL (https://vimeo.com/289497563)

Math

Geometric Algebra Resources (https://bivector.net/)

Projective Geometric Algebra (http://projectivegeometricalgebra.org/)

Some zfs commands

Query status of pool:

zpool status

Check filesystem:

zpool scrub tank

Create snapshot with name derived from current date:

zfs snapshot tank/data@'date +%Y-%m-%d' (Replace ' with backticks)

List snapshots:

zfs list -t snapshot

Destroy snapshot:

zfs destroy tank/data@snapshotname

Send snapshot over network:

zfs send tank/data@snapshot  | ssh root@192.168.1.1 zfs recv tank/data

Send snapshop unencrypted, but very fast via nc:

nc -w 120 -l -p 8000 | zfs receive tank/data
zfs send tank/data@snapshot | nc -w 20 192.168.1.1 8000

Send incremental snapshots:

zfs send -i tank/data@snapshot1 tank/data@snapshot2  | zfs recv anothertank/data

In case there are changes on the destination filesystem, the snapshot cannot be added and need to be rolled back. This can be done automatically using the -F flag:

zfs send -i tank/data@snapshot1 tank/data@snapshot2  | zfs recv -F anothertank/data

Start transfer and detach process, so shell can be closed. Useful for very long running transfers:

sudo -b nohup sh -c "sudo zfs send backup/archiv@2017-11-04 | sudo zfs recv extern/archiv"

Edit mount point:

zfs set mountpoint=/mnt tank/data

Streaming video with raspberry pi camera

Here is a collection of different ways to stream videos from a raspberry pi with a pi camera.

Lowest latency in my experiments: rpicamsrc g-streamer plugin

This requires the g-streamer rpicamsrc plugin. Google for it.

Source: gst-launch-1.0 rpicamsrc preview=0 bitrate=4000000 exposure-mode=6 intra-refresh-type=2 hflip=TRUE vflip=TRUE ! 'video/x-h264, width=1280, height=720, framerate=49/1,profile=high' ! h264parse ! rtph264pay config-interval=1 pt=96 ! udpsink host=192.168.5.63 port=9001
Destination: gst-launch-1.0 -v udpsrc port=9001 caps='application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264' ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink sync=false

RAW udp streaming with netcat

Source: raspivid -n -ih -pf high -h 480 -w 640 -t 0 -hf -vf -fl -b 2000000 -o - | nc 192.168.5.63 5000 -u
Destination: netcat -l -p 5000 -u | gst-launch-1.0 -v fdsrc ! h264parse ! avdec_h264 ! videoconvert ! autovideosink sync=false

RTP Streaming with gstreamer

Source: raspivid -n -hf -vf -pf baseline -w 800 -h 600 -fl --intra 10 -t 0 -b 2000000 -o - | gst-launch-1.0 -v fdsrc ! h264parse ! rtph264pay config-interval=1 pt=96 ! udpsink host=192.168.5.63 port=9001
Destination: gst-launch-1.0 -v udpsrc port=9001 caps='application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264' ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink sync=false

 

Getting started with Software Defined Radio (SDR), bladeRF, GnuRadio, Osmocom, GQRX

Strategy

Many tutorials already exist, that cover building bladeRF drivers, Gnuradio, Osmocom and GQRX from source. The main difference here is, that I will NOT install the built packages into my system directories or modify system files. Instead I will keep them separately in a folder in my home directory and use a startup script, that temporarily sets up the environment using the software. That way I can just delete the folder, reboot and I have a “clean” system again.

Why should I go this way? Well, I like to experiment a lot, sometimes I’m working on several projects in parallel. That also includes messing up stuff. The described strategy offers the easiest way to clean up and start over again without reinstalling the operating system.

Let’s get started

I’m starting off with a fresh Ubuntu 13.10 (beta) here. First we install several packages that set up the build environment.

sudo apt-get install git g++ cmake cmake-curses-gui libboost-all-dev libfftw3-dev libcppunit-dev python swig python-numpy doxygen python-cheetah python-gtk2-dev libgsl0-dev qt-sdk libqwt-dev python-qt4-dev python-qwt5-qt4 jackd qjackctl libsdl1.2-dev liblog4cpp5-dev phonon-backend-gstreamer phonon-backend-vlc libusb-1.0-0-dev libtecla1-dev python-wxgtk2.8 wx2.8-headers libjack-jackd2-dev

Let’s build stuff. Run these steps without superuser priviledges and change the pathnames according to your system. You will notice, that I use ccmake instead of cmake. This is a convenient tool to inspect and edit the available build settings. You could also go with cmake using the apropriate command parameters.

Building gnuradio

git clone http://git.gnuradio.org/git/gnuradio.git
cd gnuradio
mkdir build
cd build/
ccmake ../

Edit CMAKE_INSTALL_PREFIX: /home/matthias/downloads/sdr/installed

make
make install

Building bladeRF libraries

git clone https://github.com/Nuand/bladeRF.git
cd bladeRF/host
mkdir build
cd build/
ccmake ../

Edit CMAKE_INSTALL_PREFIX: /home/matthias/downloads/sdr/installed
Set INSTALL_UDEV_RULES to OFF

make
make install

There might be errors about not beeing able to install some rules to a system directory. Ignore this for now.

Build RTL-SDR

git clone git://git.osmocom.org/rtl-sdr.git
cd rtl-sdr
mkdir build
cd build/
ccmake ../

Edit CMAKE_INSTALL_PREFIX: /home/matthias/downloads/sdr/installed
Edit Gnuradio_DIR: /home/matthias/downloads/sdr/installed/lib/cmake/gnuradio

make
make install

Build OsmocomSDR GnuRadio block

git clone git://git.osmocom.org/gr-osmosdr
cd gr-osmosdr
mkdir build
cd build/
ccmake ../

Edit CMAKE_INSTALL_PREFIX: /home/matthias/downloads/sdr/installed

make
make install

Building gqrx

git clone https://github.com/csete/gqrx
mkdir build
cd build
PKG_CONFIG_PATH=/home/matthias/downloads/sdr/installed/lib/pkgconfig/ qmake-qt4 PREFIX=/home/matthias/downloads/sdr/installed ../
LD_LIBRARY_PATH=/home/matthias/downloads/sdr/installed/lib make
make install

Finally

Ok, we are done compiling. If you examined the commands, then you propably guessed how to run the programs. However it is painfull to enter these long commands each time when you start the programs, so we create some nice scripts to ease the pain.