00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00058
00059
00060 #ifndef __IPA_AVTPIKECAM_H__
00061 #define __IPA_AVTPIKECAM_H__
00062
00063 #ifdef __COB_ROS__
00064 #include "cob_camera_sensors/AbstractColorCamera.h"
00065 #else
00066 #include "cob_driver/cob_camera_sensors/common/include/cob_camera_sensors/AbstractColorCamera.h"
00067 #endif
00068
00069 #include <cstdlib>
00070
00071 #ifdef _WIN32
00072 #include <fgcamera.h>
00073 #ifdef __MINGW__
00074 typedef unsigned char UINT8;
00075 #endif
00076 #endif
00077
00078 #define UINT8P_CAST(x) reinterpret_cast<UINT8*>(x)
00079
00080 #ifdef __LINUX__
00081 #include <dc1394/dc1394.h>
00082 typedef struct
00083 {
00084 unsigned long Low;
00085 unsigned long High;
00086 }UINT32HL;
00087 #define UINT32 unsigned long
00088 #define _UINT32HL
00089 #endif
00090
00091 #ifdef SWIG
00092 %module Sensors
00093 %include "Source/Vision/CameraSensors/AbstractColorCamera.h"
00094
00095 %{
00096 #include "AVTPikeCam.h"
00097 %}
00098 #endif
00099
00100 using namespace std;
00101
00102 namespace ipa_CameraSensors {
00103
00107 class __DLL_LIBCAMERASENSORS__ AVTPikeCam : public AbstractColorCamera
00108 {
00114 class AVTPikeCamDeleter
00115 {
00116 public:
00117 ~AVTPikeCamDeleter()
00118 {
00119 #ifndef __LINUX__
00120 FGExitModule();
00121 #endif
00122 };
00123 };
00124
00125 private:
00127 bool m_operationMode_B;
00128 UINT32HL m_GUID;
00129 static bool m_OpenExecuted;
00130 static AVTPikeCamDeleter m_Deleter;
00131
00132 #ifdef __LINUX__
00133 dc1394video_frame_t* m_Frame;
00134 dc1394_t* m_IEEE1394Info;
00135 dc1394camera_list_t* m_IEEE1394Cameras;
00136 dc1394camera_t* m_cam;
00137 dc1394video_modes_t m_availableVideoModes;
00138
00139 dc1394speed_t m_IsoSpeed;
00140 dc1394framerate_t m_FrameRate;
00141 dc1394video_mode_t m_VideoMode;
00142 dc1394color_coding_t m_ColorCoding;
00143 #endif
00144
00145 #ifdef _WIN32
00146 CFGCamera m_cam;
00147 FGNODEINFO m_nodeInfo[5];
00148 UINT32 m_NodeCnt;
00149 FGFRAME m_Frame;
00150 #endif
00151
00152
00153
00154
00155
00156 unsigned long LoadParameters(const char* filename, int cameraIndex);
00157
00161 unsigned long SetParameters();
00162
00163 public:
00164
00166 AVTPikeCam ();
00168 ~AVTPikeCam ();
00169
00170
00171
00172
00173
00174 unsigned long Init(std::string directory, int cameraIndex = 0);
00175
00176 unsigned long Open();
00177 unsigned long Close();
00178
00179 unsigned long GetColorImage(char* colorImageData, bool getLatestFrame);
00180 unsigned long GetColorImage(cv::Mat* colorImage, bool getLatestFrame);
00181
00182 unsigned long SaveParameters(const char* filename);
00183
00199 unsigned long SetProperty(t_cameraProperty* cameraProperty);
00200 unsigned long SetPropertyDefaults();
00201 unsigned long GetProperty(t_cameraProperty* cameraProperty);
00202
00205 unsigned long PrintCameraInformation();
00206 unsigned long TestCamera(const char* filename);
00207
00208
00209
00210
00211
00212 };
00213
00216 __DLL_LIBCAMERASENSORS__ AbstractColorCameraPtr CreateColorCamera_AVTPikeCam();
00217
00218 }
00219
00220 #endif //__IPA_AVTPIKECAM_H__
00221
00222