Is there a limit to number of loggers when in sensor fusion mode?

Hi all,

Just started playing around with the MMR device with Swift, and have been able to successfully log data using the core sensors.
I am trying to get sensor fusion mode up and running, but I've run into the following problem.

When I try to set up more than two loggers that I want to subscribe to, the third one always seems to timeout.
Is there a limit to the number of loggers that the board will accept when in this mode?

Here's the code I've got so far attempting to set this up. Any help or suggestions would be really useful!
Perhaps I'm just not doing the setup right? Or maybe I'm misunderstanding how this sensor fusion mode works.

Thanks in advance!

    mbl_mw_metawearboard_tear_down(board)

    mbl_mw_settings_set_connection_parameters(board, 7.5, 7.5, 0, 6000)
    mbl_mw_metawearboard_set_time_for_response(board, 1000)
    mbl_mw_sensor_fusion_set_mode(board, MBL_MW_SENSOR_FUSION_MODE_NDOF)
    mbl_mw_sensor_fusion_set_acc_range(board, MBL_MW_SENSOR_FUSION_ACC_RANGE_8G)
    mbl_mw_sensor_fusion_set_gyro_range(board, MBL_MW_SENSOR_FUSION_GYRO_RANGE_2000DPS)
    mbl_mw_sensor_fusion_write_config(board)

    mbl_mw_sensor_fusion_clear_enabled_mask(board)
    mbl_mw_sensor_fusion_enable_data(board, MBL_MW_SENSOR_FUSION_DATA_QUATERNION)
    mbl_mw_sensor_fusion_enable_data(board, MBL_MW_SENSOR_FUSION_DATA_CORRECTED_ACC)
    mbl_mw_sensor_fusion_enable_data(board, MBL_MW_SENSOR_FUSION_DATA_CORRECTED_GYRO)
    mbl_mw_sensor_fusion_enable_data(board, MBL_MW_SENSOR_FUSION_DATA_CORRECTED_MAG)

    guard let fusion_signal = mbl_mw_sensor_fusion_get_data_signal(board, MBL_MW_SENSOR_FUSION_DATA_QUATERNION),
        let acc_signal = mbl_mw_sensor_fusion_get_data_signal(board, MBL_MW_SENSOR_FUSION_DATA_CORRECTED_ACC),
        let gyro_signal = mbl_mw_sensor_fusion_get_data_signal(board, MBL_MW_SENSOR_FUSION_DATA_CORRECTED_GYRO),
        let mag_signal = mbl_mw_sensor_fusion_get_data_signal(board, MBL_MW_SENSOR_FUSION_DATA_CORRECTED_MAG) else
    {
        return
    }

    fusion_signal.datasignalLog()
        .continueOnSuccessWithTask{ (logger) -> Task<OpaquePointer> in
            self.quaternionLogId = Int(mbl_mw_logger_get_id(logger))
            return acc_signal.datasignalLog()
        }.continueOnSuccessWithTask{ (logger) -> Task<OpaquePointer> in
            self.accLogId = Int(mbl_mw_logger_get_id(logger))
            return mag_signal.datasignalLog()
        }.continueOnSuccessWithTask{ (logger) -> Task<OpaquePointer> in
            self.magLogId = Int(mbl_mw_logger_get_id(logger))
            return gyro_signal.datasignalLog()
        }.continueOnSuccessWith{ logger in
            self.gyroLogId = Int(mbl_mw_logger_get_id(logger))

            mbl_mw_sensor_fusion_start(board)
            mbl_mw_logging_clear_entries(board)
            mbl_mw_logging_start(board, 1)
        }

Comments

  • Seems to be a similar issue when using the demo app.

    I can log quaternion and one of gravity or linear acceleration, but when i attempt to log all three, it sits there "Programming.." until I restart the app.

    Thoughts? Suggestions?

    Thanks

  • @mapes911 said:
    When I try to set up more than two loggers that I want to subscribe to, the third one always seems to timeout.
    Is there a limit to the number of loggers that the board will accept when in this mode?

    Yes, there is a limit to the number of available loggers. Sensor fusion data uses the most loggers so you are limited to 2 outputs.

  • @Eric said:
    Yes, there is a limit to the number of available loggers. Sensor fusion data uses the most loggers so you are limited to 2 outputs.

    Thanks Eric!

Sign In or Register to comment.