Skip to content

Commit

Permalink
Merge pull request #3 from ethz-asl/fix/replaced_std_get_time
Browse files Browse the repository at this point in the history
replaced std::get_time() as it was not found in g++ 4.9
  • Loading branch information
helenol authored Aug 12, 2016
2 parents dbafd8d + 5613f13 commit 5a240b5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion kitti_to_rosbag/src/kitti_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,13 @@ bool KittiParser::loadTimestampsIntoVector(

std::string timestamp_string = line_stream.str();
std::tm t = {};
line_stream >> std::get_time(&t, "%Y-%m-%d %H:%M:%S");
t.tm_year = std::stoi(timestamp_string.substr(0, 4)) - 1900;
t.tm_mon = std::stoi(timestamp_string.substr(5, 2)) - 1;
t.tm_mday = std::stoi(timestamp_string.substr(8, 2));
t.tm_hour = std::stoi(timestamp_string.substr(11, 2));
t.tm_min = std::stoi(timestamp_string.substr(14, 2));
t.tm_sec = std::stoi(timestamp_string.substr(17, 2));
t.tm_isdst = -1;

static const uint64_t kSecondsToNanoSeconds = 1e9;
time_t time_since_epoch = mktime(&t);
Expand Down

0 comments on commit 5a240b5

Please sign in to comment.