Items with no label
3338 Discussões

Issues with d435i IMU Gyro - flickering then ran rs-imu-calibration now returns -nan NANs

MMoye2
Principiante
3.253 Visualizações

Looking at the Gyro stream in RealSense Viewer the arrow was flickering all over the place. Accel stream seemed fine. So I ran rs-imu-calibration python script. Now Realsense Viewer Motion Module is blank. Stereo and RGB are fine. and -NAN returned when I running code derived from: https://github.com/IntelRealSense/librealsense/tree/development/examples/motion

 

Edit:

Turning "Enable Motion Correction" off brings stream back online in Viewer.

 

and running....

 

import pyrealsense2 as rs

 

try:

  pipeline = rs.pipeline()

  pipeline.start()

 

  while True:

    frames = pipeline.wait_for_frames()

    for frame in frames:

      pr = frame.get_profile()

      # if pr.stream_type() == rs.stream.gyro and pr.format() == rs.format.motion_xyz32f:

      #   data = frame.as_motion_frame().get_motion_data()

      #   print(pr.stream_type(), data)

      if pr.stream_type() == rs.stream.accel and pr.format() == rs.format.motion_xyz32f:

        data = frame.as_motion_frame().get_motion_data()

        print(pr.stream_type(), data)

 

except Exception as e:

  print(e)

 

gets results but c++ still returns NANs

 

 

0 Kudos
3 Respostas
MartyG
Colaborador honorário III
2.327 Visualizações

I'm very glad that you were able to get your gyro stream working again. Thanks very much too for sharing your Python code.

 

Another user tried to write C++ to get read-outs of IMU data and were also unsuccessful. I will point you to that discussion so you can look at their C++ code.

 

https://github.com/IntelRealSense/librealsense/issues/2905

 

The rs_sensor_control sample program can check which sensors are supported on an attached camera and fetch details about those sensors. It may be worth trying that program with the IMU components.

 

https://github.com/IntelRealSense/librealsense/tree/master/examples/sensor-control

MMoye2
Principiante
2.327 Visualizações

Hi, Thanks for the links.

So after posting I tried grabbing sensor streams ( e.g. sensor.start([&](rs2::frame frame) { /*grab the motion data */ } ) which worked so long as I did sensor.set_option(RS2_OPTION_ENABLE_MOTION_CORRECTION, 0);

 

on a whim (because the code example I found was in the dev branch) I grabbed the latest development branch from github (though now I am stuck in 32-bit on windows) and the original code works (pipeline ... wait_for_frames() ... grabbing motion etc ). I was using the latest stable before.

 

Realsense Viewer now shows correct gyro/accel info

MartyG
Colaborador honorário III
2.327 Visualizações

Awesome news, thanks so much for doing the further experimentation with the latest development build and sharing your results!

Responder