Cannot getting motion data from L515
Dear All.
I want to get motion frame (accel & gyro) from L515.
But I cannot get it.
Please tell me solution.
then, I have status below.
OS: Windows10
SDK version: 2.41.0
Firmware version: 01.05.04.01.2657
Language: python3
pyrealsense2 version: 2.43.0.3018
Serial Number: f0265046
Cable: USB3.2
Code & Phenomenon: same as code completely in URL below
https://github.com/IntelRealSense/librealsense/issues/6896
In Intel RealSenseViewer, I can get motion data cleariy.
Threfore, I don't think Hardware trouble.
Thank you.
-
Hi Kenji Yasuda,
I think there is an example for extracting the IMU data you can refer to for implementation details.
Regards,
Aznie
Intel Customer Support -
Hi Aznie.
Thank you so much for confirmin and suggesting a solution.
I read this documentation.
then, I executed below source code.
import pyrealsense2 as rs import numpy as np def initialize_camera(): p = rs.pipeline() conf = rs.config() conf.enable_stream(rs.stream.accel) conf.enable_stream(rs.stream.gyro) prof = p.start(conf) return p def gyro_data(gyro): return np.asarray([gyro.x, gyro.y, gyro.z]) def accel_data(accel): return np.asarray([accel.x, accel.y, accel.z]) p = initialize_camera() try: while True: f = p.wait_for_frames() accel = accel_data(f[0].as_motion_frame().get_motion_data()) gyro = gyro_data(f[1].as_motion_frame().get_motion_data()) print("accelerometer: ", accel) print("gyro: ", gyro) finally: p.stop()
However, I got error code in line 26 (f = p.wait_for_frames()).
Error message: Frame didn't arrive within 5000.
Please tell me what else I need to check.
Thank you.
Please sign in to leave a comment.
Comments
3 comments