8#include <RobotsIO/Utils/DatasetTransformDelayed.h>
11using namespace RobotsIO::Utils;
14DatasetTransformDelayed::DatasetTransformDelayed
17 const double& simulated_fps,
18 const bool simulate_inference_time,
19 const std::string& file_path,
20 const std::size_t& skip_rows,
21 const std::size_t& skip_cols,
22 const std::size_t& expected_cols,
23 const int rx_time_index,
24 const int tx_time_index
26 DatasetDataStreamDelayed(fps, simulated_fps, simulate_inference_time, file_path, skip_rows, skip_cols, expected_cols, rx_time_index, tx_time_index),
28 simulated_fps_(simulated_fps)
32DatasetTransformDelayed::~DatasetTransformDelayed()
36Eigen::Transform<double, 3, Eigen::Affine> DatasetTransformDelayed::transform()
42bool DatasetTransformDelayed::freeze(
const bool blocking)
44 if (!DatasetDataStreamDelayed::freeze())
47 VectorXd transform_data = data();
49 bool invalid_pose =
true;
50 for (std::size_t i = 0; i < transform_data.size(); i++)
51 invalid_pose &= (transform_data(i) == 0.0);
55 transform_ = Translation<double, 3>(transform_data.head<3>());
56 AngleAxisd rotation(transform_data(6), transform_data.segment<3>(3));
57 transform_.rotate(rotation);
65 return int(fps_ / simulated_fps_);