RVC  1.15.0
a product by RVBUST.
RVC quick start

Start your first program

This is a simple example to help you started with RVC 3D camera.

// Include files to use the RVC API.
#include <RVC/RVC.h>
// Namespace for using RVC object.
using namespace RVC;
int main(int argc, char *argv[]) {
// Before using any RVC methods, the RVC system must be initialized.
// The parameter d_num is the maximum number of avaliable Device which user desire to list.
const int d_num = 10;
// Create Device array.
RVC::Device devices[10];
// The parameter actual_size can be used to record the actual avaliable Devices number.
size_t actual_size = 0;
// List avaliable GigE Devices.
SystemListDevices(devices, d_num, &actual_size, RVC::SystemListDeviceType::GigE);
// Check the number of Devices actually searched. If no device is found, terminate the program.
if (actual_size == 0) {
return -1;
}
// Create X1 object which choose the first Device and the right camera.
RVC::X1 x1 = RVC::X1::Create(devices[0], RVC::CameraID_Right);
// Open X1.
x1.Open();
// If X1 is not open, Destroy X1 and shutdown the system.
if (!x1.IsOpen()) {
return 1;
}
// Capture with default capture setting to get 3D point map and 2D image.
bool cap_state = x1.Capture();
// If Capture success, get the data.
if (cap_state) {
// Get 3D point map.
// Get 2D image.
RVC::Image img = x1.GetImage();
}
// Close X1.
x1.Close();
// Destroy X1.
// Releases all RVC resources.
return 0;
}

It contains five part, which are described as bellow.

System initialize

Initialize the RVC system

// Before using any RVC methods, the RVC system must be initialized.

List devices

Find device of given SystemListDeviceType

// The parameter d_num is the maximum number of avaliable Device which user desire to list.
const int d_num = 10;
// Create Device array.
RVC::Device devices[10];
// The parameter actual_size can be used to record the actual avaliable Devices number.
size_t actual_size = 0;
// List avaliable GigE Devices.
SystemListDevices(devices, d_num, &actual_size, RVC::SystemListDeviceType::GigE);

Check the number of cameras actually searched. If no device is found, terminate the program.

// Check the number of Devices actually searched. If no device is found, terminate the program.
if (actual_size == 0) {
return -1;
}

Create X1 object

Select one device from the avaliable devices and select CameraID_Left or CameraID_Right camera to create X1 object.

// Create X1 object which choose the first Device and the right camera.
RVC::X1 x1 = RVC::X1::Create(devices[0], RVC::CameraID_Right);

Open X1 and check whether it has been opened.

// Open X1.
x1.Open();
// If X1 is not open, Destroy X1 and shutdown the system.
if (!x1.IsOpen()) {
return 1;
}

X1 Capture

Capture with default setting to get 3D point map and 2D image

// Capture with default capture setting to get 3D point map and 2D image.
bool cap_state = x1.Capture();

Get 3D point map and 2D image data

// If Capture success, get the data.
if (cap_state) {
// Get 3D point map.
// Get 2D image.
RVC::Image img = x1.GetImage();
}

Destroy X1 object

Close X1 and destroy this object.

// Close X1.
x1.Close();
// Destroy X1.

Shutdown RVC system

Shutdown the RVC system

// Releases all RVC resources.