【发布时间】:2016-06-17 20:39:03
【问题描述】:
我正在开发一个用于检测用户当前动作的项目,我使用 CMMotionActivityManager 来处理这些动作,包括“静止”、“步行”、“汽车”、“跑步”。 现在有一个要求,我需要知道人们停车时的位置。但问题是,我只需要人们最后停车时的位置。如何消除停车标志的影响。 因为人们在开车时总是停下来。
如果汽车停止,则状态将为'stationary,1,walking,0,running,0,automotive,1,cycling,0'
如果汽车在汽车运动中,状态:'stationary,0,walking,0,running,0,automotive,1,cycling,0'
如果汽车处于静止状态:'stationary,1,walking,0,running,0,automotive,0,cycling,0'
这是代码的一部分:
if (activity.automotive && activity.stationary) {
//stop signs status
}
if (activity.automotive && !activity.stationary) {
//automotive
}
if (!activity.automotive && activity.stationary && activity.confidence == CMMotionActivityConfidenceHigh) {
//stationary with a high confidence
}
但是系统不能那么敏感,它无法确定用户是因为停车标志而停车还是最终停车。 由于不够灵敏,所以不知道如何提高检测人是否最终停车的准确度。
【问题讨论】:
-
你最后有没有得到什么有用的东西?
标签: ios core-motion cmmotionmanager