worked on synthetic sensors
worked on grid-walker minor changes/fixes/improvements
This commit is contained in:
@@ -83,6 +83,10 @@ namespace Offline {
|
||||
// get all sensor events from the offline file
|
||||
const std::vector<Entry> events = reader->getEntries();
|
||||
|
||||
// reference time (system vs. first-event)
|
||||
Timestamp tsRef1 = Timestamp::fromMS(events.front().ts);
|
||||
Timestamp tsRef2 = Timestamp::fromRunningTime();
|
||||
|
||||
// process every event
|
||||
for (const Entry& e : events) {
|
||||
|
||||
@@ -92,6 +96,14 @@ namespace Offline {
|
||||
// timestamp
|
||||
const Timestamp ts = Timestamp::fromMS(e.ts);
|
||||
|
||||
// ensure events happen occur fast as they did during recording
|
||||
if (realtime) {
|
||||
const Timestamp ts1 = ts-tsRef1;
|
||||
const Timestamp ts2 = Timestamp::fromRunningTime() - tsRef2;
|
||||
const Timestamp diff = ts1-ts2;
|
||||
if (diff.ms() > 0) {std::this_thread::sleep_for(std::chrono::milliseconds(diff.ms()));}
|
||||
}
|
||||
|
||||
// event index
|
||||
const size_t idx = e.idx;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user