Monday, July 18, 2011

impressive build

Found this interesting http://www.totalgeekdom.com/?p=572

Tuesday, July 12, 2011

Homework and DARPA

So one of the homework questions that I had for my 'knowledge based systems' course got was about the major AI contests which kind of got me thinking a bit about why not smaller challenges. While there are some things that will only ever be answered by the large and expensive grand challenges, there is another aspect that is lost with them. It is important to note that participation in these projects like the DARPA grand challenge or DARPA urban challenge is a very exclusive thing and requires large interdisciplinary teams. While much good can come of this, I think there is also some harm in all the focus being placed on these projects.

First, a large portion of academia in unable to participate in these challenges. While my college has a graduate CS program, we lack ME and ECE programs, which would obviously be required for these projects. Additionally we are not a tier 1 university, but instead focused on professional development. However that does not mean that non of the students have anything to offer to hard problems, and by alienating so many smaller colleges and universities we loose a large portion of potential minds that could work on some of these problems.

Another problem that I see is that many of these research groups, because of the huge financial input into the problem, are likely to take risks on outrageous ideas. Sometimes these are critical for making breakthroughs, or even just seeing that another legitimate solution exists.

So why not mini challenges? What I see is that the Maker/DIY/Hacker community has incredibly sophisticated tools, everything from arduino, beagleboard, Digilent FPGA boards, Android devices, and the Kinect. As an R/C enthusiast I also know that we have quite sophisticated platforms. So it does not seem like there is a technical reason not to fund small teams of 2-5 individuals, probably university students, with a standard platform to perform some given tasks in a scaled down challenge.

In addition to the additional mind share working on the problem I think some other huge things will come out of something like this. First, we will see more people with sophisticated AI backgrounds graduating from ALL colleges and universities instead of just the elite ones. This is great for companies that might want a low cost/risk way to explore some of these ways of solving programming problems.

Additionally I think we will see one huge impact if standardized and smaller scaled hardware is used, that of massively filtered data. One of the great things that the human mind does is filter at various levels. Why can we not use the same ideas in AI to take real world problems and simplify them, but still come out with satisfactory results?

Sunday, July 3, 2011

ADK adventure

Last night I tried working with the USB host shield on the arduino and ran into a number of problems. It seems that the version of the USB Host Shield library that is distributed with the ADK package does not work right on linux. This is kind of annoying. I then spent some time mucking around with version two of the USB host library, since the author notes that the first version is no longer being developed. It appears though that this is a major rewrite of the library, and in no way compatible with the androidAccessory library. I did manage to get the authors quality control test program functioning after correcting a case sensitivity issue.

I am now playing around with this again (yes, I am that thick headed) using the most recent copy of the first version of the library available on github. I also ran across this blog post which may be a tad helpful.
http://marioboehmer.blogspot.com/2011/05/android-adk-with-standard-arduino-uno.html

Lets see how this all works....

And it works. I thought I tried that last night, but sometimes things just work so much better after a nights sleep and starting over. Using the version from github works while the one from google does not. I connected it to the full version of the demokit android app, I will now add in some hardware and see what happens.

Tuesday, June 28, 2011

so this looks like an interesting read.....http://www.aosabook.org/en/index.html

Saturday, June 25, 2011

cool things to play with sometime

http://wiki.processing.org/w/Android

and obviously
http://openkinect.org/wiki/Main_Page

Wednesday, June 8, 2011

Pair IT

So I had read an interesting article (http://pragprog.com/magazines/2011-06/pair-programming-in-a-flash) over the weekend about pair programming. I have done a bit of pair work with Ron, but not terribly much. It seems like a potentially great idea, especially if you can mix junior and senior level guys together, there is a great deal of learning that can happen, and it is a great way to mentor.

The interesting thing however that I thought of today is that most of my pair work is not while coding but with deploying servers. Over the last few months I have been more involved in helping set up webapp servers in conjunction with our IT department. The observation I had is that we are essentially doing paired IT, in much the same way that the pragmatic guys are saying to do paired programming. My observation is that paired IT for deploying webapps is a very good way to do things. Things move very quickly using this technique, and there is very little down time working with new services that have to be deployed. I think one of the keys here is also the combination of people involved. IT is obviously IT, with little programming experience, but a wealth of background in managing servers and networks. Then I am a programmer with a decent background in server technology. That combination I think leads to an effective pairing, where the task can be approached by two people with differing views. The other advantage I notice is that when things go wrong it is in many cases a much shorter troubleshooting period, since having a developer right there means that looking at stack traces is more fruitful in many cases than it is with only IT personnel looking at it, or having to send it to a developer. Obviously this still happens since I am often not the developer for the project being deployed, however I think having that combination of skills is a great way to pair in IT.

So, here are some guidelines I think might be useful:
- Deploy new services/webapps in a pair
- One member of the pair should be from IT and the other from webops or development
- experiment with ideas singly, not in pairs

So, I think this is just as good of an idea as pair programming, and can really make deployments fairly painless and quick.

Sunday, May 15, 2011

ADK compiled for android 3.1

I got the ADK compiled for android 3.1. The way it is written is targeted at 3.0 with an additional library. The general instructions and ADK can be found here http://developer.android.com/guide/topics/usb/adk.html

First, remove line 10 () from the androidManifest.xml file. Now we must change DemoKitActivity.java.

The imports for USB must be changed from com.android.future.usb.... to android.hardware.usb....

In line 128 and 139 change:
UsbAccessory accessory = UsbManager.getAccessory(intent);
to:
UsbAccessory accessory =(UsbAccessory)intent.getParcelableExtra(UsbManager.EXTRA_ACCESSORY);


Line 152 must go from:
mUsbManager = UsbManager.getInstance(this);
to:
mUsbManager = (UsbManager) getSystemService(Context.USB_SERVICE);

Now I just have to wait for my USB host board to come in so that I can play with some stuff....

Saturday, May 14, 2011

lots of stuff

Well, been a long time since I updated. Well, have some new tech toys, particularly a tegra 2 powered tablet. Which just got an os update today, which should include host mode USB. That will be great. I also ordered a usb host shield for the arduino. I am really looking forward to playing with some physical devices hooked up to the android device. I now just have to learn to program for android......

Also have all of the functional construction done on my Mountain Models EVA. Hopefully if the weather is nice next weekend I will get a chance to hit the field. We shall see.

Also am moving to a new place with tons more room on June 1st. I am really hoping to have some dedicated workbench/lab space setup for doing embedded systems type stuff with arduino and android devices. We will see how it all works out, but there should def. be more room for working on projects which ia always a huge plus.

Wednesday, April 13, 2011

Antlr

So I have started playing a little bit with Antlr, specifically using antlrworks. I was originally going to learn MPS, however Antlr seems like a possibly better choice. It seems that it can generate python as well as java parsers. Obviously I am most interested in the python ones.

http://www.dalkescientific.com/writings/diary/archive/2007/10/30/antlr_mw.html

This seems to be a good article that I am starting to work through.

http://www.antlr.org/wiki/display/ANTLR3/ANTLR+Cheat+Sheet


Some notes:
need the python library from http://antlr.org/download/Python/
- requires 3.1.3 version of antlr, will not work with the newest version of antlrworks
name of file must match the grammar name
the language can be specified like(defaults to java):
options{
language=python;
}

Wednesday, March 9, 2011

Well, havent posted anything in a while. I have been too busy with school and work and all of that normal stuff. But I did pick up a 8-bit AVR based game console/dev kit. I am hoping in a few weeks to dive into that. I also want to use the n-gon code I wrote to help implement astroids on the arduino. I think that would be fairly cool, and will learn a great many things. Just have to get through some school stuff first.

Monday, January 3, 2011

n-gon

So this weekend I wanted to use the ST7565 display with the arduino to draw a rotating cube, but decided to start in 2D first. So I did a rotating n-gon, which just showed how distracted and out of practice I am with C. None the less, it works, for the most part. Here is the source, pictures to follow later.

point.h:

typedef struct{
int x;
int y;
} Point;


arduino sketch:

#include
#include
#include "point.h"

#define BACKLIGHT 10
#define n 4
//n as in n-gon

ST7565 glcd(9, 8, 7, 6, 5);

static Point p[n];
static Point center;
float theta=30;
//due to error the smallest usable theta appears to be
//10 degrees, 15 is even better. anything lower and the steps are uneven due to
//rounding.
float c_t; //cos of theta
float s_t; //sin theta
boolean persist = true;
float distance;


void setup(){
Serial.begin(9600);
pinMode(BACKLIGHT, OUTPUT);
digitalWrite(BACKLIGHT, HIGH);
p[0]= (Point) {40, 10};
p[1]= (Point) {80, 10};
p[2]= (Point) {80, 50};
p[3]= (Point) {40, 50};
center= (Point) {60, 30};

glcd.st7565_init();
glcd.st7565_command(CMD_DISPLAY_ON);
glcd.st7565_command(CMD_SET_ALLPTS_NORMAL);
glcd.st7565_set_brightness(0x18);
theta = theta*(3.1415/180);
s_t=sin(theta);
c_t=cos(theta);

glcd.clear();
}

void loop(){
distance = sqrt(pow(p[1].x-p[0].x, 2)+pow(p[1].y-p[0].y, 2));
Serial.println(distance);

if(persist==false){
glcd.clear();
}
for(int i=0; i glcd.drawline(p[i].x, p[i].y,
p[i+1].x, p[i+1].y, BLACK);
}
glcd.drawline(p[n-1].x, p[n-1].y,
round(p[0].x), p[0].y, BLACK);
glcd.display();

for(int i=0; i p[i]=rotate_point(p[i], true);
}
delay(500);
}

Point rotate_point(Point _p, boolean clockwise){
//c_t is cos(theta) as a global to reduce computation
//s_t is sin(theat) as a global to reduce computation
//center is a Point, which represents the local origin the point
// will rotate around
float x = _p.x-center.x;
float y = _p.y-center.y;
if(clockwise==true){
_p.x = round((c_t*x)-(s_t*y)+center.x);
_p.y = round((s_t*x)+(c_t*y)+center.y);
}else{
_p.x = round((c_t*x)+(s_t*y)+center.x);
_p.y = round((c_t*y)-(s_t*x)+center.y);
}

return _p;
}