You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/rosbags.md
+76-56
Original file line number
Diff line number
Diff line change
@@ -27,80 +27,48 @@ The technical challenges shall be examined within this article.
27
27
We shall the discuss the requirements on such a tool, the technical challenges and changes to be made to the current ROS2.0 system.
28
28
29
29
30
-
## Requirements
30
+
## Requirements for storage format
31
31
32
-
### API for recording and replaying
32
+
To be chosen from section "Relaxed or dismissed requirements" in the "Alternatives" section
33
33
34
-
The most important requirement for rosbags is being capable to record all available topics with minimal deserializing overhead.
35
-
We shall therefore implement a set of functions in the rmw layer, which allows users to take messages raw, meaning in a serialized form object to the underlying middleware.
36
-
In the case of DDS, such a raw message shall correspond to the CDR data being sent over the wire.
37
-
Simultaneously, there shall be an API to convert a ROS2.0 message into its binary representation, such as CDR, in order to record data which is not being sent over the wire but created manually.
38
34
39
-
The same requirements are set for publishing stored data, where already serialized data shall be transmitted over the wire without the need of serializing.
40
-
Analog to taking a message in its raw format, we shall implement a rmw function which allows publishing a raw message on a topic.
41
-
In order to read a serialized message from a rosbag, we shall have a function which converts a serialized binary representation in its corresponding ROS2.0 message.
35
+
## Proposal for data storage format
42
36
43
-
Given the requirements above, we propose the following rmw API:
37
+
To be chosen from section "Dismissed data storage formats" in the "Alternatives" section
The chosen format has to scale up to multiple terabytes of file size.
58
48
59
-
The in the code snippet mentioned raw message shall be defined as follows:
49
+
#### Parallelism
50
+
It must be possible to write to the file from multiple instances at the same time.
60
51
61
-
```c
62
-
typedef struct rmw_message_raw_t
63
-
{
64
-
unsigned int length;
65
-
char * raw_data;
66
-
} rmw_message_raw_t;
67
-
```
52
+
#### Compression
53
+
When the file size becomes larger, it should be possible to compress the file for long time archiving.
68
54
69
-
The `raw_data` field shall contain all message data needed to extract a ROS message given a respective type support, which contains all necessary information on how to concert the raw data into its corresponding ros message type.
70
-
An example for CDR data in case of DDS:
55
+
#### Random access
56
+
It must be possible to grant random read access to the file and extract specific individual messages.
57
+
Random access further means that it should be possible to extract the n-th message of one topic.
Given the API proposed in the above section, we need a data storage format which allows to sufficiently store and replay this serialized data.
87
-
There are a few requirements for writing to such a data storage format:
88
-
89
-
- Scalability: The chosen format has to scale up to multiple terabytes of file size.
90
-
- Parallelism: It must be possible to write to the file from multiple instances at the same time.
91
-
- Compression (might be relaxed): Ideally, when the file size becomes larger, it should be possible to compress the file for long time archiving.
59
+
#### Range access
60
+
It further should be possible to only replay/read a section of the record, specified by a range of time.
61
+
It should be possible to access a range of messages in terms of timestamps from `tx` to `tx+n`.
92
62
93
-
In terms of reading from the file, there are similar requirements:
94
-
95
-
- Random access: It must be possible to grant random read access to the file and extract specific individual messages.
96
-
- Range access: It further should be possible to only replay/read a section of the record, specified by a range of time.
97
-
- Chunk sizes: The chunk sizes must be configurable to fit various large message types.
63
+
#### Variable Chunk sizes
64
+
The chunk sizes must be configurable to fit various large message types in order to stay performant even with large data messages.
98
65
66
+
#### Backwards compatible with ROS1
99
67
A general requirement is to be backwards compatible with existing ROS1 bags.
100
68
This compatibility can either be via a conversion script, which permanently converts ROS1 bags into ROS2 bags or a bridge API which allows to manually open existing ROS1 bags and publish them into the ROS2 system.
101
69
102
70
103
-
##Evaluation of possible data storage formats
71
+
### Dismissed data storage formats
104
72
105
73
In the following, we are iterating over a couple of data formats, which may be suitable for the underlying ROSbag implementation.
106
74
We hereby iterate over existing third party software as well as examining of maintaining a self-made format.
@@ -150,3 +118,55 @@ The Gazebo team created a nicely composed [comparison](https://osrfoundation.atl
150
118
- Ability to query the tables with classical relational SQL syntax.
151
119
152
120
#### Cons
121
+
122
+
123
+
## API for recording and replaying
124
+
125
+
The most important requirement for rosbags is being capable to record all available topics with minimal deserializing overhead.
126
+
We shall therefore implement a set of functions in the rmw layer, which allows users to take messages raw, meaning in a serialized form object to the underlying middleware.
127
+
In the case of DDS, such a raw message shall correspond to the CDR data being sent over the wire.
128
+
Simultaneously, there shall be an API to convert a ROS2.0 message into its binary representation, such as CDR, in order to record data which is not being sent over the wire but created manually.
129
+
130
+
The same requirements are set for publishing stored data, where already serialized data shall be transmitted over the wire without the need of serializing.
131
+
Analog to taking a message in its raw format, we shall implement a rmw function which allows publishing a raw message on a topic.
132
+
In order to read a serialized message from a rosbag, we shall have a function which converts a serialized binary representation in its corresponding ROS2.0 message.
133
+
134
+
Given the requirements above, we propose the following rmw API:
The in the code snippet mentioned raw message shall be defined as follows:
151
+
152
+
```c
153
+
typedef struct rmw_message_raw_t
154
+
{
155
+
unsigned int length;
156
+
char * raw_data;
157
+
} rmw_message_raw_t;
158
+
```
159
+
160
+
The `raw_data` field shall contain all message data needed to extract a ROS message given a respective type support, which contains all necessary information on how to concert the raw data into its corresponding ros message type.
0 commit comments