Skip to content

nan #1

Open
Open
nan#1
@maciekish

Description

@maciekish

Hi,
I'm trying to implement this in my custom location manger on iOS but get_lat_long get_bearing and get_mph all just return nan.

I'm creating the filter like this:

self.kalmanFilter = alloc_filter_velocity2d(self.noise); //Noise is 1.0f

Updating it like this:

update_velocity2d(self.kalmanFilter, location.coordinate.latitude, location.coordinate.longitude, timeIntervalSinceUpdate); //Where timeIntervalSinceUpdate is an NSTimeInterval since the last CLLocation

And reading it like this:

CLLocationDegrees lat, lon;
get_lat_long(self.kalmanFilter, &lat, &lon);
CLLocationDirection bearing = get_bearing(self.kalmanFilter);
CLLocationSpeed speed = get_mph(self.kalmanFilter) * 0.44704f; //Convert mph to meters per second
NSLog(@"%.1f %.1f %1.f %1.f", lat, lon, speed, bearing);

All i get is "nan nan nan nan"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions