Cellular Automata in Haskell

Ben recently tried this and I wanted to see if I could do it my way

I’ve seen this done (Bartosz?) before but I tried to do it without looking anything up.

The comonad is an interesting pattern to use. It automates the translation invariant nature off the cellular automata. This would also be useful for translationally invariant PDEs like the simple wave equation or others.

I used the laziness of Haskell to start with an infinite plane of zeros. Of course if you ever want to look at it, you need to pick a finite slice at the end using dtake



Ordered pairs in Idris

I implemented an ordered pair type in Idris. Took me a while.


Already has an inequality type. That may have been better to use.

Exploration and guesswork was necessary. How the heck do I get a hotkey for holes in atom?

The first couple Opairs are ordinary pairs. Just exploring the syntax.

I switched out of InEq which explicitly stores the number it is talking about to better match the equality type.

The Inequality type acts something like a mix of Nat and Equality.

My head hurts and I’m dehydrated.



Position Tracking using Wifi


I have been aware of machine learning projects that use RSSI (signal strength) (for example, try typing iwconfig in a linux terminal. You can grep that for signal strength.)

CSI (channel state information) is more though. Uses alternative firmware. Gets you phase sensitivity.


mini PCIe is a pain. Many laptops support it and mini pcs. But still, that is a ~100$ investment or so.

plausible but unconfirmed alternative for atheros cards


Another paper describing localization



LimeSDR, gettin going


I had trouble installing the ppa the first time I tried about a month ago. It seemed to go through the second time around

Install LimeSuite using the ppa instructions for ubuntu. I have 16.04


lsusb shows OpenMoko as the device. Odd.



Ok. A capitalized command LimeSuiteGUI is insane. No commands are capitalized.

It brings up some spaceship of cryptic options.

Some of the stuff in the top menu bar seems good. Connecting, Programming, FFT, etc.

The commands

LimeUtil –info

LimeUtil –find

Lists a device. So that’s good. Also does updating?


Added a myriad RF ppa for gnuradio


sudo apt-get install gnuradio gnuradio-dev

Also installed gqrx. This is very useful for determining if the goddamn thing is working at all

Install Gqrx SDR on Ubuntu Linux



Ok. GQRX was crashing on boot.

So was gnuradio when I tried playing with the osmocom source

GNU C++ version 5.4.0 20160609; Boost_105800; UHD_003.010.001.001-release

ImportError: /usr/lib/python2.7/dist-packages/gnuradio/uhd/_uhd_swig.x86_64-linux-gnu.so: undefined symbol: _ZN3uhd4usrp10multi_usrp7ALL_LOSB5cxx11E

so did python

from gnuradio import uhd

Eventually I apt get installed libuhd-dev which makes gqrx run now with an rtl-sdr

gqrx with line


should work but didn’t


Hmm another twist

Limesdr is power hungry

I may not have a usb3 port on my 2012 desktop insane as that sounds

so i need external power? I wonder if that is what the blinking led signifies


Trying to install in windows now. Maybe that will work better

Install PothosSDR

After running zadig can recognize an rtl-sdr in gqrx


Install the drivers as specified for limesdr.

I accidentally installed the x86 instead of the x64 drivers and needed to uninstall with deletion and then reinstall properly. Got error code 48

It appears to be working.


GQRX opens.



It has been months since I tried in ubuntu 16.04. Maybe things have gotten better.

ok. At first gqrx wouldn’t load but after fiddling with the sampling and bandwidth it does. I don’t get any FM signals with nothing attached to the Lime. That is either good or bad. It does appear to be receiving data at least though.


So I have not gotten gqrx to actually receive signals with limesdr, but gnuradio appears to be working to some degree. This graph plays audio on 101.5 although very crappily. I hope it just needs filtering (I think I should be low passing those resamplers. Also I probably shouldn’t be receiving on the middle of the band where the DC spike is). I doubled the resampler because a single resampler through an error for too much decimation. Is this standard procedure?


Useful gnuradio tutorials


Possibly useful blog series



ok. Next step is simple transmit and receive




3d printing Linkages


I’m starting by trying to make a simple scissor linkage. The challenge is the rotating joint


I decrease the radius of the peg by 0.5mm compared to the hole. This gave me a nice fit. Slides smoothly, doesn’t pop out.

Hmm Only for the center hole though. The other’s are much too loose.

took about 1:10 to print 8

took about 12 mins to print 1

0.3 is definitely too big

0.4 is nice and tight. But it isn’t good enough. The thing still wants to get out of the hinge.

Back to the drawing board. A three piece design? Or just make the pegs and holes longer?


Update: I extended the holes so the diameter equals the length. It works GORGEOUS.



I printed a circular version. You just need to angle the bars of the scissor by 2 *pi/N where N is the number of sides of the polygon you want.



Notes on ROS and ORB SLAM 2


This seems like the most recent openly available slam package I could find. So let’s try it out

whenever using ros always



when using ros

rosnode info or rosnode list to inspect running nodes

rostopic gets the avaiable messages

Something like this. However, should edit the yaml config file

sudo apt-get install ros-kinetic-usb-cam

To inspect the image

rosrun usb_cam usb_cam_node __name:=camera

changes the topic name to camera


Dang. I’m pretty impressed. With a bad calibration file and no tuning, it works ok in short term. Blur clearly seems like an issue.

The contents of the example yaml config


Other things to consider LSD-SLAM



Actually, many people are recommending svo and dso saying orb_slam while the better behaving one, works poorly on the pi








Also a perhaps useful ROS short course

Old 6/16:

So I downloaded a cool looking package


roslaunch svo_ros live.launch

You need to have a camera running

sudo apt-get install ros-jade-usb-cam

run with

rosrun usb_cam usb_cam_node

You can see it using image_viewer

rosrun image_viewer image_viewer image:=/cam_usb/image_raw

Change the param file in svo_ros so that the camera has the same resolution and stuff