An abstract class for accessing OpenNI2 compatible sensors.
This class permits to access several sensors simultaneously. The same options (resolution, fps, etc.) are used for every sensor.
More references to read:
Definition at line 28 of file COpenNI2Generic.h.
#include <mrpt/hwdrivers/COpenNI2Generic.h>
Public Member Functions | |
COpenNI2Generic () | |
Default ctor. More... | |
~COpenNI2Generic () | |
Default ctor. More... | |
int | getConnectedDevices () |
Get a list of the connected OpenNI2 sensors. More... | |
void | kill () |
Kill the OpenNI2 driver. More... | |
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(). More... | |
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(). More... | |
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(). More... | |
void | setVerbose (bool verbose) |
bool | isVerbose () const |
Sensor parameters (alternative to \a loadConfig ) and manual control | |
void | open (unsigned sensor_id=0) |
Try to open the camera (all the parameters [resolution,fps,...] must be set before calling this) - users may also call initialize(), which in turn calls this method. More... | |
unsigned int | openDevicesBySerialNum (const std::set< unsigned > &vSerialRequired) |
Open a set of RGBD devices specified by their serial number. More... | |
unsigned int | openDeviceBySerial (const unsigned int SerialRequired) |
Open a RGBD device specified by its serial number. More... | |
bool | getDeviceIDFromSerialNum (const unsigned int SerialRequired, int &sensor_id) const |
Get the ID of the device corresponding to 'SerialRequired'. More... | |
bool | isOpen (const unsigned sensor_id) const |
Check if the given 'sensor_id' has been open. More... | |
void | close (unsigned sensor_id=0) |
Close the conection to the sensor (not need to call it manually unless desired for some reason, since it's called at destructor) More... | |
int | getNumDevices () const |
The amount of available devices at initialization. More... | |
Protected Member Functions | |
bool | getColorSensorParam (mrpt::utils::TCamera ¶m, unsigned sensor_id=0) const |
bool | getDepthSensorParam (mrpt::utils::TCamera ¶m, unsigned sensor_id=0) const |
void | showLog (const std::string &message) const |
Protected Attributes | |
std::vector< int > | vSerialNums |
A vector with the serial numbers of the available devices. More... | |
int | m_width |
The same options (width, height and fps) are set for all the sensors. More... | |
int | m_height |
float | m_fps |
int | m_rgb_format |
int | m_depth_format |
bool | m_verbose |
bool | m_grab_image |
The data that the RGBD sensors can return. More... | |
bool | m_grab_depth |
bool | m_grab_3D_points |
Default: all true. More... | |
Static Protected Attributes | |
static std::vector< stlplus::smart_ptr< CDevice > > | vDevices |
static int | numInstances |
mrpt::hwdrivers::COpenNI2Generic::COpenNI2Generic | ( | ) |
Default ctor.
mrpt::hwdrivers::COpenNI2Generic::~COpenNI2Generic | ( | ) |
Default ctor.
void mrpt::hwdrivers::COpenNI2Generic::close | ( | unsigned | sensor_id = 0 | ) |
Close the conection to the sensor (not need to call it manually unless desired for some reason, since it's called at destructor)
|
protected |
int mrpt::hwdrivers::COpenNI2Generic::getConnectedDevices | ( | ) |
Get a list of the connected OpenNI2 sensors.
|
protected |
bool mrpt::hwdrivers::COpenNI2Generic::getDeviceIDFromSerialNum | ( | const unsigned int | SerialRequired, |
int & | sensor_id | ||
) | const |
Get the ID of the device corresponding to 'SerialRequired'.
void mrpt::hwdrivers::COpenNI2Generic::getNextFrameD | ( | mrpt::math::CMatrix & | depth_img, |
uint64_t & | timestamp, | ||
bool & | there_is_obs, | ||
bool & | hardware_error, | ||
unsigned | sensor_id = 0 |
||
) |
The main data retrieving function, to be called after calling loadConfig() and initialize().
depth_img | The output retrieved depth image (only if there_is_obs=true). |
timestamp | The timestamp of the capture (only if there_is_obs=true). |
there_is_obs | If set to false, there was no new observation. |
hardware_error | True on hardware/comms error. |
sensor_id | The index of the sensor accessed. |
void mrpt::hwdrivers::COpenNI2Generic::getNextFrameRGB | ( | mrpt::utils::CImage & | rgb_img, |
uint64_t & | timestamp, | ||
bool & | there_is_obs, | ||
bool & | hardware_error, | ||
unsigned | sensor_id = 0 |
||
) |
The main data retrieving function, to be called after calling loadConfig() and initialize().
out_img | The output retrieved RGB image (only if there_is_obs=true). |
timestamp | The timestamp of the capture (only if there_is_obs=true). |
there_is_obs | If set to false, there was no new observation. |
hardware_error | True on hardware/comms error. |
sensor_id | The index of the sensor accessed. |
void mrpt::hwdrivers::COpenNI2Generic::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().
out_obs | The output retrieved observation (only if there_is_obs=true). |
there_is_obs | If set to false, there was no new observation. |
hardware_error | True on hardware/comms error. |
sensor_id | The index of the sensor accessed. |
int mrpt::hwdrivers::COpenNI2Generic::getNumDevices | ( | ) | const |
The amount of available devices at initialization.
bool mrpt::hwdrivers::COpenNI2Generic::isOpen | ( | const unsigned | sensor_id | ) | const |
Check if the given 'sensor_id' has been open.
Whether there is a working connection to the sensor
bool mrpt::hwdrivers::COpenNI2Generic::isVerbose | ( | ) | const |
void mrpt::hwdrivers::COpenNI2Generic::kill | ( | ) |
Kill the OpenNI2 driver.
void mrpt::hwdrivers::COpenNI2Generic::open | ( | unsigned | sensor_id = 0 | ) |
Try to open the camera (all the parameters [resolution,fps,...] must be set before calling this) - users may also call initialize(), which in turn calls this method.
Raises an exception upon error.
std::exception | A textual description of the error. |
unsigned int mrpt::hwdrivers::COpenNI2Generic::openDeviceBySerial | ( | const unsigned int | SerialRequired | ) |
Open a RGBD device specified by its serial number.
This method is a wrapper for openDevicesBySerialNum(const std::set<unsigned>& vSerialRequired) This method requires to open the sensors which are still closed to read their serial.
unsigned int mrpt::hwdrivers::COpenNI2Generic::openDevicesBySerialNum | ( | const std::set< unsigned > & | vSerialRequired | ) |
Open a set of RGBD devices specified by their serial number.
Raises an exception when the demanded serial numbers are not among the connected devices. This function also fills a vector with the serial numbers of the connected OpenNI2 sensors (this requires openning the sensors which are still closed to read their serial)
void mrpt::hwdrivers::COpenNI2Generic::setVerbose | ( | bool | verbose | ) |
|
protected |
|
protected |
Definition at line 141 of file COpenNI2Generic.h.
|
protected |
Definition at line 140 of file COpenNI2Generic.h.
|
protected |
Default: all true.
Definition at line 148 of file COpenNI2Generic.h.
|
protected |
Definition at line 148 of file COpenNI2Generic.h.
|
protected |
The data that the RGBD sensors can return.
Definition at line 148 of file COpenNI2Generic.h.
|
protected |
Definition at line 139 of file COpenNI2Generic.h.
|
protected |
Definition at line 141 of file COpenNI2Generic.h.
|
protected |
Definition at line 142 of file COpenNI2Generic.h.
|
protected |
The same options (width, height and fps) are set for all the sensors.
(This could be changed if necessary)
Definition at line 139 of file COpenNI2Generic.h.
|
staticprotected |
Definition at line 133 of file COpenNI2Generic.h.
|
staticprotected |
Definition at line 131 of file COpenNI2Generic.h.
|
protected |
A vector with the serial numbers of the available devices.
Definition at line 136 of file COpenNI2Generic.h.
Page generated by Doxygen 1.8.16 for MRPT 1.4.0 SVN: at Mon Oct 14 23:11:08 UTC 2019 |