Grabber for DINAST devices (i.e., IPA-1002, IPA-1110, IPA-2001) More...
#include <dinast_grabber.h>
Public Member Functions | |
DinastGrabber (const int device_position=1) | |
Constructor that sets up the grabber constants. | |
std::string | getDeviceVersion () |
Get the version number of the currently opened device. | |
virtual float | getFramesPerSecond () const |
Obtain the number of frames per second (FPS). | |
virtual std::string | getName () const |
Returns the name of the concrete subclass, DinastGrabber. | |
virtual bool | isRunning () const |
Check if the grabber is running. | |
virtual void | start () |
Start the data acquisition process. | |
virtual void | stop () |
Stop the data acquisition process. | |
virtual | ~DinastGrabber () throw () |
Destructor. It never throws. | |
Protected Types | |
enum | { CMD_READ_START = 0xC7, CMD_READ_STOP = 0xC8, CMD_GET_VERSION = 0xDC, CMD_SEND_DATA = 0xDE } |
Device command values. More... | |
enum | pixel_size { RAW8 = 1, RGB16 = 2, RGB24 = 3, RGB32 = 4 } |
Size of pixel. More... | |
Protected Member Functions | |
void | captureThreadFunction () |
The function in charge of getting the data from the camera. | |
int | checkHeader () |
Check if we have a header in the global buffer, and return the position of the next valid image. | |
pcl::PointCloud < pcl::PointXYZI >::Ptr | getXYZIPointCloud () |
Obtains XYZI Point Cloud from the image of the camera. | |
void | onInit (const int device_id) |
On initialization processing. | |
void | readImage () |
Read image data and leaves it on image_. | |
void | setupDevice (int device_position, const int id_vendor=0x18d1, const int id_product=0x1402) |
Setup a Dinast 3D camera device. | |
bool | USBRxControlData (const unsigned char req_code, unsigned char *buffer, int length) |
Send a RX data packet request. | |
bool | USBTxControlData (const unsigned char req_code, unsigned char *buffer, int length) |
Send a TX data packet request. | |
Protected Attributes | |
unsigned char | bulk_ep_ |
Bulk endpoint address value. | |
boost::mutex | capture_mutex_ |
boost::thread | capture_thread_ |
libusb_context * | context_ |
The libusb context. | |
struct libusb_device_handle * | device_handle_ |
the actual device_handle for the camera | |
double | dist_max_2d_ |
double | fov_ |
diagonal Field of View | |
boost::circular_buffer < unsigned char > | g_buffer_ |
Global circular buffer. | |
unsigned char * | image_ |
int | image_height_ |
Height of image. | |
int | image_size_ |
Total size of image. | |
int | image_width_ |
Width of image. | |
boost::signals2::signal < sig_cb_dinast_point_cloud > * | point_cloud_signal_ |
unsigned char * | raw_buffer_ |
Temporary USB read buffer, since we read two RGB16 images at a time size is the double of two images plus a sync packet. | |
bool | running_ |
bool | second_image_ |
Since there is no header after the first image, we need to save the state. | |
int | sync_packet_size_ |
Length of a sync packet. | |
Private Types | |
typedef void( | sig_cb_dinast_point_cloud )(const boost::shared_ptr< const pcl::PointCloud< pcl::PointXYZI > > &) |
Grabber for DINAST devices (i.e., IPA-1002, IPA-1110, IPA-2001)
Definition at line 57 of file dinast_grabber.h.
typedef void( pcl::DinastGrabber::sig_cb_dinast_point_cloud)(const boost::shared_ptr< const pcl::PointCloud< pcl::PointXYZI > > &) [private] |
Definition at line 60 of file dinast_grabber.h.
anonymous enum [protected] |
Device command values.
Definition at line 199 of file dinast_grabber.h.
enum pcl::DinastGrabber::pixel_size [protected] |
pcl::DinastGrabber::DinastGrabber | ( | const int | device_position = 1 | ) |
Constructor that sets up the grabber constants.
[in] | device_position | Number corresponding the device to grab |
Definition at line 46 of file dinast_grabber.cpp.
pcl::DinastGrabber::~DinastGrabber | ( | ) | throw () [virtual] |
Destructor. It never throws.
Definition at line 65 of file dinast_grabber.cpp.
void pcl::DinastGrabber::captureThreadFunction | ( | ) | [protected] |
The function in charge of getting the data from the camera.
Definition at line 437 of file dinast_grabber.cpp.
int pcl::DinastGrabber::checkHeader | ( | ) | [protected] |
Check if we have a header in the global buffer, and return the position of the next valid image.
Definition at line 411 of file dinast_grabber.cpp.
Get the version number of the currently opened device.
Definition at line 197 of file dinast_grabber.cpp.
float pcl::DinastGrabber::getFramesPerSecond | ( | ) | const [virtual] |
Obtain the number of frames per second (FPS).
Implements pcl::Grabber.
Definition at line 95 of file dinast_grabber.cpp.
virtual std::string pcl::DinastGrabber::getName | ( | ) | const [inline, virtual] |
Returns the name of the concrete subclass, DinastGrabber.
Implements pcl::Grabber.
Definition at line 81 of file dinast_grabber.h.
pcl::PointCloud< pcl::PointXYZI >::Ptr pcl::DinastGrabber::getXYZIPointCloud | ( | ) | [protected] |
Obtains XYZI Point Cloud from the image of the camera.
[out] | the | point cloud from the image data |
Definition at line 299 of file dinast_grabber.cpp.
bool pcl::DinastGrabber::isRunning | ( | ) | const [virtual] |
Check if the grabber is running.
Implements pcl::Grabber.
Definition at line 88 of file dinast_grabber.cpp.
void pcl::DinastGrabber::onInit | ( | const int | device_id | ) | [protected] |
On initialization processing.
Definition at line 107 of file dinast_grabber.cpp.
void pcl::DinastGrabber::readImage | ( | ) | [protected] |
Read image data and leaves it on image_.
Definition at line 229 of file dinast_grabber.cpp.
void pcl::DinastGrabber::setupDevice | ( | int | device_position, |
const int | id_vendor = 0x18d1 , |
||
const int | id_product = 0x1402 |
||
) | [protected] |
Setup a Dinast 3D camera device.
[in] | device_position | Number corresponding the device to grab |
[in] | id_vendor | The ID of the camera vendor (should be 0x18d1) |
[in] | id_product | The ID of the product (should be 0x1402) |
Definition at line 116 of file dinast_grabber.cpp.
void pcl::DinastGrabber::start | ( | ) | [virtual] |
Start the data acquisition process.
Implements pcl::Grabber.
Definition at line 209 of file dinast_grabber.cpp.
void pcl::DinastGrabber::stop | ( | ) | [virtual] |
Stop the data acquisition process.
Implements pcl::Grabber.
Definition at line 219 of file dinast_grabber.cpp.
bool pcl::DinastGrabber::USBRxControlData | ( | const unsigned char | req_code, |
unsigned char * | buffer, | ||
int | length | ||
) | [protected] |
Send a RX data packet request.
[in] | req_code | the request to send (the request field for the setup packet) |
[in] | length | the length field for the setup packet. The data buffer should be at least this size. |
Definition at line 359 of file dinast_grabber.cpp.
bool pcl::DinastGrabber::USBTxControlData | ( | const unsigned char | req_code, |
unsigned char * | buffer, | ||
int | length | ||
) | [protected] |
Send a TX data packet request.
[in] | req_code | the request to send (the request field for the setup packet) |
[in] | length | the length field for the setup packet. The data buffer should be at least this size. |
Definition at line 383 of file dinast_grabber.cpp.
unsigned char pcl::DinastGrabber::bulk_ep_ [protected] |
Bulk endpoint address value.
Definition at line 196 of file dinast_grabber.h.
boost::mutex pcl::DinastGrabber::capture_mutex_ [mutable, protected] |
Definition at line 210 of file dinast_grabber.h.
boost::thread pcl::DinastGrabber::capture_thread_ [protected] |
Definition at line 208 of file dinast_grabber.h.
libusb_context* pcl::DinastGrabber::context_ [protected] |
The libusb context.
Definition at line 182 of file dinast_grabber.h.
struct libusb_device_handle* pcl::DinastGrabber::device_handle_ [protected] |
the actual device_handle for the camera
Definition at line 185 of file dinast_grabber.h.
double pcl::DinastGrabber::dist_max_2d_ [protected] |
Definition at line 173 of file dinast_grabber.h.
double pcl::DinastGrabber::fov_ [protected] |
diagonal Field of View
Definition at line 176 of file dinast_grabber.h.
boost::circular_buffer<unsigned char> pcl::DinastGrabber::g_buffer_ [protected] |
Global circular buffer.
Definition at line 193 of file dinast_grabber.h.
unsigned char* pcl::DinastGrabber::image_ [protected] |
Definition at line 201 of file dinast_grabber.h.
int pcl::DinastGrabber::image_height_ [protected] |
Height of image.
Definition at line 165 of file dinast_grabber.h.
int pcl::DinastGrabber::image_size_ [protected] |
Total size of image.
Definition at line 168 of file dinast_grabber.h.
int pcl::DinastGrabber::image_width_ [protected] |
Width of image.
Definition at line 162 of file dinast_grabber.h.
boost::signals2::signal<sig_cb_dinast_point_cloud>* pcl::DinastGrabber::point_cloud_signal_ [protected] |
Definition at line 211 of file dinast_grabber.h.
unsigned char* pcl::DinastGrabber::raw_buffer_ [protected] |
Temporary USB read buffer, since we read two RGB16 images at a time size is the double of two images plus a sync packet.
Definition at line 190 of file dinast_grabber.h.
bool pcl::DinastGrabber::running_ [protected] |
Definition at line 206 of file dinast_grabber.h.
bool pcl::DinastGrabber::second_image_ [protected] |
Since there is no header after the first image, we need to save the state.
Definition at line 204 of file dinast_grabber.h.
int pcl::DinastGrabber::sync_packet_size_ [protected] |
Length of a sync packet.
Definition at line 171 of file dinast_grabber.h.