Skip to content
This repository was archived by the owner on Jul 20, 2025. It is now read-only.

Commit 6a4c6d6

Browse files
author
Stephen Schiffli
committed
Merge branch 'release-2.8.1'
2 parents dd65930 + 0d506ac commit 6a4c6d6

File tree

171 files changed

+9082
-8074
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

171 files changed

+9082
-8074
lines changed

Docs/gen_api_reference.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
appledoc -p "MetaWear iOS/macOS/tvOS API 2.8.0" --project-version "2.8.0" -c "MBIENTLAB INC" --company-id com.mbientlab --no-create-docset --no-repeat-first-par --ignore .m -o . ../MetaWear/Classes
1+
appledoc -p "MetaWear iOS/macOS/tvOS API 2.8.1" --project-version "2.8.1" -c "MBIENTLAB INC" --company-id com.mbientlab --no-create-docset --no-repeat-first-par --ignore .m -o . ../MetaWear/Classes
22
open html/index.html
33

44
make html

Docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@
5555
# built documents.
5656
#
5757
# The short X.Y version.
58-
version = '2.8.0'
58+
version = '2.8.1'
5959
# The full version, including alpha/beta/rc tags.
60-
release = '2.8.0'
60+
release = '2.8.1'
6161

6262
# The language for content autogenerated by Sphinx. Refer to documentation
6363
# for a list of supported languages.

Docs/source/sensor_fusion.rst

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,24 @@
33
Sensor Fusion
44
=============
55

6-
The MetaMotion family of boards comes with a builtin Sensor Fusion algorithm. It's configured via properties on the `MBLSensorFusion <https://www.mbientlab.com/docs/metawear/ios/latest/Classes/MBLSensorFusion.html>`_ class.
6+
The MetaMotion family of boards comes with a builtin Sensor Fusion algorithm. It's configured via properties on the `MBLSensorFusion <https://www.mbientlab.com/docs/metawear/ios/latest/Classes/MBLSensorFusion.html>`_ class. When using the sensor fusion algorithm, it is important that you do not simultaenously use the Accelerometer, Gyro, and Magnetometer modules; the algorithm configures those sensors internally based on how you configure the sensor fusion algorithm.
77

88
As explained `here <http://www.chrobotics.com/library/attitude-estimation>`_. When estimating attitude and heading, the best results are obtained by combining data from multiple types of sensors to take advantage of their relative strengths. For example, rate gyros can be integrated to produce angle estimates that are reliable in the short-term, but that tend to drift in the long-term. Accelerometers, on the other hand, are sensitive to vibration and other non-gravity accelerations in the short-term, but can be trusted in the long-term to provide angle estimates that do no degrade as time progresses. Combining rate gyros and accelerometers can produce the best of both worlds - angle estimates that are resistant to vibration and immune to long-term angular drift.
99

10+
Mode
11+
----
12+
The sensor fusion algorithm has 4
13+
`fusion modes <https://mbientlab.com/docs/metawear/ios/latest/Constants/MBLSensorFusionMode.html>`_, listed in the below table:
14+
15+
======== ==========================================================================
16+
Mode Description
17+
======== ==========================================================================
18+
NDoF Calculates absolute roeintation from accelerometer, gyro, and magnetometer
19+
IMUPlus Calculates relative orientation in space from accelerometer and gyro data
20+
Compass Determines geographic direction from th Earth's magnetic field
21+
M4G Similar to IMUPlus except rotation is detected with the magnetometer
22+
======== ==========================================================================
23+
1024
Attitude and Heading
1125
--------------------
1226

@@ -46,7 +60,16 @@ This looks at the acceleration due to motion and removes the acceleration due to
4660
Corrected Sensor Readings
4761
-------------------------
4862

49-
Sensor fusion algorithms are able to use the strengths of various sensors to improve the weaknesses of others. This allows us to extract more accurate readings of sensor values.
63+
Sensor fusion algorithms are able to use the strengths of various sensors to improve the weaknesses of others. This allows us to extract more accurate readings of sensor values. Keep in mind that each sensor fusion mode has different sets of available data and produces it at different rates.
64+
65+
======== ===== ===== ====
66+
Mode Acc Gyro Mag
67+
======== ===== ===== ====
68+
NDoF 100Hz 100Hz 25Hz
69+
IMUPlus 100Hz 100Hz N/A
70+
Compass 25Hz N/A 25Hz
71+
M4G 50Hz N/A 50Hz
72+
======== ===== ===== ====
5073

5174
::
5275

MetaWear.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'MetaWear'
3-
s.version = '2.8.0'
3+
s.version = '2.8.1'
44
s.license = { :type => 'Commercial', :text => 'See https://www.mbientlab.com/terms/', :file => 'LICENSE' }
55
s.homepage = 'https://mbientlab.com'
66
s.summary = 'iOS/macOS/tvOS API and documentation for the MetaWear platform'

MetaWear/Classes/Core/MBLConstants.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ typedef NS_ENUM(uint8_t, MBLFirmwareVersion) {
7070
MBLFirmwareVersion1_2_3,
7171
MBLFirmwareVersion1_2_4,
7272
MBLFirmwareVersion1_2_5,
73-
MBLFirmwareVersion1_3_0
73+
MBLFirmwareVersion1_3_0,
74+
MBLFirmwareVersion1_3_1
7475
};
7576
NSString *MBLFirmwareVersionString(MBLFirmwareVersion version);
7677

MetaWear/Classes/Core/MBLConstants.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
#import "MBLConstants.h"
3737
#import "MBLConstants+Private.h"
3838

39-
NSString *const kMBLAPIVersion = @"2.8.0";
39+
NSString *const kMBLAPIVersion = @"2.8.1";
4040

4141
NSString *MBLFirmwareVersionString(MBLFirmwareVersion version)
4242
{
@@ -69,6 +69,8 @@
6969
return @"1.2.5";
7070
case MBLFirmwareVersion1_3_0:
7171
return @"1.3.0";
72+
case MBLFirmwareVersion1_3_1:
73+
return @"1.3.1";
7274
}
7375
}
7476

MetaWear/Classes/Core/MBLEvent.m

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -804,6 +804,51 @@ - (MBLFilter *)changeOfEventAcrossThreshold:(double)threshold hysteresis:(double
804804
}
805805

806806

807+
typedef struct __attribute__((packed)) {
808+
uint8_t filter_id;
809+
uint8_t outputlen:2;
810+
uint8_t inputlen:2;
811+
uint8_t inputcount:3;
812+
uint8_t issigned:1;
813+
uint8_t mode:3;
814+
} df_rms_param_t;
815+
816+
static const int RMS_MODE_RMS = 0;
817+
static const int RMS_MODE_RSS = 1;
818+
819+
- (MBLFilter *)rmsOfEventWithInputLength:(uint8_t)inputLength inputCount:(uint8_t)inputCount format:(MBLFormat *)format
820+
{
821+
df_rms_param_t params = {0};
822+
params.filter_id = 7;
823+
params.outputlen = 4 - 1;
824+
params.inputlen = inputLength - 1;
825+
params.inputcount = inputCount - 1;
826+
params.issigned = YES;
827+
params.mode = RMS_MODE_RMS;
828+
829+
MBLFilter *filter = [[MBLFilter alloc] initWithTrigger:self
830+
filterParameters:[NSData dataWithBytes:&params length:sizeof(df_rms_param_t)]
831+
format:format];
832+
return filter;
833+
}
834+
835+
- (MBLFilter *)rssOfEventWithInputLength:(uint8_t)inputLength inputCount:(uint8_t)inputCount format:(MBLFormat *)format
836+
{
837+
df_rms_param_t params = {0};
838+
params.filter_id = 7;
839+
params.outputlen = 4 - 1;
840+
params.inputlen = inputLength - 1;
841+
params.inputcount = inputCount - 1;
842+
params.issigned = YES;
843+
params.mode = RMS_MODE_RSS;
844+
845+
MBLFilter *filter = [[MBLFilter alloc] initWithTrigger:self
846+
filterParameters:[NSData dataWithBytes:&params length:sizeof(df_rms_param_t)]
847+
format:format];
848+
return filter;
849+
}
850+
851+
807852
- (MBLEvent *)readDataOnEvent:(MBLData *)data
808853
{
809854
return [[MBLTriggeredRead alloc] initWithData:data trigger:self];

MetaWear/Classes/Modules/Accelerometer/AccelerometerBosch/AccelerometerBMI160/MBLAccelerometerBMI160.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
#import "MBLAccelerometerBoschFlatEvent.h"
4545
#import "MBLAccelerometerBMI160StepEvent.h"
4646
#import "MBLAccelerometerBMI160MotionEvent+Private.h"
47-
#import "MBLRMSAccelerometerDataFilter.h"
4847
#import "MBLFormat.h"
4948
#import "MBLNumericFormatter.h"
5049
#import "MBLData+Private.h"

MetaWear/Classes/Modules/Accelerometer/AccelerometerBosch/MBLAccelerometerBosch.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@
4242
#import "MBLAccelerometerBoschTapEvent.h"
4343
#import "MBLAccelerometerBoschFlatEvent.h"
4444
#import "MBLAccelerometerBMI160StepEvent.h"
45-
#import "MBLRMSAccelerometerDataFilter.h"
4645
#import "MBLFormat.h"
4746
#import "MBLNumericFormatter.h"
4847
#import "MBLData+Private.h"
4948
#import "bmi160.h"
49+
#import "MBLAccelerometerBoschRMSFormat.h"
5050

5151
@interface MBLAccelerometerBosch ()
5252
@property (nonatomic) MBLRegister *accelDataConfig;
@@ -69,7 +69,7 @@ - (instancetype)initWithDevice:(MBLMetaWear *)device moduleInfo:(MBLModuleInfo *
6969
self.xAxisReadyEvent = [[MBLAccelerometerBoschAxisReadyEvent alloc] initWithAccelerometer:self axis:MBLAccelerometerAxisX];
7070
self.yAxisReadyEvent = [[MBLAccelerometerBoschAxisReadyEvent alloc] initWithAccelerometer:self axis:MBLAccelerometerAxisY];
7171
self.zAxisReadyEvent = [[MBLAccelerometerBoschAxisReadyEvent alloc] initWithAccelerometer:self axis:MBLAccelerometerAxisZ];
72-
self.rmsDataReadyEvent = [[MBLRMSAccelerometerDataFilter alloc] initWithAccelerometerBosch:self];
72+
self.rmsDataReadyEvent = [self.dataReadyEvent rmsOfEventWithInputLength:2 inputCount:3 format:[[MBLAccelerometerBoschRMSFormat alloc] initWithAccelerometer:self]];
7373

7474
// Default settings
7575
self.fullScaleRange = MBLAccelerometerBoschRange16G;

MetaWear/Classes/Modules/Accelerometer/MBLAccelerometer.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
#import "MBLAccelerometerOrientationEvent.h"
4747
#import "MBLAccelerometerTapEvent.h"
4848
#import "MBLAccelerometerShakeEvent.h"
49-
#import "MBLRMSAccelerometerDataFilter.h"
5049
#import "MBLAccelerometerData+Private.h"
5150
#import "MBLAccelerometerAxisReadyEvent.h"
5251

0 commit comments

Comments
 (0)