RegisterMessageConverterArgsSchema<Src>
type RegisterMessageConverterArgsSchema<Src> = object;
This type represents the arguments you pass to ExtensionContext.registerMessageConverter when you want to register a schema message converter.
schema
converters allow you to leverage Foxglove's built-in visualization panels by
transforming messages to adhere to Foxglove-supported schemas — for example, you can convert
your custom GPS messages to
foxglove.LocationFix
messages for visualization in the Map
panel.
See the Creating a topic converter guide for more details.
Type Parameters
Type Parameter | Default type |
---|---|
Src | unknown |
Properties
type
type: "schema";
fromSchemaName
fromSchemaName: string;
The source message schema name. This is the schema name of the original message.
toSchemaName
toSchemaName: string;
The converted message schema name. This is the schema name of the message you will output from the converter.
converter()
converter: (msg, event) => unknown;
A function which takes the original message and returns the converted message.
If the function returns undefined
, the output is ignored, and no message is provided to the
panel. This is useful if you want to selectively output converted messages depending on the
input messages' contents.
Parameters
Parameter | Type |
---|---|
msg | Src |
event | Immutable <MessageEvent <Src >> |
Returns
unknown