mars_lib 0.1.0.2abe2576fe7f
Modular and Robust Sensor-Fusion
Loading...
Searching...
No Matches
Public Member Functions | List of all members
mars::ReadGpsWithVelData Class Reference

#include </home/runner/work/mars_lib/mars_lib/source/mars/include/mars/data_utils/read_gps_w_vel_data.h>

+ Collaboration diagram for mars::ReadGpsWithVelData:

Public Member Functions

EIGEN_MAKE_ALIGNED_OPERATOR_NEW ReadGpsWithVelData (std::vector< BufferEntryType > *data_out, std::shared_ptr< SensorAbsClass > sensor, const std::string &file_path, const double &time_offset=0)
 

Constructor & Destructor Documentation

◆ ReadGpsWithVelData()

EIGEN_MAKE_ALIGNED_OPERATOR_NEW mars::ReadGpsWithVelData::ReadGpsWithVelData ( std::vector< BufferEntryType > *  data_out,
std::shared_ptr< SensorAbsClass sensor,
const std::string &  file_path,
const double &  time_offset = 0 
)
inline
31 {
32 std::vector<std::string> expect_entry = { "t", "lat", "long", "alt", "v_x", "v_y", "v_z" };
33
34 CsvDataType csv_data;
35 ReadCsv(&csv_data, file_path);
36
37 unsigned long number_of_datapoints = csv_data["t"].size();
38 data_out->resize(number_of_datapoints);
39
40 for (size_t k = 0; k < number_of_datapoints; k++)
41 {
42 Time time = csv_data["t"][k] + time_offset;
43
44 BufferDataType data;
45 data.set_measurement(std::make_shared<GpsVelMeasurementType>(csv_data["lat"][k], csv_data["long"][k],
46 csv_data["alt"][k], csv_data["v_x"][k],
47 csv_data["v_y"][k], csv_data["v_z"][k]));
48
49 BufferEntryType current_entry(time, data, sensor);
50 data_out->at(k) = current_entry;
51 }
52 }
std::map< std::string, std::vector< double > > CsvDataType
Definition read_csv.h:26
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: