KinectGrabber.hpp
Go to the documentation of this file.
1 
28 /*
29  * KinecGrabber.h
30  *
31  * Created on: 20.03.2012
32  * Author: Thomas Wiemann
33  */
34 
35 #ifndef KINECGRABBER_H_
36 #define KINECGRABBER_H_
37 
38 #include "lvr2/io/PointBuffer.hpp"
39 #include "libfreenect.hpp"
40 
41 #include <boost/thread.hpp"
42 #include <vector>
43 
44 namespace lvr2
45 {
46 
47 class KinectGrabber : public Freenect::FreenectDevice
48 {
49 public:
50  KinectGrabber(freenect_context *_ctx, int _index);
51  virtual ~KinectGrabber();
52 
54  void getDepthImage(std::vector<short> &img);
55  void getColorImage(std::vector<uint8_t> &img);
56 
57 protected:
58  virtual void VideoCallback(void* data, uint32_t timestamp);
59  virtual void DepthCallback(void* data, uint32_t timestamp);
60 
63 
65  boost::mutex m_depthMutex;
66 
68  boost::mutex m_colorMutex;
69 
71  std::vector<short> m_depthImage;
72 
74  std::vector<uint8_t> m_colorImage;
75 
76  bool m_haveData;
77 
78 };
79 
80 } // namespace lvr2
81 
82 #endif /* KINECGRABBER_H_ */
void getDepthImage(std::vector< short > &img)
Returns the currently present point cloud data.
virtual void VideoCallback(void *data, uint32_t timestamp)
boost::mutex m_depthMutex
Mutex for save depth buffer access.
static Timestamp timestamp
A global time stamp object for program runtime measurement.
Definition: Timestamp.hpp:116
std::shared_ptr< PointBuffer > PointBufferPtr
virtual void DepthCallback(void *data, uint32_t timestamp)
std::vector< uint8_t > m_colorImage
The raw color image.
PointBufferPtr m_buffer
PointBufferPtr with current data.
KinectGrabber(freenect_context *_ctx, int _index)
boost::mutex m_colorMutex
Mutex for save color buffer access.
std::vector< short > m_depthImage
The raw depth image.
void getColorImage(std::vector< uint8_t > &img)


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Mon Feb 28 2022 22:46:06