-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_count is undefined in sample for Cyton #156
Comments
I just fixed the timestamp issue, I thought, are you on latest? I'll check on _count, count is supposed to be a running counter of how many samples you have received and it should not be replaced by sample nunber |
Whoops, I was on 2.1.0, just upgraded to 2.1.2 and the timestamp is working. When I console.log the sample, it looks like this: { channelData:
[ -0.008210846270423683,
-0.008674019119026556,
-0.00841266017111065,
-0.008528978649256069,
-0.14546783512447298,
-0.15143103467595992,
-0.14272368910595049,
-0.17293137883321988,
-0.00791066234238891,
-0.007832811216451074,
-0.007839673201998854,
-0.00794427936604969,
-0.14284814361907763,
-0.15420410385180758,
-0.15851689529620352,
-0.16886982099650155 ],
sampleNumber: 56,
auxData:
{ lower: <Buffer 00 00 00 00 00 00>,
upper: <Buffer 00 00 00 00 00 00> },
timestamp: 1500589833556,
_timestamps: { lower: 1500589833554, upper: 1500589833558 },
accelData: [ 0, 0, 0 ],
valid: true } No ._count in there. |
Yup it's because I don't have an auto test to make sure count is there.... Adding and will probs release a new version later with the patch! You could put a counter on your 'sample' event counter to do the same thing In the meantime |
Ok, thanks! For now I'll just sync once every sample cycle. Also just noticed that the accelData is sometimes there, sometimes not. It would be nice to have it always there, and just keep the last value until it's updated. |
Cool! Let me know if you have any problems. I'll think about it but I don't like the idea of adding static info to the sample object. Time syncing is different though because that accel packet comes in over multiple packets. With normal accel mode there is data every packet but most are zeros so you have to omit the packets with zeros in them. There is an internal object that stores the accel array as it builds, we could put a public accessor on it and you could read that every sample and forget about looking for it in each sample. Thoughts? |
Hmm. Maybe just leave it the way it is for now then and let people handle it as they see fit. I guess adding a public method to access it wouldn't be a bad thing though. |
Trying to run the timesync examples, I've found that
_count
insample
,sample._count
is undefined. I think what this can be replaced with is sampleNumber, but it doesn't exactly work the same. It's in this file: https://github.com/OpenBCI/OpenBCI_NodeJS/blob/2.0.0/openBCICyton.jsand the only place I see it is
sampleObject._count = this.sampleCount++;
The other problem I noticed is that the 'timestamp' property of 'sample' is always null, even after syncing. Is this supposed to take some value other than null after syncing?
The text was updated successfully, but these errors were encountered: