RobotsIO
Loading...
Searching...
No Matches
DatasetDataStream.h
1/*
2 * Copyright (C) 2020 Istituto Italiano di Tecnologia (IIT)
3 *
4 * This software may be modified and distributed under the terms of the
5 * BSD 3-Clause license. See the accompanying LICENSE file for details.
6 */
7
8#ifndef ROBOTSIO_DATASETDATASTREAM_H
9#define ROBOTSIO_DATASETDATASTREAM_H
10
11#include <Eigen/Dense>
12
13namespace RobotsIO {
14 namespace Utils {
15 class DatasetDataStream;
16 }
17}
18
19
21{
22public:
23 static const int NoTimeIndex = -1;
24
25 DatasetDataStream(const std::string& file_path, const std::size_t& skip_rows, const std::size_t& skip_cols, const std::size_t& expected_cols, const int rx_time_index = NoTimeIndex, const int tx_time_index = NoTimeIndex);
26
27 virtual ~DatasetDataStream();
28
29 double rx_time();
30
31 double tx_time();
32
33 virtual Eigen::VectorXd data();
34
35 virtual bool freeze();
36
37protected:
38 int get_head();
39
40 bool set_head(const int& value);
41
42 Eigen::VectorXd data(const int& index);
43
44private:
45 Eigen::MatrixXd data_;
46
47 Eigen::VectorXd data_rx_time_;
48
49 Eigen::VectorXd data_tx_time_;
50
51 int rx_time_index_;
52
53 int tx_time_index_;
54
55 int head_ = -1;
56
57 const std::string log_name_ = "DatasetDataStream";
58};
59
60#endif /* ROBOTSIO_DATASETDATASTREAM_H */