sensor

Android SensorEvent timestamp issue

∥☆過路亽.° 提交于 2020-01-01 07:04:23
问题 I am currently working on an android application where I have to log all the sensor values. I got the sensor event timestamp from "event.timestamp" and I converted this value into a unix timestamp. long currTimeRelativeToBootMs = SystemClock.uptimeMillis(); long currTimeAbsoluteMs = System.currentTimeMillis(); mStartTimeAbsoluteS = ((double)(currTimeAbsoluteMs - currTimeRelativeToBootMs))/(double)1000.0; ... //timestampRelativeInNs = event.timestamp double temp = mStartTimeAbsoluteS+((double

Android SensorEvent timestamp issue

一世执手 提交于 2020-01-01 07:03:07
问题 I am currently working on an android application where I have to log all the sensor values. I got the sensor event timestamp from "event.timestamp" and I converted this value into a unix timestamp. long currTimeRelativeToBootMs = SystemClock.uptimeMillis(); long currTimeAbsoluteMs = System.currentTimeMillis(); mStartTimeAbsoluteS = ((double)(currTimeAbsoluteMs - currTimeRelativeToBootMs))/(double)1000.0; ... //timestampRelativeInNs = event.timestamp double temp = mStartTimeAbsoluteS+((double

What is the equivalent for a Hidden Markov Model in the WEKA toolkit?

纵饮孤独 提交于 2020-01-01 05:48:08
问题 I need to classify a datastream which comes from a sensor network consisting of 8 accelerometers. Each accelerometer gives me a X Y and Z value. Thus at each sample i have 8 x 3 = 24 acceleration values. I sample at about 30 hz and the performance time is about 0.5 seconds. At first i thought of using a Hidden Markov model for this but it seems that the WEKA toolkit does not provide such a thing. What is the WEKA equivalent for this? Thank you. EDIT: how to format data? I have collected data

iPhone Temperature Sensor

我与影子孤独终老i 提交于 2019-12-31 22:57:37
问题 My question is very similar to this one: iPhone Proximity Sensor. There's clearly some manner of thermometer within the iPhone that's readable by the OS. Has anyone uncovered the super-secret undocumented APIs to read this sensor? 回答1: I doubt this sensor is for ambient temperature - rather I suspect it is for overheating of the circuits. If that is all you want then great, but again, I think it would be useless for ambient temperature. just my opinion. 回答2: All i could find was

How to append fast updating strings to file in swift

做~自己de王妃 提交于 2019-12-31 05:29:11
问题 I want to write sensor data to a file as the sensor updates within the method. I need to append the data as it updates, but my file overwrites with the last sensor output when I try to. func startAccel(fileName: String, fileURL: URL) ->Void{ //Starting accelerometer motionManager.accelerometerUpdateInterval = 1.0 / Double(hz) //determines refresh speed motionManager.startAccelerometerUpdates(to: OperationQueue.current!){ (data, error) in if let myData = data{ do{ let newLine = "Accelerometer,

Getting magnetic field values in global coordinates

这一生的挚爱 提交于 2019-12-30 11:56:06
问题 For an Android application, I need to get magnetic field measurements across the axis of global (world's) coordinate system. Here is how I'm going (guessing) to implement this. Please, correct me if necessary. Also, please, note that the question is about algorithmic part of the task, and not about Android APIs for sensors - I have an experience with the latter. First step is to obtain TYPE_MAGNETIC_FIELD sensor data ( M ) and TYPE_ACCELEROMETER sensor data ( G ). The second is supposed to be

Smoothing data from a sensor

给你一囗甜甜゛ 提交于 2019-12-28 01:43:28
问题 I have a 3D sensor which measures v(x,y,z) data. I'm only using the x and y data. Smoothing only x and y would be enough. If I use a log to show the data, it shows me something like this: (time) 0.1 ... (Data log) x = 1.1234566667 (time) 0.2 ... (Data log) x = 1.1245655666 (time) 0.3 ... (data log) x = 1.2344445555 Well the data is more exact actually, but I want to smooth between the 1.1234 value and the 1.2344 value, because for me it's the same, I can use integers to, showing only "x= 1"

How to set text in onSensorChange metod +accelerometer

为君一笑 提交于 2019-12-25 18:56:05
问题 Thanks in advance. I m working in game application using accelerometer. but i've facing a problem, when i update textview in "onSensorChange" method of accelerometer.application not perform good. My code like this. int nCounter = 0; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mTV_CountTextView = (Textview)findViewById(R.id.TextView); } .... ...... public void onSensorChanged(SensorEvent sensorEvent) { { if

Android Wear: measuring sensors and preventing ambient mode / sleep

假装没事ソ 提交于 2019-12-25 09:50:38
问题 I have built an app for Android Wear that needs to measure the motion (accelerometer) sensors continuously for an hour or so for data collection purposes. During operation, I have had problems with the device going into ambient mode (or sleep) and slowing down (or shutting off) the sensors. As a result, I am using the following command to lock the screen on and it seems to work. But it also seems wasteful, since I dont actually need the screen on, just the sensors running. getWindow()

How can I detect the up-down (Ping-pong) movement of device? [closed]

蹲街弑〆低调 提交于 2019-12-25 03:36:49
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed last year . There is a dice game in android games that when you move up and down your device like a Ping-pong racket, it throws dices in the screen. I want to detect this movement of device. How can I do that? Thanks, 回答1: package org.mabna.order.utils; public interface OnDeviceShakeListener {