Monday 24 March 2008

Formatted data output, getting there!

Over the last while I cleaned up and restructured some of the code, which took ages, hit so many weird problems with PL/PSQL, and the error reporting is not very great - it has taken me upwards of an hour to spot some mistakes! So slow progress.

Now the code is pretty much ready to be used with a trigger when a new data is uploaded, I have done GPS segments to locations mapping now too (if a new location is found, it is added to the location list). The way I'm doing this is by getting the average of all the coordinates within that segment which have more than 3 satellites, and then trying to match this average coordinate to a previously detected location which is within 200meters, the only problem is that sometimes the average of coordinates is not accurate enough to detect the location accurately. Will have to work on this more.

Formated output, Finally!

Messed around with outputting some HTML of the analyzed data.
Formated results are available here. (GPS coordinates are slightly changed so I don't give out where I live on the internet...). To match DCU, the average coordinate must be within 800meters from the centre, and for home I made it slightly smaller, due to the high freaquancy of the locations visited and creating lots of locations within, especially with DCU and to reduce some errors.

Now some of the more interesting data I have collected which is not me doing Home -> DCU -> Home:

2008-03-14

segmentStart End From To Location
83 07:40:17 07:53:41 31141 31186 ID-2 name Home
84 07:53:52 08:32:41 31187 31318 travel
85 08:32:41 13:12:50 31319 32216 ID-1 name DCU

Typical day, leaving my house slightly early to make it for 9am Real-Time Embedded lecture, GPS must have run out of battery or the Nokia device must have reset it self, both are fairly typical.

The "From" and "To" are foreign data base keys to the original GPS data.


2008-03-01

segmentStart End From To Location
76 21:36:55 21:37:44 29789 29792 travel
77 21:37:57 21:46:18 29793 29820 ID-2 name Home
78 21:46:30 22:25:34 29821 29933 travel
79 22:25:47 23:59:55 29934 30204 ID-16 name Merrion Square

Turning the device on fairly late, driving in to town, parking my car near Merrion Square to go to a friends birthday party, GPS device and Nokia tablet left in the car.

2008-03-02

segmentStart End From To Location
80 00:01:07 02:20:37 30207 30612 ID-16 name Merrion Square
81 02:20:49 03:31:04 30613 30826 travel
82 03:31:16 05:00:24 30827 31138 ID-2 name Home

New day, There till around 2:20, and then leaving for home... GPS running until battery runs out at 5am. Did not detect me giving a lift to friends besides DCU, where I stopped by for less than 5 min, neither it detected my filling up petrol. But these type of segments are very minute and not really considered significant.


2008-02-11

segmentStart End From To Location
62 09:10:05 09:11:13 25709 25712 ID-2 name Home
63 09:12:01 09:39:52 25713 25800 travel
64 09:40:15 12:33:13 25801 26325 ID-1 name DCU
65 12:33:46 12:43:02 26326 26354 travel
66 12:43:25 13:10:47 26355 26442 ID-13 name Clontarf Dart Station
67 13:12:22 13:23:50 26443 26470 travel
68 13:24:02 21:05:07 26471 27825 ID-18 name unknown

This is slightly more interesting as there is more activity in here.
Leaving home, parking up my car in the estate besides DCU, driving to clontarf dart station, leaving the GPS in my car, going for orthodontist appointment and driving back to DCU. The last area is a bug in data normalization which I have to take a look at.

2008-02-08

segmentStart End From To Location
58 16:52:52 20:58:09 24442 25153 ID-1 name DCU
59 20:58:22 21:10:29 25154 25199 travel
60 21:10:42 23:12:10 25200 25579 ID-12 name Friends party
61 23:12:32 23:49:57 25580 25706 travel

Interesting too, turning on the device in DCU, small travel period up close by to Griffth avenue, dropping down to a friends party for 2 hours and then driving back home, except during the traveling, GPS device ran out of battery, which lasts around 7 hours!

So I'm fairly happy with the output, besides the way I'm matching average GPS coordinate to an existing location... I'll have to find a better way of doing this if I have time... and need to hunt down the bug 2008-02-11.

Data collection problems

As previously mentioned, not getting time to charge the Bluetooth GPS device is a problem and only around 7 hours of data is collected when I don't get a chance to charge it.
I lost few days of data because there are times when GPS has not acquired signal after running out of battery, the time/date it reports is wrong... I had to delete around 2000 GPS coordinates because of this.

And me mainly being home mid December - February. I didn't realize I didn't collect so much data for February... Now I'm going try to collect data every day for the next few weeks.

Whats next

Fix the bug where I can't transfer the bluetooth logs to postgres database mentioned few months back, and start to think about how I'm going to let the user access this data nicely under Processing. And clean up a lot of things! So this basically is nearly the end of the 2nd stage of the project.

I'm having a meeting with my supervisor on Friday, so few new ideas might come in :). I'll try to post up the algorithm I'm using and a new revised Grant chart.




No comments: