rgbd
client_rgbd.h
Go to the documentation of this file.
1 
5 #ifndef RGBD_CLIENT_RGBD_H_
6 #define RGBD_CLIENT_RGBD_H_
7 
8 #include <ros/node_handle.h>
9 #include <ros/subscriber.h>
10 #include <ros/callback_queue.h>
11 
12 #include "rgbd/types.h"
13 
14 #include "rgbd_msgs/RGBD.h"
15 
16 
17 namespace rgbd {
18 
22 class ClientRGBD {
23 
24 public:
25 
29  ClientRGBD();
30 
36  virtual ~ClientRGBD();
37 
43  bool initialize(const std::string& server_name);
44 
49  bool deinitialize();
50 
55  bool initialized() { return !sub_image_.getTopic().empty(); }
56 
63  bool nextImage(Image& image);
64 
71 
72 protected:
73 
74  ros::Subscriber sub_image_;
75  ros::CallbackQueue cb_queue_;
76 
80  bool new_image_;
88 
89  void rgbdImageCallback(const rgbd_msgs::RGBD::ConstPtr& msg);
90 
91 };
92 
93 }
94 
95 #endif // RGBD_CLIENT_RGBD_H_
rgbd::ClientRGBD::new_image_
bool new_image_
Track if image is updated in a callback.
Definition: client_rgbd.h:80
std::string
std::shared_ptr
types.h
rgbd::ClientRGBD::~ClientRGBD
virtual ~ClientRGBD()
Destructor.
Definition: client_rgbd.cpp:16
rgbd::ClientRGBD::initialized
bool initialized()
Check if the client is initialized. nextImage will not return an image if client is not initialized.
Definition: client_rgbd.h:55
rgbd::ClientRGBD::image_ptr_
Image * image_ptr_
Pointer to the Image being written in the NextImage calls. Either set to the address of the provided ...
Definition: client_rgbd.h:87
rgbd::Image
Definition: image.h:43
rgbd
Definition: client.h:24
rgbd::ClientRGBD::initialize
bool initialize(const std::string &server_name)
Initialize the client.
Definition: client_rgbd.cpp:22
rgbd::ClientRGBD::sub_image_
ros::Subscriber sub_image_
Definition: client_rgbd.h:74
rgbd::ClientRGBD::deinitialize
bool deinitialize()
Clears the subscriber. initialized will now return false.
Definition: client_rgbd.cpp:36
rgbd::ClientRGBD::rgbdImageCallback
void rgbdImageCallback(const rgbd_msgs::RGBD::ConstPtr &msg)
Definition: client_rgbd.cpp:69
rgbd::ClientRGBD
Client which subscribes to RGBD topic.
Definition: client_rgbd.h:22
rgbd::ClientRGBD::cb_queue_
ros::CallbackQueue cb_queue_
Definition: client_rgbd.h:75
rgbd::ClientRGBD::nextImage
ImagePtr nextImage()
Get a new Image. If no new image has been received since the last call, The ImagePtr will be a nullpt...
Definition: client_rgbd.cpp:54
rgbd::ClientRGBD::ClientRGBD
ClientRGBD()
Constructor.
Definition: client_rgbd.cpp:10