9 #ifndef mrpt_COpenNI2Generic_H
10 #define mrpt_COpenNI2Generic_H
35 int width,
int height,
float fps = 30.0f,
bool open_streams_now =
true);
52 bool& hardware_error,
unsigned sensor_id = 0);
65 bool& hardware_error,
unsigned sensor_id = 0);
79 bool& hardware_error,
unsigned sensor_id = 0);
89 void open(
unsigned sensor_id = 0);
99 const std::set<unsigned>& vSerialRequired);
112 const unsigned int SerialRequired,
int& sensor_id)
const;
122 bool isOpen(
const unsigned sensor_id)
const;
126 void close(
unsigned sensor_id = 0);
147 static std::vector<std::shared_ptr<CDevice>>
vDevices;
An abstract class for accessing OpenNI2 compatible sensors.
bool isOpen(const unsigned sensor_id) const
Whether there is a working connection to the sensor.
void showLog(const std::string &message) const
void close(unsigned sensor_id=0)
Close the connection to the sensor (no need to call it manually unless desired for some reason,...
bool getDeviceIDFromSerialNum(const unsigned int SerialRequired, int &sensor_id) const
Get the ID of the device corresponding to 'SerialRequired'.
bool m_grab_image
The data that the RGBD sensors can return.
int getConnectedDevices()
Get a list of the connected OpenNI2 sensors.
bool getColorSensorParam(mrpt::utils::TCamera ¶m, unsigned sensor_id=0) const
static std::vector< std::shared_ptr< CDevice > > vDevices
COpenNI2Generic()
Default ctor (width=640, height=480, fps=30)
unsigned int openDevicesBySerialNum(const std::set< unsigned > &vSerialRequired)
Open a set of RGBD devices specified by their serial number.
void getNextFrameD(mrpt::math::CMatrix &depth_img, uint64_t ×tamp, bool &there_is_obs, bool &hardware_error, unsigned sensor_id=0)
The main data retrieving function, to be called after calling loadConfig() and initialize().
std::vector< int > vSerialNums
A vector with the serial numbers of the available devices.
void getNextFrameRGBD(mrpt::obs::CObservation3DRangeScan &out_obs, bool &there_is_obs, bool &hardware_error, unsigned sensor_id=0)
The main data retrieving function, to be called after calling loadConfig() and initialize().
bool start()
Open all sensor streams (normally called automatically at constructor, no need to call it manually).
void kill()
Kill the OpenNI2 driver.
void getNextFrameRGB(mrpt::utils::CImage &rgb_img, uint64_t ×tamp, bool &there_is_obs, bool &hardware_error, unsigned sensor_id=0)
The main data retrieving function, to be called after calling loadConfig() and initialize().
~COpenNI2Generic()
Default ctor.
void setVerbose(bool verbose)
int m_width
The same options (width, height and fps) are set for all the sensors.
int getNumDevices() const
The number of available devices at initialization.
void open(unsigned sensor_id=0)
Try to open the camera (all the parameters [resolution,fps,...] must be set before calling this) - us...
unsigned int openDeviceBySerial(const unsigned int SerialRequired)
Open a RGBD device specified by its serial number.
bool getDepthSensorParam(mrpt::utils::TCamera ¶m, unsigned sensor_id=0) const
This class is a "CSerializable" wrapper for "CMatrixFloat".
Declares a class derived from "CObservation" that encapsules a 3D range scan measurement,...
A class for storing images as grayscale or RGB bitmaps.
Structure to hold the parameters of a pinhole camera model.
GLenum GLsizei GLsizei height
GLsizei const GLchar ** string
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
unsigned __int64 uint64_t