forked from foxglove/schemas
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Foxglove schemas and generate ros/proto/jsonschema definitions (f…
…oxglove#14) **Public-Facing Changes** This package is now published on NPM as `@foxglove/message-schemas`, and is the source of truth for message schemas supported by Foxglove Studio, which are documented in https://foxglove.dev/docs/studio/messages/introduction. We also generate ROS 1/2, Protobuf, JSON Schema, and TypeScript definitions from these schemas. **Description** The website will be updated to pull schemas from this repository. - [ ] ~generate FileDescriptorSet for easy use with mcap/websocket~ - [x] generate TypeScript definitions for Node Playground - [x] export TypeScript definitions from index.d.ts? - [x] generate .msg for ROS 2 - [x] array lengths for matrices? - [x] add other types Closes https://github.com/foxglove/studio/issues/3043
- Loading branch information
Showing
387 changed files
with
10,464 additions
and
8,993 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* eslint-env node */ | ||
module.exports = { | ||
env: { es2020: true }, | ||
ignorePatterns: ["dist"], | ||
extends: ["plugin:@foxglove/base", "plugin:@foxglove/jest"], | ||
overrides: [ | ||
{ | ||
files: ["*.ts", "*.tsx"], | ||
extends: ["plugin:@foxglove/typescript"], | ||
parserOptions: { | ||
project: "tsconfig.json", | ||
tsconfigRootDir: __dirname, | ||
}, | ||
}, | ||
], | ||
rules: { | ||
"no-warning-comments": ["error", { terms: ["fixme"], location: "anywhere" }], | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
proto/ros/**/*.proto linguist-generated | ||
json-schema/**/*.json linguist-generated | ||
schemas/** linguist-generated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
schemas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
printWidth: 100 | ||
trailingComma: all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"configurations": [ | ||
{ | ||
"type": "node", | ||
"name": "vscode-jest-tests.v2", | ||
"request": "launch", | ||
"console": "integratedTerminal", | ||
"internalConsoleOptions": "neverOpen", | ||
"disableOptimisticBPs": true, | ||
"cwd": "${workspaceFolder}", | ||
"runtimeExecutable": "yarn", | ||
"args": [ | ||
"test", | ||
"--runInBand", | ||
"--watchAll=false", | ||
"--testNamePattern", | ||
"${jest.testNamePattern}", | ||
"--runTestsByPath", | ||
"${jest.testFile}" | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,31 @@ | ||
This repo contains Protobuf and JSON schemas for [foxglove](https://foxglove.dev/docs/studio/messages/introduction) and ROS messages. | ||
# @foxglove/message-schemas | ||
|
||
> [Message schemas](https://foxglove.dev/docs/studio/messages/introduction) supported by [Foxglove Studio](https://studio.foxglove.dev) | ||
[![npm version](https://img.shields.io/npm/v/@foxglove/message-schemas.svg?style=flat)](https://www.npmjs.com/package/@foxglove/message-schemas) | ||
|
||
## Introduction | ||
|
||
The [schemas](./schemas) folder contains type definitions generated from these schemas for ROS 1, ROS 2, Protobuf, JSON Schema, and TypeScript. | ||
|
||
These schemas can be used in [MCAP](https://github.com/foxglove/mcap) files or [Foxglove WebSocket](https://github.com/foxglove/ws-protocol) servers to take advantage of Foxglove Studio's visualizations. | ||
|
||
The ROS schemas are generated from the common ROS message types at [@foxglove/rosmsg-msgs-common](https://github.com/foxglove/rosmsg-msgs-common) and [@foxglove/rosmsg-msgs-foxglove](https://github.com/foxglove/rosmsg-msgs-foxglove). | ||
## License | ||
|
||
@foxglove/message-schemas is licensed under [MIT License](https://opensource.org/licenses/MIT). | ||
|
||
## Proto | ||
## Development | ||
|
||
The .proto schemas are located in the `proto` folder. | ||
The schema definitions are in [src/schemas.ts](src/schemas.ts). | ||
|
||
## Generate | ||
After editing the schemas, re-generate the language-specific definitions by running `yarn update-generated-files`. | ||
|
||
### Generate .proto files and JSON Schemas for common ROS datatypes | ||
### Releasing | ||
|
||
``` | ||
$ yarn install | ||
$ yarn generate:proto | ||
$ yarn generate:json | ||
``` | ||
1. Run `yarn version --[major|minor|patch]` to bump version | ||
2. Run `git push && git push --tags` to push new tag | ||
3. GitHub Actions will take care of the rest | ||
|
||
### Combine .proto files into a binary FileDescriptorSet | ||
## Stay in touch | ||
|
||
``` | ||
$ protoc --proto_path=proto proto/ros/sensor_msgs/PointCloud2.proto --include_imports --descriptor_set_out=PointCloud2.bin | ||
``` | ||
Join our [Slack channel](https://foxglove.dev/join-slack) to ask questions, share feedback, and stay up to date on what our team is working on. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"testMatch": ["<rootDir>/src/**/*.test.ts"], | ||
"transform": { | ||
"^.+\\.ts$": "ts-jest" | ||
}, | ||
"globals": { | ||
"ts-jest": { | ||
"diagnostics": { | ||
"//": "add 6133 (unused variables) to default ignore codes", | ||
"ignoreCodes": [6059, 18002, 18003, 6133] | ||
} | ||
} | ||
}, | ||
"//": "Native find is slow because it does not exclude files: https://github.com/facebook/jest/pull/11264#issuecomment-825377579", | ||
"haste": { "forceNodeFilesystemAPI": true } | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.