나는 매 0.1 초 후 위치를 업데이트하는 코드를 다음 사용하고 -계산 정확한 속도 사용하여 GPS
- (void)viewDidLoad
{
[super viewDidLoad];
CLController = [[CoreLocationController alloc] init];
CLController.delegate = self;
// set auto update timer
currentTimer = [NSTimer scheduledTimerWithTimeInterval:0.1 target:self
selector:@selector(updatestart) userInfo:nil repeats:YES];
}
-(void)updatestart
{
[CLController.locMgr startUpdatingLocation];
}
그리고 내가 사용 내가 미터에 속도를 얻고있다
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
[locMgr stopUpdatingLocation];
NSLog(@"%f",newLocation.speed);
}
을 속도를 계산하기 위해 노력하고 있어요/초이지만 시간이 지나면 프로세스가 느려지고 여행을 멈추더라도 속도가 계산됩니다.
내가 원하는 것은 정확한 속도를 얻고 속도가 12km/hr 이상이면 경고를 표시하는 것입니다.
동일한 방법을 찾을 수있는 다른 방법이 있습니까?
감사합니다.
측정을 계속하지 않으면 어떻게 움직 였는지, 다시 시작했는지 어떻게 알 수 있습니까? 0m/s는 12m/s만큼이나 유효한 속도 측정입니다. – Caleb