in reply to Re^2: GPS tracking with Perl
in thread GPS tracking with Perl
fyi, although it can be done more cleanly (both code and output), I flip off my GPS and back on again, and within three seconds (literally), I achieve lock on four sats:
use warnings; use strict; use GPSD::Parse; my $gps = GPSD::Parse->new; $gps->poll; my $sats = $gps->satellites; for my $sat (keys %$sats){ if (! $gps->satellites($sat, 'used')){ print "$sat: unused\n"; } else { print "$sat used:\n"; for (keys %{ $sats->{$sat} }){ print "\t$_: $sats->{$sat}{$_}\n"; } } }
Output:
17: used az: 67 el: 74 used: 1 ss: 15 3: unused 11: unused 19: unused 22: unused 24: unused 28: used az: 99 ss: 14 el: 36 used: 1 30: unused 13: used el: 6 used: 1 ss: 13 az: 220 12: unused 6: used az: 165 used: 1 el: 30 ss: 23 15: unused 1: unused
I have 100% test coverage between the cases that I'm using a socket (actual GPS), or replaying with a saved output file. I've got the docs in order, and have added a couple of examples. Usually it takes me a bit more time for a v1.00 release, but this was a very quick turnaround and I'm very happy with the results. I've tested the code on four machines; two Pi's one with a GPS, the other without, and same with two laptops (one with, one without). I'm just cleaning things up, and then I'm ready to move on to the video camera project. After that, I may consider actually constructing something.
|
---|