-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
imu data and image data not streaming simultaneously on pyrealsense #4018
Comments
Camera:d435i My python script is working if I stream only IMU data or only Image data but not together import pyrealsense2 as rs def initialize_camera(): def gyro_data(gyro): def accel_data(accel): t0 = time.time() Start streamingtry: It ends with error "RuntimeError: null pointer passed for argument "frame_ref" |
@Praneet1997 hello,
The envisioned approach is a dynamic discovery while iterating over the frames in the frames = pipe.wait_for_frames()
for frame in frames:
if frame.is_depth():
...
if frame.is_motion():
#check if Accel or Gyro
...
if frame.is_pose():
... In addition there are also auxiliary functions available for certain frame types, e.g. |
there is no attribute of frame object as is_motion or is depth AttributeError: 'pyrealsense2.pyrealsense2.frame' object has no attribute 'is_depth' |
As you can see in the documentation for the frame class using the builtin |
I also seem to be running into this problem. I've tried to implement what @ev-mp said about iterating over the frames and dynamically retrieving the data, but I still get the "RuntimeError: null pointer passed for argument "frame_ref"" error. I'm using the following code: import pyrealsense2 as rs pipeline = rs.pipeline() def gyro_data(gyro): def accel_data(accel): pipeline.start(config)
finally: Can anybody see what the problem is? If the problem is in the lines: I'm using the D435i camera on a Jetson TX1 running ubuntu 16.04. Thank you! |
by using for frame in frames:
if frame.is_motion_frame():
accel = accel_data(frame.as_motion_frame().get_motion_data()) |
Thank you @lramati, that solved the problem. Much appreciated. |
HI @Praneet1997, If no additional support for this topic, will close it. |
Before opening a new issue, we wanted to provide you with some useful suggestions (Click "Preview" above for a better view):
All users are welcomed to report bugs, ask questions, suggest or request enhancements and generally feel free to open new issue, even if they haven't followed any of the suggestions above :)
Issue Description
<Describe your issue / question / feature request / etc..>
The text was updated successfully, but these errors were encountered: