Skip to content
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

Cannot run the Realsense device at 60 fps #31

Open
LZC-68 opened this issue Jun 16, 2022 · 5 comments
Open

Cannot run the Realsense device at 60 fps #31

LZC-68 opened this issue Jun 16, 2022 · 5 comments

Comments

@LZC-68
Copy link

LZC-68 commented Jun 16, 2022

We want to run Realsense(D435) at 60 fps. But the actual fps we got is 33.3.

image

Configurations are set as:

depthResolution (640 480)
rgbResolution (640 480)
framerate 60
enableEmitter true
needAlignment true
alignmentFrame RGB

Moreover, we tried to set different framerate, the Realsense can be connected when set framerate as 15, 30 and 60 fps.

@Nicogene
Copy link
Member

Hi @LZC-68 !

Are they included in the [SETTINGS] group?

@LZC-68
Copy link
Author

LZC-68 commented Jun 16, 2022

Hi @Nicogene

Yes, they are included in the [SETTINGS] group.

I post contents in the config.ini here.

device RGBDSensorWrapper
subdevice realsense2
name /depthCamera

[SETTINGS]
depthResolution (640 480) #Other possible values (424 240) or (640 480)
rgbResolution (640 480) #Other possible values (424 240) or (640 480)
framerate 60
enableEmitter true
needAlignment true
alignmentFrame RGB

[HW_DESCRIPTION]
clipPlanes (0.2 10.0)

@Nicogene
Copy link
Member

When you run the device do you get this warning?

yCWarning(REALSENSE2) << "Framerate not specified... setting 30 fps by default";

It would be interesting to see if through rpc port it is possible to set the framerate.

@xEnVrE do you remember the rpc protocol? Otherwise we have to reverse-engineer it

@LZC-68
Copy link
Author

LZC-68 commented Jun 16, 2022

Hi @Nicogene

No, we don't have that warning. Instead we had this one:

[INFO] |yarp.devices.RGBDSensorWrapper| RGBDSensorWrapper: using default 'period' parameter of  0.03 s

So, we realized that it is not enough to change the SETTINGS::framerate parameter (which is propagated to the Intel SDK at initialization time) but also to specify the period to the RGBDSensorWrapper as well.

In the end, with this configuration file:

device       RGBDSensorWrapper
subdevice    realsense2
name         /depthCamera
period       0.016
 
[SETTINGS]
depthResolution (640 480)    #Other possible values (424 240) or (640 480)
rgbResolution   (640 480)    #Other possible values (424 240) or (640 480)
framerate       60
enableEmitter   true
needAlignment   true
alignmentFrame  RGB
 
[HW_DESCRIPTION]
clipPlanes (0.2 10.0)

we were able to get the camera working at the desired fps.

Maybe it would be good adding this piece of information in the README.md. Also, do you think it is possible to maybe change the code such that the user has to specify only the framerate?

Thanks

@Nicogene
Copy link
Member

@LZC-68 this kind of error came out because the parameter name used by the wrapper/nws (RGBDSensorWrapper) is different by the one used by the underlying sensor, period vs SETTINGS::framerate.

Usually, they match and it is not needed to specify it twice. Moreover in this case framerate != period also semantically,
We could take the period specified for the wrapper and do 1/period for the device but the realsense SDK requires specific values, for example if you have a period of 0.033 -> framerate = 30.3030, and since the SDK will accept integer number like 30 60 etc. it will fail the open of the streams.
We could ceil the number and/or check if the period and SETTINGS::framerate are consistent, or we just document it properly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants