Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
139 commits
Select commit Hold shift + click to select a range
d539807
add bmp390 calib and parsing support
MAzalya Sep 9, 2024
f34fb92
add bmp390 consensys support
MAzalya Sep 24, 2024
92d4267
Merge remote-tracking branch 'origin/master' into JA-119
MAzalya Oct 14, 2024
48783c6
Merge remote-tracking branch 'origin/master' into JA-119
MAzalya Oct 17, 2024
534ca56
add bmp update unit test
MAzalya Oct 18, 2024
afc9861
add new bmp support to unit test
MAzalya Oct 21, 2024
4e61708
add 3r simulator bmp data parsing test
MAzalya Oct 21, 2024
fc02cab
minor restructure
MAzalya Oct 23, 2024
659b970
Added & Initialized SensorLSM6DSV Class
dmariapan-shimmer Oct 23, 2024
3fdc125
Remove LSM6DSV sensor class unless ShimmerGen3R
dmariapan-shimmer Oct 23, 2024
2302c3a
initialized sensor LIS3MDL Mag for shimmer3r
harithjamadi Oct 24, 2024
7a78535
Updates & Added Gyro Sensor Details
dmariapan-shimmer Oct 24, 2024
a9935d9
update sensor id
MAzalya Oct 24, 2024
55eab47
more updates
MAzalya Oct 25, 2024
44604e8
Updates Made Accel_LN and Gyro
dmariapan-shimmer Oct 25, 2024
b45ed95
some update on mag sensor config
harithjamadi Oct 25, 2024
666a0df
add shimmer3r config
MAzalya Oct 28, 2024
96d5182
SensorLIS2DW12 Class Added
dmariapan-shimmer Oct 28, 2024
301f418
remove list of compatible version for lismdl
harithjamadi Oct 28, 2024
bba24fd
Merge remote-tracking branch 'origin/JA-116_MA' into JA-129
harithjamadi Oct 28, 2024
714da0f
CompatibilityInfoForMaps Update
dmariapan-shimmer Oct 28, 2024
7c097ee
Merge remote-tracking branch 'origin/JA-116_MA' into JA-117
dmariapan-shimmer Oct 28, 2024
f207aa5
Updated Sensor Class
dmariapan-shimmer Oct 28, 2024
017d3a2
add pres_rate bmp390
MAzalya Oct 28, 2024
b4a8332
Updates for ShimmerObject for LSM6DSV LN Accel & Gyro
dmariapan-shimmer Oct 29, 2024
a1e7056
added more lis3mdl implementation on shimmerobject
harithjamadi Oct 29, 2024
acf1db4
Additional Gyro Options - Low-Power Mode
dmariapan-shimmer Oct 30, 2024
d2531f5
Merge remote-tracking branch 'origin/JA-116_MA' into JA-127
dmariapan-shimmer Oct 30, 2024
3ab3504
added lis2mdl for wide range mag shimmer3r
harithjamadi Oct 30, 2024
71cbdbd
updating package name for lisxmdl
harithjamadi Nov 1, 2024
1a2544b
Updates for LIS2DW12 WR Accel
dmariapan-shimmer Nov 1, 2024
f173af8
update lis3mdl to extends from lisxmdl
harithjamadi Nov 1, 2024
5aab7f0
Updates for ShimmerObject LIS2DW12 WR Accel
dmariapan-shimmer Nov 1, 2024
8d8b67c
Updates for WR Accel
dmariapan-shimmer Nov 4, 2024
3dd8309
Merge branch 'master' into JA-119
MAzalya Nov 5, 2024
b2d35cf
Merge remote-tracking branch 'origin/JA-116_MA' into JA-119
MAzalya Nov 5, 2024
55ff6d8
listOfCompatibleVersionInfoBMP390
MAzalya Nov 5, 2024
160d599
Update listOfCompatibleVersionInfo & LABEL_SENSOR_TILE
dmariapan-shimmer Nov 5, 2024
f1df34d
initializing adxl371 high g accel for shimmer3r
harithjamadi Nov 5, 2024
13020e8
adding 3r label to configuration for lisxmdl sensor
harithjamadi Nov 5, 2024
d85c756
Updates for LSM303 methods
dmariapan-shimmer Nov 5, 2024
ed26a95
minor update on the accel rate array
harithjamadi Nov 5, 2024
8bc3170
change the label sensor title for lisxmdl
harithjamadi Nov 5, 2024
6bc28ee
Merge remote-tracking branch 'origin/JA-127' into JA-115
MAzalya Nov 7, 2024
3f8c1f6
Merge branch 'JA-115' into JA-117
MAzalya Nov 7, 2024
e267be3
fix 3r gyro label
MAzalya Nov 7, 2024
a2e14f1
fix merge issue
MAzalya Nov 7, 2024
006dede
Merge branch 'JA-115' into JA-129
MAzalya Nov 7, 2024
383fd0b
fix merge conflicts
MAzalya Nov 7, 2024
b127b07
tidy up
MAzalya Nov 7, 2024
90d0e4d
more updates
MAzalya Nov 7, 2024
81b09ea
Merge branch 'JA-115' into JA-120
MAzalya Nov 7, 2024
b1fbbac
another conflicts resolve issue fix
MAzalya Nov 7, 2024
6c10e04
Update for override methods of LN Accel
dmariapan-shimmer Nov 12, 2024
de14042
update override method for lisxmdl mag sensor
harithjamadi Nov 13, 2024
cca1726
update override method for adxl371
harithjamadi Nov 13, 2024
f8a9dab
Update for Shimmer3r Gyro methods
dmariapan-shimmer Nov 13, 2024
785af86
Updates for Accel LN vars
dmariapan-shimmer Nov 13, 2024
be7368f
Update for Shimmer3r WR Accel Methods
dmariapan-shimmer Nov 14, 2024
93a36bf
update on lisxmdl configoption file
harithjamadi Nov 15, 2024
a4a2228
added some comment on tbd method for high g accel and wr mag
harithjamadi Nov 15, 2024
e36510d
update lis2mdl and lis3mdl method conflict
harithjamadi Nov 15, 2024
b1ebe67
Updated configBytesGenerate method for Gyro 3r
dmariapan-shimmer Nov 19, 2024
9d57286
separating the lis3mdl, lis2mdl to extends abstractsensor individually
harithjamadi Nov 21, 2024
7e67b18
some update on lis3mdl on shimmerobject
harithjamadi Nov 21, 2024
4b792de
added some method for the shimmer object lis3mdl
harithjamadi Nov 21, 2024
a189a69
Merge pull request #173 from ShimmerEngineering/JA-115_2
MAzalya Nov 22, 2024
b2b6475
Merge pull request #172 from ShimmerEngineering/JA-115_3_split
MAzalya Nov 22, 2024
722bfef
3r update
MAzalya Nov 22, 2024
a96376a
add 3r calib params unittest, more refactoring
MAzalya Nov 26, 2024
bb27255
Update SignalsToPlotDialog.java
JongChern Nov 27, 2024
a5b9a1f
update tbd bt command
MAzalya Nov 29, 2024
f71ceca
Merge branch 'JA-115' of https://github.com/ShimmerEngineering/Shimme…
MAzalya Nov 29, 2024
28b803b
update gyro to i16, ignore endian
MAzalya Nov 29, 2024
94fb40c
fix shimmer 3r gyro cant be enabled
MAzalya Dec 2, 2024
bc450e3
update configbyte for high g accel and wr mag
harithjamadi Dec 2, 2024
1e87fc8
refactoring
MAzalya Dec 3, 2024
64f27ec
Merge pull request #177 from ShimmerEngineering/JA-115_nullfix
MAzalya Dec 3, 2024
78c4fd2
fix shimmer3r unit test for wr mag, wr accel and ln accel
harithjamadi Dec 3, 2024
3e601cd
add missing bmp methods
MAzalya Dec 3, 2024
c5861cd
update for additional 3 configbytes
MAzalya Dec 4, 2024
a18ffad
update high g accel, mag sensor to shown in config option for shimmer3r
harithjamadi Dec 4, 2024
c433db2
Temp Fix for LN Accel & Gyro (Calib not read Issue)
dmariapan-shimmer Dec 4, 2024
a39dec5
Merge remote-tracking branch 'origin/CON-685_sensorconfig' into CON-685
dmariapan-shimmer Dec 4, 2024
2bf1c4c
revert some changes from JA-115_unittestfix
MAzalya Dec 5, 2024
e5d714d
Merge remote-tracking branch 'origin/JA-115_MA' into JA-115
MAzalya Dec 5, 2024
35fce84
fix high g accel fail to enable
harithjamadi Dec 5, 2024
e97e43a
Merge pull request #179 from ShimmerEngineering/JA-115_inquiryresponse
JongChern Dec 5, 2024
44929a9
Merge remote-tracking branch 'origin/JA-115' into CON-685_sensorconfig
MAzalya Dec 5, 2024
9859420
Fix for Configure Panel 'Calib not read' Issue
dmariapan-shimmer Dec 5, 2024
9a83d76
Merge branch 'CON-685' into JA-115
MAzalya Dec 5, 2024
46b7462
fix the pressure sensor not showing and cant be enable
harithjamadi Dec 5, 2024
e0d1ea0
Merge pull request #180 from ShimmerEngineering/CON-685_sensorconfig
MAzalya Dec 5, 2024
d3d0edc
remove 5120hz rate support
MAzalya Dec 6, 2024
e3a0a99
fix on the sensor enabled when enabling mag/wr accel sensor
harithjamadi Dec 6, 2024
b4822fc
Merge remote-tracking branch 'origin/CON-685_sensorconfig' into JA-11…
MAzalya Dec 6, 2024
8621265
update to add wrmag and highg accel streaming support
MAzalya Dec 6, 2024
3dfbf1d
Fix for WR Accel & WR Mag Calib params display not generated
dmariapan-shimmer Dec 6, 2024
5bc80d7
add more updates
MAzalya Dec 9, 2024
05ce8d8
Update testing Calib Issue
dmariapan-shimmer Dec 9, 2024
e743842
Merge pull request #182 from ShimmerEngineering/JA-115_altaccelmag_st…
MAzalya Dec 10, 2024
df18149
Removed unnecessary changes
dmariapan-shimmer Dec 10, 2024
369fde3
Merge remote-tracking branch 'origin/JA-115' into CON-685
MAzalya Dec 10, 2024
bdbb67f
fix sensor ranges setting issues
MAzalya Dec 10, 2024
6a452f5
Merge pull request #183 from ShimmerEngineering/CON-685_MA
MAzalya Dec 12, 2024
33d85a2
update on algo support for s3r
harithjamadi Dec 12, 2024
efae4b4
some update on orientation and gyro algo for s3r
harithjamadi Dec 13, 2024
ad5aa7a
update wr mag range and rate
MAzalya Dec 17, 2024
22de728
fix gsr/ppg sensor enable index out of bound issue
MAzalya Dec 17, 2024
0fe8c2a
update on adc sensor for s3r to 14 bit reso
harithjamadi Dec 17, 2024
c1365db
modify some method for u14 data parsing
harithjamadi Dec 17, 2024
421189b
Merge branch 'CON-685_sensorconfig' into CON-685_AH
harithjamadi Dec 18, 2024
2f7470c
fix minor issue with the method
harithjamadi Dec 18, 2024
317d7f2
more update on the s3r adc implementation in shimmerobject
harithjamadi Dec 18, 2024
2a28dee
update on the ppg sensor for shimmer3r
harithjamadi Dec 18, 2024
391cd26
fix on a10 and a15 sensor didnt plot correctly
harithjamadi Dec 18, 2024
9f589c0
Fix: Pressure Resolution Configurable (UL-High)
dmariapan-shimmer Dec 20, 2024
d4d79bb
tidy up
MAzalya Dec 24, 2024
2c4f350
Merge pull request #185 from ShimmerEngineering/CON-685_AH
MAzalya Dec 24, 2024
db6ee71
Merge pull request #186 from ShimmerEngineering/JA-115_DM
MAzalya Dec 24, 2024
ef08610
Merge pull request #184 from ShimmerEngineering/CON-685_sensorconfig
MAzalya Dec 24, 2024
1fb406c
some minor updates and attempt to fix NaN calibration for wr mag
harithjamadi Dec 27, 2024
467ef68
small fix on the high g accel, mag range config value
harithjamadi Dec 30, 2024
85e686c
Ongoing Fix configBytesParse for SensorBMP390
dmariapan-shimmer Dec 31, 2024
4149c81
Ongoing Fix PressureResolution Issue
dmariapan-shimmer Jan 2, 2025
f691959
ongoing fix for gyro range config
harithjamadi Jan 2, 2025
86bf7e9
more 3r support
JongChern Jan 6, 2025
7298099
fix pressure reso msb bytes
MAzalya Jan 6, 2025
6ad1625
Merge remote-tracking branch 'origin/JA-115' into JA-115_MA_2
MAzalya Jan 6, 2025
4225d15
fix gyro upper msb range bytes
MAzalya Jan 6, 2025
ca2f2d6
Merge remote-tracking branch 'origin/JA-115' into JA-115_AH
MAzalya Jan 6, 2025
c3db864
Merge remote-tracking branch 'origin/JA-115_AH' into JA-115_MA_2
MAzalya Jan 7, 2025
d4f5d5c
Merge remote-tracking branch 'origin/master' into JA-115
MAzalya Jan 7, 2025
17b542a
remove static for shimmerverobject and some changes on sensor adc
harithjamadi Jan 9, 2025
72f3770
Merge pull request #188 from ShimmerEngineering/JA-115_staticfix
MAzalya Jan 9, 2025
4e8c82c
tidy up
MAzalya Jan 9, 2025
7139c57
Merge branch 'JA-115' of https://github.com/ShimmerEngineering/Shimme…
MAzalya Jan 9, 2025
71d449c
fix
MAzalya Jan 9, 2025
104e0fe
tidy up, refactoring
MAzalya Jan 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,22 @@ public AlgorithmDetails(
mListOfChannelDetails = listOfAlgortihmChannels;
}

public AlgorithmDetails(
String objectClusterName,
String guiFriendlyName,
List<String> listOfAssociatedSensorChannels,
long derivedSensorBitmapId,
List<Integer> listOfRequiredSensors,
String units,
SENSOR_CHECK_METHOD sensorCheckMethod,
List<ChannelDetails> listOfAlgortihmChannels){
this(objectClusterName, guiFriendlyName, listOfAssociatedSensorChannels, derivedSensorBitmapId, listOfRequiredSensors, units);
mSensorCheckMethod = sensorCheckMethod;
//2016-11-28 MN changed below to override mListOfChannelDetails as this() above attempts to create one from this class
// mListOfChannelDetails.addAll(listOfAlgortihmChannels);
mListOfChannelDetails = listOfAlgortihmChannels;
}

/** Just used in PPGtoHR
* @param objectClusterName
* @param guiFriendlyName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ public static final class DatabaseConfigHandle{
// ------------------- Static Algorithm map start -----------------------
public static final AlgorithmDetails algoGyroOnTheFlyCal = new AlgorithmDetails(
Arrays.asList(//Configuration.Shimmer2.SENSOR_ID.GYRO,
Configuration.Shimmer3.SENSOR_ID.SHIMMER_MPU9X50_GYRO),
Configuration.Shimmer3.SENSOR_ID.SHIMMER_MPU9X50_GYRO,
Configuration.Shimmer3.SENSOR_ID.SHIMMER_LSM6DSV_GYRO),
CHANNEL_UNITS.NO_UNITS,
SENSOR_CHECK_METHOD.ANY);
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.util.Map;

import com.shimmerresearch.algorithms.AlgorithmDetails;
import com.shimmerresearch.algorithms.AlgorithmDetails.SENSOR_CHECK_METHOD;
import com.shimmerresearch.driver.Configuration;
import com.shimmerresearch.driver.ObjectCluster;
import com.shimmerresearch.driver.ShimmerDevice;
Expand Down Expand Up @@ -289,8 +290,11 @@ public static class DatabaseChannelHandles{
Configuration.Shimmer3.ObjectClusterSensorName.GYRO_Z),
(DerivedSensorsBitMask.ORIENTATION_6DOF_LN_QUAT|DerivedSensorsBitMask.ORIENTATION_6DOF_LN_EULER),
Arrays.asList(Configuration.Shimmer3.SENSOR_ID.SHIMMER_ANALOG_ACCEL,
Configuration.Shimmer3.SENSOR_ID.SHIMMER_MPU9X50_GYRO),
Configuration.Shimmer3.SENSOR_ID.SHIMMER_MPU9X50_GYRO,
Configuration.Shimmer3.SENSOR_ID.SHIMMER_LSM6DSV_ACCEL_LN,
Configuration.Shimmer3.SENSOR_ID.SHIMMER_LSM6DSV_GYRO),
CHANNEL_UNITS.NO_UNITS,
SENSOR_CHECK_METHOD.ANY,
listChannelsEuler6DOF_LN);

public static final AlgorithmDetails algo6DoFOrientation_WR_Acc = new AlgorithmDetails(
Expand All @@ -304,8 +308,11 @@ public static class DatabaseChannelHandles{
Configuration.Shimmer3.ObjectClusterSensorName.GYRO_Z),
(DerivedSensorsBitMask.ORIENTATION_6DOF_WR_QUAT|DerivedSensorsBitMask.ORIENTATION_6DOF_WR_EULER),
Arrays.asList(Configuration.Shimmer3.SENSOR_ID.SHIMMER_LSM303_ACCEL,
Configuration.Shimmer3.SENSOR_ID.SHIMMER_MPU9X50_GYRO),
Configuration.Shimmer3.SENSOR_ID.SHIMMER_MPU9X50_GYRO,
Configuration.Shimmer3.SENSOR_ID.SHIMMER_LIS2DW12_ACCEL_WR,
Configuration.Shimmer3.SENSOR_ID.SHIMMER_LSM6DSV_GYRO),
CHANNEL_UNITS.NO_UNITS,
SENSOR_CHECK_METHOD.ANY,
listChannelsQuat6DOF_WR);

public static final Map<String, AlgorithmDetails> mAlgorithmMapRef;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
package com.shimmerresearch.algorithms.orientation;
import java.util.LinkedHashMap;
import com.shimmerresearch.algorithms.AlgorithmDetails;
import com.shimmerresearch.algorithms.AlgorithmLoaderInterface;
import com.shimmerresearch.driver.ShimmerDevice;
import com.shimmerresearch.driver.Configuration.COMMUNICATION_TYPE;
import com.shimmerresearch.driverUtilities.ExpansionBoardDetails;
import com.shimmerresearch.driverUtilities.ShimmerVerDetails.FW_ID;
import com.shimmerresearch.driverUtilities.ShimmerVerObject;
public class OrientationModule6DOFLoader implements AlgorithmLoaderInterface {
@Override
public LinkedHashMap<String, AlgorithmDetails> getMapOfSupportedAlgorithms(ShimmerDevice shimmerDevice) {
ShimmerVerObject svo = shimmerDevice.getShimmerVerObject();
ExpansionBoardDetails eBD = shimmerDevice.getExpansionBoardDetails();
LinkedHashMap<String, AlgorithmDetails> mapOfSupportedAlgorithms = new LinkedHashMap<String, AlgorithmDetails>();
if(svo.getFirmwareIdentifier()==FW_ID.STROKARE){
// mapOfSupportedAlgorithms.put(OrientationModule6DOF.algo6DoFOrientation_WR_Acc.mAlgorithmName, OrientationModule6DOF.algo6DoFOrientation_WR_Acc);
}
else {
if((svo.isShimmerGen3() || svo.isShimmerGen4())){
// mapOfSupportedAlgorithms.putAll(OrientationModule6DOF.mAlgorithmMapRef);
mapOfSupportedAlgorithms = AlgorithmDetails.loadAlgorithmsWhereSensorsAreAvailable(shimmerDevice, OrientationModule6DOF.mAlgorithmMapRef);
}
}
return mapOfSupportedAlgorithms;
}
@Override
public void initialiseSupportedAlgorithms(ShimmerDevice shimmerDevice, COMMUNICATION_TYPE comType) {
// shimmerDevice.getSensorMap().containsKey(key)
LinkedHashMap<String, AlgorithmDetails> mapOfSupported6DOFCh = getMapOfSupportedAlgorithms(shimmerDevice);
for (AlgorithmDetails algorithmDetails:mapOfSupported6DOFCh.values()) {
OrientationModule6DOF orientationModule6DOF = new OrientationModule6DOF(shimmerDevice, algorithmDetails, shimmerDevice.getSamplingRateShimmer(COMMUNICATION_TYPE.BLUETOOTH));
//TODO load any default settings here
shimmerDevice.addAlgorithmModule(orientationModule6DOF);
}
}
}
package com.shimmerresearch.algorithms.orientation;

import java.util.LinkedHashMap;

import com.shimmerresearch.algorithms.AlgorithmDetails;
import com.shimmerresearch.algorithms.AlgorithmLoaderInterface;
import com.shimmerresearch.driver.ShimmerDevice;
import com.shimmerresearch.driver.Configuration.COMMUNICATION_TYPE;
import com.shimmerresearch.driverUtilities.ExpansionBoardDetails;
import com.shimmerresearch.driverUtilities.ShimmerVerDetails.FW_ID;
import com.shimmerresearch.driverUtilities.ShimmerVerObject;

public class OrientationModule6DOFLoader implements AlgorithmLoaderInterface {

@Override
public LinkedHashMap<String, AlgorithmDetails> getMapOfSupportedAlgorithms(ShimmerDevice shimmerDevice) {
ShimmerVerObject svo = shimmerDevice.getShimmerVerObject();
ExpansionBoardDetails eBD = shimmerDevice.getExpansionBoardDetails();

LinkedHashMap<String, AlgorithmDetails> mapOfSupportedAlgorithms = new LinkedHashMap<String, AlgorithmDetails>();

if(svo.getFirmwareIdentifier()==FW_ID.STROKARE){
// mapOfSupportedAlgorithms.put(OrientationModule6DOF.algo6DoFOrientation_WR_Acc.mAlgorithmName, OrientationModule6DOF.algo6DoFOrientation_WR_Acc);
}
else {
if((svo.isShimmerGen3() || svo.isShimmerGen3R() || svo.isShimmerGen4())){
mapOfSupportedAlgorithms = AlgorithmDetails.loadAlgorithmsWhereSensorsAreAvailable(shimmerDevice, OrientationModule6DOF.mAlgorithmMapRef);

}
}

return mapOfSupportedAlgorithms;
}

@Override
public void initialiseSupportedAlgorithms(ShimmerDevice shimmerDevice, COMMUNICATION_TYPE comType) {
// shimmerDevice.getSensorMap().containsKey(key)

LinkedHashMap<String, AlgorithmDetails> mapOfSupported6DOFCh = getMapOfSupportedAlgorithms(shimmerDevice);
for (AlgorithmDetails algorithmDetails:mapOfSupported6DOFCh.values()) {
OrientationModule6DOF orientationModule6DOF = new OrientationModule6DOF(shimmerDevice, algorithmDetails, shimmerDevice.getSamplingRateShimmer(COMMUNICATION_TYPE.BLUETOOTH));

//TODO load any default settings here

shimmerDevice.addAlgorithmModule(orientationModule6DOF);
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.util.Map;

import com.shimmerresearch.algorithms.AlgorithmDetails;
import com.shimmerresearch.algorithms.AlgorithmDetails.SENSOR_CHECK_METHOD;
import com.shimmerresearch.driver.Configuration;
import com.shimmerresearch.driver.ObjectCluster;
import com.shimmerresearch.driver.ShimmerDevice;
Expand Down Expand Up @@ -291,8 +292,12 @@ public static class DatabaseChannelHandles{
(DerivedSensorsBitMask.ORIENTATION_9DOF_LN_QUAT|DerivedSensorsBitMask.ORIENTATION_9DOF_LN_EULER),
Arrays.asList(Configuration.Shimmer3.SENSOR_ID.SHIMMER_ANALOG_ACCEL,
Configuration.Shimmer3.SENSOR_ID.SHIMMER_MPU9X50_GYRO,
Configuration.Shimmer3.SENSOR_ID.SHIMMER_LSM303_MAG),
Configuration.Shimmer3.SENSOR_ID.SHIMMER_LSM303_MAG,
Configuration.Shimmer3.SENSOR_ID.SHIMMER_LSM6DSV_ACCEL_LN,
Configuration.Shimmer3.SENSOR_ID.SHIMMER_LSM6DSV_GYRO,
Configuration.Shimmer3.SENSOR_ID.SHIMMER_LIS3MDL_MAG),
CHANNEL_UNITS.NO_UNITS,
SENSOR_CHECK_METHOD.ANY,
listChannelsEuler9DOF_LN);

public static final AlgorithmDetails algo9DoFOrientation_WR_Acc = new AlgorithmDetails(
Expand All @@ -310,8 +315,12 @@ public static class DatabaseChannelHandles{
(DerivedSensorsBitMask.ORIENTATION_9DOF_WR_QUAT|DerivedSensorsBitMask.ORIENTATION_9DOF_WR_EULER),
Arrays.asList(Configuration.Shimmer3.SENSOR_ID.SHIMMER_LSM303_ACCEL,
Configuration.Shimmer3.SENSOR_ID.SHIMMER_MPU9X50_GYRO,
Configuration.Shimmer3.SENSOR_ID.SHIMMER_LSM303_MAG),
Configuration.Shimmer3.SENSOR_ID.SHIMMER_LSM303_MAG,
Configuration.Shimmer3.SENSOR_ID.SHIMMER_LIS2DW12_ACCEL_WR,
Configuration.Shimmer3.SENSOR_ID.SHIMMER_LSM6DSV_GYRO,
Configuration.Shimmer3.SENSOR_ID.SHIMMER_LIS3MDL_MAG),
CHANNEL_UNITS.NO_UNITS,
SENSOR_CHECK_METHOD.ANY,
listChannelsQuat9DOF_WR);


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ public LinkedHashMap<String, AlgorithmDetails> getMapOfSupportedAlgorithms(Shimm
mapOfSupportedAlgorithms.put(OrientationModule9DOF.algo9DoFOrientation_WR_Acc.mAlgorithmName, OrientationModule9DOF.algo9DoFOrientation_WR_Acc);
}
else {
if(svo.isShimmerGen3() || svo.isShimmerGen4()){
// mapOfSupportedAlgorithms.putAll(OrientationModule9DOF.mAlgorithmMapRef);
if(svo.isShimmerGen3() || svo.isShimmerGen3R() || svo.isShimmerGen4()){

mapOfSupportedAlgorithms = AlgorithmDetails.loadAlgorithmsWhereSensorsAreAvailable(shimmerDevice, OrientationModule9DOF.mAlgorithmMapRef);

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
import com.shimmerresearch.driver.ObjectCluster;
import com.shimmerresearch.driver.ShimmerDevice;
import com.shimmerresearch.exgConfig.ExGConfigOptionDetails.EXG_CHIP_INDEX;
import com.shimmerresearch.sensors.AbstractSensor.SENSORS;
import com.shimmerresearch.sensors.SensorGSR;
import com.shimmerresearch.sensors.SensorSystemTimeStamp;
import com.shimmerresearch.sensors.bmpX80.SensorBMPX80;
Expand Down Expand Up @@ -335,6 +336,7 @@ public int getNumCrcBytes() {
aMap.put(GET_BMP180_PRES_CALIBRATION_COMMAND, new BtCommandDetails(GET_BMP180_PRES_CALIBRATION_COMMAND, "GET_BMP180_PRES_CALIBRATION_COMMAND", BMP180_PRES_CALIBRATION_RESPONSE));
aMap.put(GET_BMP180_CALIBRATION_COEFFICIENTS_COMMAND, new BtCommandDetails(GET_BMP180_CALIBRATION_COEFFICIENTS_COMMAND, "GET_BMP180_CALIBRATION_COEFFICIENTS_COMMAND", BMP180_CALIBRATION_COEFFICIENTS_RESPONSE));
aMap.put(GET_BMP280_CALIBRATION_COEFFICIENTS_COMMAND, new BtCommandDetails(GET_BMP280_CALIBRATION_COEFFICIENTS_COMMAND, "GET_BMP280_CALIBRATION_COEFFICIENTS_COMMAND", BMP280_CALIBRATION_COEFFICIENTS_RESPONSE));
aMap.put(GET_PRESSURE_CALIBRATION_COEFFICIENTS_COMMAND, new BtCommandDetails(GET_PRESSURE_CALIBRATION_COEFFICIENTS_COMMAND, "GET_PRESSURE_CALIBRATION_COEFFICIENTS_COMMAND", PRESSURE_CALIBRATION_COEFFICIENTS_RESPONSE));
aMap.put(GET_MPU9150_MAG_SENS_ADJ_VALS_COMMAND, new BtCommandDetails(GET_MPU9150_MAG_SENS_ADJ_VALS_COMMAND, "GET_MPU9150_MAG_SENS_ADJ_VALS_COMMAND", MPU9150_MAG_SENS_ADJ_VALS_RESPONSE));
aMap.put(GET_INTERNAL_EXP_POWER_ENABLE_COMMAND, new BtCommandDetails(GET_INTERNAL_EXP_POWER_ENABLE_COMMAND, "GET_INTERNAL_EXP_POWER_ENABLE_COMMAND", INTERNAL_EXP_POWER_ENABLE_RESPONSE));
aMap.put(GET_EXG_REGS_COMMAND, new BtCommandDetails(GET_EXG_REGS_COMMAND, "GET_EXG_REGS_COMMAND", EXG_REGS_RESPONSE));
Expand Down Expand Up @@ -453,6 +455,7 @@ public int getNumCrcBytes() {
aMap.put(BMP180_PRES_CALIBRATION_RESPONSE, new BtCommandDetails(BMP180_PRES_CALIBRATION_RESPONSE, "BMP180_PRES_CALIBRATION_RESPONSE", -1)); // Unhandled //TODO RS
aMap.put(BMP180_CALIBRATION_COEFFICIENTS_RESPONSE, new BtCommandDetails(BMP180_CALIBRATION_COEFFICIENTS_RESPONSE, "BMP180_CALIBRATION_COEFFICIENTS_RESPONSE", 22));
aMap.put(BMP280_CALIBRATION_COEFFICIENTS_RESPONSE, new BtCommandDetails(BMP280_CALIBRATION_COEFFICIENTS_RESPONSE, "BMP280_CALIBRATION_COEFFICIENTS_RESPONSE", 24));
aMap.put(PRESSURE_CALIBRATION_COEFFICIENTS_RESPONSE, new BtCommandDetails(PRESSURE_CALIBRATION_COEFFICIENTS_RESPONSE, "PRESSURE_CALIBRATION_COEFFICIENTS_RESPONSE", 21));
aMap.put(MPU9150_MAG_SENS_ADJ_VALS_RESPONSE, new BtCommandDetails(MPU9150_MAG_SENS_ADJ_VALS_RESPONSE, "MPU9150_MAG_SENS_ADJ_VALS_RESPONSE", -1)); // Unhandled
aMap.put(INTERNAL_EXP_POWER_ENABLE_RESPONSE, new BtCommandDetails(INTERNAL_EXP_POWER_ENABLE_RESPONSE, "INTERNAL_EXP_POWER_ENABLE_RESPONSE", 1));
aMap.put(EXG_REGS_RESPONSE, new BtCommandDetails(EXG_REGS_RESPONSE, "EXG_REGS_RESPONSE", 11));
Expand Down Expand Up @@ -1314,7 +1317,11 @@ private void processResponseCommand(byte responseCommand) {
if(mShimmerVerObject.isShimmerGen2()) {
lengthSettings = 5;
idxLengthChannels = 3;
}else if(mShimmerVerObject.isShimmerGen3R()) {
lengthSettings = 11;
idxLengthChannels = 9;
}

// get Sampling rate, accel range, config setup byte0, num chans and buffer size
byte[] settings = readBytes(lengthSettings, responseCommand);
if(settings!=null){
Expand Down Expand Up @@ -1553,6 +1560,27 @@ else if(responseCommand==BMP280_CALIBRATION_COEFFICIENTS_RESPONSE){
retrievePressureCalibrationParametersFromPacket(pressureResoRes,CALIB_READ_SOURCE.LEGACY_BT_COMMAND);
printLogDataForDebugging("BMP280 CALIB Received:\t" + UtilShimmer.bytesToHexStringWithSpacesFormatted(pressureResoRes));
}
} else if(responseCommand==PRESSURE_CALIBRATION_COEFFICIENTS_RESPONSE){
byte[] pressureResoRes = null;
byte[] filteredByteArray = null;
if(mSensorBMPX80.mSensorType.equals(SENSORS.BMP390)){
pressureResoRes = new byte[23]; //21 bytes + 2
pressureResoRes = readBytes(23, responseCommand);
printLogDataForDebugging("BMP390 CALIB Received:\t" + UtilShimmer.bytesToHexStringWithSpacesFormatted(pressureResoRes));
}else if(mSensorBMPX80.mSensorType.equals(SENSORS.BMP280)){
pressureResoRes = new byte[26]; //24 bytes + 2
pressureResoRes = readBytes(26, responseCommand);
printLogDataForDebugging("BMP280 CALIB Received:\t" + UtilShimmer.bytesToHexStringWithSpacesFormatted(pressureResoRes));
}else if(mSensorBMPX80.mSensorType.equals(SENSORS.BMP180)){
pressureResoRes = new byte[24]; //22 bytes + 2
pressureResoRes = readBytes(24, responseCommand);
printLogDataForDebugging("BMP180 CALIB Received:\t" + UtilShimmer.bytesToHexStringWithSpacesFormatted(pressureResoRes));
}

if(pressureResoRes!=null){
filteredByteArray = Arrays.copyOfRange(pressureResoRes, 2, pressureResoRes.length);
retrievePressureCalibrationParametersFromPacket(filteredByteArray,CALIB_READ_SOURCE.LEGACY_BT_COMMAND);
}
}
else if(responseCommand==EXG_REGS_RESPONSE){
delayForBtResponse(300); // Wait to ensure the packet has been fully received
Expand Down Expand Up @@ -3342,7 +3370,9 @@ public void readShimmerVersionNew() {

public void readPressureCalibrationCoefficients() {
if(getHardwareVersion()==HW_ID.SHIMMER_3){
if(getFirmwareVersionCode()>1){
if(getFirmwareVersionCode()>=9){
writeInstruction(GET_PRESSURE_CALIBRATION_COEFFICIENTS_COMMAND);
}else if(getFirmwareVersionCode()>1){
if(isSupportedBmp280()){
// writeInstruction(InstructionsGet.GET_BMP280_CALIBRATION_COEFFICIENTS_COMMAND_VALUE);
// writeInstruction(LiteProtocol.Temp.InstructionsGet.GET_BMP280_CALIBRATION_COEFFICIENTS_COMMAND);
Expand All @@ -3352,6 +3382,8 @@ public void readPressureCalibrationCoefficients() {
writeInstruction(GET_BMP180_CALIBRATION_COEFFICIENTS_COMMAND);
}
}
}else if(getHardwareVersion()==HW_ID.SHIMMER_3R) {
writeInstruction(GET_PRESSURE_CALIBRATION_COEFFICIENTS_COMMAND);
}
}

Expand Down Expand Up @@ -3413,7 +3445,8 @@ public void readBtFwVersion() {
* @param rate it is a value between 0 and 255; 6 = 1152Hz, 77 = 102.56Hz, 255 = 31.25Hz
*/
public void writeGyroSamplingRate(int rate) {
if(getHardwareVersion()==HW_ID.SHIMMER_3){
if(getHardwareVersion()==HW_ID.SHIMMER_3
|| getHardwareVersion()==HW_ID.SHIMMER_3R){
mTempIntValue=rate;
writeInstruction(new byte[]{SET_MPU9150_SAMPLING_RATE_COMMAND, (byte)rate});
}
Expand Down Expand Up @@ -3575,7 +3608,8 @@ public void readAccelSamplingRate() {
* @param rate it is a value between 1 and 7; 1 = 1 Hz; 2 = 10 Hz; 3 = 25 Hz; 4 = 50 Hz; 5 = 100 Hz; 6 = 200 Hz; 7 = 400 Hz
*/
public void writeAccelSamplingRate(int rate) {
if(getHardwareVersion()==HW_ID.SHIMMER_3){
if(getHardwareVersion()==HW_ID.SHIMMER_3
|| getHardwareVersion()==HW_ID.SHIMMER_3R){
mTempIntValue=rate;
writeInstruction(new byte[]{SET_ACCEL_SAMPLING_RATE_COMMAND, (byte)rate});
}
Expand Down Expand Up @@ -3926,7 +3960,7 @@ public void readGyroRange() {
* @param range is a numeric value defining the desired gyroscope range.
*/
public void writeGyroRange(int range) {
if(getHardwareVersion()==HW_ID.SHIMMER_3){
if(getHardwareVersion()==HW_ID.SHIMMER_3 || getHardwareVersion()==HW_ID.SHIMMER_3R){
writeInstruction(new byte[]{SET_MPU9150_GYRO_RANGE_COMMAND, (byte)range});
setGyroRange((int)range);
}
Expand Down Expand Up @@ -3964,11 +3998,22 @@ public void writeShimmerAndSensorsSamplingRate(double rate) {
int samplingByteValue = (int) (1024/getSamplingRateShimmer()); //the equivalent hex setting
writeInstruction(new byte[]{SET_SAMPLING_RATE_COMMAND, (byte)Math.rint(samplingByteValue), 0x00});
}
else if(getHardwareVersion()==HW_ID.SHIMMER_3) {
else if(getHardwareVersion()==HW_ID.SHIMMER_3
|| getHardwareVersion()==HW_ID.SHIMMER_3R) {

writeMagSamplingRate(getMagRate());
writeAccelSamplingRate(getLSM303DigitalAccelRate());
writeGyroSamplingRate(getMPU9X50GyroAccelRate());
try {
writeAccelSamplingRate(getWRAccelRate());
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
writeGyroSamplingRate(getGyroRate());
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
writeExgSamplingRate(rate);

byte[] buf = convertSamplingRateFreqToBytes(getSamplingRateShimmer(), getSamplingClockFreq());
Expand Down
Loading