Main Page
Modules
Namespaces
Classes
Files
File List
File Members
src
sensors
camera
xb3
src
test.cpp
Go to the documentation of this file.
1
/**************************************************************************************************
2
Software License Agreement (BSD License)
3
4
Copyright (c) 2011-2013, LAR toolkit developers - University of Aveiro - http://lars.mec.ua.pt
5
All rights reserved.
6
7
Redistribution and use in source and binary forms, with or without modification, are permitted
8
provided that the following conditions are met:
9
10
*Redistributions of source code must retain the above copyright notice, this list of
11
conditions and the following disclaimer.
12
*Redistributions in binary form must reproduce the above copyright notice, this list of
13
conditions and the following disclaimer in the documentation and/or other materials provided
14
with the distribution.
15
*Neither the name of the University of Aveiro nor the names of its contributors may be used to
16
endorse or promote products derived from this software without specific prior written permission.
17
18
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
19
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
21
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
24
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
25
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
***************************************************************************************************/
27
//#include <ros/ros.h>
28
//#include <image_transport/image_transport.h>
29
//#include <cv_bridge/cv_bridge.h>
30
//#include <sensor_msgs/image_encodings.h>
31
//#include <opencv2/imgproc/imgproc.hpp>
32
//#include <opencv2/highgui/highgui.hpp>
33
39
#include <signal.h>
40
//=============================================================================
41
// PGR Includes
42
//=============================================================================
43
#include "
pgr_registers.h
"
44
#include "
pgr_stereocam.h
"
45
46
#define PFLN {printf("DEBUG PRINT FILE %s LINE %d\n",__FILE__,__LINE__);}
47
48
TriclopsContext
wideTriclops
;
49
TriclopsContext
shortTriclops
;
50
51
TriclopsError
e
;
52
53
char
file_shortcal
[1024] =
"config/short.cal"
;
54
char
file_widecal
[1024] =
"config/wide.cal"
;
55
56
57
58
int
main
(
int
argc,
char
**argv)
59
{
60
61
62
struct
{
63
int
width;
64
int
height;
65
}Image;
66
Image.width=320;
67
Image.height=240;
68
69
70
// read in the TriclopsContexts from calibration files
71
printf(
"Getting TriclopsContexts from files \n%s \n and \n%s ... \n"
,
file_shortcal
,
file_widecal
);
72
e
=
triclopsGetDefaultContextFromFile
( &
shortTriclops
,
file_shortcal
);
73
if
(
e
!=
TriclopsErrorOk
) { fprintf( stderr,
"Can't get short context from file\n"
); }
74
//triclopsWriteDefaultContextToFile( shortTriclops, (char*)"../config/short_context.txt");
75
76
//e = triclopsGetDefaultContextFromFile( &wideTriclops,file_widecal);
77
//if ( e != TriclopsErrorOk ){ fprintf( stderr, "Can't get wide context from file\n" ); shutdown_module(SIGINT);}
78
//triclopsWriteDefaultContextToFile( wideTriclops, (char*)"../config/wide_context.txt");
79
// make sure we are in subpixel mode
80
//triclopsSetSubpixelInterpolation( wideTriclops, 1 );
81
82
PFLN
83
triclopsSetMaxThreadCount
(
shortTriclops
,1 );
84
PFLN
85
//triclopsSetMaxThreadCount( wideTriclops,1 );
86
PFLN
87
88
89
}
pgr_registers.h
Header file for the registers for the PGR toolbox.
TriclopsErrorOk
Definition:
triclops.h:102
PFLN
#define PFLN
Definition:
test.cpp:46
pgr_stereocam.h
Library from Point Grey Research to access the xb3 images.
triclopsSetMaxThreadCount
TriclopsError triclopsSetMaxThreadCount(TriclopsContext context, int maxThreadCount)
main
int main(int argc, char **argv)
Definition:
test.cpp:58
e
TriclopsError e
Definition:
test.cpp:51
wideTriclops
TriclopsContext wideTriclops
Definition:
test.cpp:48
TriclopsContext
void * TriclopsContext
Definition:
triclops.h:272
file_shortcal
char file_shortcal[1024]
Definition:
test.cpp:53
TriclopsError
TriclopsError
Definition:
triclops.h:99
file_widecal
char file_widecal[1024]
Definition:
test.cpp:54
triclopsGetDefaultContextFromFile
TriclopsError triclopsGetDefaultContextFromFile(TriclopsContext *defaultContext, char *filename)
shortTriclops
TriclopsContext shortTriclops
Definition:
test.cpp:49
xb3
Author(s): Miguel Oliveira, Tiago Talhada
autogenerated on Mon Mar 2 2015 01:33:02