diff --git a/README.md b/README.md index 3ca2fc6..7e1eebb 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # Foxglove OMG IDL -This repo contains implementations for supporting OMG specifications within [Foxglove](https://www.foxglove.dev). The parsers expect schemas according to the MCAP specifications: [ros2idl](https://mcap.dev/spec/registry#ros2idl), [omgidl](https://mcap.dev/spec/registry#omgidl). +This repo contains implementations of OMG IDL specifications used by [Foxglove](https://www.foxglove.dev). The parsers expect schemas according to the MCAP specifications: [ros2idl](https://mcap.dev/spec/registry#ros2idl), [omgidl](https://mcap.dev/spec/registry#omgidl). -| Package name | Description | Reference | Version | -| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | -| `@foxglove/omgidl-parser` | Parse OMG IDL schema to definitions for Foxglove Studio and serialization. [README](./packages//omgidl-parser/README.md) | [Interface Definition Language Specification](https://www.omg.org/spec/IDL/4.2/PDF) | [![](https://shields.io/npm/v/@foxglove/omgidl-parser)](https://www.npmjs.com/package/@foxglove/omgidl-parser) | -| `@foxglove/omgidl-serialization` | De/Serialize data using IDL to CDR and CDR2 [README](./packages/omgidl-serialization/README.md) | [Extensible and Dynamic Types for DDS Specification](https://www.omg.org/spec/DDS-XTypes/1.3/PDF) | [![](https://shields.io/npm/v/@foxglove/omgidl-serialization)](https://www.npmjs.com/package/@foxglove/omgidl-serialization) | -| `@foxglove/ros2idl-parser` | `ros2idl` schema parser to definitions for serialization [README](./packages/ros2idl-parser/README.md) | [article](https://design.ros2.org/articles/idl_interface_definition.html), [repo](https://github.com/ros2/rosidl) | [![](https://shields.io/npm/v/@foxglove/ros2idl-parser)](https://www.npmjs.com/package/@foxglove/ros2idl-parser) | +| Package name | Description | Reference | Version | +| -------------------------------- | ------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| `@foxglove/omgidl-parser` | Parse OMG IDL schemas – [README](./packages//omgidl-parser/README.md) | [Interface Definition Language Specification](https://www.omg.org/spec/IDL/4.2/PDF) | [![](https://shields.io/npm/v/@foxglove/omgidl-parser)](https://www.npmjs.com/package/@foxglove/omgidl-parser) | +| `@foxglove/omgidl-serialization` | De/Serialize data using IDL to CDR and CDR2 – [README](./packages/omgidl-serialization/README.md) | [Extensible and Dynamic Types for DDS Specification](https://www.omg.org/spec/DDS-XTypes/1.3/PDF) | [![](https://shields.io/npm/v/@foxglove/omgidl-serialization)](https://www.npmjs.com/package/@foxglove/omgidl-serialization) | +| `@foxglove/ros2idl-parser` | Parse the ROS 2 dialect of IDL – [README](./packages/ros2idl-parser/README.md) | [article](https://design.ros2.org/articles/idl_interface_definition.html), [repo](https://github.com/ros2/rosidl) | [![](https://shields.io/npm/v/@foxglove/ros2idl-parser)](https://www.npmjs.com/package/@foxglove/ros2idl-parser) | See known limitations here: [Parser/Grammar Limitations](./packages/omgidl-parser/README.md#omg-idl-subset-support) diff --git a/packages/omgidl-parser/src/processIDL.ts b/packages/omgidl-parser/src/processIDL.ts index 154190c..e1617cf 100644 --- a/packages/omgidl-parser/src/processIDL.ts +++ b/packages/omgidl-parser/src/processIDL.ts @@ -73,7 +73,7 @@ function getValueAnnotation( return undefined; } -/** Convert to IDL Message Definitions for serialization and compatibility foxglove studio's Raw Message panel. Returned in order of original definitions*/ +/** Convert to IDL Message Definitions for serialization and compatibility with Foxglove's Raw Message panel. Returned in order of original definitions*/ export function toIDLMessageDefinitions(map: Map): IDLMessageDefinition[] { const messageDefinitions: IDLMessageDefinition[] = []; const topLevelConstantDefinitions: MessageDefinitionField[] = []; diff --git a/packages/ros2idl-parser/src/parse.ros2idl.test.ts b/packages/ros2idl-parser/src/parse.ros2idl.test.ts index 16783f1..f37dc88 100644 --- a/packages/ros2idl-parser/src/parse.ros2idl.test.ts +++ b/packages/ros2idl-parser/src/parse.ros2idl.test.ts @@ -424,7 +424,7 @@ module rosidl_parser { const unsigned long UNSIGNED_LONG_CONSTANT = 42; module rosidl_parser { module msg { - struct MyMessage { + struct MyMessage { string<5> bounded_string_value; wstring wstring_value; wstring<23> bounded_wstring_value; @@ -801,7 +801,7 @@ module rosidl_parser { }); it("can parse comments", () => { - const msgDef = ` + const msgDef = ` // All of these comments should be ignored module action { /** another comment */ @@ -850,7 +850,7 @@ module rosidl_parser { ]); }); it("can parse multiple forward declarations on same line with default annotation", () => { - const msgDef = ` + const msgDef = ` module action { struct MyAction_Goal { @default(value=5) @@ -879,7 +879,7 @@ module rosidl_parser { }, ]); }); - it("normalizes the builtin_interfaces/msg/Time type for use in studio", () => { + it("normalizes the builtin_interfaces/msg/Time type for use in foxglove", () => { const msgDef = ` module builtin_interfaces { module msg { @@ -912,7 +912,7 @@ module rosidl_parser { }); /**************** Not supported by IDL (as far as I can tell) */ it("cannot parse multiple const declarations in a single line", () => { - const msgDef = ` + const msgDef = ` module action { module MyAction_Goal_Constants { const short short1, short2 = -23; @@ -923,7 +923,7 @@ module rosidl_parser { }); /**************** Syntax Errors */ it("missing bracket at the end will result in end of input error", () => { - const msgDef = ` + const msgDef = ` module rosidl_parser { module action { module MyAction_Goal_Constants { @@ -939,7 +939,7 @@ module rosidl_parser { ); }); it("cannot parse empty module", () => { - const msgDef = ` + const msgDef = ` module rosidl_parser { module action { module MyAction_Goal_Constants { diff --git a/packages/ros2idl-parser/src/parseRos2idl.ts b/packages/ros2idl-parser/src/parseRos2idl.ts index 374eab2..d908853 100644 --- a/packages/ros2idl-parser/src/parseRos2idl.ts +++ b/packages/ros2idl-parser/src/parseRos2idl.ts @@ -21,7 +21,7 @@ export function parseRos2idl(messageDefinition: string): MessageDefinition[] { field.type = normalizeName(field.type); } // Modify the definition of builtin_interfaces/msg/Time and Duration so they are interpreted as - // {sec: number, nsec: number}, compatible with the rest of Studio. The ros2idl builtin types + // {sec: number, nsec: number}, compatible with the rest of Foxglove. The ros2idl builtin types // use "nanosec" instead of "nsec". if ( def.name === "builtin_interfaces/msg/Time" ||