Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am dunmatt on github.
  • I am dunmatt (https://keybase.io/dunmatt) on keybase.
  • I have a public key ASBH27OQ8Fm2UnVjZwPE7IJPNz7GxbXO4w-mAjCSDPkm2Ao

To claim this, I am signing this object:

@dunmatt
dunmatt / telemetryConsumer.ino
Last active March 22, 2016 18:38
This is a skeleton Arduino sketch that taps into the Mass Destruction telemetry stream.
#define TELEMETRY_ITEM_BUFFER_SIZE 40
#define OWN_NUMBER 100 // TODO: replace this with your assigned number
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
char telemetryBuffer[TELEMETRY_ITEM_BUFFER_SIZE];
@dunmatt
dunmatt / telemetryConsumer.scala
Created March 22, 2016 16:00
This is a simple app to demonstrate connecting to the Mass Destruction telemetry stream and parsing the stream format.
import org.zeromq.ZMQ
case class TelemetryDatum(robotId: Int, x: Double, y: Double, theta: Double) {}
object TelemetryDatum {
def apply(d: String): TelemetryDatum = {
val arr = d.trim.split(" ")
TelemetryDatum(arr(0).toInt, arr(1).toDouble, arr(2).toDouble, arr(3).toDouble)
}
}
@dunmatt
dunmatt / xbee_profile.xml
Created March 22, 2016 15:43
This is the XBee S1 configuration for Mass Destruction telemetry streaming.
<?xml version="1.0" encoding="UTF-8"?>
<data>
<profile>
<description_file>xb24-dm_8070.xml</description_file>
<settings>
<setting command="CH">10</setting>
<setting command="ID">C0C0</setting>
<setting command="MT">3</setting>
<setting command="PL">4</setting>
@dunmatt
dunmatt / jfc
Last active December 23, 2015 16:49
This is a compiler and interpreter for the register machine outlined in the Phil 191 readings.
#!/usr/bin/env python
import sys
from pyquery import PyQuery as pq
class Node:
def __init__(self, operation, register, initial):
self.operation = operation
self.register = register
self.lineNumb = 0
@dunmatt
dunmatt / SublimeText ADE Component Implementation Snippet
Last active December 18, 2015 23:39
This is a snippet for Sublime Text 2 (and probably TextMate) to stub out an ADE Component implementation for you.
<snippet>
<content><![CDATA[/**
* Agent Development Environment (ADE)
*
* @version 1.0
* @author ${1:M@}
* @file ${100:${TM_FILEPATH/([^a]|a[^d]|ad[^e])+ade\/(?<dir>.+?)\/[\w\.]+$/$+{dir}/}}/$TM_FILENAME
*
* Copyright 1997-2013 M@ Dunlap and HRILab (hrilab.org)
* All rights reserved. Do not copy and use without permission.
@dunmatt
dunmatt / SublimeText ADE Component Snippet
Last active December 18, 2015 23:39
This is a snippet for Sublime Text 2 (and probably TextMate) to stub out an ADE Component interface for you.
<snippet>
<content><![CDATA[/**
* Agent Development Environment (ADE)
*
* @version 1.0
* @author ${1:M@}
* @file ${100:${TM_FILEPATH/([^a]|a[^d]|ad[^e])+ade\/(?<dir>.+?)\/[\w\.]+$/$+{dir}/}}/$TM_FILENAME
*
* Copyright 1997-2013 M@ Dunlap and HRILab (hrilab.org)
* All rights reserved. Do not copy and use without permission.