WebSocket server for republishing LCM messages
Project description
lcm-websocket-server
WebSocket server for republishing LCM messages.
Installation
poetry build
pip install dist/lcm_websocket_server-*-py3-none-any.whl
Usage
For a list of available options, run:
lcm-websocket-server --help
To run the server locally on port 8765 and republish messages on all channels:
lcm-websocket-server --host localhost --port 8765 --channel ".*" your_lcm_types_package
The lcm_packages
argument is the name of the package (or comma-separated list of packages) that contains the LCM Python message definitions. Submodules are scanned recursively and registered so they can be automatically identified, decoded, and republished.
Example: compas_lcmtypes
For example, the compas_lcmtypes
package contains LCM types for the CoMPAS lab. These can be installed with:
pip install compas-lcmtypes==0.1.0
Then, the server can be run with:
lcm-websocket-server compas_lcmtypes
Docker
Build
A Docker image to run the lcm-websocket-server
can be built with:
./scripts/docker_build.sh
This will create the mbari/lcm-websocket-server
image.
Run
The container can be run with:
docker run \
--name lcm-websocket-server \
--rm \
-e HOST=0.0.0.0 \
-e PORT=8765 \
-e CHANNEL=".*" \
-v /path/to/your_lcm_types_package:/app/your_lcm_types_package \
-e LCM_PACKAGES=your_lcm_types_package \
--network=host \
-d \
mbari/lcm-websocket-server
Note that the HOST
, PORT
, and CHANNEL
environment variables specified above are the defaults for the mbari/lcm-websocket-server
image. These can be omitted if the defaults are acceptable.
The LCM_PACKAGES
environment variable should be set to the name of the package (or comma-separated list of packages) that contains the LCM Python message definitions. The /app
directory is included in the PYTHONPATH
so that any packages mounted there (as shown with -v
above) can be imported.
It's recommended to run with --network=host
to avoid issues with LCM over UDP. This will allow the container to use the host's network stack.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file lcm_websocket_server-0.1.0.tar.gz
.
File metadata
- Download URL: lcm_websocket_server-0.1.0.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.2 CPython/3.9.13 Linux/6.2.0-32-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6b59e6bc48f73b537076e3003ddc0f60acbe598130a26836d0ccc40c7d4995a |
|
MD5 | 46eb49884ed01d22b598433b67abbe56 |
|
BLAKE2b-256 | 3d13f57c22f37718a7d9927af7a3fef479aa495e29276875c5c01d22a5244381 |
File details
Details for the file lcm_websocket_server-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: lcm_websocket_server-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.2 CPython/3.9.13 Linux/6.2.0-32-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e1379b88b15cd376f0960aa336db698a2e75a7222c4af28a9c4cad7bf55cbe6 |
|
MD5 | 8805a01aa1dd2d1d20a6f20b792cd988 |
|
BLAKE2b-256 | 46c03407665b55b605eed40e67f11a5407ee6bc6a4a7ae8f747894dc720950d4 |