Category Archives: Software

hi 2016 (2 servo drawing robot arm, tripod gait 12 servo hexapod, visit to NASA, quadcopter tuning, etc.)

hm, haven’t updated in a while.

i built a lot of robots with parents over the winter break. i built a robot arm and refreshed on inverse kinematics; more specifically, make sure your servos are rotating as you expect: IK goes counterclockwise since angles increase that way, but your servos may increasing in a clockwise direction… a simple map(theta, 0, 180, 180, 0) will fix your problem if you catch it.


processing takes in x,y coordinates drawn on the screen and spits them out to arduino over serial, which does the inverse kinematics and spits out the theta values to the servo

or for the one where it draws what you draw on the screen,

also tried to face.

it does not face well, in part i have derpy three year old code


this processing code takes a lot of processing libraries. thresholds image, performs canny edge detection, then a walking algorithm (look at each black pixel by scanning image in x and y, see if neighbors are black as well, then walk along that pixel) to turn the edges into vectors. then output to robot, but robot is limited in resolution (arduino servo library) and cheap hobby servo overshoot.

below you can see preview in python.Β  (basic code, I basically copied the output from processing into a text file andΒ  added some python code to that to plot the values)

is to check image is within the working envelope of the arm. IK is fixed with arm “up”.



problem of walking algorithm: adds a box around the image. irritating. need to rewrite code. looking into open cv.

i also rehashed my hexapod project with 12 servos and popsicle sticks


basically this

but modified to work with the servo configuration on the rectangular robot, and added code to allow you to step through the gait with “j” and “k”:

need to implement the other gaits; also, this moves so smoothly, envious, but they have lasercutter :3

worked on quad, now stuck at calibration stage 😑 because i have not built quad before, i could not push through this in a day or two unlike the drawing arm and hexapod.



made from a sad clothes drying rack we took apart





we couldn’t find the original cable for the transmitter, so we connected the ports up with a FTDI -> USB cable as per


used and calibrated my servos to zero… took a while to realize it *can* and *should* read the current values, guess my wires were loose, but the values because a lot easier to input. used the kk2 screen to fix some controls that were reversed from what the kk2 expected (left = left and not right, etc.). zeroed all the values on the kk2. turns out (minus the flipping controls) I could zero just as well on using the trim knobs on the controller itself.

went to visit NASA space museum in houston. they had little robot that made and served you froyo. adorable.


also, some regal looking hexapods in the actual NASA workplace.



at MITERS I got a robot arm working with lots of help from MITERS / London Hackerspace / john from BUILDS. For robot arm competition.

i’m now robot art-ing. here is using Fengrave on a black and white image with appropriate offsets to produce gcode (well, limited to G0 and G1 commands)



face code still derp. (streaks are because i wrote gcode translator, and it goes to x,y,z position instead of x,y and then z). too many x,y points. draws slowly.


michael made crayon extruder (=metal tube + power resistor) and also pen mount. crayons = hard to control flow rate. started making square, then pooped out a lot of melted crayon. alas.


learned a lot of patience dealing with old manuals, 20 year old operating systems / controllers. main issue turned out to be a dumb calibration assumption (robot had arrows; should have ignored them and used indentations instead). gcode -> V+

also, i learned about oscilloscope rs232 decoder! had to invert to get it working properly (zeros are high in rs232?). scope ground, tx line. bam, now you can check whether you are actually transmitting all the carriage return and line feeds you need…


currently: reading up on image processing. openCV.

terse update. more details available if questions exist.

many thanks to my parents for being excited and not jaded

Organizing an solid modelling CAD reading group (toward FOSS CAD)

I’m starting a new reading group!

The idea is to get a good background on parametric solid modelling CAD (think solidworks, proE, openSCAD).

(to be clear, NOT how to use the tools, but how to write new ones or contribute to FOSS implementations).

I think the first group meeting would simply be an overview of existing approaches and the pros/cons of existing FOSS CAD software (as well as introductions to each other).

Proposed time is 6pm EST Sundays over google hangouts (and possibly simultaneously in person in Camberville, MA), totally open to other times.

Sign up here: FORM

Restarting Cinnamon after freeze without losing session information

Whoo! For some reason, cinnamon freezes extremely often (multiple times a day) on my desktop, and I had been resorting to “ctrl-alt-f1” to get to a terminal and running “killall cinnamon-session”, which brings me back to login screen. Fortunately, there is a better solution, aka “ctrl-alt-esc”.

Here’s the relevant excerpt from the Cinnamon blog (

Desktop freezes

In case of a freeze or if you need to restart Cinnamon for any reason, you can now do so via a keyboard shortcut. The default key combination is Ctrl+Alt+Escape. Pressing this combination of keys restarts nemo and cinnamon-settings-daemon in case they had crashed, and launches a brand new instance of the Cinnamon desktop. Unlike Ctrl+Alt+Backspace which terminates your session and brings you back to the login screen, Ctrl+Alt+Escape simply restarts Cinnamon itself, which means your session is exactly as it was, you don’t lose any work and all your windows and applications remain open.


WordPress Blogroll Links Import Fix & Google Spreadsheet to OPML Generator

In order to bulk import a list of titles & URLs for my friend’s blogs into wordpress, I created a google spreadsheet and then used an open-source opml-generator to turn the spreadsheet into OPML and import it into WordPress.

The hosted version at was not working for me as of Aug. 2015, so I fixed it and ran it locally. Here are the fixes I made.

To Run

I had to install the google app engine python SDK,

Also, I had to install django-utils and python 2.7

$ sudo pip install django-utils
$ sudo apt-get install python2.7-dev

Then, simply use the appserver included with the google app engine python SDK, give it this project’s directory

$ /path/to/google_appengine/ /path/to/opml-generator

The happy output should look like

INFO     2015-08-17 03:30:37,516] Checking for updates to the SDK.
INFO     2015-08-17 03:30:38,341] The SDK is up to date.
INFO     2015-08-17 03:30:38,373] Starting API server at: http://localhost:40380
INFO     2015-08-17 03:30:38,375] Starting module "default" running at: http://localhost:8080
INFO     2015-08-17 03:30:38,376] Starting admin server at: http://localhost:8000

and go to http://localhost:8080/

Enter the URL, the title, and the “opml” url should automatically populate.


Then I had to make a few changes to make app.yaml recognize the django-utils was needed, that I was using python 2.7,

$ vi app.yaml
threadsafe: no
runtime: python27

- name: django
  version: "1.5"

I created the URL via “Share” > “Share with Others” > “Anyone can view” and it looked like

It appears that the original code works with old google docs urls, which look like:

Thus, I modified base.html to find the document key appropriately.

//var ssKey = ssUrl.split('key=')[1];
var ssKey = ssUrl.split('/d/')[1]; console.log(ssKey); 
//ssKey = ssKey.split('&')[0]; 
ssKey = ssKey.split('/pubhtml')[0];

Note: I also threw out some printouts to console.log to figure all this out. They can be found by using Chrome or Firefox, Ctrl-Shift-C, and going ot the “Console” tab.

Screenshot from 2015-08-16 23:50:09

I also edited the output URL which, for localhost, did not include the port.

//var opmlUrl = 'http://' + window.location.hostname + '/opml?sskey=' + ssKey + '&wsid=od6'; 
var opmlUrl = 'http://' + window.location.hostname + ':8080/opml?sskey=' + ssKey + '&wsid=od6';

Output OPML Format

In the end, I looked at the output OPML and think I should probably have just made the file by hand / with vim macros… it would have been easy enough. But I got to take a peek at Google App Engine, so that was nice.

Here’s what the OPML looks like, if you’re interested in creating it more manually instead of installing google app engine etc. etc. to run this code:

<?xml version="1.0" encoding="utf-8" ?>
<opml version="1.1">
   <outline text="MITERS">
    <outline title="MITERS | MIT Electronics Research Society" xmlUrl=""/>
    <outline title="nk | Nick Kirkby" xmlUrl=""/>

Or in screenshot form

Screenshot from 2015-08-16 23:31:43

WordPress Import Blogroll Fix

The error: when you try to import the OPML file into WordPress, it says “All done!” but when you check the blogroll manager, no links were actually imported.

Screenshot from 2015-08-16 23:34:13

The fix: Super simple. Just change all the instances of xmlUrl in the OPML file into htmlUrl .

Screenshot from 2015-08-17 18:27:12

Tada! The links now import properly πŸ™‚

Fixing “Docky crashes on suspend or unplug” in Ubuntu 14.04

in short

download and install this deb file; or do it yourself in just seven lines (see below)! πŸ™‚


On Ubuntu 14.04, my docky crashes extremely often (on any power status changes — suspend, disconnecting from the charger, etc.).

The fix has been known for a while, but after several months and no new Docky package (perhaps it is no longer maintained?), I decided to dig in and figure out how to fix this.

This time I googled it, and someone else had written up how to apply the fix to source code, build, and re-install. Turns out to only take a handful of lines! Here, I’m documenting with pictures.

Basically, we apply the one-liner fix using the “classic” instructions here How to download, modify, build and install a Debian source package? .


Fixing Docky

Let’s get the source and edit the file “Docky.Services/Docky.Services/SystemService.cs”, as described in “Comment 2 for bug 1309706“:

apt-get source docky
cd docky-2.2.0/
vim Docky.Services/Docky.Services/SystemService.cs

For me, the fix was on line 281. Change




See pictures below.





Build it~

sudo apt-get build-dep docky
dch -i

This last step is to update the package number. I don’t know anything about this, but it auto-inserted a new package number so I just wrote a quick comment and called it good.


debuild -us -uc -b
sudo dpkg -i ../docky_2.2.0-2ubuntu1_all.deb

Whoo! That’s it πŸ™‚

Deb File

Here’s my file:

and its SHA sum follows, although obviously just doing the seven command-line steps above yourself is easy and way more secure…

nrw@nrw-PC:~/docky-2.2.0$ sha256sum ../docky_2.2.0-2ubuntu1_all.deb

Redmine Backlog Tweaks (via Tampermonkey/Greasemonkey): Highlight My Backlog

My coworkers wrote a script that, via a Chrome/Firefox plugin (Tampermonkey/Greasemonkey respectively), highlights the items on a Redmine backlog that belong to you and also puts in parenthesis at the top how many of the points on the sprint are yours.
Before:Screenshot from 2015-07-30 14:53:50After:Screenshot from 2015-07-30 14:53:27The scripts, written by Tom and Abra, can be found at , and my version (combining the two and adding in a strong orange color + larger and different font) can be found as follows:

// ==UserScript==
// @name         Highlight my redmine backlog
// @namespace
// @version      0.1b
// @description  Highlights issues assigned to you in redmine Backlogs view and
//               puts in parens the total point count you have for each sprint.
// @author       Tom Clegg, Abram Connelly
// @match*
// @grant        none
// ==/UserScript==

$.ajax('/my/account', {success: function(data, _, _) {
    var key = $('#api-access-key',data).text();
    var url = '/issues.json?assigned_to_id=me&limit=100';
    var ajaxopts = {
        dataType: 'json',
        headers: {'X-Redmine-API-Key': key},
        success: dopage
    $.ajax(url, ajaxopts);
    function dopage(data, _, _) {

        var my_sprint_info = {};

        for (var i=0; i<data.issues.length; i++) {

            if ("fixed_version" in data.issues[i]) {
              var sprint_id = data.issues[i];
              var sprint_name = data.issues[i];
              if (!(sprint_id in my_sprint_info)) {
                  my_sprint_info[sprint_id]={"story_points" : 0, "sprint_id" : sprint_id, "sprint_name" : sprint_name };
              if ("story_points" in data.issues[i]) {
                my_sprint_info[sprint_id].story_points += data.issues[i].story_points;

                'background':'#F49C54', //orange
                'font-family':'URW Bookman L, serif',

        if (data.total_count > data.offset + data.limit) {
            $.ajax(url + '&offset=' + (data.offset + data.limit), ajaxopts);

        for (var sprint_id in my_sprint_info) {
            var cur_pnt = $("#sprint_" + sprint_id).children(".fff-right").children(".velocity").text();
            cur_pnt += " (" + my_sprint_info[sprint_id].story_points +")";
            $("#sprint_" + sprint_id).children(".fff-right").children(".velocity").text(cur_pnt);

Step-by-Step Greasemonkey Install

1. Install Greasemonkey:

2. Create a file with the contents above ending in “.user.js”

3. Double-click the file and Greasemonkey will install it

For more details, see .

Step-by-Step Tampermonkey Install

1. Install Tampermonkey:

2.Β  Go to the tampermonkey icon and click “Add a new script…”Screenshot from 2015-07-15 05:10:49

3. Copy-and-paste the code in and ctrl-s to save (or click the floppy disk)

Screenshot from 2015-07-15 05:11:31

If you want to edit the script, just go to Dashboard and click the script name to open up the editor.

Screenshot from 2015-07-15 05:11:11


At work (Curoverse), we are all Arvados contributors (and open-source data and computation workflow management platform) and use the open-source Redmine to keep track of our open issues, tickets, and bugs.

We chose to use Redmine and merely mirror on Github, instead of using Github Issues, because Github itself is not open-source and we prefer to own our own data. In particular, since we operate in sprints, we use the backlog feature a lot. However, I’d been struggling to adopt Redmine, since it was impossible to use as a to-do list.

But my co-workers made a greasemonkey / tampermonkey browser plugin that highlights your tasks & how many points are assigned to you, which makes the whole system way more usable.

See the original link,, for more details about the Redmine API and features you could addΒ  to this script πŸ™‚