plotjuggler_plugins/DataStreamFoxgloveBridge/PROTOCOL.md
This plugin targets the current Foxglove WebSocket protocol used by the Foxglove SDK and foxglove_bridge.
cdrros2msgfoxglove.sdk.v1QWebSocket::open(const QNetworkRequest&)Sec-WebSocket-Protocol: foxglove.sdk.v1JSON messages are identified by the op field.
Relevant ops for this plugin:
serverInfoadvertiseunadvertisestatusremoveStatus is ignored in the current implementationadvertiseExpected channel fields:
idtopicencodingschemaNameschemaschemaEncodingThis plugin accepts only channels where:
encoding == "cdr"schemaEncoding == "ros2msg"schema is non-emptyFor ros2msg, the schema is handled as UTF-8 text and forwarded to PlotJuggler's existing ROS 2 parser factory.
unadvertiseExpected payload:
channelIdsThese channel IDs are removed from the available channel list. Active subscriptions tied to removed channels are dropped locally.
If all active subscriptions are removed, the plugin shuts the stream down instead of staying connected with no parsers.
subscribeFormat:
{
"op": "subscribe",
"subscriptions": [
{ "id": 1, "channelId": 10 }
]
}
id is the client-generated subscription IDchannelId is the server-advertised Foxglove channel IDunsubscribeFormat:
{
"op": "unsubscribe",
"subscriptionIds": [1]
}
The plugin expects Foxglove MessageData frames:
0: opcode1-4: subscriptionId little-endian uint325-12: log_time little-endian uint64 in nanoseconds13+: serialized ROS 2 CDR payloadFor the current implementation:
0x01 is handledsubscriptionId is used to look up the parser created for the selected channelros2msg parserros2msgdataReceived() emissions are coalesced on a short timer to avoid one UI update per packetFoxglove status messages use a numeric level enum:
0: info1: warning2: errorThis plugin surfaces warning and error messages to the user.
omgidl / ros2idl