8#ifndef ROBOTSIO_CAMERA_H
9#define ROBOTSIO_CAMERA_H
11#include <RobotsIO/Camera/CameraParameters.h>
12#include <RobotsIO/Camera/DatasetParameters.h>
13#include <RobotsIO/Utils/ProbeContainer.h>
18#include <opencv2/opencv.hpp>
38 virtual bool status()
const;
48 virtual std::pair<bool, RobotsIO::Camera::CameraParameters> parameters()
const;
54 virtual std::pair<bool, Eigen::MatrixXf>
depth(
const bool& blocking) = 0;
56 virtual std::pair<bool, Eigen::MatrixXd> point_cloud(
const bool& blocking,
const double& maximum_depth = std::numeric_limits<double>::infinity(),
const bool& use_root_frame =
false,
const bool& enable_colors =
false);
58 virtual std::pair<bool, Eigen::Transform<double, 3, Eigen::Affine>> pose(
const bool& blocking) = 0;
60 virtual std::pair<bool, cv::Mat> rgb(
const bool& blocking) = 0;
62 virtual std::pair<bool, double> time_stamp_rgb()
const;
64 virtual std::pair<bool, double> time_stamp_depth()
const;
70 virtual std::pair<bool, Eigen::VectorXd>
auxiliary_data(
const bool& blocking);
72 virtual std::size_t auxiliary_data_size()
const;
80 virtual bool is_offline()
const;
82 virtual bool set_frame_index(
const std::int32_t& index);
84 virtual bool step_frame();
90 virtual bool log_frame(
const bool& log_depth =
false);
92 virtual bool start_log(
const std::string& path);
94 virtual bool stop_log();
97 virtual bool initialize();
109 Eigen::MatrixXd deprojection_matrix_;
111 bool deprojection_matrix_initialized_ =
false;
116 Camera(
const std::string& data_path,
const std::size_t& width,
const std::size_t& height,
const double& fx,
const double& cx,
const double& fy,
const double& cy);
124 virtual std::pair<bool, Eigen::Transform<double, 3, Eigen::Affine>> pose_offline();
126 virtual std::pair<bool, cv::Mat> rgb_offline();
128 virtual std::pair<bool, double> time_stamp_rgb_offline()
const;
130 virtual std::pair<bool, double> time_stamp_depth_offline()
const;
142 std::string compose_index(
const std::size_t& index);
144 virtual std::pair<bool, Eigen::MatrixXd> load_data();
148 const bool offline_mode_ =
false;
150 Eigen::MatrixXd data_;
152 std::int32_t frame_index_ = -1;
154 std::size_t rgb_offset_ = 0;
156 std::size_t depth_offset_ = 0;
158 std::size_t number_frames_;
166 std::string log_path_;
168 std::int32_t log_index_ = 0;
virtual std::pair< bool, Eigen::MatrixXd > deprojection_matrix() const
virtual std::pair< bool, Eigen::MatrixXf > depth_offline()
virtual bool evaluate_deprojection_matrix()
virtual bool log_frame(const bool &log_depth=false)
virtual std::int32_t frame_index() const
virtual std::pair< bool, Eigen::VectorXd > auxiliary_data_offline()
const std::string log_name_
virtual std::pair< bool, Eigen::MatrixXf > depth(const bool &blocking)=0
virtual std::pair< bool, Eigen::VectorXd > auxiliary_data(const bool &blocking)