Recorder that serialises VLink traffic into the MCAP container (.vcap / .vcapx).
VCAPWriter materialises a BagWriter that emits Foxglove-compatible MCAP files. It inherits the cross-format split-recording machinery from BagWriter and produces files that any MCAP-aware tool can replay. Compression flips between no-compression and Zstd when the build links libzstd; other selectors degrade to plain chunks.
- File-format diagram
push_schema() --> schema record
push(frame) --> channel record (once per URL)
--> message chunk (Zstd optional)
on_end() --> attachments + summary section + footer (index of summary)
- Writer states
+----------+ on_begin() +---------+ push()/push_schema() +-----------+
| closed | ------------> | opening | -----------------------> | recording |
+----------+ +---------+ +-----------+
^ |
| +-------------+
| | rotating |
| | (new .vcap) |
| +-------------+
| |
+-------------------- on_end() / dtor --------------------- finalising
|
v
sealed
VLINK_EXPORT std::vector< std::string > split(const std::string &str, char f=',') noexcept
Splits a string by a single-character delimiter; empty parts are skipped.
- Example
writer->async_run();
writer->push_schema(my_schema);
frame.
url =
"dds://lidar/front";
frame.
ser_type =
"demo.proto.PointCloud";
frame.
data = serialized_bytes;
writer->push(frame);
static std::shared_ptr< BagWriter > create(const std::string &path, const Config &config={})
Builds the concrete writer matching the extension of path.
@ kProtobuf
Decode through the Protocol Buffers stack.
@ kPublish
Message emitted by a Publisher node.
One recorded or replayed message as it flows through the bag pipeline.
Definition: types.h:230
Bytes data
Serialised payload bytes.
Definition: types.h:236
SchemaType schema_type
Coarse schema family; reader fills it before user output.
Definition: types.h:234
ActionType action_type
Recorded action kind.
Definition: types.h:235
int64_t timestamp
Canonical time in microseconds (record / playback).
Definition: types.h:231
std::string ser_type
Serialisation type; reader fills it before user output.
Definition: types.h:233
std::string url
Topic URL.
Definition: types.h:232
- 参见
- BagWriter, VDBWriter