-
Notifications
You must be signed in to change notification settings - Fork 10
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
setFeature
function doesn't work on RealSenseD455
#41
Comments
I have tried connecting to a D455 and controlling the gain directly through librealsense and everything was working as expected. This is the script I used: import time
import pyrealsense2 as rs
print('Connecting...')
pipeline = rs.pipeline()
config = rs.config()
config.enable_stream(rs.stream.depth)
config.enable_stream(rs.stream.color)
profile = pipeline.start(config)
rgb_sensor = profile.get_device().query_sensors()[1]
print('Connected')
while True:
rgb_sensor.set_option(rs.option.gain, 0)
time.sleep(1)
rgb_sensor.set_option(rs.option.gain, 127)
time.sleep(1) The problem is that if the yarp realsense device is already using the realsense the script above can't connect to it and to change the parameters. This is weird since, if another process is reading images from the realsense using librealsense, the script can still connect to it and change gain, exposure, etc. |
Hi @andrearosasco, not sure if you already found it but here is how is implemented in the device yarp-device-realsense2/src/devices/realsense2/realsense2Driver.cpp Lines 1235 to 1243 in d4da73f
where yarp-device-realsense2/src/devices/realsense2/realsense2Driver.cpp Lines 233 to 261 in d4da73f
It seems that the calls are the same of the one of the librealsense example |
Thanks, @Nicogene! Yes, everything looks the same. The only thing I could think so is that for some reason on the d455 |
Good catch! Maybe it is a bug that can be reported in |
Today I checked this issue and I found that - on ergoCub at least - when I try to set the options via RPC the device outputs an error due to this exception: yarp-device-realsense2/src/devices/realsense2/realsense2Driver.cpp Lines 191 to 203 in d4da73f
where cc @Nicogene |
So I just tested the code again and it looks like it works. I didn't change anything but the version of yarp and of the yarp-device-realsense2 on ergoCub have probably changed at some point . Current versions |
Another thing that may play a role here is the firmware version of the realsense. On ergoCubSN001 we could not get |
Just to clarify, this has been tested on the new ergoCubSN001 while the issue was raised on the previous ergoCubSN000. cc @Nicogene |
Indeed, I guess that the firmware version between the two realsense may be different. |
I wrote a short Python script to connect to a realsense device and adjust different parameters.
The script works on iCub2.7 but not on ergoCub and R1.
I think this might be somehow connected to the camera model as both R1 and ergoCub use a D455 while iCub2.7 has a D415.
In every test the device has been started using the
yarprobotinterface
and notyarpdev
.This is a small script to test the correct behavior:
As a quick workaround, I'm working on setting the camera parameter directly, using the pyrealsense2 package.
Apparently, even with the yarp device connected to the camera, it is possible to connect and modify the parameters.
The text was updated successfully, but these errors were encountered: