librealsense icon indicating copy to clipboard operation
librealsense copied to clipboard

pyrealsense2 has no attribute context

Open anath93 opened this issue 1 year ago • 7 comments


Required Info
Camera Model D455
Firmware Version 5.16.0.1
Operating System & Version Ubuntu 22.04
Kernel Version (Linux Only) 5.15
Platform Jetson Orin,Jetpack 6
SDK Version 2.55.1.0 }
Segment Robot

Issue Description

Trying to calibrate IMU, using python rs-imu-calibration.py script but unable to. image

Tried other posts for import pyrealsense2.pyrealsense as rs but still same.

anath93 avatar May 30 '24 15:05 anath93

Installing pip install pyrealsense2 worked but still trying the script for imu calibration gives error

image

SDK built using RUSB

anath93 avatar May 30 '24 15:05 anath93

Hi @anath93 Is the camera detected if you launch the IMU calibration script in sudo admin permissions mode, please?

sudo python3 rs-imu-calibration.py

MartyG-RealSense avatar May 30 '24 16:05 MartyG-RealSense

@MartyG-RealSense image

anath93 avatar May 30 '24 16:05 anath93

Another weird issue image

anath93 avatar May 30 '24 16:05 anath93

@MartyG-RealSense the only way Motion module force pause goes away is if I use development branch from librealsense wrapper and I can see gyro values but still unable to use rs-imu calibrate.

anath93 avatar May 30 '24 17:05 anath93

Does it make a difference if you edit the pyrealsense2 import line of the rs-imu-calibration.py script from this:

import pyrealsense2 as rs

to this:

import pyrealsense2.pyrealsense2 as rs

https://github.com/IntelRealSense/librealsense/blob/master/tools/rs-imu-calibration/rs-imu-calibration.py#L10

MartyG-RealSense avatar May 31 '24 14:05 MartyG-RealSense

No it does not, same result. Tried that already.

anath93 avatar May 31 '24 14:05 anath93

If you have access to the RealSense Viewer tool, what is the value of Y on the 'Accel' panel if you enable the Motion Module in the Viewer's options side-panel? You can see the Accel values if you hover the mouse cursor over the Accel panel.

The ideal target value of Y Accel is '-9.80' when the camera is resting stationary on a flat surface. If your Viewer shows the Y Accel value as significantly lower than this target, such as -9.3 or -9.4, then it is evidence that your IMU needs calibration. If your Y value is closer to -9.80 though, such as -9.75, then your IMU calibration is likely already good and does not need recalibrating with rs-imu-calibration.py

MartyG-RealSense avatar Jun 01 '24 13:06 MartyG-RealSense

Hi @anath93 Do you require further assistance with this case, please? Thanks!

MartyG-RealSense avatar Jun 06 '24 09:06 MartyG-RealSense

@MartyG-RealSense Thank you for the help. I am closing the ticket here, I am working with your backend team over internal ticket as this is issue and there is workaround.

anath93 avatar Jun 06 '24 12:06 anath93

You are very welcome, @anath93 - thanks very much for the update!

MartyG-RealSense avatar Jun 06 '24 13:06 MartyG-RealSense

Did you find a solution to this?

michelgokan avatar Aug 17 '24 15:08 michelgokan