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

TypeError: get_info(): incompatible function arguments. The following argument types are supported: 1. (self: pyrealsense2.device, info: pyrealsense2.camera_info) -> str #4606

Closed
LLUWE19 opened this issue Aug 8, 2019 · 2 comments

Comments

@LLUWE19
Copy link

LLUWE19 commented Aug 8, 2019


Required Info
Camera Model D400
Firmware Version (Open RealSense Viewer --> Click info)
Operating System & Version {Win (8.1/10)
Platform PC
SDK Version { legacy / 2.2.25 }
Language python
Segment others

Hi,

I am trying to automate the opening of multiple devices. I have managed to open multiple devices following this code:
#1735

However I want to read and load cameras automatically. I have tried following the C++ tutorial and swapping for python but cannot extract the serial number. e.g.

# Create librealsense context for managing devices
ctx = rs.context()

pipelines = []

for d in ctx.query_devices():
    print(d)
    pipe = rs.pipeline(ctx)
    cfg = rs.config()
    cfg.enable_device(d.get_info(RS2_CAMERA_INFO_SERIAL_NUMBER))
    pipe.start(cfg)
    pipelines.append(pipe)

// Start a streaming pipe per each connected device
for (auto&& dev : ctx.query_devices())
{
    rs2::pipeline pipe(ctx);
    rs2::config cfg;
    cfg.enable_device(dev.get_info(RS2_CAMERA_INFO_SERIAL_NUMBER));
    pipe.start(cfg);
    pipelines.emplace_back(pipe);
}

from C++ tutorial

To map the specific device to the newly-allocated pipeline we define rs2::config object, and assign it with the device's serial number.

from config documentation:

Select a specific device explicitly by its serial number, to be used by the pipeline.

From this information I guess I have to manually enter serial numbers?

What should I enter in the RS2_CAMERA_INFO_SERIAL_NUMBER?
Is there a way to extract the serial number automatically? Or load devices automatically?
How do I return the Serial number as a string?

TypeError: get_info(): incompatible function arguments. The following argument types are supported:
1. (self: pyrealsense2.device, info: pyrealsense2.camera_info) -> str

Am I on the right track?
Hope question makes sense and thanks for your time

@LLUWE19 LLUWE19 changed the title Multiple Cameras with pyrealsense2 TypeError: get_info(): incompatible function arguments. TypeError: get_info(): incompatible function arguments. The following argument types are supported: 1. (self: pyrealsense2.device, info: pyrealsense2.camera_info) -> str Aug 9, 2019
@LLUWE19 LLUWE19 closed this as completed Aug 9, 2019
@BryanVision
Copy link

Did you get this solved?

@lramati
Copy link
Contributor

lramati commented Aug 20, 2019

@BryanVision RS2_CAMERA_INFO_* is how these enum values are accessed in C++. In Python, you need rs.camera_info.* (see docs here)

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

3 participants