Code from my projects can usually be found on my Github page at: http://github.com/bransorem
A few other projects:
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:
The source code can be found on Github.
Studiolink is a DSLR camera controller hardware and software interface. First, you load the Android app onto your phone and plug in the home-built hardware. Then, you connect to the hardware via Bluetooth. Once the connection is established, you can control shutter functions on your Nikon or Canon DSLR. This is an extremely early version of the project. Currently, it only acts as an intervalometer, shutter release, and timer. We are currently working on new hardware that will allow us to stream Liveview from the camera and control all essential functions. The Android app is written in Java and the hardware uses an Arduino which is programmed in C++.
Current source code can be found on Github.
Below is a small snippet of the Arduino code:
...
// ============================================================
// Intervalometer
// ============================================================
void interval(){
Interval.shot = 0;
intinterrupted = false;
return_message(INTERVAL_STARTED);
for (int i = 0; i < Interval.shots - 1; i++){
if (!intinterrupted){
if (!intinterrupted) Interval.shot++;
if (!intinterrupted) capture();
if (!intinterrupted) {
INTERVAL_STATUS[3] = Interval.shot >> 8;
INTERVAL_STATUS[4] = Interval.shot & 0xFF;
return_message(INTERVAL_STATUS);
}
if (!intinterrupted) timer(Interval.time);
}
else {
return_message(CANCEL);
break;
}
}
Interval.shot++;
if (!intinterrupted){
capture();
INTERVAL_STATUS[3] = Interval.shot >> 8;
INTERVAL_STATUS[4] = Interval.shot & 0xFF;
return_message(INTERVAL_STATUS);
}
}
...
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 + " ***"
...
]
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
}
}
...