Skip to content

Commit

Permalink
do not die if Geo::ECEF not present
Browse files Browse the repository at this point in the history
  • Loading branch information
Matija Nalis committed Jan 4, 2015
1 parent 4b8201d commit 470c925
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sirfbin_gp2_to_human.pl
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,13 @@ ()
printf " GPS location fix found!\n";
my ($x, $y, $z) = (getbes32, getbes32, getbes32);
printf " x=%d y=%d z=%d\n", $x, $y, $z;
{
use Geo::ECEF;
eval {
require Geo::ECEF;
my $obj=Geo::ECEF->new(); #WGS84 is the default
my ($lat, $lon, $hae)=$obj->geodetic($x, $y, $z);
printf " (lat=$lat, lon=$lon, HAE=$hae -- FIXME ECEF calc precision?)\n";
}
};
say " (WARNING: No Geo::ECEF found, not calculating WGS84)" if $@;
printf " xv=%f yv=%f zv=%f\n", getbes16 / 8, getbes16 / 8, getbes16 / 8;
printf " mode1=0x%x HDOP=%f mode2=0x%x\n", getub, getub / 5, getub;
my $week=getbes16; my $TOW = getbeu32 / 100;
Expand Down

0 comments on commit 470c925

Please sign in to comment.