diff --git a/Directory.Build.props b/Directory.Build.props index 9db0f63..6e2f429 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -13,7 +13,7 @@ LICENSE true icon.png - 0.4.2 + 0.4.3 10.0 strict diff --git a/OpenEphys.Onix1/Bno055DataFrame.cs b/OpenEphys.Onix1/Bno055DataFrame.cs index 0d4f559..23569a3 100644 --- a/OpenEphys.Onix1/Bno055DataFrame.cs +++ b/OpenEphys.Onix1/Bno055DataFrame.cs @@ -7,6 +7,19 @@ namespace OpenEphys.Onix1 /// /// 3D-orientation data produced by a Bosch Bno55 9-axis inertial measurement unit (IMU). /// + /// + /// The physical interpretation of the orientation measurements contained within a depends on the sensor fusion mode that is enabled and the axis configuration + /// that is chosen (see page. 26 of the datasheet) + /// . If the chip is in NDOF mode and is calibrated, orientation measurements (Quaternion, Euler Angles, + /// and Gravity Vector) are absolute ("allocentric") and referenced to the gravity vector and Earth's + /// magnetic field. Specifically, if the chip's axes are oriented such that Y points towords magnetic + /// north, X points towards magnetic east, and Z points opposite the gravity vector, the orientation + /// reading will be null (i.e. Quaternion: X = 0, Y = 0, Z = 0, W = 1; Euler Angles: Yaw = 0, Pitch = 0, + /// and Roll = 0 degrees; Gravity: X = 0, Y = 0, Z = 9.8 m/s^2). Linear acceleration readings are always + /// taken relative to the chip's axis definitions (they are "egocentric"). + /// public class Bno055DataFrame : DataFrame { /// diff --git a/OpenEphys.Onix1/ConfigureNeuropixelsV1eHeadstage.cs b/OpenEphys.Onix1/ConfigureNeuropixelsV1eHeadstage.cs index 97c8c00..596ef75 100644 --- a/OpenEphys.Onix1/ConfigureNeuropixelsV1eHeadstage.cs +++ b/OpenEphys.Onix1/ConfigureNeuropixelsV1eHeadstage.cs @@ -52,7 +52,7 @@ public ConfigureNeuropixelsV1eHeadstage() [TypeConverter(typeof(PolledBno055SingleDeviceFactoryConverter))] [Description("Specifies the configuration for the Bno055 device.")] public ConfigurePolledBno055 Bno055 { get; set; } = - new ConfigurePolledBno055 { AxisMap = Bno055AxisMap.ZXY, AxisSign = Bno055AxisSign.MirrorZ | Bno055AxisSign.MirrorY }; + new ConfigurePolledBno055 { AxisMap = Bno055AxisMap.YZX, AxisSign = Bno055AxisSign.MirrorX | Bno055AxisSign.MirrorZ }; /// /// Gets or sets the port. diff --git a/OpenEphys.Onix1/ConfigureNeuropixelsV2eBetaHeadstage.cs b/OpenEphys.Onix1/ConfigureNeuropixelsV2eBetaHeadstage.cs index 92f7d9b..0fae7b3 100644 --- a/OpenEphys.Onix1/ConfigureNeuropixelsV2eBetaHeadstage.cs +++ b/OpenEphys.Onix1/ConfigureNeuropixelsV2eBetaHeadstage.cs @@ -51,7 +51,7 @@ public ConfigureNeuropixelsV2eBetaHeadstage() [TypeConverter(typeof(PolledBno055SingleDeviceFactoryConverter))] [Description("Specifies the configuration for the Bno055 device.")] public ConfigurePolledBno055 Bno055 { get; set; } = - new ConfigurePolledBno055 { AxisMap = Bno055AxisMap.ZXY, AxisSign = Bno055AxisSign.Default }; + new ConfigurePolledBno055 { AxisMap = Bno055AxisMap.YZX, AxisSign = Bno055AxisSign.MirrorX | Bno055AxisSign.MirrorY }; /// /// Gets or sets the port. diff --git a/OpenEphys.Onix1/ConfigureNeuropixelsV2eHeadstage.cs b/OpenEphys.Onix1/ConfigureNeuropixelsV2eHeadstage.cs index 0bf066c..899076e 100644 --- a/OpenEphys.Onix1/ConfigureNeuropixelsV2eHeadstage.cs +++ b/OpenEphys.Onix1/ConfigureNeuropixelsV2eHeadstage.cs @@ -51,7 +51,7 @@ public ConfigureNeuropixelsV2eHeadstage() [TypeConverter(typeof(PolledBno055SingleDeviceFactoryConverter))] [Description("Specifies the configuration for the Bno055 device.")] public ConfigurePolledBno055 Bno055 { get; set; } = - new ConfigurePolledBno055 { AxisMap = Bno055AxisMap.ZXY, AxisSign = Bno055AxisSign.Default }; + new ConfigurePolledBno055 { AxisMap = Bno055AxisMap.YZX, AxisSign = Bno055AxisSign.MirrorX | Bno055AxisSign.MirrorY }; /// /// Gets or sets the port. diff --git a/OpenEphys.Onix1/ConfigurePolledBno055.cs b/OpenEphys.Onix1/ConfigurePolledBno055.cs index ce542d0..1f318fe 100644 --- a/OpenEphys.Onix1/ConfigurePolledBno055.cs +++ b/OpenEphys.Onix1/ConfigurePolledBno055.cs @@ -5,11 +5,14 @@ namespace OpenEphys.Onix1 { /// - /// Configures a Bosch Bno055 9-axis inertial measurement unit (IMU) that is polled by the host computer. + /// Configures a Bosch Bno055 9-axis inertial measurement unit (IMU) to operate in nine degrees of freedom + /// (NDOF) fusion mode that is polled by the host computer. /// /// - /// This configuration operator can be linked to a data IO operator, such as , using a shared DeviceName. + /// See page. 25 of the datasheet + /// for an explanation of NDOF mode. This configuration operator can be linked to a data IO operator, + /// such as , using a shared DeviceName. /// [Editor("OpenEphys.Onix1.Design.PolledBno055Editor, OpenEphys.Onix1.Design", typeof(ComponentEditor))] [Description("Configures a PolledBno055 device.")] @@ -150,38 +153,41 @@ public PolledBno055DeviceInfo(ContextTask context, Type deviceType, uint deviceA /// /// Specifies the axis map of a Bno055 compared to the default orientation. - /// the datasheet. /// /// - /// The axis of the device can be reconfigured to the new reference axis to account for - /// differences in its mounting position. The following values can be applied to the Bno055's - /// AXIS_MAP_CONFIG register at address 0x41 in order to rotate the Bno055's coordinate system - /// compared to the default orientation presented on page 24 of the Bno055 datasheet. + /// The axes of the Bno055 can be reconfigured to account for differences in its mounting position. The + /// following values can be applied to the Bno055's AXIS_MAP_CONFIG register at address 0x41 to + /// rotate the Bno055's coordinate system compared to the default orientation presented on page 26 of the + /// Bno055 datasheet. + /// Remapping is documented using the following notion: Original Axis->New Axis'. For instance, + /// X->Z', indicates that what was the X-axis in the default configuration will be the Z axis in the remapped + /// configuration. /// public enum Bno055AxisMap : uint { /// - /// Specifies X->X, Y->Y, Z->Z (chip default). + /// Specifies that X->X', Y->Y', Z->Z' (chip default). /// XYZ = 0b00_10_01_00, /// - /// Specifies X->X, Y->Z, Z->Y. + /// Specifies that X->X', Z->Y', Y->Z' /// XZY = 0b00_01_10_00, /// - /// Specifies X->Y, Y->X, Z->Z. + /// Specifies that Y->X', X->Y', Z->Z' /// YXZ = 0b00_10_00_01, /// - /// Specifies X->Y, Y->Z, Z->X. + /// Specifies that Y->X', Z->Y', X->Z' /// YZX = 0b00_00_10_01, /// - /// Specifies X->Z, Y->X, Z->Y. + /// Specifies that Z->X', X->Y', Y->Z' /// ZXY = 0b00_01_00_10, /// - /// Specifies X->Z, Y->Y, Z->X. + /// Specifies that Z->X', Y->Y', X->Z' /// ZYX = 0b00_00_01_10, } @@ -190,10 +196,17 @@ public enum Bno055AxisMap : uint /// Specifies the axis map sign of a Bno055 IMU /// /// - /// The axis of the device can be reconfigured to the new reference axis to account for - /// differences in its mounting position. The following values can be applied to the Bno055's - /// AXIS_MAP_SIGN register at address 0x42 to mirror specific axes in the Bno055's coordinate - /// system compared to the default orientation presented on page 24 of the Bno055 datasheet. + /// + /// The axes of the Bno055 can be reconfigured to account for differences in its mounting position. The + /// following values can be applied to the Bno055's AXIS_MAP_SIGN register at address 0x42 to mirror + /// specific axes in the Bno055's coordinate system compared to the default directions presented on page + /// 26 of the Bno055 + /// datasheet. + /// + /// + /// Note that this setting is applied after the axis map specified by and + /// applies to the new axis definitions. + /// /// [Flags] public enum Bno055AxisSign : uint @@ -203,15 +216,15 @@ public enum Bno055AxisSign : uint /// Default = 0b00000_000, /// - /// Specifies that Z axis should be mirrored. + /// Specifies that Z' axis should be mirrored. /// MirrorZ = 0b00000_001, /// - /// Specifies that Y axis should be mirrored. + /// Specifies that Y' axis should be mirrored. /// MirrorY = 0b00000_010, /// - /// Specifies that X axis should be mirrored. + /// Specifies that X' axis should be mirrored. /// MirrorX = 0b00000_100, } diff --git a/OpenEphys.Onix1/ConfigureUclaMiniscopeV4.cs b/OpenEphys.Onix1/ConfigureUclaMiniscopeV4.cs index 74d635d..267b12e 100644 --- a/OpenEphys.Onix1/ConfigureUclaMiniscopeV4.cs +++ b/OpenEphys.Onix1/ConfigureUclaMiniscopeV4.cs @@ -50,8 +50,7 @@ public ConfigureUclaMiniscopeV4() [TypeConverter(typeof(PolledBno055SingleDeviceFactoryConverter))] [Description("Specifies the configuration for the Bno055 device.")] public ConfigurePolledBno055 Bno055 { get; set; } = - new ConfigurePolledBno055 { AxisMap = Bno055AxisMap.ZYX, AxisSign = Bno055AxisSign.MirrorX | Bno055AxisSign.MirrorY | Bno055AxisSign.MirrorZ }; - + new ConfigurePolledBno055 { AxisMap = Bno055AxisMap.ZYX, AxisSign = Bno055AxisSign.MirrorZ }; /// /// Gets or sets the port.