@@ -31,26 +31,37 @@ namespace rerun_vrs {
31
31
};
32
32
33
33
RerunFramePlayer::RerunFramePlayer (vrs::StreamId id, rerun::RecordingStream& rec)
34
- : id_{id}, rec_{rec} {}
34
+ : id_{id}, rec_{rec}, entityPath_{ add_quotes (id. getName ())} {}
35
35
36
36
bool RerunFramePlayer::onDataLayoutRead (
37
37
const vrs::CurrentRecord& record, size_t blockIndex, vrs::DataLayout& layout
38
38
) {
39
39
if (!enabled_)
40
40
return false ;
41
41
42
+ std::ostringstream buffer;
43
+ layout.printLayoutCompact (buffer);
44
+ const auto & layout_str = buffer.str ();
45
+
42
46
rec_.set_time_seconds (" timestamp" , record.timestamp );
47
+
48
+ if (record.recordType == vrs::Record::Type::CONFIGURATION)
49
+ // NOTE this is meta data from the sensor that doesn't change over time and only comes
50
+ // in once in the beginning
51
+ rec_.log_timeless (
52
+ (entityPath_ + " /configuration" ).c_str (),
53
+ rerun::TextDocument (layout_str)
54
+ );
55
+
43
56
if (record.recordType == vrs::Record::Type::DATA) {
44
57
auto & config = getExpectedLayout<FrameNumberDataLayout>(layout, blockIndex);
45
58
uint64_t frame_number;
46
59
if (config.frameNumber .get (frame_number))
47
60
rec_.set_time_sequence (" frame_number" , frame_number);
48
- }
49
61
50
- // TODO write this information to a markdown file
51
- /* std::ostringstream buffer; */
52
- /* layout.printLayoutCompact(buffer); */
53
- /* std::cout << buffer.str() << std::endl; */
62
+ // this is meta data per record and changes over time
63
+ rec_.log ((entityPath_ + " /data" ).c_str (), rerun::TextDocument (layout_str));
64
+ }
54
65
55
66
return true ; // read next blocks, if any
56
67
}
0 commit comments