- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个 iOS 健身应用,可以从蓝牙胸带收集心率数据。我最近添加了一个 Apple Watch 扩展,并利用 watch 的心率传感器作为胸带的替代品。不幸的是,我发现它非常不准确,以至于基本上没有用。这是一个 3 英里远足的示例,其中红线显示从胸带收集的数据,蓝线显示从 Apple Watch 收集的数据:
我可以看出胸带数据是两者中更准确的一个,因为当叠加在海拔数据上时,较高的心率与上坡路段非常接近。 (另外,我不希望我的心率像 Apple Watch 显示的那样从 60 跳到 120 或 110 跳到 160……也不会一次保持相同的值一分钟。)
这是我用来收集 watch 数据的代码。是否有另一种方法来配置它以获得更准确的数据,或者它是否与此硬件一样好?
- (void)startWorkoutSession {
if (self.workoutSession) {
return;
}
// configure a HealthKit workout
HKWorkoutConfiguration *configuration = [[HKWorkoutConfiguration alloc] init];
configuration.activityType = HKWorkoutActivityTypeHiking;
configuration.locationType = HKWorkoutSessionLocationTypeOutdoor;
// start the workout
NSError *error = nil;
self.workoutSession = [[HKWorkoutSession alloc] initWithConfiguration:configuration error:&error];
if (!self.workoutSession) {
//NSLog(@"*** Unable to create the workout session: %@ ***", error.localizedDescription);
NSDictionary *data = [NSDictionary dictionaryWithObjectsAndKeys:
@"createWorkoutSession", @"error",
error.localizedDescription, @"description",
nil];
[self.iosApp sendMessage:data replyHandler:nil errorHandler:^(NSError * _Nonnull error) {
// maybe show a local alert here?
}];
return;
}
self.workoutSession.delegate = self;
[self.healthStore startWorkoutSession:self.workoutSession];
// update the controls view and show the tracking view
self.controls.status = StatusStarted;
if (![self.activeController isEqual:self.tracking]) {
[self.tracking becomeCurrentPage];
}
}
- (void)workoutSession:(HKWorkoutSession *)workoutSession didChangeToState:(HKWorkoutSessionState)toState fromState:(HKWorkoutSessionState)fromState date:(NSDate *)date {
// required method
if (toState == HKWorkoutSessionStateRunning) {
[self requestHeartRate:date];
}
}
- (void)requestHeartRate:(NSDate *)date {
__weak typeof(self) weakSelf = self;
NSPredicate *predicate = [HKQuery predicateForSamplesWithStartDate:date endDate:nil options:HKQueryOptionNone];
HKSampleType *heartRateType = [HKSampleType quantityTypeForIdentifier:HKQuantityTypeIdentifierHeartRate];
HKAnchoredObjectQuery *query = [[HKAnchoredObjectQuery alloc] initWithType:heartRateType predicate:predicate anchor:0 limit:0 resultsHandler:^(HKAnchoredObjectQuery *query, NSArray<HKSample *> *samples, NSArray<HKDeletedObject *> *deletedObjects, HKQueryAnchor *anchor, NSError *error) {
if ((!error)&&(samples.count > 0)) {
[weakSelf receiveHeartRate:(HKQuantitySample *)[samples objectAtIndex:0]];
} else {
NSLog(@"error with initial heart rate query: %@", error);
}
}];
[query setUpdateHandler:^(HKAnchoredObjectQuery *query, NSArray<HKSample *> *samples, NSArray<HKDeletedObject *> *deletedObjects, HKQueryAnchor *anchor, NSError *error) {
if ((!error)&&(samples.count > 0)) {
[weakSelf receiveHeartRate:(HKQuantitySample *)[samples objectAtIndex:0]];
} else {
NSLog(@"error with updated heart rate query: %@", error);
}
}];
[self.healthStore executeQuery:query];
}
- (void)receiveHeartRate:(HKQuantitySample *)sample {
HKQuantity *quantity = sample.quantity;
int value = (int)[quantity doubleValueForUnit:[HKUnit unitFromString:@"count/min"]];
//NSLog(@"got heart rate %i", value);
// display the heart rate in the tracking view
[self.tracking updateHeartRate:value];
}
更新:
我在看 this comparison chart作为我对 Apple Watch 期望的准确性的指示。现在我意识到这只是将 Apple Watch 与另一个基于 watch (手腕)的传感器进行比较。因此,也许该图表只是表明这两种基于手腕的模型都同样不准确。
这很令人困惑,因为您可以在网上搜索“Apple Watch 心率准确度”并找到很多关于它准确度的故事,但没有人显示像我看到的那样的结果,我认为这很差。
最佳答案
要提高 Apple Watch 上的心率报告频率和准确性,您的应用唯一可以做的就是使用准确的 HKWorkoutActivityType
记录锻炼类(class)。因为看起来你已经在这样做了,所以你应该 file a radar与 Apple 讨论测量的准确性。
关于ios - Apple Watch 的心率数据非常不准确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43990802/
当然,您可以将剩余文件大小除以当前下载速度,但如果您的下载速度波动(而且它会波动),这不会产生很好的结果。有什么更好的算法可以产生更平滑的倒计时? 最佳答案 安exponential moving a
对于一个业余项目,我正在尝试对齐照片并创建 3D 图片。我基本上在一个钻机上有 2 个相机,我用来拍照。我会自动尝试以您获得 3D SBS 图像的方式对齐图像。 它们是高分辨率图像,这意味着需要处理大
当然,您可以将剩余的文件大小除以当前的下载速度,但如果您的下载速度波动(而且会波动),这不会产生很好的结果。什么是产生更平滑倒计时的更好算法? 最佳答案 安exponential moving ave
我有一个数据集,其中包含患有糖尿病和未患有糖尿病的人。我想使用这些数据训练一个模型来计算糖尿病状况未知的人的风险概率。我知道在培训中没有被诊断出糖尿病的人大多数都没有糖尿病,但很可能其中一些人可能患有
let parent = path[row-1] let child = path[row] let indexOfChild = matrix[parent.obje
我正在编写一些使用 Element.getBoundingClientRect 的代码(gBCR),加上内联样式更新,以执行计算。 这不适用于一般网站,我不关心或不感兴趣是否有“更好的 CSS 方式”
我有一个很大的 csv 文件,其中包含大量脏数据,我想通过消除所有不是绝对必要的值来稍微清理一下它。 Here是我正在谈论的文件。 它有以下组件: 网站,标题,开始日期,开始日期,雇主,地点,纬度,
有谁知道一个库,它为 Java 提供了一个错误不高于 1-2 毫秒的 Thread.sleep()? 我尝试了 sleep 、错误测量和 BusyWait 的混合,但在不同的 Windows 机器上我
UiApp有DateBox和 DateTimeFormat 对于那个类(class)。但是,不存在诸如 TimePicker 或 TimeBox 这样的东西,用户可以通过明确指定的方式(例如通过使用
因此,我使用 sklearn 的 svm.SVC 模块编写了一个程序来学习 mnist 数据集,出于某种原因,每当我计算其准确性为 100% 时。这似乎好得令人难以置信,这是预期的吗? from sk
我当前找到了 gpytorch ( https://github.com/cornellius-gp/gpytorch )。它似乎是将 GPR 集成到 pytorch 中的一个很棒的包。第一次测试也呈
我正在使用 QT Creator 5.9 创建一个简单的 Web 浏览器模型,我的 EditLine/Text Box 有问题: 1.如何在转到不同的网站/页面后自动更新显示的 URL 字符串。 2。
我在 Linux 上尝试 time -p 命令,我写了一些代码来浪费 CPU 周期: #include using namespace std; int main() { long int c;
亲爱的程序员/脚本编写者/工程师/其他人, 问题:我目前正在为 Android 3.2 平板电脑开发增强现实应用程序,但在获取准确的罗盘读数方面遇到一些问题。我需要确切地知道平板电脑所面向的 (z)
我最近一直在尝试了解 Apache Spark 作为 Scikit Learn 的替代品,但在我看来,即使在简单的情况下,Scikit 收敛到准确模型的速度也远远快于 Spark。例如,我使用以下脚本
如果不是,它的准确性如何? 我想在下载之前知道图片的大小。 最佳答案 HTTP Content-length header 是否格式错误?是的。 您是否应该相信它能公平地表示消息正文的大小?是的。 关
这是一个关于 ngram 线性回归的问题,使用 Tf-IDF(术语频率 - 逆文档频率)。为此,我使用 numpy 稀疏矩阵和 sklearn 进行线性回归。 使用一元语法时,我有 53 个案例和 6
对于某些给定的固定宽度,如何计算特定标签 (NSTextField) 中字符串的高度? 我用谷歌搜索了各种方法并尝试了 this method from Apple .它的工作原理,除了高度变成一行对
我是一名优秀的程序员,十分优秀!