YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
RGBDRosConversionUtils.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2023 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
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>
21#include <yarp/rosmsg/sensor_msgs/CameraInfo.h>
22#include <yarp/rosmsg/sensor_msgs/Image.h>
23
24#include <yarp/rosmsg/impl/yarpRosHelper.h>
25
27
29
31 public yarp::os::Subscriber<yarp::rosmsg::sensor_msgs::Image>
32{
33 protected:
36
37 protected:
38 std::mutex m_port_mutex;
42 mutable yarp::rosmsg::sensor_msgs::CameraInfo m_lastCameraInfo;
46
47 public:
48 commonImageProcessor (std::string data_topic_name, std::string camera_info_topic_name);
49 virtual ~commonImageProcessor();
50 using yarp::os::Subscriber<yarp::rosmsg::sensor_msgs::Image>::onRead;
51 virtual void onRead(yarp::rosmsg::sensor_msgs::Image& v) override;
52
53 public:
54 size_t getWidth() const;
55 size_t getHeight() const;
56 bool getFOV(double& horizontalFov, double& verticalFov) const;
57 bool getIntrinsicParam(yarp::os::Property& intrinsic) const;
58
59 public:
62};
63
65 yarp::rosmsg::sensor_msgs::Image& dest,
66 const std::string& frame_id,
67 const yarp::rosmsg::TickTime& timeStamp,
68 const unsigned int& seq);
69
70void deepCopyImages(const DepthImage& src,
71 yarp::rosmsg::sensor_msgs::Image& dest,
72 const std::string& frame_id,
73 const yarp::rosmsg::TickTime& timeStamp,
74 const unsigned int& seq);
75
77
78void shallowCopyImages(const DepthImage& src, DepthImage& dest);
79
80} // namespace yarp::dev::RGBDRosConversionUtils
81
82#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
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 mini-server for performing network communication in the background.
A class for storing options and configuration information.
Definition Property.h:33
An abstraction for a time stamp and/or sequence number.
Definition Stamp.h:21
A port specialized for reading data of a constant type published on a topic.
Definition Subscriber.h:22
Image class with user control of representation details.
Definition Image.h:374
Typed image class.
Definition Image.h:616
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)