Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README and studio references #153

Merged
merged 2 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion packages/omgidl-parser/src/processIDL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, AnyIDLNode>): IDLMessageDefinition[] {
const messageDefinitions: IDLMessageDefinition[] = [];
const topLevelConstantDefinitions: MessageDefinitionField[] = [];
Expand Down
14 changes: 7 additions & 7 deletions packages/ros2idl-parser/src/parse.ros2idl.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
Expand All @@ -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 {
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion packages/ros2idl-parser/src/parseRos2idl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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" ||
Expand Down