A "Schema Parser Plugin" is a plugin that allow us to parse messages that have a schema, such as
- ROS1 and ROS2 messages
- Protobuf
Or schemaless messages such as JSON, BSON ,etc.
The parsing step consists in taking the message and "decompose it into a vector of "key/value" pairs.
Consider the ROS message geometry_msgs/Pose. We have the following schema:
'''' MSG: geometry_msgs/Pose
geometry_msgs/Point position geometry_msgs/Quaternion orientation
################## MSG: geometry_msgs/Point float64 x float64 y float64 z
##################
MSG: geometry_msgs/Quaternion float64 x float64 y float64 z float64 w ''''
The input of the parser will be the serialized message, that in this case will be exactly (7*8 = 56 bytes).
The output of the parser will be a vector of 7 key/value pairs, where:
- the key is an index (int32_t). This index will point to a table of strings.
- the value is a
VarNumber
, i.e. a data structure that can contain any arithmetic type (integer, boolean, floating point).
Specifically, this will be the table of strings that the key will point to:
- "position/x"
- "position/y"
- "position/z"
- "orientation/x"
- "orientation/y"
- "orientation/z"
- "orientation/w"