47 #include <flycapture/FlyCapture2.h> 54 #define PGERROR(error, msg) PointGreyCamera::handleError(msg, error) 57 std::cout <<
"Serial: " << cinfo.serialNumber
58 <<
", Model: " << cinfo.modelName
59 <<
", Vendor: " << cinfo.vendorName
60 <<
", Sensor: " << cinfo.sensorInfo
61 <<
", Resolution: " << cinfo.sensorResolution
62 <<
", Color: " << std::boolalpha << cinfo.isColorCamera
63 <<
", Firmware Version: " << cinfo.firmwareVersion << std::endl;
66 int main(
int argc,
char** argv) {
67 BusManager bus_manager;
70 unsigned num_devices = 0;
71 PGERROR(bus_manager.GetNumOfCameras(&num_devices),
72 "Failed get number of cameras");
74 std::cout <<
"Number of cameras found: " << num_devices << std::endl;
75 for (
unsigned i = 0; i < num_devices; ++i) {
79 PGERROR(bus_manager.GetCameraFromIndex(i, &guid),
80 "Failed to get camera from index " + s.str());
83 PGERROR(camera.Connect(&guid),
"Failed to connect to camera");
86 PGERROR(camera.GetCameraInfo(&cinfo),
"Failed to get camera info");
88 std::cout <<
"[" << i <<
"]";
93 std::cout <<
"No PointGrey cameras detected on this computer." 94 << std::endl << std::endl;
96 std::cout <<
"Note that you may need to restart udev and " 97 "replug your camera, eg:" << std::endl
98 <<
" sudo service udev restart" << std::endl;
100 }
catch (
const std::runtime_error& e) {
101 std::cout <<
"There was an error checking the active cameras: " << e.what()
Interface to Point Grey cameras.
#define PGERROR(error, msg)
void printCameraInfo(const CameraInfo &cinfo)
int main(int argc, char **argv)