MRPT
2.0.3
test.cpp
Go to the documentation of this file.
1
/* +------------------------------------------------------------------------+
2
| Mobile Robot Programming Toolkit (MRPT) |
3
| https://www.mrpt.org/ |
4
| |
5
| Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6
| See: https://www.mrpt.org/Authors - All rights reserved. |
7
| Released under BSD License. See: https://www.mrpt.org/License |
8
+------------------------------------------------------------------------+ */
9
10
#include <
mrpt/hwdrivers/CImageGrabber_dc1394.h
>
11
#include <iostream>
12
13
using namespace
mrpt::hwdrivers
;
14
using namespace
mrpt::obs
;
15
using namespace
std;
16
17
//#define DO_CAPTURE 1
18
#define DO_CAPTURE 0
19
20
// ------------------------------------------------------
21
// TestEnumerate_1394
22
// ------------------------------------------------------
23
void
TestEnumerate_1394
()
24
{
25
CImageGrabber_dc1394::TCameraInfoList
lstCams;
26
27
cout <<
"Enumerating cameras..."
<< endl;
28
29
CImageGrabber_dc1394::enumerateCameras
(lstCams);
30
31
cout <<
"Found "
<< lstCams.size() <<
" cameras."
<< endl;
32
33
for
(CImageGrabber_dc1394::TCameraInfoList::const_iterator it =
34
lstCams.begin();
35
it != lstCams.end(); it++)
36
{
37
cout <<
"======= CAMERA ========="
<< endl;
38
cout <<
" GUID : "
<< it->guid << endl;
39
cout <<
" Unit : "
<< it->unit << endl;
40
cout <<
" Vendor: "
<< it->vendor << endl;
41
cout <<
" Model : "
<< it->model << endl;
42
cout << endl;
43
}
44
}
45
46
int
main
(
int
argc
,
char
**
argv
)
47
{
48
try
49
{
50
TestEnumerate_1394
();
51
52
return
0;
53
}
54
catch
(
const
std::exception& e)
55
{
56
std::cerr <<
"MRPT error: "
<<
mrpt::exception_to_str
(e) << std::endl;
57
return
-1;
58
}
59
catch
(...)
60
{
61
printf(
"Another exception!!"
);
62
return
-1;
63
}
64
}
mrpt::hwdrivers::CImageGrabber_dc1394::enumerateCameras
static void enumerateCameras(TCameraInfoList &out_list)
Generates a list with the information on all the existing (Firewire) cameras in the system.
Definition:
CImageGrabber_dc1394.cpp:775
TestEnumerate_1394
void TestEnumerate_1394()
Definition:
vision_stereo_rectify/test.cpp:23
mrpt::hwdrivers
Contains classes for various device interfaces.
Definition:
C2DRangeFinderAbstract.h:19
mrpt::obs
This namespace contains representation of robot actions and observations.
Definition:
CParticleFilter.h:17
main
int main()
Definition:
vision_stereo_rectify/test.cpp:78
CImageGrabber_dc1394.h
argv
const char * argv[]
Definition:
RawlogGrabberApp_unittest.cpp:40
mrpt::hwdrivers::CImageGrabber_dc1394::TCameraInfoList
std::list< TCameraInfo > TCameraInfoList
Definition:
CImageGrabber_dc1394.h:221
argc
const int argc
Definition:
RawlogGrabberApp_unittest.cpp:41
mrpt::exception_to_str
std::string exception_to_str(const std::exception &e)
Builds a nice textual representation of a nested exception, which if generated using MRPT macros (THR...
Definition:
exceptions.cpp:59
Page generated by
Doxygen 1.8.17
for MRPT 2.0.3 at Fri May 15 23:51:15 UTC 2020