Best place for iOS library documentation?

19 views
Skip to first unread message

Ben Lisbakken

unread,
Apr 17, 2014, 7:14:38 PM4/17/14
to commonsense...@googlegroups.com
Hello --

The iOS library has a lot of settings and functionality. I'm wondering if there's a place that describes them. I didn't find anything here http://senseobservationsystems.github.io/sense-ios-library/index.html or http://developer.sense-os.nl/ or https://github.com/senseobservationsystems/sense-ios-library

I have a few questions that I am looking for documentation on:
- Burst metrics
--- How do the burst metrics behave? Are they multiple data points from within the kCSSpatialSettingInterval?
--- Are burst metrics evenly spaced within an interval?
--- Is the number of metrics in a burst static or dynamic?
--- For a non burst, such as kCSSENSOR_ACCELERATION, is it an average or just one datapoint within the interval?

- Is it possible to have multiple sensors polling at nearly the same instant?

- Can kCSSpatialSettingInterval be < 1.0?

Thanks,
Ben

Ben Lisbakken

unread,
Apr 17, 2014, 8:18:08 PM4/17/14
to commonsense...@googlegroups.com
Ah, I see now that there is kCSSpatialSettingNrSamples to determine how many samples burst does per interval.

Pim Nijdam

unread,
Apr 18, 2014, 4:24:12 AM4/18/14
to commonsense...@googlegroups.com
Hi Ben,

The documentation on the library is somewhat outdated. To answer your questions:

> --- How do the burst metrics behave? Are they multiple data points from within the kCSSpatialSettingInterval?
At a certain interval the motion sensors are turned on and a number of samples (burst) is collected. The collected burst is a single data point that looks like
{ "date":<unix timestamp>
"value":{"header":"x-axis,y-axis,z-axis", "interval":<interval in ms>, "values":[[0,0,9.81],[0.0,0.1]]}
}
So the values are a 2-d array, 1 dimension for all three axes, and 1 dimension over time.

> --- Are burst metrics evenly spaced within an interval?
Yes, fixed interval. The following three settings determine the behaviour of the sensor:
//spatial settings
kCSSpatialSettingInterval: the interval between bursts
kCSSpatialSettingFrequency: the sample frequency during the burst
kCSSpatialSettingNrSamples: number of samples for each bursts.

> --- For a non burst, such as kCSSENSOR_ACCELERATION, is it an average or just one datapoint within the interval?
It's a single data point.

- Is it possible to have multiple sensors polling at nearly the same instant?
All motion sensors sample at exactly the same time: accelerometer, gyro, linear acceleration and their burst counter-parts.
Other sensors are not synchronized.

- Can kCSSpatialSettingInterval be < 1.0?
If the interval is shorter than the burst duration it will sample continuously, but chop-up the samples in bursts.
Typically we sample every minute with a 3 second burst duration at 50Hz.

I hope that answers your questions.

Regards,

Pim


--
You received this message because you are subscribed to the Google Groups "CommonSense Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to commonsense-devel...@googlegroups.com.
To post to this group, send email to commonsense...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ben Lisbakken

unread,
Apr 18, 2014, 7:26:49 PM4/18/14
to commonsense...@googlegroups.com
Pim --

Thanks for the response.

With the library is it possible to synchronize other sensors with the accelerometer, gyro etc.? If not, is it because apple's apis don't make it possible?

How does sensor usage affect battery life? Which sensors drain the battery fastest?

Thanks,
Ben


--
You received this message because you are subscribed to a topic in the Google Groups "CommonSense Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/commonsense-developers/IOPyO0nE1Xo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to commonsense-devel...@googlegroups.com.

Ben Lisbakken

unread,
Apr 18, 2014, 10:53:52 PM4/18/14
to commonsense...@googlegroups.com
I have another question so I can understand bursts better.

If I set:
kCSSpatialSettingInterval: 10
kCSSpatialSettingFrequency: 3
kCSSpatialSettingNrSamples: 6

Does this mean that every 10 seconds, I would have a burst that would record 3 samples per second for 2 seconds?

If so, I am confused about the data that I'm seeing.

The interval says "279". Is this the interval between samples in the burst? For instance, in each burst I have 6 samples -- is there 279 milliseconds between each sample?

If there is 279 seconds between each sample, each burst is only 1.674 seconds (6*279), but I thought I was setting bursts to be 2 seconds long?

I must be missing something or misunderstanding.

Thanks,
Ben

Pim Nijdam

unread,
Apr 23, 2014, 8:34:24 AM4/23/14
to commonsense...@googlegroups.com
Hi Ben,

It seems you've discovered a bug in the library. In this case the reported interval seems to be wrong. It is sampling at the specified interval. But after it receives the data it calculates the actual interval (usually the specified and measured sample interval are very close, but in some cases if the device is very busy we see that the sample interval is affected), but there is an 'off by one' error in calculating the interval. It simply divides the time between the first and last sample by the number of samples instead of dividing by the number of intervals (i.e. number of samples minus one). I hadn't noticed the error before as we usually work with 150 samples. 

I'll put in a fix in the library. But for now just now that it's sampling at the specified interval and for the specified number of samples but reporting the wrong interval.

Regards,

Pim

Ben Lisbakken

unread,
Apr 23, 2014, 10:18:49 AM4/23/14
to commonsense...@googlegroups.com
Pim --

So, with the data I posted, I am actually getting a 333ms interval rate?

Thanks,
Ben

Pim Nijdam

unread,
Apr 23, 2014, 12:43:41 PM4/23/14
to commonsense...@googlegroups.com
Ben,

Yes. The corrected interval would be 279.0 * 6 / 5 = 334.8. Which seems pretty close.

Pim

Ben Lisbakken

unread,
Apr 23, 2014, 1:17:43 PM4/23/14
to commonsense...@googlegroups.com
I must be misunderstanding. With these settings
kCSSpatialSettingInterval: 10
kCSSpatialSettingFrequency: 3
kCSSpatialSettingNrSamples: 6

Does this mean that every 10 seconds, I would have a burst that would record 3 samples per second for 2 seconds?

Therefore the interval returned should be 333ms because 3 samples per second * 333ms = 1second.

-Ben

Pim Nijdam

unread,
Apr 23, 2014, 1:39:50 PM4/23/14
to commonsense...@googlegroups.com
You are correct. Although the actual value may differ slightly (couple of ms) as ios is not realtime and provides a best effort. 
Reply all
Reply to author
Forward
0 new messages