ifm / ifm3d

Library and Utilities for working with ifm pmd-based 3D ToF Cameras
https://api.ifm3d.com
Apache License 2.0
112 stars 71 forks source link

How does a single host computer access 2 or more different O3x100's with only one environment variable $IFM3D_IP? #289

Closed pjbesl44 closed 3 years ago

graugans commented 3 years ago

Hey @pjbesl44 what are you referring to the command line tools or to C++ or Python code?

pjbesl44 commented 3 years ago

Hi Christian,

Very much appreciate your help. Figured it out assuming you were saying “it should be obvious.”

In my software interface to the IFM, I call WaitForFrame( ) with a camera and a framegrabber.

auto global_ifmCamera = ifm3d::Camera::MakeShared(); auto global_ifmFrameGrabber = std::make_shared(global_ifmCamera, ifm3d::DEFAULT_SCHEMA_MASK|ifm3d::EXP_TIME|ifm3d::IMG_CART|ifm3d::ILLU_TEMP);

… // later on in a while loop

if (! global_ifmFrameGrabber->WaitForFrame(global_ifmImageData.get(), 1500))

I’d never seen any examples on your github with different IP addresses being using by the same C++ main. I searched on MakeShared on github. Never saw a single argument much less 3 but am sure it was just my search. I now see MakeShared can take optional arguments. In /usr/include/ifm3d/camera/camera.h I see

static Ptr
MakeShared(const std::string& ip = ifm3d::DEFAULT_IP,
           const std::uint16_t xmlrpc_port = ifm3d::DEFAULT_XMLRPC_PORT,
           const std::string& password = ifm3d::DEFAULT_PASSWORD);

I get it. You can mark the question closed.

graugans commented 3 years ago

Hey @pjbesl44 , there is an example about multiple cameras available here: https://github.com/ifm/ifm3d-examples/blob/master/multi_camera_grabber/ex-multi_camera_grabber.cpp

pjbesl44 commented 3 years ago

Danke