25 #ifndef VIDEOSOURCE_KINECT_HH_
26 #define VIDEOSOURCE_KINECT_HH_
30 #include <libfreenect.hpp>
32 #include <libfreenect.h>
34 #include <VideoSource/VideoSource_Kinect_Base.hh>
35 #include <Image/Camera.hh>
39 class VideoSource_Kinect_Callback;
67 virtual int OpenDevice();
69 virtual int OpenDevice(
int device);
72 virtual int CloseDevice();
76 virtual int PreGrab();
78 virtual int PostGrab();
91 virtual int CreateDepthLookupTable(
double px=328.82739,
double py=252.6967098,
double fx=585.9303337,
double fy=585.5482334);
94 virtual int SetVideoModeColor();
96 virtual int SetVideoModeIR();
102 virtual int SetSwitchVideoModeAfterGrab();
106 virtual int SetTilt(
double degrees);
109 virtual int SetLed(
int mode);
117 virtual int GetAccelerometer(
double &tilt,
double &x,
double &y,
double &z);
125 virtual int ToggleDepthStream();
128 void DeleteDepthLookupTable();
134 static Freenect::Freenect *kinectManager_;
141 static int deviceCount_;
143 static int openDevices_;
virtual int SetVideoMode(freenect_video_format format)
std::vector< Camera< float > > depthbuffer_
pthread_mutex_t * color_mutex
virtual int GetNumDevices()
Get the number of devices.
Implementing FreenectDevice Interface, this class is used internally by VideoSource_Kinect - do not u...
virtual void VideoCallback(void *video, uint32_t timestamp)
libfreenect thread calls this when new color data is available
virtual void DepthCallback(void *depth, uint32_t timestamp)
libfreenect thread calls this when new depth data is available
freenect_video_format format_
std::vector< Camera< unsigned char > > colorbuffer_
virtual int GetLatestDepth(Camera< float > &image)
Callbacks store image data in double buffer, get latest Note that the depth image is shifted by 3 pix...
virtual void SetDepthMode(int mode)
virtual int GetLatestColor(Camera< unsigned char > &image)
Callbacks store image data in double buffer, get latest.
The image template class for specific storage types.
pthread_cond_t * newColorAvail_
void CreateLookupTable(double px, double py, double fx, double fy)
Image< float > depthLookupTable_
VideoSource_Kinect_Callback(freenect_context *_ctx, int _index)
libfreenect constructor used by VideoSource_Kinect, do not use directly
pthread_mutex_t * depthavail_mutex
Checks for VideoSource capabilities.
Use Kinect with the libfreenect drivers just like the ToF Cameras.
virtual int SetSwitchVideoModeAfterGrab(bool switchMode)
pthread_mutex_t * coloravail_mutex
Use Kinect just like the ToF Cameras.
This is the base class for images in BIAS.
pthread_mutex_t * depth_mutex
pthread_cond_t * newDepthAvail_