rgbd
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
rgbd::ClientRGBD Class Reference

Client which subscribes to RGBD topic. More...

#include <client_rgbd.h>

Public Member Functions

 ClientRGBD ()
 Constructor. More...
 
bool deinitialize ()
 Clears the subscriber. initialized will now return false. More...
 
bool initialize (const std::string &server_name)
 Initialize the client. More...
 
bool initialized ()
 Check if the client is initialized. nextImage will not return an image if client is not initialized. More...
 
ImagePtr nextImage ()
 Get a new Image. If no new image has been received since the last call, The ImagePtr will be a nullptr. More...
 
bool nextImage (Image &image)
 Get a new Image. If no new image has been received since the last call, no image will be written and false will be returned. More...
 
virtual ~ClientRGBD ()
 Destructor. More...
 

Protected Member Functions

void rgbdImageCallback (const rgbd_msgs::RGBD::ConstPtr &msg)
 

Protected Attributes

ros::CallbackQueue cb_queue_
 
Imageimage_ptr_
 Pointer to the Image being written in the NextImage calls. Either set to the address of the provided reference. Or being wrapped into a shared pointer. Ownership therefore belongs to the caller of nextImage, which provides the references or receives the SharedPtr. image_ptr_ should only be accessed inside a NextImage call. Outside it, the image_ptr_ might be invalid/ This is used since you can not pass additional arguments to the callback. A raw pointer is prefered to avoid unnecessary copy operations. More...
 
bool new_image_
 Track if image is updated in a callback. More...
 
ros::Subscriber sub_image_
 

Detailed Description

Client which subscribes to RGBD topic.

Definition at line 22 of file client_rgbd.h.

Constructor & Destructor Documentation

◆ ClientRGBD()

rgbd::ClientRGBD::ClientRGBD ( )

Constructor.

Definition at line 10 of file client_rgbd.cpp.

◆ ~ClientRGBD()

rgbd::ClientRGBD::~ClientRGBD ( )
virtual

Destructor.

image_ptr_ is not deleted as the client never owns the image pointer

Definition at line 16 of file client_rgbd.cpp.

Member Function Documentation

◆ deinitialize()

bool rgbd::ClientRGBD::deinitialize ( )

Clears the subscriber. initialized will now return false.

Returns
indicates success

Definition at line 36 of file client_rgbd.cpp.

◆ initialize()

bool rgbd::ClientRGBD::initialize ( const std::string server_name)

Initialize the client.

Parameters
server_nameFully resolved server name
Returns
indicates success

Definition at line 22 of file client_rgbd.cpp.

◆ initialized()

bool rgbd::ClientRGBD::initialized ( )
inline

Check if the client is initialized. nextImage will not return an image if client is not initialized.

Returns
initialized or not

Definition at line 55 of file client_rgbd.h.

◆ nextImage() [1/2]

ImagePtr rgbd::ClientRGBD::nextImage ( )

Get a new Image. If no new image has been received since the last call, The ImagePtr will be a nullptr.

Returns
ImagePtr to an Image or a nullptr

Definition at line 54 of file client_rgbd.cpp.

◆ nextImage() [2/2]

bool rgbd::ClientRGBD::nextImage ( Image image)

Get a new Image. If no new image has been received since the last call, no image will be written and false will be returned.

Parameters
imageImage reference which will be written.
Returns
valid image written

Definition at line 44 of file client_rgbd.cpp.

◆ rgbdImageCallback()

void rgbd::ClientRGBD::rgbdImageCallback ( const rgbd_msgs::RGBD::ConstPtr &  msg)
protected

Definition at line 69 of file client_rgbd.cpp.

Member Data Documentation

◆ cb_queue_

ros::CallbackQueue rgbd::ClientRGBD::cb_queue_
protected

Definition at line 75 of file client_rgbd.h.

◆ image_ptr_

Image* rgbd::ClientRGBD::image_ptr_
protected

Pointer to the Image being written in the NextImage calls. Either set to the address of the provided reference. Or being wrapped into a shared pointer. Ownership therefore belongs to the caller of nextImage, which provides the references or receives the SharedPtr. image_ptr_ should only be accessed inside a NextImage call. Outside it, the image_ptr_ might be invalid/ This is used since you can not pass additional arguments to the callback. A raw pointer is prefered to avoid unnecessary copy operations.

Definition at line 87 of file client_rgbd.h.

◆ new_image_

bool rgbd::ClientRGBD::new_image_
protected

Track if image is updated in a callback.

Definition at line 80 of file client_rgbd.h.

◆ sub_image_

ros::Subscriber rgbd::ClientRGBD::sub_image_
protected

Definition at line 74 of file client_rgbd.h.


The documentation for this class was generated from the following files: