@foxglove/ws-protocol-examples v0.10.0
Foxglove WebSocket examples
This package provides example server and client implementations of the Foxglove WebSocket protocol. The protocol enables Foxglove to ingest arbitrary “live” streamed data.
To list all possible actions, run the following command:
$ npx @foxglove/ws-protocol-examples@latest --helpExample servers
Run the sysmon example server, which uses JSON-encoded data to transmit system monitoring information like memory and CPU usage:
$ npx @foxglove/ws-protocol-examples@latest sysmonRun the image-server example server, which uses JSON-encoded data to transmit images:
$ npx @foxglove/ws-protocol-examples@latest image-serverRun the mcap-play example server, which plays back recorded data from a local MCAP file:
$ npx @foxglove/ws-protocol-examples@latest mcap-play <file> [--rate 1.0] [--loop]Note: You must exit each server (control + c) before starting up another.
To see data from any server, open Foxglove with a Foxglove WebSocket connection to ws://localhost:8765/:
Example clients
Run a simple example client that subscribes to messages with the protobuf or json encoding:
$ npx @foxglove/ws-protocol-examples@latest simple-client ws://localhost:8765Run a client that advertises the /chatter topic and publishes messages to it with json or ros1 encoding:
$ npx @foxglove/ws-protocol-examples@latest publish-client -e json ws://localhost:8765Connect to a server and record message data into an MCAP file:
$ npx @foxglove/ws-protocol-examples@latest mcap-record ws://localhost:8765 -o <file.mcap>Development
This package lives inside a monorepo that uses yarn workspaces, so most commands (other than yarn install) should be prefixed with yarn workspace @foxglove/ws-protocol-examples ....
yarn install– Install development dependenciesyarn workspace @foxglove/ws-protocol-examples version --patch(or--minoror--major) – Increment the version number and create the appropriate git tagyarn workspace @foxglove/ws-protocol-examples run-example --help– Run the example scripts
9 months ago
11 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago