anyKode Marilou
|
QueryDeviceCamera searches and returns a camera from the list of the PHX's devices.
DeviceCamera * QueryDeviceCamera(const xkode::lib::String& Name);
Parameters |
Description |
const xkode::lib::String& Name |
[in] Relative name of the camera : Ex: box1/viewpoint0/camera |
Pointer to the instance of the required camera. The function returns NULL if the device were not found.
//Visual .net 2005 Managed C++ syntax int main(array<System::String ^> ^args) { String ^RobotPHX="/robot1"; String ^Server="localhost"; Moda::Connection ^connection=gcnew Moda::Connection(true); if(connection->Connect(Server)) { Console::WriteLine("Connection ok"); Moda::RobotPHX ^robot=connection->QueryRobotPHX(RobotPHX); if(robot) { Moda::DeviceCamera ^pCamera=robot->QueryDeviceCamera("viewpoint0/camera"); if(pCamera) { pCamera->SetResolution(320,240); Moda::DeviceCameraSettings ^settings=pCamera->GetCameraSettings(); settings->Format=Moda::SurfaceFormats::R8G8B8; settings->Width=320; settings->Height=240; pCamera->SetCameraSettings(settings); while(1) { Moda::Image ^image=pCamera->GetNextImage(); image->Display(0,0); } } else { Console::WriteLine("Camera not found"); } } else { Console::WriteLine("Unable to connect\r\n"); } connection->Disconnect(); Console::ReadKey(); return 0; } }
Documentation v4.7 (18/01/2015), Copyright (c) 2015 anyKode. All rights reserved.
|
What do you think about this topic? Send feedback!
|