View my account

D455 IMU Sampling Rate Issue

Comments

5 comments

  • MartyG

    Hi Hamedtaheri   A RealSense development team member advised at the link below that writing to .csv was "extremely not efficient" and recommended saving data to a .bag file instead and then extracting .csv from the bag file.

    https://github.com/IntelRealSense/librealsense/issues/1485#issuecomment-380728118

    0
    Comment actions Permalink
  • Hamedtaheri

    Thanks MartyG, I tried saving data to a .bag file and got the same issue. 

    import pyrealsense2 as rs
    import time

    # Configure pipeline
    pipeline = rs.pipeline()
    config = rs.config()

    # Enable IMU streams
    # Gyro at 200 Hz and Accel at 100 Hz
    config.enable_stream(rs.stream.gyro, rs.format.motion_xyz32f, 200)
    config.enable_stream(rs.stream.accel, rs.format.motion_xyz32f, 100)

    # Record directly to a .bag file
    config.enable_record_to_file("imu_data.bag")

    # Start streaming
    profile = pipeline.start(config)

    # Record for 10 seconds
    duration = 10.0
    start_time = time.time()

    try:
    while (time.time() - start_time) < duration:
    # Grab frames. The data is automatically recorded to the .bag file.
    frames = pipeline.wait_for_frames()
    except KeyboardInterrupt:
    pass
    finally:
    # Stop the pipeline
    pipeline.stop()
    print("Recording complete. Data saved to imu_data.bag")
    0
    Comment actions Permalink
  • MartyG

    Please try setting Accel to 250 and Gyro to 400.  Do these higher frequencies affect the number of samples or do they remain at 6,000 samples?

    0
    Comment actions Permalink
  • Hamedtaheri

    I tested my IMU with different settings for the accelerometer and gyroscope, and observed the following accelerometer outputs:
    • desired_accel_rate = 200, desired_gyro_rate = 400
    Accelerometer output: 100Hz
    • desired_accel_rate = 100, desired_gyro_rate = 400
    Accelerometer output: 85Hz
    • desired_accel_rate = 100, desired_gyro_rate = 200
    Accelerometer output: 75Hz

    Based on a suggestion to test at 250Hz, I encountered the following error:

    Profile = pipeline.start(config)
    RuntimeError: Couldn't resolve requests

    It seems my IMU does not support 250Hz for the accelerometer.

    0
    Comment actions Permalink
  • MartyG

    250 Accel is supported in RealSense IMU cameras up until mid 2022.  IMU-equipped cameras manufactured after that time support 200 instead.  So please try 200 Accel instead of 250.  Apologies for the confusion!

    0
    Comment actions Permalink

Please sign in to leave a comment.