project notes

-->

arrival prediction

without comments

The first python-y version had a proof-of-concept arrival prediction system and we’ve talked about it for a while.. but now I’m finally taking steps towards making an arrival prediction algorithm for the bus data.

Er, but I’m doing it the roundabout way.  My plan has always been based on ‘waypoints’ and having a record of the time it takes for a bus to go from point-to-point.  So first I need waypoints.  Duke Mobile has a feed of stops but this isn’t spatially-resolved enough.  So I’m working on a google maps tool for pushing waypoint info into a database.  Kinda futile to post a link to such a transient thing but no one can stop me, hahaha.

The roundabout business is that, since I’ve recently come into pleasant contact with TwiML, I’d like to make an SMS service for the bus-tracking data.  It’s actually all ready to go — I just need more of these danged waypoints!  A user sends a text to my number with the route they’re interested in and gets a text back with the ‘snapped’ positions of all the buses on that route (as in, the bus locations are snapped to the nearest landmark).  Not quite perfect — I’d like to send info about heading or the buses’ final destinations — but we’re getting there.

Written by Matt

August 9th, 2010 at 10:32 pm

Posted in bus tracking

messing around with Twilio

with one comment

Update II: They Might Be Giants have had this since the early eighties!? Albeit in tape-based voicemail form..haha. I added a song in their honor.

Update: found a map of some excellent other Twilio projects.

Twilio lets you interact with people over the phone. Their API is hilariously simple: I made an over-the-phone jukebox in about 90 minutes and I was cracking up at how easy it was to make something so quaint. You can mess around with the service for free, so go check it out.

Call (919) 695-9242 to play with my pseudo-app — rock out to some distorted tunes. Code concepts are mostly from Twilio’s markup tutorials but I’ve pasted the bulk of what I’m using below. First is menu.php; second chunk of this file has the Twilio XML markup (split for better syntax highlighting). Hm, the syntax highlighter is messing with my XML..you have to keep the Twilio markup capitalized so watch that.

<?php
	$name = "Friend";  // removed list of known callers

	header("content-type: text/xml");
	echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
?>
  
	
		Hello <?php echo $name ?>.  This is the Phony Juke Box.
		Press nine at anytime to return to this menu.
                One: Arkaid Fire 
	        Two: Wahlay
		

		That's all for now, choose one quick!
	
	Too late!  Goodbye.
 

User input on the main menu goes to playMe.php, also in two chunks:

<?php
	$req = $_REQUEST['Digits'];
	switch ($req) {
		case '1':
			$band = 'The Arkaid Fire';
			$song = 'The Suburbs';
			$target = 'arcadeFire.mp3';	break;
		case '2':
			$band = 'Wahlay';
			$song = 'The Power';
			$target = 'wale.mp3'; break;
           //etc..

		case '9':  // the 'back-to-menu' button
			$target = 'menu';
			break;
		default:  // any other buttons
			$target = 'menu';
	}
?>

	<?php if ($target == 'menu')
		echo " menu.php ";
	?>

	
	  
		This is <?php echo $band ?>, with the song, <?php echo $song ?>. 
		 http://weakorbit.com/tw/<?php echo $target ?> 
		 That was fun.  Adeeohs.
	

Written by Matt

August 7th, 2010 at 12:31 am

Posted in Uncategorized

Racer 0.2

with one comment

This is hilarious.. wireless camera on a racecar with the feed and controls hooked up to an arcade machine. via hackaday.

Written by Matt

August 5th, 2010 at 1:01 pm

Posted in another's

Google maps markers with only CSS

with 2 comments

The main DuTrack site will be loading up to 30 icons on a page every five seconds and each icon will have a unique color and arrow direction corresponding to the vehicle’s route and heading.  So originally I made a /lot/ of images and we were using Google Maps’ Marker class.  This is hard to customize and was pretty poor, performance-wise.  The site had a nasty flicker.

Inspired by the CSS-only twitter fail whale, we’re now loading up divs with the GMaps OverlayView and styling them extensively to make these little guys:

Well, the dot and arrow /are/ images (the arrow is rotated with the jQueryRtotate plugin) but the rest is just three or so divs.  Flickering is very rare now and the marker color can be easily changed with one of our admin tools.

Custom OverlayViews are covered pretty well in the tutorial for V3 of the Maps API. As of right now, our code is also available on dutrack.com/js/markers_v4.js Things aren’t being positioned correctly in IE, so for that browser, we’re still using images. This should be reparable though.

Here’s our CSS, there’s an inverted triangle, an outer circle that forms the border and an inner circle that sits on top of it to make the whitespace. There’s also an info window that we just drop on top of this marker.

	.markerCircle {  /*creates the marker circle's border */
		width: 28px;
		height: 28px;
		-webkit-border-radius: 14px;
		-moz-border-radius: 14px;
		border-radius: 14px;
		z-index: 2;
	}

	.markerInner {
		width: 24px;
		height: 24px;
		background-color: #FCFCFC;

		z-index: 3;
		position: absolute;
		top: 2px;
		left: 2px;
		-webkit-border-radius: 12px;
		-moz-border-radius: 12px;
		border-radius: 12px;
	}

	.markerPoint {
		width: 0;
		height: 0;
		line-height: 0;

		/* border-top now styled in the js */
		border-left: 14px solid transparent;
		border-right: 14px solid transparent;
		border-bottom: none;
		position: absolute;
		top: 12px;
		z-index: 2;
	}

Written by Matt

July 28th, 2010 at 2:08 pm

Posted in bus tracking

DuTrack Admin demo

without comments

A demo of the current version of some bus-tracking admin features is now online.  Changes made there affect this demo version of the map.

The demo doesn’t show live buses as it’s not hooked into any trackers (or OpenGTS for that matter).  This doesn’t affect the admin stuff though.  You can demo OpenGTS here.  I also removed all user management and authentication from the demo.

Annnd the live DuTrack site is still at http://dutrack.com.

Written by Matt

July 21st, 2010 at 3:37 pm

Posted in bus tracking

public UI and more trackers

with one comment

Front-end development is oddly entertaining.  I’ve been working a lot lately on the bus-tracking website, DuTrack.com I’m also finishing up the admin site.  I hope to post the admin site’s code somewhere like github and run a demo on this domain.  Hopefully this week.

We’ve also been getting lots more phones!  These are all installed in buses now, tracking away these summer days..

Written by Matt

July 19th, 2010 at 3:15 pm

Posted in bus tracking

smd proto

without comments

Finished the tiny SMD VTD proto a while ago.  It may have transistor issues, still working that out..  Matt Brown’s SMD soldering rig is shown below and it’s pretty clever: a dentist pick with the handle flattened and resting on a hard drive magnet.  Keeps things pinned.

Written by Matt

July 19th, 2010 at 3:12 pm

Posted in vtd

za

without comments

So I ‘made’ some pizzas — four so far now. Assembled is probably more accurate.. They’re pretty good though.

Written by Matt

July 19th, 2010 at 3:11 pm

Posted in Uncategorized

wire-bound trees

without comments

amazing work, available for a cool $5k at the Maker’s Market.

Written by Matt

June 22nd, 2010 at 4:26 pm

Posted in another's

mariotoids

without comments

This little guy was made as a geocache trinket.  Me and V left it somewhere in Durham..  I first had an original tune but it was quite short, only like ten tones.  Then I remembered jarv.org.  He made a pretty sick mario beat with the same micro I was using!  How!?  He used progmem.  So I learned about progmem and took jarv’s code (thanks!).  I thought bobbing the camera to the beat would be smart..  Dumb..

If you’re curious enough to hold through the initial random tones, you get that famous track..  I think it’s my best one-night-build of all time.  Of All Time.

And here is the code [.C file]. I called it zelda because I originally wanted it to make this sound. You know, you’ve found a geocache, dah-dah-DAH-DAH!

Written by Matt

June 13th, 2010 at 10:12 pm

Posted in 30DOC

Tagged with