Projects

Code from my projects can usually be found on my Github page at: http://github.com/bransorem

A few other projects:

OpenROV

OpenROV, founded by Eric Stackpole, is "a DIY telerobotics community centered around underwater exploration & adventure." The GUI will be based on web technologies and hosted using a RaspberryPi, though the first prototype will likely be based on a BeagleBone. The onboard computer will run Node.js and send the GUI as a webpage to a connected browser, after which it will communicate using AJAX. The video will be streamed using Socket.io.

Here is the early mockup that I created:

OpenROV GUI

The source code can be found on Github.

comic2pdf

comic2pdf is a simple Python script that converts most CBR and CBZ files to PDF's. The source code is available on Github.

Below is a small snippet of the script:

...
def handlerar(filein):
    fileout = filein[:-4] + '.rar'
    shutil.copy(filein, fileout)
    command = 'unrar e ' + '"' + fileout + '" "' + filein[:-4] + '"/'
    # get files before extraction
    old_files = os.listdir(os.getcwd())

    # use subprocess to run unrar command
    try:
        nout = open('NULL', 'w')
        retcode = subprocess.call(command, shell=True, stdout=nout, stderr=nout)
        nout.close()
        os.remove('NULL')
        if retcode < 0:
            print >>sys.stderr, "Child was terminated by signal", -retcode
    except OSError, e:
        print >>sys.stderr, "Execution failed:", e

    new_files = os.listdir(os.getcwd())
    # get difference between ls's
    newdir = [adir for adir in new_files if not adir in old_files]
    os.remove(fileout)
    print "Converting " + filein + " -> " + filein[:-4] + ".pdf"
    # should be the only one! I'm not bothering to parallelize it
    if len(newdir) == 1:
    	toPDF(filein[:-4], newdir[0])
    else:
	    print "*** Oops, couldn't create a file.  Skipped " + filein + " ***"
...	    
]

AL5A IK

This project was developed as a Humboldt State University project. It is an Arduino-based inverse kinematics controller for the Lynxmotion AL5A robotic arm. The program feeds servo data to the Lynxmotion SSC-32 board. The source code is available on Github.

Below is a small snippet of the code:

...
// Establish the joints that will be used with this joint set
// Args:  Joint* array_of_joints[],  int length_of_array
void Joints::setJoints(Joint* jointset[], int len){
  _length = len;
  for (int i=0; i < len; i++){
    appendJoint(jointset[i]);
  }
}

// Add a joint to this joint set
// Args:  Joint* joint
void Joints::appendJoint(Joint* joint){
  int len = _length;
  // can only have 32 joints with the SSC-32
  if (len <= 32){
    joints[len] = joint;
    len++;
    _length = len;
  }
  else {
    // error, too many joints
  }
}

// Remove a joint from the joint set
// 'pops' off last joint
void Joints::removeJoint(){
  int len = _length;
  // are there any joints in the set?
  if (len > 0){
    joints[len] = 0;
    len--;
    _length = len;
  }
  else {
    // error, no joints in array
  }
}
...