8#ifndef ROBOTSIO_YARPCAMERA_H
9#define ROBOTSIO_YARPCAMERA_H
11#include <RobotsIO/Camera/Camera.h>
15#include <opencv2/opencv.hpp>
19#include <yarp/os/BufferedPort.h>
20#include <yarp/os/Network.h>
21#include <yarp/sig/Image.h>
22#include <yarp/sig/Vector.h>
34 YarpCamera(
const std::string& port_prefix,
const bool& network_bootstrap =
false);
36 YarpCamera(
const std::size_t& width,
const std::size_t& height,
const double& fx,
const double& cx,
const double& fy,
const double& cy,
const std::string& port_prefix,
const bool& enable_camera_pose);
38 YarpCamera(
const std::string& data_path,
const std::size_t& width,
const double& height,
const double& fx,
const double& cx,
const double& fy,
const double& cy);
46 std::pair<bool, Eigen::Transform<double, 3, Eigen::Affine>>
pose(
const bool& blocking)
override;
48 std::pair<bool, cv::Mat> rgb(
const bool& blocking)
override;
50 std::pair<bool, Eigen::MatrixXf>
depth(
const bool& blocking)
override;
52 std::pair<bool, double> time_stamp_rgb()
const override;
54 std::pair<bool, double> time_stamp_depth()
const override;
57 yarp::os::Network yarp_;
63 yarp::os::BufferedPort<yarp::sig::ImageOf<yarp::sig::PixelFloat>> port_depth_;
65 yarp::os::BufferedPort<yarp::sig::ImageOf<yarp::sig::PixelRgb>> port_rgb_;
71 yarp::os::BufferedPort<yarp::sig::Vector> port_pose_;
73 bool enable_camera_pose_ =
false;
75 yarp::sig::Vector last_camera_pose_;
81 double time_stamp_rgb_;
83 double time_stamp_depth_;
85 bool is_time_stamp_rgb_ =
false;
87 bool is_time_stamp_depth_ =
false;
93 const std::string log_name_ =
"YarpCamera";
std::pair< bool, Eigen::MatrixXf > depth(const bool &blocking) override
std::pair< bool, Eigen::Transform< double, 3, Eigen::Affine > > pose(const bool &blocking) override