YARP
Yet Another Robot Platform
RGBDRosConversionUtils.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 
6 #ifndef RGBD_ROS_UTILS_H
7 #define RGBD_ROS_UTILS_H
8 
9 #include <iostream>
10 #include <cstring>
11 #include <mutex>
12 
13 #include <yarp/os/PeriodicThread.h>
14 #include <yarp/sig/all.h>
15 #include <yarp/sig/Matrix.h>
16 #include <yarp/os/Stamp.h>
17 #include <yarp/os/Property.h>
18 
19 #include <yarp/os/Node.h>
20 #include <yarp/os/Subscriber.h>
23 
25 
27 
28 namespace yarp {
29  namespace dev {
30  namespace RGBDRosConversionUtils {
31 
33  public yarp::os::Subscriber<yarp::rosmsg::sensor_msgs::Image>
34 {
35  protected:
38 
39  protected:
40  std::mutex m_port_mutex;
48 
49  public:
50  commonImageProcessor (std::string data_topic_name, std::string camera_info_topic_name);
51  virtual ~commonImageProcessor();
53  virtual void onRead(yarp::rosmsg::sensor_msgs::Image& v) override;
54 
55  public:
56  size_t getWidth() const;
57  size_t getHeight() const;
58  bool getFOV(double& horizontalFov, double& verticalFov) const;
59  bool getIntrinsicParam(yarp::os::Property& intrinsic) const;
60 
61  public:
64 };
65 
66 void deepCopyImages(const yarp::sig::FlexImage& src,
68  const std::string& frame_id,
69  const yarp::rosmsg::TickTime& timeStamp,
70  const unsigned int& seq);
71 
72 void deepCopyImages(const DepthImage& src,
74  const std::string& frame_id,
75  const yarp::rosmsg::TickTime& timeStamp,
76  const unsigned int& seq);
77 
79 
80 void shallowCopyImages(const DepthImage& src, DepthImage& dest);
81 
82 }
83 }
84 }
85 
86 #endif
contains the definition of a Matrix type
yarp::sig::ImageOf< yarp::sig::PixelFloat > DepthImage
bool getFOV(double &horizontalFov, double &verticalFov) const
virtual void onRead(yarp::rosmsg::sensor_msgs::Image &v) override
commonImageProcessor(std::string data_topic_name, std::string camera_info_topic_name)
bool getLastDepthData(yarp::sig::ImageOf< yarp::sig::PixelFloat > &data, yarp::os::Stamp &stmp)
bool getIntrinsicParam(yarp::os::Property &intrinsic) const
bool getLastRGBData(yarp::sig::FlexImage &data, yarp::os::Stamp &stmp)
yarp::os::Subscriber< yarp::rosmsg::sensor_msgs::CameraInfo > m_subscriber_camera_info
A class for storing options and configuration information.
Definition: Property.h:34
An abstraction for a time stamp and/or sequence number.
Definition: Stamp.h:22
A port specialized for reading data of a constant type published on a topic.
Definition: Subscriber.h:23
Image class with user control of representation details.
Definition: Image.h:414
void shallowCopyImages(const yarp::sig::FlexImage &src, yarp::sig::FlexImage &dest)
void deepCopyImages(const yarp::sig::FlexImage &src, yarp::rosmsg::sensor_msgs::Image &dest, const std::string &frame_id, const yarp::rosmsg::TickTime &timeStamp, const unsigned int &seq)
The main, catch-all namespace for YARP.
Definition: dirs.h:16