Skip to content
Snippets Groups Projects
Commit abb20330 authored by Dominic Brestel's avatar Dominic Brestel
Browse files

Add initial scene state to first recording batch

parent 7a0f7f68
No related branches found
No related tags found
No related merge requests found
......@@ -482,6 +482,11 @@ void armarx::ArVizStorage::recordBatch(armarx::viz::data::RecordingBatch& batch)
batch.header.lastRevision = last.revision;
batch.header.firstTimestampInMicroSeconds = first.timestampInMicroseconds;
batch.header.lastTimestampInMicroSeconds = last.timestampInMicroseconds;
if(firstBatch) {
batch.initialState = currentState;
firstBatch = false;
}
std::string filename = batchFileName(batch.header);
std::filesystem::path filePath = recordingPath / filename;
......@@ -571,6 +576,7 @@ std::string armarx::ArVizStorage::startRecording(std::string const& newRecording
recordingMetaData.batchHeaders.clear();
}
firstBatch = true;
recordingTask = new RunningTask<ArVizStorage>(this, &ArVizStorage::record);
recordingTask->start();
......@@ -640,7 +646,7 @@ armarx::viz::data::RecordingBatch armarx::ArVizStorage::getRecordingBatch(std::s
return result;
}
if (batchIndex < 0 && batchIndex >= (long)recording->batchHeaders.size())
if (batchIndex < 0 || batchIndex >= (long)recording->batchHeaders.size())
{
ARMARX_WARNING << "Batch index is not valid. Index = " << batchIndex
<< "Batch count: " << recording->batchHeaders.size();
......
......@@ -110,6 +110,7 @@ namespace armarx
std::vector<viz::data::TimestampedLayerUpdate> currentState;
std::vector<viz::data::TimestampedLayerUpdate> history;
long revision = 0;
bool firstBatch = false;
// We store all interactions in here
// But we curate them, so that only the last interaction with an element is reported
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment