Giter Site home page Giter Site logo

digitalinteraction / openmovement Goto Github PK

View Code? Open in Web Editor NEW
142.0 50.0 76.0 390.51 MB

Open Movement devices are miniature, embeddable, open source sensors developed at Newcastle University, UK. The source code for the firmware and software is available under a BSD 2-clause license, and the hardware (PCB designs, layouts and schematics), enclosure designs and documentation are available under a Creative Commons 3.0 BY Attribution License.

Home Page: https://openmovement.dev

HTML 0.25% JavaScript 23.94% CSS 0.17% C 68.73% Makefile 0.74% Shell 0.02% C++ 0.28% Java 0.55% PHP 0.02% Python 0.22% Inno Setup 0.03% MATLAB 0.44% C# 4.32% Swift 0.04% Objective-C 0.16% Batchfile 0.07% Visual Basic .NET 0.01% BitBake 0.01%

openmovement's Introduction

Open Movement

Open Movement devices are miniature, embeddable, open source sensors developed by the Open Movement Team at Newcastle University, UK. The source code for the firmware and software is available under a BSD 2-clause license, and the hardware (PCB designs, layouts and schematics), enclosure designs and documentation are available under a Creative Commons 3.0 BY Attribution License.

Downloads

See Also

YouTube Channel / Open Movement Videos

openmovement's People

Contributors

baawolf avatar bradleypursglove avatar cassimladha avatar danielgjackson avatar felixliu-sf avatar nhammerla avatar sebble avatar sjmf avatar tomn-design avatar tomnappey avatar tompbsmith avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openmovement's Issues

APDS-9007 light sensor range

The light sensor's range is specified in Axivity's doc to be 3-1000 lux. In the UK BioBank's datasheet, it's 3-300 lux. Finally, on the sensor's manufacturer datasheet (Broadcom APDS-9007), it is 3-70K lux.

My question is hence: which one is correct? Since it's the same sensor, I would expect the range to be 3-70K lux? Or was the sensor modified to reduce to a range of 3-1000 lux, and if so, why?

Cannot connect to AX3 device in AX3 GUI but OK in firmware update

I am unable to get the AX3 device to show up in the AX3 GUI (Open Movement 1.0.0.37) devices table. The installation of the software and drivers all went smoothly and the tool is running just fine. I am running a fresh install of Windows 10 in Mac Parallels.

When I plug in the device to USB it shows up in Ports as expected as "Microchip CDC device (COM3)". The LED does blinking red for a few seconds, pause, blinking red, then blue, then white, then green, and finally ends up with a fading in/out white-ish led (maybe red/green/blue at once).

I downloaded and ran the AX3 firmware V47 script and it does seem to have connected with the device successfully and installed updated firmware. Any help greatly appreciated.

Bootload: "CWA17_47.hex"
BOOTER

Loading .HEX file: CWA17_47.he=== 3 ranges ===
--- Range 1/3, start 0x00000000, length 0x00000200 (512) ---
--- Range 2/3, start 0x00002800, length 0x0001ce70 (118384) ---
--- Range 3/3, start 0x000557f8, length 0x00000008 (8) ---
===
x
Waiting for any devices to connect...
DEVICE ADDED: \\?\hid#vid_04d8&pid_003c#7&221b53bb&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
Opening device...
Opening device: \\?\hid#vid_04d8&pid_003c#7&221b53bb&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
Sending query packet...: \\?\hid#vid_04d8&pid_003c#7&221b53bb&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
Getting query response...
Received query response.
Device family: 0x02
Memory region #1: type=1, address=0x00001400, length=0x00028c00 (166912)
Preparing regions from .HEX file...
Copying @0x0002a000,4...
NOTE: Partial read (0x0002a000, 4) not complete (0).

NOTE: Not copying over (read outside range?)
Erasing...
Starting erase...
Erasing...
xxxxxxxxxxxxx
Programming...
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
Verifying...
rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
NOTE: Verify OK.
Resetting...
Sending reset packet...
Closing device...
Finished
DEVICE REMOVED: \\?\hid#vid_04d8&pid_003c#7&221b53bb&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}

bug in getStationaryPeriods.m script on finding temperature

Line 133 that reads
indT = (D.TEMP(:,1)>= T(t)-tBounds) & (D.TEMP(:,1) <= T(t)+wlen+tBounds);

has an issue where wlen is NOT in units of time. It should therefore be converted by:

indT = (D.TEMP(:,1)>= T(t)-tBounds) & (D.TEMP(:,1) <= T(t)+(wlen/86400/50)+tBounds); %convert wlen to time again for searching

Software/AX3/cwa-convert/java output is not matching with Software/AX3/cwa-convert/c/

Hi,
We converted a CWA file using Software/AX3/cwa-convert/c/ and Software/AX3/cwa-convert/java (with only input and output parameters).

Below are the observations.

  1. The Java output is not matching with C output. Output values are completely different.
  2. C output contains 2244360 records and java output contains 4488640 records
  3. C output contains 7 values in each record but java output contains 4 values

We need to use java code to convert CWA file. Please let us know if anything missing.

SampleCWA.zip

Thanks,
Veera.

c cwa-convert - Absolute path of .cwa file not working under UNIX systems.

Just wanted to let it be known here, if anyone is having the same issue and looking for a an answer:

The c cwa-converter does not work when the absolute path to the .cwa file is declare in the CLI with UNIX systems. The reason for this behaviour is the forward slash that is parsed because of the windows version.

if (argv[i][0] == '-' || argv[i][0] == '/')

If I find the time I will submit a proper fix but the quick fix if you work on a UNIX system is to just remove the forward slash part (since there is no use for it beyond Windows anyways):

if (argv[i][0] == '-')

Bugs found in get stationary periods script

in the script getStationaryPeriods there is a type that interpolates to 5Hz instead of 50Hz

% interpolate for speed later on at 50Hz
T = st:0.2/86400:en; <-this gives 5Hz...

should be

% interpolate for speed later on at 50Hz
T = st:0.02/86400:en;

temperature

Why is there no temperature when exporting csv?

Not enough data for this WTV_sd method Sampling frequency must be finite.!!

Hi everyone,
I just faced this problem with some few files. When I try to extract the data it gives me the following error:
"

myPA = findPA('29835_0504062018.cwa','site',1,'side',1,'mass',68,'bodyFat',0.2,'epoch','days','csv','29835_0504062018.csv');
progress: 0 percent
current path:

Status: Calculating the PA data.

progress: 1 percent
progress: 1 percent
progress: 2 percent
progress: 2 percent
progress: 3 percent
progress: 4 percent
progress: 4 percent
progress: 5 percent
progress: 5 percent
progress: 6 percent
progress: 7 percent
progress: 7 percent
progress: 8 percent
progress: 8 percent
progress: 9 percent
Not enough data for this WTV_sd method
Sampling frequency must be finite.
Error using vertcat
Dimensions of arrays being concatenated are not consistent.

Error in findPA (line 195)
PAdata.Raw = [PAdata.Raw; calcPA(filename, p.Results,fileinfo,startTime(i),stopTime(i))];
"

Could someone help me with that?

Thanks
Hosam

WAX9 Issue: Can't find via Bluetooth, crashes Firmware Bootloader

Hi guys,

I just received a WAX9 from Axivity, and can't find it via bluetooth at all. I've tried searching for it via iPhone, my Mac and my Windows machine and none of them can find it. It just flashes a dim blue light every second or so.

I tried plugging it in to see if a firmware update was necessary, and it showed up as the AX3 instead of the WAX9 in device manager with no drivers to be found. I then tried plugging it in with the bootloader open and... the bootloader crashes as soon as it sees it. It acknowledges the arrival but then goes to not responding, the device itself is rapidly flashing red though.

Any thoughts? It seems a touch DOA, I tried charging it and left it for an hour or so (the LEDs shown while charging didn't match up with the dev guide at all though, it was a sort of white light with a touch of other colour added in, and it never really changed colour either).

jomapi does not work with AX6

jomapi throw error on startup that the device # for the AX6 is invalid. Using the updated AX6 C code to compile the jar seems to have fixed the problem for on start, unsure if there are any other issues with the jomapi working with the AX6.

Split out repository

Hello,

I am trying to fork a copy of your Java code for converting .CWA files. However, as this repository contains all your software sources and releases, I cannot just clone this single folder. This makes working with your repository and code difficult. I recommend you try to follow GitHub recommended behaviour (see https://guides.github.com/activities/hello-world/) and have a separate repository for each piece of software. This will allow you to individually version and release components instead of the entire repository as you currently have.

Cheers

Over Sampling Rate per second

I'm reading in the sample CWA file from UK Biobank from this page https://biobank.ctsu.ox.ac.uk/crystal/field.cgi?id=90001 (Resources tab). I wrapped https://github.com/digitalinteraction/openmovement/blob/master/Software/AX3/cwa-convert/c/main.c into the read.cwa package (https://github.com/muschellij2/read.cwa) and the pycwa wraps the accProcess.py code from https://github.com/activityMonitoring/biobankAccelerometerAnalysis/tree/master/accelerometer to compare the results. As you can see from the counts from the data indicate some seconds have > 100 (the sampling rate) records, but I'm wondering if some resampling is done in any way.

 library(readr)
library(GGIR)
library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union
library(pycwa)
library(read.cwa)
library(lubridate)
#> 
#> Attaching package: 'lubridate'
#> The following objects are masked from 'package:base':
#> 
#>     date, intersect, setdiff, union
destfile = file.path(tempdir(), "accsamp.zip")
file = file.path(tempdir(), "accsamp.cwa")
if (!file.exists(file)) {
  if (!file.exists(destfile)) {
    download.file("https://biobank.ctsu.ox.ac.uk/crystal/crystal/examples/accsamp.zip",
                  destfile = destfile, quiet = FALSE)
  }
  unz = unzip(destfile, exdir = tempdir(), overwrite = TRUE)
}

xyz = c("x", "y", "z")

round_to_seconds = function(df) {
  df %>% mutate(time = lubridate::floor_date(time, "1 second"))
}
get_ranges = function(x) {
  sapply(x[xyz], range)
}

############################################
# Reader from OpenMovement/om
############################################
om = read_cwa(file, verbose = FALSE)
om = om$data
colnames(om) = tolower(colnames(om))
om = om[, c("time", xyz)]
nrow(om)
#> [1] 62227320
get_ranges(om)
#>              x         y         z
#> [1,] -8.000000 -8.000000 -8.000000
#> [2,]  7.984375  7.984375  7.984375
om = round_to_seconds(om)

############################################
# Reader from https://github.com/activityMonitoring/biobankAccelerometerAnalysis
############################################
py = py_read_cwa(file, verbose = FALSE)
py = py[, c("time", xyz)]
nrow(py)
#> [1] 60477000
get_ranges(py)
#>           x      y      z
#> [1,] -8.000 -8.000 -8.000
#> [2,]  7.984  7.984  7.984
py = round_to_seconds(py)


head(om)
#> # A tibble: 6 x 4
#>   time                      x      y      z
#>   <dttm>                <dbl>  <dbl>  <dbl>
#> 1 2013-07-13 10:00:05 -0.672   0.125 -1.30 
#> 2 2013-07-13 10:00:05 -0.0312 -0.109  0.844
#> 3 2013-07-13 10:00:05 -0.0469 -0.125  0.891
#> 4 2013-07-13 10:00:05 -0.0312 -0.125  0.891
#> 5 2013-07-13 10:00:05 -0.0312 -0.125  0.891
#> 6 2013-07-13 10:00:05 -0.0312 -0.125  0.891
head(py)
#> # A tibble: 6 x 4
#>   time                     x      y      z
#>   <dttm>               <dbl>  <dbl>  <dbl>
#> 1 2013-07-13 09:00:05 -0.672  0.125 -1.30 
#> 2 2013-07-13 09:00:05 -0.031 -0.109  0.844
#> 3 2013-07-13 09:00:05 -0.047 -0.125  0.891
#> 4 2013-07-13 09:00:05 -0.031 -0.125  0.891
#> 5 2013-07-13 09:00:05 -0.031 -0.125  0.891
#> 6 2013-07-13 09:00:05 -0.031 -0.125  0.891

# need to add because of DST
py$time = py$time + as.period(1, "hour")

om %>% filter(time <= time[1] + as.period(30, "seconds")) %>% group_by(time) %>% count()
#> # A tibble: 31 x 2
#> # Groups:   time [31]
#>    time                    n
#>    <dttm>              <int>
#>  1 2013-07-13 10:00:05    23
#>  2 2013-07-13 10:00:06   101
#>  3 2013-07-13 10:00:07   103
#>  4 2013-07-13 10:00:08   103
#>  5 2013-07-13 10:00:09   104
#>  6 2013-07-13 10:00:10   103
#>  7 2013-07-13 10:00:11   104
#>  8 2013-07-13 10:00:12   103
#>  9 2013-07-13 10:00:13   104
#> 10 2013-07-13 10:00:14   104
#> # … with 21 more rows
py %>% filter(time <= time[1] + as.period(30, "seconds")) %>% group_by(time) %>% count()
#> # A tibble: 31 x 2
#> # Groups:   time [31]
#>    time                    n
#>    <dttm>              <int>
#>  1 2013-07-13 10:00:05    23
#>  2 2013-07-13 10:00:06   100
#>  3 2013-07-13 10:00:07   100
#>  4 2013-07-13 10:00:08   100
#>  5 2013-07-13 10:00:09   100
#>  6 2013-07-13 10:00:10   100
#>  7 2013-07-13 10:00:11   100
#>  8 2013-07-13 10:00:12   100
#>  9 2013-07-13 10:00:13   100
#> 10 2013-07-13 10:00:14   100
#> # … with 21 more rows

gg = GGIR::g.cwaread(file, end = Inf, progressBar = TRUE, desiredtz = "UTC")
#>   |                                                                              |                                                                      |   0%  |                                                                              |                                                                      |   1%  |                                                                              |=                                                                     |   1%  |                                                                              |=                                                                     |   2%  |                                                                              |==                                                                    |   2%  |                                                                              |==                                                                    |   3%  |                                                                              |==                                                                    |   4%  |                                                                              |===                                                                   |   4%  |                                                                              |===                                                                   |   5%  |                                                                              |====                                                                  |   5%  |                                                                              |====                                                                  |   6%  |                                                                              |=====                                                                 |   6%  |                                                                              |=====                                                                 |   7%  |                                                                              |=====                                                                 |   8%  |                                                                              |======                                                                |   8%  |                                                                              |======                                                                |   9%  |                                                                              |=======                                                               |   9%  |                                                                              |=======                                                               |  10%  |                                                                              |=======                                                               |  11%  |                                                                              |========                                                              |  11%  |                                                                              |========                                                              |  12%  |                                                                              |=========                                                             |  12%  |                                                                              |=========                                                             |  13%  |                                                                              |=========                                                             |  14%  |                                                                              |==========                                                            |  14%  |                                                                              |==========                                                            |  15%  |                                                                              |===========                                                           |  15%  |                                                                              |===========                                                           |  16%  |                                                                              |============                                                          |  16%  |                                                                              |============                                                          |  17%  |                                                                              |============                                                          |  18%  |                                                                              |=============                                                         |  18%  |                                                                              |=============                                                         |  19%  |                                                                              |==============                                                        |  19%  |                                                                              |==============                                                        |  20%  |                                                                              |==============                                                        |  21%  |                                                                              |===============                                                       |  21%  |                                                                              |===============                                                       |  22%  |                                                                              |================                                                      |  22%  |                                                                              |================                                                      |  23%  |                                                                              |================                                                      |  24%  |                                                                              |=================                                                     |  24%  |                                                                              |=================                                                     |  25%  |                                                                              |==================                                                    |  25%  |                                                                              |==================                                                    |  26%  |                                                                              |===================                                                   |  26%  |                                                                              |===================                                                   |  27%  |                                                                              |===================                                                   |  28%  |                                                                              |====================                                                  |  28%  |                                                                              |====================                                                  |  29%  |                                                                              |=====================                                                 |  29%  |                                                                              |=====================                                                 |  30%  |                                                                              |=====================                                                 |  31%  |                                                                              |======================                                                |  31%  |                                                                              |======================                                                |  32%  |                                                                              |=======================                                               |  32%  |                                                                              |=======================                                               |  33%  |                                                                              |=======================                                               |  34%  |                                                                              |========================                                              |  34%  |                                                                              |========================                                              |  35%  |                                                                              |=========================                                             |  35%  |                                                                              |=========================                                             |  36%  |                                                                              |==========================                                            |  36%  |                                                                              |==========================                                            |  37%  |                                                                              |==========================                                            |  38%  |                                                                              |===========================                                           |  38%  |                                                                              |===========================                                           |  39%  |                                                                              |============================                                          |  39%  |                                                                              |============================                                          |  40%  |                                                                              |============================                                          |  41%  |                                                                              |=============================                                         |  41%  |                                                                              |=============================                                         |  42%  |                                                                              |==============================                                        |  42%  |                                                                              |==============================                                        |  43%  |                                                                              |==============================                                        |  44%  |                                                                              |===============================                                       |  44%  |                                                                              |===============================                                       |  45%  |                                                                              |================================                                      |  45%  |                                                                              |================================                                      |  46%  |                                                                              |=================================                                     |  46%  |                                                                              |=================================                                     |  47%  |                                                                              |=================================                                     |  48%  |                                                                              |==================================                                    |  48%  |                                                                              |==================================                                    |  49%  |                                                                              |===================================                                   |  49%  |                                                                              |===================================                                   |  50%  |                                                                              |===================================                                   |  51%  |                                                                              |====================================                                  |  51%  |                                                                              |====================================                                  |  52%  |                                                                              |=====================================                                 |  52%  |                                                                              |=====================================                                 |  53%  |                                                                              |=====================================                                 |  54%  |                                                                              |======================================                                |  54%  |                                                                              |======================================                                |  55%  |                                                                              |=======================================                               |  55%  |                                                                              |=======================================                               |  56%  |                                                                              |========================================                              |  56%  |                                                                              |========================================                              |  57%  |                                                                              |========================================                              |  58%  |                                                                              |=========================================                             |  58%  |                                                                              |=========================================                             |  59%  |                                                                              |==========================================                            |  59%  |                                                                              |==========================================                            |  60%  |                                                                              |==========================================                            |  61%  |                                                                              |===========================================                           |  61%  |                                                                              |===========================================                           |  62%  |                                                                              |============================================                          |  62%  |                                                                              |============================================                          |  63%  |                                                                              |============================================                          |  64%  |                                                                              |=============================================                         |  64%  |                                                                              |=============================================                         |  65%  |                                                                              |==============================================                        |  65%  |                                                                              |==============================================                        |  66%  |                                                                              |===============================================                       |  66%  |                                                                              |===============================================                       |  67%  |                                                                              |===============================================                       |  68%  |                                                                              |================================================                      |  68%  |                                                                              |================================================                      |  69%  |                                                                              |=================================================                     |  69%  |                                                                              |=================================================                     |  70%  |                                                                              |=================================================                     |  71%  |                                                                              |==================================================                    |  71%  |                                                                              |==================================================                    |  72%  |                                                                              |===================================================                   |  72%  |                                                                              |===================================================                   |  73%  |                                                                              |===================================================                   |  74%  |                                                                              |====================================================                  |  74%  |                                                                              |====================================================                  |  75%  |                                                                              |=====================================================                 |  75%  |                                                                              |=====================================================                 |  76%  |                                                                              |======================================================                |  76%  |                                                                              |======================================================                |  77%  |                                                                              |======================================================                |  78%
gg = gg$data
gg$time = lubridate::as_datetime(gg$time)
gg %>% filter(time <= time[1] + as.period(30, "seconds")) %>%
  round_to_seconds() %>% group_by(time) %>% count()
#> # A tibble: 31 x 2
#> # Groups:   time [31]
#>    time                    n
#>    <dttm>              <int>
#>  1 2013-07-13 10:00:05    23
#>  2 2013-07-13 10:00:06   100
#>  3 2013-07-13 10:00:07   100
#>  4 2013-07-13 10:00:08   100
#>  5 2013-07-13 10:00:09   100
#>  6 2013-07-13 10:00:10   100
#>  7 2013-07-13 10:00:11   100
#>  8 2013-07-13 10:00:12   100
#>  9 2013-07-13 10:00:13   100
#> 10 2013-07-13 10:00:14   100
#> # … with 21 more rows

Created on 2020-11-02 by the reprex package (v0.3.0.9001)

Session info
sessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value                       
#>  version  R version 4.0.2 (2020-06-22)
#>  os       macOS Catalina 10.15.6      
#>  system   x86_64, darwin17.0          
#>  ui       X11                         
#>  language (EN)                        
#>  collate  en_US.UTF-8                 
#>  ctype    en_US.UTF-8                 
#>  tz       America/New_York            
#>  date     2020-11-02                  
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package     * version    date       lib source                            
#>  assertthat    0.2.1      2019-03-21 [2] CRAN (R 4.0.0)                    
#>  backports     1.1.10     2020-09-15 [1] CRAN (R 4.0.2)                    
#>  cli           2.1.0      2020-10-12 [1] CRAN (R 4.0.2)                    
#>  colorout    * 1.2-2      2020-06-01 [2] Github (jalvesaq/colorout@726d681)
#>  crayon        1.3.4      2017-09-16 [2] CRAN (R 4.0.0)                    
#>  data.table    1.13.2     2020-10-19 [1] CRAN (R 4.0.2)                    
#>  digest        0.6.27     2020-10-24 [1] CRAN (R 4.0.2)                    
#>  dplyr       * 1.0.2      2020-08-18 [2] CRAN (R 4.0.2)                    
#>  ellipsis      0.3.1      2020-05-15 [2] CRAN (R 4.0.0)                    
#>  evaluate      0.14       2019-05-28 [2] CRAN (R 4.0.0)                    
#>  fansi         0.4.1      2020-01-08 [2] CRAN (R 4.0.0)                    
#>  fs            1.5.0      2020-07-31 [2] CRAN (R 4.0.2)                    
#>  generics      0.0.2      2018-11-29 [2] CRAN (R 4.0.0)                    
#>  GGIR        * 2.1-3      2020-10-22 [1] Github (wadpac/GGIR@49aedcd)      
#>  glue          1.4.2      2020-08-27 [1] CRAN (R 4.0.2)                    
#>  highr         0.8        2019-03-20 [2] CRAN (R 4.0.0)                    
#>  hms           0.5.3      2020-01-08 [2] CRAN (R 4.0.0)                    
#>  htmltools     0.5.0      2020-06-16 [2] CRAN (R 4.0.0)                    
#>  jsonlite      1.7.1      2020-09-07 [1] CRAN (R 4.0.2)                    
#>  knitr         1.30       2020-09-22 [1] CRAN (R 4.0.2)                    
#>  lattice       0.20-41    2020-04-02 [2] CRAN (R 4.0.2)                    
#>  lifecycle     0.2.0      2020-03-06 [2] CRAN (R 4.0.0)                    
#>  lubridate   * 1.7.9      2020-06-08 [2] CRAN (R 4.0.0)                    
#>  magrittr      1.5        2014-11-22 [2] CRAN (R 4.0.0)                    
#>  Matrix        1.2-18     2019-11-27 [2] CRAN (R 4.0.2)                    
#>  pillar        1.4.6      2020-07-10 [2] CRAN (R 4.0.2)                    
#>  pkgconfig     2.0.3      2019-09-22 [2] CRAN (R 4.0.0)                    
#>  purrr         0.3.4      2020-04-17 [2] CRAN (R 4.0.0)                    
#>  pycwa       * 0.1.0      2020-10-30 [1] local                             
#>  R.methodsS3   1.8.1      2020-08-26 [1] CRAN (R 4.0.2)                    
#>  R.oo          1.24.0     2020-08-26 [1] CRAN (R 4.0.2)                    
#>  R.utils       2.10.1     2020-08-26 [1] CRAN (R 4.0.2)                    
#>  R6            2.4.1      2019-11-12 [2] CRAN (R 4.0.0)                    
#>  Rcpp          1.0.5      2020-07-06 [2] CRAN (R 4.0.0)                    
#>  read.cwa    * 0.2.1      2020-10-26 [1] local                             
#>  readr       * 1.4.0      2020-10-05 [1] CRAN (R 4.0.2)                    
#>  reprex        0.3.0.9001 2020-09-30 [1] Github (tidyverse/reprex@d3fc4b8) 
#>  reticulate    1.18       2020-10-25 [1] CRAN (R 4.0.2)                    
#>  rlang         0.4.8.9000 2020-10-22 [1] Github (r-lib/rlang@7a36238)      
#>  rmarkdown     2.4        2020-09-30 [1] CRAN (R 4.0.2)                    
#>  rstudioapi    0.11       2020-02-07 [2] CRAN (R 4.0.0)                    
#>  sessioninfo   1.1.1      2018-11-05 [2] CRAN (R 4.0.0)                    
#>  stringi       1.5.3      2020-09-09 [1] CRAN (R 4.0.2)                    
#>  stringr       1.4.0      2019-02-10 [2] CRAN (R 4.0.0)                    
#>  styler        1.3.2      2020-02-23 [2] CRAN (R 4.0.0)                    
#>  tibble        3.0.4      2020-10-12 [1] CRAN (R 4.0.2)                    
#>  tidyselect    1.1.0      2020-05-11 [2] CRAN (R 4.0.0)                    
#>  utf8          1.1.4      2018-05-24 [2] CRAN (R 4.0.0)                    
#>  vctrs         0.3.4      2020-08-29 [1] CRAN (R 4.0.2)                    
#>  withr         2.3.0      2020-09-22 [1] CRAN (R 4.0.2)                    
#>  xfun          0.18       2020-09-29 [1] CRAN (R 4.0.2)                    
#>  yaml          2.2.1      2020-02-01 [2] CRAN (R 4.0.0)                    
#> 
#> [1] /Users/johnmuschelli/Library/R/4.0/library
#> [2] /Library/Frameworks/R.framework/Versions/4.0/Resources/library

Just the r code (without output):

library(readr)
library(GGIR)
library(dplyr)
library(pycwa)
library(read.cwa)
library(lubridate)
destfile = file.path(tempdir(), "accsamp.zip")
file = file.path(tempdir(), "accsamp.cwa")
if (!file.exists(file)) {
  if (!file.exists(destfile)) {
    download.file("https://biobank.ctsu.ox.ac.uk/crystal/crystal/examples/accsamp.zip",
                  destfile = destfile, quiet = FALSE)
  }
  unz = unzip(destfile, exdir = tempdir(), overwrite = TRUE)
}

xyz = c("x", "y", "z")

round_to_seconds = function(df) {
  df %>% mutate(time = lubridate::floor_date(time, "1 second"))
}
get_ranges = function(x) {
  sapply(x[xyz], range)
}

############################################
# Reader from OpenMovement/om
############################################
om = read_cwa(file, verbose = FALSE)
om = om$data
colnames(om) = tolower(colnames(om))
om = om[, c("time", xyz)]
nrow(om)
get_ranges(om)
om = round_to_seconds(om)

############################################
# Reader from https://github.com/activityMonitoring/biobankAccelerometerAnalysis
############################################
py = py_read_cwa(file, verbose = FALSE)
py = py[, c("time", xyz)]
nrow(py)
get_ranges(py)
py = round_to_seconds(py)


head(om)
head(py)

# need to add because of DST
py$time = py$time + as.period(1, "hour")

om %>% filter(time <= time[1] + as.period(30, "seconds")) %>% group_by(time) %>% count()
py %>% filter(time <= time[1] + as.period(30, "seconds")) %>% group_by(time) %>% count()

gg = GGIR::g.cwaread(file, end = Inf, progressBar = TRUE, desiredtz = "UTC")
gg = gg$data
gg$time = lubridate::as_datetime(gg$time)
gg %>% filter(time <= time[1] + as.period(30, "seconds")) %>%
  round_to_seconds() %>% group_by(time) %>% count()

WAX9 demo source code

I'm writing some code to access the WAX9 sensor from a Mac application, based on the waxrec utility.
I was wondering if you could make the source code for the WAX9 demo available as well (the one with the yellow submarine).

I'm particularly interested in the algorithm you used to extract the absolute rotation from the IMU data.

Thanks!

How to calculate upper arm angle and angular velocity

Hi
I´ve just started using Axivity (AX3) and OmGui. Does anyone know how to calculate upper arm elevation and angular velocity from data :)
Also - I would very much like to read more about how to transform AX3 data into angle and velocities so I would be grateful if anyone could send a reference or link.

Kind regards
Annett

Axivity AX3 drift in data after using export CSV

Hi everyone, I am currently doing a research project using Axivity AX3 accelerometers more precisely a step algorithm validation study using video to determine the true values. During my data analysis i realized that there is some kind of drift in the data after exporting it as csv. More precisely, video and acceleration signal match as displayed in the GUI (graph) but there is an increasing time difference when i look at the data, which I exported with the Export Raw CSV option. The error is around 30 sec per hour of video, which is quite significant in my case.
Accelerometer settings: +-50Hz and +-8g.
OMGUI Version: Downloaded 11/2020

I will try to reinstall the Programm and see if my issue is fixed in a newer version.
If that does not work I will try to come up with a reproducible example for you.

resampling by OMGUI

Following wadpac/GGIR#369 it may be good to also open an issue here.
It seems to me that something is wrong with the OMGUI resampling step.

What I did: I used OMGUI to export http://www.axivity.com/files/resources/longitudinal_data.zip twice to csv, once with resampling and once without resampling, and then plotted those signals on top of each other as a function of timestamp.

Next, I see a non-constant offset in the values between the types of output for all three axes. My guess is that this is related to the resampling because that is the only thing that changed.

BuildAx

Hello.
I'm Electronics Engineers in Korea.
Thank you for open BuildAx Sensor source.
We want to use BuildAx Sensor, We have to modify circuit and firmware.
But I can't find NTC thermistor's partnumber in BuildAx Sensor.
Can you tell me BuildAx Sensor NTC thermistor's partnumber?

cwa-convert Java - CwaBlock copy constructor misses fields

The copy constructor at https://github.com/digitalinteraction/openmovement/blob/master/Software/AX3/cwa-convert/java/src/newcastle/cwa/CwaBlock.java#L130 is incorrect as it only copies some of the fields. The temperature, battery, light, events and number of samples are left as the default 0 value. This causes issues particularly in the method CwaReader.readBlock at https://github.com/digitalinteraction/openmovement/blob/master/Software/AX3/cwa-convert/java/src/newcastle/cwa/CwaReader.java#L116 that uses the copy constructor to return a copy of the current block. Due to this bug, the block returned is missing key fields so cannot be used.

Example code used to convert CWA-DATA.CWA

Hi,

I tried your example code for converting a CWA-DATA.CWA file in the device into a CSV file, but I got different results from OpenMovement software.

Could you please give an example code in either MATLAB or Python to do the same conversion as in OpenMovement Software? Also, which code you use to convert from timestamp into datetime string?

Thanks

timestamp calculated correctly?

Is the following line in the Java implementation correct?:

long time0 = getTimestamp(blockTimestamp) + (long)(1000 * offsetStart / freq);

offsetStart is already divided by freq in

offsetStart = -timestampOffset / freq;

so it would seem that it's being divided twice. For reference, I checked the C version and it seems that it is not divided again there:
t0 = (double)time0 + offsetStart; // Packet start time

Changes in WAX9 FW 3.2?

Is there any details on what changed with the Magnetometer in WAX9's 3.2 update? I've got a WAX9 that came with whatever version is the stock one which reported completely different values in places to the 3.2 firmware.

Documentation of WAX3 Movement Sensor

There is nearly no documentation about the WAX3 movement sensor.

How can you integrate it into other applications. F.e. with the WaxLib.dll
Our use case would be to analyse the received movement data in real time and integrate this in a unity project. Do you have an example which accomplishes something like that?

OMGui - Temperature calibration is incorrect

The calibration applied to the temperature reading in the OMGui application is temperature * 75000 / 256 - 50000 to give the battery level in millicentrigrade (https://github.com/digitalinteraction/openmovement/blob/master/Software/OM/omapi/src/omapi-reader.c#L549). On my test file, this displays as 35.25^C in the UI, which is too hot.

Compare this to the calibration specified in the Matlab cwa-convert application of temperature * 150 - 20500)/1000 to give the battery level in degrees celcius (https://github.com/digitalinteraction/openmovement/blob/master/Software/Analysis/Matlab/AX3_readFile.m#L250) which on the same test data set gives a temperature of 23.15C, which is much more realistic.

From this comparison, it appears as though the OMGui application temperature calibration is incorrect.

Matlab AX3_readFile - last packet has incorrect data read due to off-by-one packet count

When using AX3_readFile, the last packet read is incorrect. With my test file it returns LIGHT values of 887, 885 and 21044, TEMP values of 23.15, 23.15, 0 and ACC values of 0. Stepping into the packet reading code at https://github.com/digitalinteraction/openmovement/blob/master/Software/Analysis/Matlab/AX3_readFile.m#L243 shows that the offset calculation is off-by-one, as the vector validIds contains the base-1 index of the packet (e.g. 3, 4, 5). However, in the read operation of fseek(fid,validIds(i)*512+18,-1), packet 3 (which starts at 1024 (packet 1 = offset 0, packet 2 = offset 512, packet 3 = offset 1024)) is actually read from position 1536 (3 * 512). Therefore all data reading code should be corrected to (validIds(i) - 1) * 512 +... to correctly compensate for the base-1 index.

Java Android Datamode 129 not sending

When I configure my WAX9 in Datamode "129" no data can be read from the input stream. The LED is flashing fast blue. So I think the sensor is sending, but can't be read by the Android Application.
Datamode "1" works, but "129" not.

Need urgent information

Which code is been used by the GUI version of Openmovement?
As i tested the python code which took much time compared to Matlab script.
I didn't test it with R or C?
Can anybody know what exactly is used by it GUI version?
Any help will be appreciated.

Thanks

Document CWA format and calibrations

When trying to use the OpenMovement software on an AX3 CWA file, I am finding that the output of the different language converters are giving me different answers. For example, see issue #11 . It would be sensible and appropriate to document the CWA file format in a language-agnostic fashion with the documented calibration factors for all the fields (accelerometer, battery, light, temperature, etc.). In addition, providing a sample CWA file with the equivalent decoded data will be very useful for validating any libraries that claim to read CWA files.

OSC mode Wax9: allows user to select different ranges for accelerometer, gyro and mag.

The OSC mode for the Wax9 overrides the user's parameters for acc, gyro and mag ranges.

In waxrec.c the default values for a 8g, 2000 dps conversion are fixed, therefore these cannot be changed in the terminal (only in the OSC mode).

Waxrec.c line 1441

        o += write_osc_float(buffer + o, wax9Packet->accel.x / 4096.0f);        /* [OSC float] Accel. X-axis <4 bytes> */
        o += write_osc_float(buffer + o, wax9Packet->accel.y / 4096.0f);        /* [OSC float] Accel. Y-axis <4 bytes> */
        o += write_osc_float(buffer + o, wax9Packet->accel.z / 4096.0f);        /* [OSC float] Accel. Z-axis <4 bytes> */
        o += write_osc_float(buffer + o, wax9Packet->gyro.x * 0.07f);           /* [OSC float] Gyro.  X-axis <4 bytes> */
        o += write_osc_float(buffer + o, wax9Packet->gyro.y * 0.07f);           /* [OSC float] Gyro.  Y-axis <4 bytes> */
        o += write_osc_float(buffer + o, wax9Packet->gyro.z * 0.07f);           /* [OSC float] Gyro.  Z-axis <4 bytes> */
        o += write_osc_float(buffer + o, wax9Packet->mag.x * 0.10f);            /* [OSC float] Mag.   X-axis <4 bytes> */
        o += write_osc_float(buffer + o, wax9Packet->mag.y * 0.10f);            /* [OSC float] Mag.   Y-axis <4 bytes> */
        o += write_osc_float(buffer + o, wax9Packet->mag.z * 0.10f);            /* [OSC float] Mag.   Z-axis <4 bytes> */

It would be great if these parameters can be changed without recompiling or adding multiply blocks in the host.

Thanks

Unable to download data and start recording

Hello, I have been using OMGui for several months to start recording data on AX3 devices and download data at the end of recording sessions. Recently, the software has not been working on my computer. Specifically, when I open the software with a device plugged in, I can see the data in the software and can stop recording. However, I cannot download the data and restart the recording process. When I select "download" or "record interval" nothing happens. I have tried reinstalling the software, but the issue remains. Does this sound familiar to anyone? Any suggestions or ideas of what might be wrong?

cwa-convert Java - CwaBlock incorrectly deserialises accelerometer packets with BPS of 4

The logic for reading packets with a BPS of 4 is incorrect as the statement byteBuffer.getInt(30 + 4 * i) is upcast to a long. When the result of getInt is negative then the resulting upcasting is negative as well, which pads the exponent with 1's. This means that the exponent is read out as a negative instead of a positive so the values are right shifted further than they should.

Feature suggestion: Datetime placeholder in filename

To simplify transfer, it would be nice to have a {datetime} placeholder available to use in the OmGUI and reduce the likelihood of unintentional overwriting (although the operator can see a warning dialog, but there is no way to simply set a non conflicting filename apart from modifying the name of the file of the previous recording with the same name on disk).

AX3_readFile with unpacked data

Hi Daniel

Is it possible to edit AX3_readFile so it is compatible with unpacked data?

I see some code already to check for samples per packet. Probably just need some edits to parseValueBlockML to handle cases where samplesPerPacket = 80?

Cheers

Tom

EDIT: I think this should be an easy solution:

Instead of storing the acc data in a temp file prior to unpacking, you could just save it into the data struct directly:

if samplesPerPacket == 120,
    ACC_tmp((i-1)*samplesPerPacket+1:i*samplesPerPacket) = fread(fid, samplesPerPacket, 'uint32',0,'ieee-le');
else
    data.ACC((i-1)*samplesPerPacket+1:i*samplesPerPacket,2:4) = reshape(fread(fid, samplesPerPacket*3, 'int16').', [3, samplesPerPacket]).' / 256;
end

Need to skip the next block too, where the unpacking happens:

if samplesPerPacket == 120,
    if options.modality(1),
        % decode values for accelerometer

        if options.verbose > 0,
            fprintf('parsing samples\n');
        end

        % calls external c-code to unpack values (for speed pass on full
        % block instead of loop)

        if options.useC
            data.ACC(:,2:4) = parseValueBlock(ACC_tmp)' / 256;
        else
            data.ACC(:,2:4) = double(parseValueBlockML(ACC_tmp)) / 256;
        end

        clear ACC_tmp; % clear some memory
    end
end

And probably avoid ACC_tmp being initialized:

if samplesPerPacket == 120,
    ACC_tmp = zeros(size(validIds,1)*samplesPerPacket,1,'uint32');
end

Novice

Hi Daniel,
My apologies - for a novice matlab user. Can you please step me through how I would import / read my CWA files with the readCWA script / code?
Thank you

Discharged error, but has charge.

image
I am testing devices, and am getting this error with many during set up. They have been kept with charged and recharged every few months, but this error shows even though they still have a charge on them.
Any help is appreciated

Malformed OSC message from Wax9

Compiled waxrec on mac using 10.10.

The OSC message sent using the Wax9 is malformed.

I have successfully compiled by myself the updated waxrec.c found on openmovement github wax3 page (although the commits and the code reports an update to the wax9) on Mac. I was able to have the Wax9 sending data to the mac. I use the following command because I need the -osc flag so that I can send data over udp in real time to Max/MSP or PureData.

./waxrec /dev/tty.WAX9-CC03-COM1 -init “\r\nRATE X 1 50\r\nDATAMODE 1\r\nSTREAM\r\n” -osc localhost:8200

It outputs the following message from the interpreter (Cycling 74 Max)

udpreceive: Bad size count 76 in OSC bundle (only 68 bytes left in entire bundle)

Changing to Datamode 0 gives a different Bad size count.

The same works with Wax3.

Thanks

Import of .csv file

I'm setting up a bunch (nearly 2000) Axivity AX3s as part of a research project. We have ~2k participants. For each participant we've created a unique ID, which we input as the Session ID on the device.

I have a USB-hub available allowing me to connect 28 devices at once. They register fine in OmGui. I can even make changes to them all at once, but I still have to manually change the Session ID for each one - unless there is something I'm missing, of course.

Is it possible to import a .csv file containing a list of Session IDs and relevant setting-indications for OmGui to read and apply to selected devices?

  • Jack

Running Python script error

Hello,
I have .cwa file I need to parse and store in SQLite DB. For this, I download the cwa.py script. I passed the input file it creates the SQLite DB file but did not store any values.
When I check out the DB file. It contains DateTime, x, y, z columns.

I tried once more by debugging the code. I concluded that after open file, it read the data in binary format which make no sense in if else condition
self.fh = open(filename, "rb")

Any help will be appreciated in this regard.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.